1// Copyright 2019 the V8 project authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5extern class JSGeneratorObject extends JSObject { 6 function: JSFunction; 7 context: Context; 8 receiver: JSAny; 9 10 // For executing generators: the most recent input value. 11 // For suspended generators: debug information (bytecode offset). 12 // There is currently no need to remember the most recent input value for a 13 // suspended generator. 14 input_or_debug_pos: Object; 15 16 // The most recent resume mode. 17 resume_mode: Smi; 18 19 // A positive value indicates a suspended generator. The special 20 // kGeneratorExecuting and kGeneratorClosed values indicate that a generator 21 // cannot be resumed. 22 continuation: Smi; 23 24 // Saved interpreter register file. 25 parameters_and_registers: FixedArray; 26} 27 28extern class JSAsyncFunctionObject extends JSGeneratorObject { 29 promise: JSPromise; 30} 31 32extern class JSAsyncGeneratorObject extends JSGeneratorObject { 33 // Pointer to the head of a singly linked list of AsyncGeneratorRequest, or 34 // undefined. 35 queue: HeapObject; 36 // Whether or not the generator is currently awaiting. 37 is_awaiting: Smi; 38} 39 40extern class AsyncGeneratorRequest extends Struct { 41 next: AsyncGeneratorRequest|Undefined; 42 resume_mode: Smi; 43 value: Object; 44 promise: JSPromise; 45} 46