// Copyright 2019 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @abstract extern class Context extends HeapObject { length: Smi; scope_info: ScopeInfo; previous: Context|Zero|Undefined; } extern class AwaitContext extends Context generates 'TNode'; extern class BlockContext extends Context generates 'TNode'; extern class CatchContext extends Context generates 'TNode'; extern class DebugEvaluateContext extends Context generates 'TNode'; extern class EvalContext extends Context generates 'TNode'; extern class FunctionContext extends Context generates 'TNode'; extern class ModuleContext extends Context generates 'TNode'; extern class NativeContext extends Context; extern class ScriptContext extends Context generates 'TNode'; extern class WithContext extends Context generates 'TNode'; const MIN_CONTEXT_SLOTS: constexpr int31 generates 'Context::MIN_CONTEXT_SLOTS'; extern enum NativeContextSlot extends intptr constexpr 'Context::Field' { AGGREGATE_ERROR_FUNCTION_INDEX, ARRAY_BUFFER_FUN_INDEX, ARRAY_BUFFER_NOINIT_FUN_INDEX, ARRAY_BUFFER_MAP_INDEX, ARRAY_FUNCTION_INDEX, ARRAY_JOIN_STACK_INDEX, OBJECT_FUNCTION_INDEX, ITERATOR_RESULT_MAP_INDEX, JS_ARRAY_PACKED_ELEMENTS_MAP_INDEX, JS_ARRAY_PACKED_SMI_ELEMENTS_MAP_INDEX, MATH_RANDOM_CACHE_INDEX, MATH_RANDOM_INDEX_INDEX, NUMBER_FUNCTION_INDEX, PROXY_REVOCABLE_RESULT_MAP_INDEX, REFLECT_APPLY_INDEX, REGEXP_FUNCTION_INDEX, REGEXP_LAST_MATCH_INFO_INDEX, INITIAL_STRING_ITERATOR_MAP_INDEX, INITIAL_ARRAY_ITERATOR_MAP_INDEX, SLOW_OBJECT_WITH_NULL_PROTOTYPE_MAP, STRICT_ARGUMENTS_MAP_INDEX, SLOPPY_ARGUMENTS_MAP_INDEX, FAST_ALIASED_ARGUMENTS_MAP_INDEX, PROMISE_FUNCTION_INDEX, PROMISE_THEN_INDEX, PROMISE_PROTOTYPE_INDEX, STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, CONTINUATION_PRESERVED_EMBEDDER_DATA_INDEX, BOUND_FUNCTION_WITH_CONSTRUCTOR_MAP_INDEX, BOUND_FUNCTION_WITHOUT_CONSTRUCTOR_MAP_INDEX, ... } extern operator '[]' macro LoadContextElement( NativeContext, NativeContextSlot): Object; extern operator '[]=' macro StoreContextElement( NativeContext, NativeContextSlot, Object): void; type ContextSlot generates 'TNode' constexpr 'int32_t'; const PROXY_SLOT: constexpr ContextSlot generates 'Context::MIN_CONTEXT_SLOTS'; extern operator '[]' macro LoadContextElement(Context, ContextSlot): Object; extern operator '[]=' macro StoreContextElement( Context, ContextSlot, Object): void; extern operator '[]' macro LoadContextElement(Context, intptr): Object; extern operator '[]' macro LoadContextElement(Context, Smi): Object; // A dummy used instead of a context constant for runtime calls that don't need // a context. type NoContext extends Smi; extern macro NoContextConstant(): NoContext; const kNoContext: NoContext = NoContextConstant();