From dbbdd0eca241f7d6d5a8c11b02abd2e43a6bc9db Mon Sep 17 00:00:00 2001 From: Victor Gomes Date: Tue, 22 Oct 2019 14:59:24 +0200 Subject: [PATCH] Reland x3 "[runtime] Remove extension slots from context objects" Original change's description: > [runtime] Remove extension slots from context objects > > Context objects have an extension slot, which contains further > additional data that depends on the type of the context. > > This CL removes the extension slot from contexts that don't need > them, hence reducing memory. > > The following contexts will still have an extension slot: native, > module, await, block and with contexts. See objects/contexts.h for > what the slot is used for. > The following contexts will not have an extension slot anymore (they > were not used before): script, catch and builtin contexts. > Eval and function contexts only have the extension slot if they > contain a sloppy eval. > > Bug: v8:9744 > Change-Id: I8ca56c22fa02437bbac392ea72174ebfca80e030 > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1863191 > Commit-Queue: Victor Gomes > Reviewed-by: Toon Verwaest > Reviewed-by: Jakob Gruber > Reviewed-by: Ulan Degenbaev > Reviewed-by: Leszek Swirski > Reviewed-by: Peter Marshall > Auto-Submit: Victor Gomes > Cr-Commit-Position: refs/heads/master@{#64372} TBR=verwaest@chromium.org,jgruber@chromium.org,ulan@chromium.org,leszeks@chromium.org,petermarshall@chromium.org Bug: v8:9744 Change-Id: I8700ed2fa62c89e86c39bb16ac3167f38ea8d63f Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1873695 Commit-Queue: Victor Gomes Reviewed-by: Leszek Swirski Reviewed-by: Ulan Degenbaev Reviewed-by: Peter Marshall Cr-Commit-Position: refs/heads/master@{#64477} --- src/ast/scopes.cc | 21 +- src/ast/scopes.h | 21 + src/builtins/base.tq | 2 - src/builtins/builtins-arguments-gen.cc | 23 +- src/builtins/builtins-async-gen.cc | 14 +- src/builtins/builtins-constructor-gen.cc | 2 - src/builtins/builtins-promise-gen.cc | 2 +- src/builtins/builtins-proxy-gen.cc | 3 +- src/codegen/code-stub-assembler.cc | 18 +- src/codegen/code-stub-assembler.h | 10 +- src/compiler/access-builder.cc | 10 + src/compiler/access-builder.h | 3 + src/compiler/bytecode-graph-builder.cc | 51 +- src/compiler/heap-refs.h | 1 + src/compiler/js-create-lowering.cc | 25 +- src/compiler/js-generic-lowering.cc | 4 + src/compiler/js-heap-broker.cc | 9 + src/compiler/js-operator.cc | 9 + src/compiler/js-operator.h | 1 + src/compiler/js-typed-lowering.cc | 32 ++ src/compiler/js-typed-lowering.h | 1 + src/compiler/opcodes.h | 1 + src/compiler/operator-properties.cc | 1 + src/compiler/typer.cc | 3 + src/compiler/verifier.cc | 3 + src/debug/debug-scopes.cc | 2 +- src/diagnostics/objects-printer.cc | 4 +- src/heap/factory.cc | 14 +- src/interpreter/interpreter-assembler.cc | 8 +- src/objects/contexts-inl.h | 7 +- src/objects/contexts.cc | 9 +- src/objects/contexts.h | 38 +- src/objects/scope-info.cc | 35 +- src/objects/scope-info.h | 7 +- src/profiler/heap-snapshot-generator.cc | 8 +- src/runtime/runtime-scopes.cc | 4 +- .../AsyncGenerators.golden | 8 +- .../bytecode_expectations/AsyncModules.golden | 8 +- .../bytecode_expectations/BasicLoops.golden | 10 +- .../BreakableBlocks.golden | 18 +- .../CallLookupSlot.golden | 2 +- .../ClassDeclarations.golden | 10 +- .../CompoundExpressions.golden | 6 +- .../ConstVariableContextSlot.golden | 20 +- .../ContextParameters.golden | 12 +- .../ContextVariables.golden | 541 +++++++++--------- .../CountOperators.golden | 12 +- .../CreateArguments.golden | 8 +- .../bytecode_expectations/Delete.golden | 4 +- .../bytecode_expectations/Eval.golden | 2 +- .../bytecode_expectations/ForAwaitOf.golden | 8 +- .../bytecode_expectations/ForOfLoop.golden | 16 +- .../IIFEWithOneshotOpt.golden | 8 +- .../LetVariableContextSlot.golden | 24 +- .../bytecode_expectations/LookupSlot.golden | 12 +- .../OuterContextVariables.golden | 8 +- .../PrivateAccessorAccess.golden | 22 +- .../PrivateAccessorDeclaration.golden | 28 +- .../PrivateClassFields.golden | 12 +- .../PrivateMethodAccess.golden | 10 +- .../PrivateMethodDeclaration.golden | 16 +- .../PublicClassFields.golden | 20 +- .../StandardForLoop.golden | 36 +- .../StaticClassFields.golden | 40 +- .../StaticPrivateMethodAccess.golden | 16 +- .../StaticPrivateMethodDeclaration.golden | 14 +- .../interpreter/test-bytecode-generator.cc | 12 +- test/cctest/test-code-stub-assembler.cc | 3 - test/cctest/test-heap-profiler.cc | 2 +- test/mjsunit/regress/regress-crbug-1016056.js | 18 + .../compiler/js-create-lowering-unittest.cc | 11 +- tools/gen-postmortem-metadata.py | 2 - 72 files changed, 789 insertions(+), 616 deletions(-) create mode 100644 test/mjsunit/regress/regress-crbug-1016056.js diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc index 3dfd707f39..914885ab99 100644 --- a/src/ast/scopes.cc +++ b/src/ast/scopes.cc @@ -196,8 +196,7 @@ Scope::Scope(Zone* zone, ScopeType scope_type, Handle scope_info) already_resolved_ = true; #endif set_language_mode(scope_info->language_mode()); - num_heap_slots_ = scope_info->ContextLength(); - DCHECK_LE(Context::MIN_CONTEXT_SLOTS, num_heap_slots_); + DCHECK_EQ(ContextHeaderLength(), num_heap_slots_); private_name_lookup_skips_outer_class_ = scope_info->PrivateNameLookupSkipsOuterClass(); // We don't really need to use the preparsed scope data; this is just to @@ -288,11 +287,6 @@ void Scope::SetDefaults() { start_position_ = kNoSourcePosition; end_position_ = kNoSourcePosition; - num_stack_slots_ = 0; - num_heap_slots_ = Context::MIN_CONTEXT_SLOTS; - - set_language_mode(LanguageMode::kSloppy); - calls_eval_ = false; sloppy_eval_can_extend_vars_ = false; scope_nonlinear_ = false; @@ -307,6 +301,11 @@ void Scope::SetDefaults() { private_name_lookup_skips_outer_class_ = false; must_use_preparsed_scope_data_ = false; + + num_stack_slots_ = 0; + num_heap_slots_ = ContextHeaderLength(); + + set_language_mode(LanguageMode::kSloppy); } bool Scope::HasSimpleParameters() { @@ -2289,7 +2288,7 @@ void Scope::AllocateVariablesRecursively() { this->ForEach([](Scope* scope) -> Iteration { DCHECK(!scope->already_resolved_); if (WasLazilyParsed(scope)) return Iteration::kContinue; - DCHECK_EQ(Context::MIN_CONTEXT_SLOTS, scope->num_heap_slots_); + DCHECK_EQ(scope->ContextHeaderLength(), scope->num_heap_slots_); // Allocate variables for this scope. // Parameters must be allocated first, if any. @@ -2317,14 +2316,14 @@ void Scope::AllocateVariablesRecursively() { // If we didn't allocate any locals in the local context, then we only // need the minimal number of slots if we must have a context. - if (scope->num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && + if (scope->num_heap_slots_ == scope->ContextHeaderLength() && !must_have_context) { scope->num_heap_slots_ = 0; } // Allocation done. DCHECK(scope->num_heap_slots_ == 0 || - scope->num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); + scope->num_heap_slots_ >= scope->ContextHeaderLength()); return Iteration::kDescend; }); } @@ -2429,7 +2428,7 @@ int Scope::ContextLocalCount() const { is_function_scope() ? AsDeclarationScope()->function_var() : nullptr; bool is_function_var_in_context = function != nullptr && function->IsContextSlot(); - return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - + return num_heap_slots() - ContextHeaderLength() - (is_function_var_in_context ? 1 : 0); } diff --git a/src/ast/scopes.h b/src/ast/scopes.h index 04dbb983ab..cbfe5732e7 100644 --- a/src/ast/scopes.h +++ b/src/ast/scopes.h @@ -454,6 +454,26 @@ class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) { int num_stack_slots() const { return num_stack_slots_; } int num_heap_slots() const { return num_heap_slots_; } + bool HasContextExtension() const { + switch (scope_type_) { + case MODULE_SCOPE: + case WITH_SCOPE: // DebugEvaluateContext as well + return true; + default: + DCHECK_IMPLIES(sloppy_eval_can_extend_vars_, + scope_type_ == FUNCTION_SCOPE || + scope_type_ == EVAL_SCOPE || + scope_type_ == BLOCK_SCOPE); + DCHECK_IMPLIES(sloppy_eval_can_extend_vars_, is_declaration_scope()); + return sloppy_eval_can_extend_vars_; + } + UNREACHABLE(); + } + int ContextHeaderLength() const { + return HasContextExtension() ? Context::MIN_CONTEXT_EXTENDED_SLOTS + : Context::MIN_CONTEXT_SLOTS; + } + int ContextLocalCount() const; // Determine if we can parse a function literal in this scope lazily without @@ -803,6 +823,7 @@ class V8_EXPORT_PRIVATE DeclarationScope : public Scope { } sloppy_eval_can_extend_vars_ = true; + num_heap_slots_ = Context::MIN_CONTEXT_EXTENDED_SLOTS; } bool sloppy_eval_can_extend_vars() const { diff --git a/src/builtins/base.tq b/src/builtins/base.tq index c4c488da95..459a073596 100644 --- a/src/builtins/base.tq +++ b/src/builtins/base.tq @@ -110,13 +110,11 @@ extern class NumberDictionary extends HashTable; type RawPtr generates 'TNode' constexpr 'void*'; extern class Code extends HeapObject; type BuiltinPtr extends Smi generates 'TNode'; - @abstract extern class Context extends HeapObject { length: Smi; scope_info: ScopeInfo; previous: Object; - extension: Object; } extern class AwaitContext extends Context generates 'TNode'; extern class BlockContext extends Context generates 'TNode'; diff --git a/src/builtins/builtins-arguments-gen.cc b/src/builtins/builtins-arguments-gen.cc index fb6169adf8..feca0bf206 100644 --- a/src/builtins/builtins-arguments-gen.cc +++ b/src/builtins/builtins-arguments-gen.cc @@ -260,17 +260,24 @@ TNode ArgumentsBuiltinsAssembler::EmitFastNewSloppyArguments( // Copy the parameter slots and the holes in the arguments. // We need to fill in mapped_count slots. They index the context, // where parameters are stored in reverse order, at - // MIN_CONTEXT_SLOTS .. MIN_CONTEXT_SLOTS+argument_count-1 + // context_header_size .. context_header_size+argument_count-1 // The mapped parameter thus need to get indices - // MIN_CONTEXT_SLOTS+parameter_count-1 .. - // MIN_CONTEXT_SLOTS+argument_count-mapped_count + // context_header_size+parameter_count-1 .. + // context_header_size+argument_count-mapped_count // We loop from right to left. Comment("Fill in mapped parameters"); - TVARIABLE( - BInt, context_index, - IntPtrOrSmiSub(IntPtrOrSmiAdd(BIntConstant(Context::MIN_CONTEXT_SLOTS), - info.formal_parameter_count), - mapped_count)); + STATIC_ASSERT(Context::MIN_CONTEXT_EXTENDED_SLOTS == + Context::MIN_CONTEXT_SLOTS + 1); + TNode flags = LoadAndUntagObjectField(LoadScopeInfo(context), + ScopeInfo::kFlagsOffset); + TNode context_header_size = IntPtrOrSmiAdd( + IntPtrToBInt( + Signed(DecodeWord(flags))), + BIntConstant(Context::MIN_CONTEXT_SLOTS)); + TVARIABLE(BInt, context_index, + IntPtrOrSmiSub(IntPtrOrSmiAdd(context_header_size, + info.formal_parameter_count), + mapped_count)); TNode the_hole = TheHoleConstant(); VariableList var_list2({&context_index}, zone()); const int kParameterMapHeaderSize = FixedArray::OffsetOfElementAt(2); diff --git a/src/builtins/builtins-async-gen.cc b/src/builtins/builtins-async-gen.cc index 7db2f1d1ce..10aedfb599 100644 --- a/src/builtins/builtins-async-gen.cc +++ b/src/builtins/builtins-async-gen.cc @@ -33,7 +33,7 @@ TNode AsyncBuiltinsAssembler::AwaitOld( TNode const native_context = LoadNativeContext(context); static const int kWrappedPromiseOffset = - FixedArray::SizeFor(Context::MIN_CONTEXT_SLOTS); + FixedArray::SizeFor(Context::MIN_CONTEXT_EXTENDED_SLOTS); static const int kResolveClosureOffset = kWrappedPromiseOffset + JSPromise::kSizeWithEmbedderFields; static const int kRejectClosureOffset = @@ -48,8 +48,9 @@ TNode AsyncBuiltinsAssembler::AwaitOld( TNode map = CAST( LoadContextElement(native_context, Context::AWAIT_CONTEXT_MAP_INDEX)); StoreMapNoWriteBarrier(closure_context, map); - StoreObjectFieldNoWriteBarrier(closure_context, Context::kLengthOffset, - SmiConstant(Context::MIN_CONTEXT_SLOTS)); + StoreObjectFieldNoWriteBarrier( + closure_context, Context::kLengthOffset, + SmiConstant(Context::MIN_CONTEXT_EXTENDED_SLOTS)); TNode const empty_scope_info = LoadContextElement(native_context, Context::SCOPE_INFO_INDEX); StoreContextElementNoWriteBarrier( @@ -124,7 +125,7 @@ TNode AsyncBuiltinsAssembler::AwaitOptimized( TNode const native_context = LoadNativeContext(context); static const int kResolveClosureOffset = - FixedArray::SizeFor(Context::MIN_CONTEXT_SLOTS); + FixedArray::SizeFor(Context::MIN_CONTEXT_EXTENDED_SLOTS); static const int kRejectClosureOffset = kResolveClosureOffset + JSFunction::kSizeWithoutPrototype; static const int kTotalSize = @@ -141,8 +142,9 @@ TNode AsyncBuiltinsAssembler::AwaitOptimized( TNode map = CAST( LoadContextElement(native_context, Context::AWAIT_CONTEXT_MAP_INDEX)); StoreMapNoWriteBarrier(closure_context, map); - StoreObjectFieldNoWriteBarrier(closure_context, Context::kLengthOffset, - SmiConstant(Context::MIN_CONTEXT_SLOTS)); + StoreObjectFieldNoWriteBarrier( + closure_context, Context::kLengthOffset, + SmiConstant(Context::MIN_CONTEXT_EXTENDED_SLOTS)); TNode const empty_scope_info = LoadContextElement(native_context, Context::SCOPE_INFO_INDEX); StoreContextElementNoWriteBarrier( diff --git a/src/builtins/builtins-constructor-gen.cc b/src/builtins/builtins-constructor-gen.cc index 206fd0badd..2647b78e77 100644 --- a/src/builtins/builtins-constructor-gen.cc +++ b/src/builtins/builtins-constructor-gen.cc @@ -254,8 +254,6 @@ TNode ConstructorBuiltinsAssembler::EmitFastNewFunctionContext( scope_info); StoreObjectFieldNoWriteBarrier(function_context, Context::kPreviousOffset, context); - StoreObjectFieldNoWriteBarrier(function_context, Context::kExtensionOffset, - TheHoleConstant()); // Initialize the varrest of the slots to undefined. TNode undefined = UndefinedConstant(); diff --git a/src/builtins/builtins-promise-gen.cc b/src/builtins/builtins-promise-gen.cc index b63df0d8b0..bf45e09a5c 100644 --- a/src/builtins/builtins-promise-gen.cc +++ b/src/builtins/builtins-promise-gen.cc @@ -267,7 +267,7 @@ TNode PromiseBuiltinsAssembler::CreatePromiseContext( TNode const context = AllocateInNewSpace(FixedArray::SizeFor(slots)); - InitializeFunctionContext(native_context, context, slots); + InitializeSyntheticFunctionContext(native_context, context, slots); return CAST(context); } diff --git a/src/builtins/builtins-proxy-gen.cc b/src/builtins/builtins-proxy-gen.cc index 429b7f747f..5e1d0348c9 100644 --- a/src/builtins/builtins-proxy-gen.cc +++ b/src/builtins/builtins-proxy-gen.cc @@ -122,7 +122,8 @@ Node* ProxiesCodeStubAssembler::CreateProxyRevokeFunctionContext( TNode map = CAST( LoadContextElement(native_context, Context::FUNCTION_CONTEXT_MAP_INDEX)); StoreMapNoWriteBarrier(context, map); - InitializeFunctionContext(native_context, context, kProxyContextLength); + InitializeSyntheticFunctionContext(native_context, context, + kProxyContextLength); StoreContextElementNoWriteBarrier(CAST(context), kProxySlot, proxy); return context; } diff --git a/src/codegen/code-stub-assembler.cc b/src/codegen/code-stub-assembler.cc index 333118ff59..bd02d4a6eb 100644 --- a/src/codegen/code-stub-assembler.cc +++ b/src/codegen/code-stub-assembler.cc @@ -2644,6 +2644,17 @@ TNode CodeStubAssembler::LoadDoubleWithHoleCheck( return UncheckedCast(Load(machine_type, base, offset)); } +TNode CodeStubAssembler::LoadScopeInfo(TNode context) { + return CAST(LoadContextElement(context, Context::SCOPE_INFO_INDEX)); +} + +TNode CodeStubAssembler::LoadScopeInfoHasExtensionField( + TNode scope_info) { + TNode value = + LoadAndUntagObjectField(scope_info, ScopeInfo::kFlagsOffset); + return IsSetWord(value); +} + TNode CodeStubAssembler::LoadContextHasExtensionField( SloppyTNode context) { TNode value = @@ -13466,8 +13477,9 @@ void CodeStubAssembler::PerformStackCheck(TNode context) { BIND(&ok); } -void CodeStubAssembler::InitializeFunctionContext(Node* native_context, - Node* context, int slots) { +void CodeStubAssembler::InitializeSyntheticFunctionContext(Node* native_context, + Node* context, + int slots) { DCHECK_GE(slots, Context::MIN_CONTEXT_SLOTS); TNode map = CAST( LoadContextElement(native_context, Context::FUNCTION_CONTEXT_MAP_INDEX)); @@ -13481,8 +13493,6 @@ void CodeStubAssembler::InitializeFunctionContext(Node* native_context, empty_scope_info); StoreContextElementNoWriteBarrier(context, Context::PREVIOUS_INDEX, UndefinedConstant()); - StoreContextElementNoWriteBarrier(context, Context::EXTENSION_INDEX, - TheHoleConstant()); } TNode CodeStubAssembler::ArrayCreate(TNode context, diff --git a/src/codegen/code-stub-assembler.h b/src/codegen/code-stub-assembler.h index a47074d7bf..290f1108d2 100644 --- a/src/codegen/code-stub-assembler.h +++ b/src/codegen/code-stub-assembler.h @@ -1443,7 +1443,11 @@ class V8_EXPORT_PRIVATE CodeStubAssembler TNode BigIntFromInt32Pair(TNode low, TNode high); TNode BigIntFromUint32Pair(TNode low, TNode high); - // Context manipulation + // ScopeInfo: + TNode LoadScopeInfo(TNode context); + TNode LoadScopeInfoHasExtensionField(TNode scope_info); + + // Context manipulation: TNode LoadContextHasExtensionField(SloppyTNode context); TNode LoadContextElement(SloppyTNode context, int slot_index); @@ -3689,8 +3693,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler Label* if_bailout = nullptr, TVariable* var_instance_type = nullptr); - void InitializeFunctionContext(Node* native_context, Node* context, - int slots); + void InitializeSyntheticFunctionContext(Node* native_context, Node* context, + int slots); TNode ArrayCreate(TNode context, TNode length); diff --git a/src/compiler/access-builder.cc b/src/compiler/access-builder.cc index e6c5568af0..974c473989 100644 --- a/src/compiler/access-builder.cc +++ b/src/compiler/access-builder.cc @@ -849,6 +849,16 @@ FieldAccess AccessBuilder::ForCellValue() { return access; } +// static +FieldAccess AccessBuilder::ForScopeInfoFlags() { + FieldAccess access = { + kTaggedBase, ScopeInfo::kFlagsOffset, + MaybeHandle(), MaybeHandle(), + Type::SignedSmall(), MachineType::TypeCompressedTaggedSigned(), + kNoWriteBarrier}; + return access; +} + // static FieldAccess AccessBuilder::ForContextSlot(size_t index) { int offset = Context::OffsetOfElementAt(static_cast(index)); diff --git a/src/compiler/access-builder.h b/src/compiler/access-builder.h index 4aa69e3726..622dc1d76c 100644 --- a/src/compiler/access-builder.h +++ b/src/compiler/access-builder.h @@ -268,6 +268,9 @@ class V8_EXPORT_PRIVATE AccessBuilder final static FieldAccess ForFixedArraySlot( size_t index, WriteBarrierKind write_barrier_kind = kFullWriteBarrier); + // Provides access to ScopeInfo flags. + static FieldAccess ForScopeInfoFlags(); + // Provides access to Context slots. static FieldAccess ForContextSlot(size_t index); diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc index 17472a305d..f50f96ba1e 100644 --- a/src/compiler/bytecode-graph-builder.cc +++ b/src/compiler/bytecode-graph-builder.cc @@ -1573,31 +1573,44 @@ BytecodeGraphBuilder::Environment* BytecodeGraphBuilder::CheckContextExtensions( // We only need to check up to the last-but-one depth, because the an eval // in the same scope as the variable itself has no way of shadowing it. for (uint32_t d = 0; d < depth; d++) { - Node* extension_slot = - NewNode(javascript()->LoadContext(d, Context::EXTENSION_INDEX, false)); - - Node* check_no_extension = - NewNode(simplified()->ReferenceEqual(), extension_slot, - jsgraph()->TheHoleConstant()); - - NewBranch(check_no_extension); + Node* has_extension = NewNode(javascript()->HasContextExtension(d)); + Environment* undefined_extension_env; + NewBranch(has_extension); { SubEnvironment sub_environment(this); + NewIfTrue(); - NewIfFalse(); - // If there is an extension, merge into the slow path. - if (slow_environment == nullptr) { - slow_environment = environment(); - NewMerge(); - } else { - slow_environment->Merge(environment(), - bytecode_analysis().GetInLivenessFor( - bytecode_iterator().current_offset())); + Node* extension_slot = NewNode( + javascript()->LoadContext(d, Context::EXTENSION_INDEX, false)); + + Node* check_no_extension = + NewNode(simplified()->ReferenceEqual(), extension_slot, + jsgraph()->UndefinedConstant()); + + NewBranch(check_no_extension); + { + SubEnvironment sub_environment(this); + + NewIfFalse(); + // If there is an extension, merge into the slow path. + if (slow_environment == nullptr) { + slow_environment = environment(); + NewMerge(); + } else { + slow_environment->Merge(environment(), + bytecode_analysis().GetInLivenessFor( + bytecode_iterator().current_offset())); + } } + NewIfTrue(); + undefined_extension_env = environment(); } - - NewIfTrue(); + NewIfFalse(); + environment()->Merge(undefined_extension_env, + bytecode_analysis().GetInLivenessFor( + bytecode_iterator().current_offset())); + mark_as_needing_eager_checkpoint(true); // Do nothing on if there is no extension, eventually falling through to // the fast path. } diff --git a/src/compiler/heap-refs.h b/src/compiler/heap-refs.h index 77309b4ea7..a1e20554c4 100644 --- a/src/compiler/heap-refs.h +++ b/src/compiler/heap-refs.h @@ -785,6 +785,7 @@ class V8_EXPORT_PRIVATE SharedFunctionInfoRef : public HeapObjectRef { Handle object() const; int builtin_id() const; + int context_header_size() const; BytecodeArrayRef GetBytecodeArray() const; #define DECL_ACCESSOR(type, name) type name() const; diff --git a/src/compiler/js-create-lowering.cc b/src/compiler/js-create-lowering.cc index 87631225ed..fe2b5cbec0 100644 --- a/src/compiler/js-create-lowering.cc +++ b/src/compiler/js-create-lowering.cc @@ -1196,9 +1196,8 @@ Reduction JSCreateLowering::ReduceJSCreateFunctionContext(Node* node) { Node* effect = NodeProperties::GetEffectInput(node); Node* control = NodeProperties::GetControlInput(node); Node* context = NodeProperties::GetContextInput(node); - Node* extension = jsgraph()->TheHoleConstant(); AllocationBuilder a(jsgraph(), effect, control); - STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == 3); // Ensure fully covered. + STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == 2); // Ensure fully covered. int context_length = slot_count + Context::MIN_CONTEXT_SLOTS; switch (scope_type) { case EVAL_SCOPE: @@ -1214,7 +1213,6 @@ Reduction JSCreateLowering::ReduceJSCreateFunctionContext(Node* node) { a.Store(AccessBuilder::ForContextSlot(Context::SCOPE_INFO_INDEX), scope_info); a.Store(AccessBuilder::ForContextSlot(Context::PREVIOUS_INDEX), context); - a.Store(AccessBuilder::ForContextSlot(Context::EXTENSION_INDEX), extension); for (int i = Context::MIN_CONTEXT_SLOTS; i < context_length; ++i) { a.Store(AccessBuilder::ForContextSlot(i), jsgraph()->UndefinedConstant()); } @@ -1235,8 +1233,9 @@ Reduction JSCreateLowering::ReduceJSCreateWithContext(Node* node) { Node* context = NodeProperties::GetContextInput(node); AllocationBuilder a(jsgraph(), effect, control); - STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == 3); // Ensure fully covered. - a.AllocateContext(Context::MIN_CONTEXT_SLOTS, + STATIC_ASSERT(Context::MIN_CONTEXT_EXTENDED_SLOTS == + 3); // Ensure fully covered. + a.AllocateContext(Context::MIN_CONTEXT_EXTENDED_SLOTS, native_context().with_context_map()); a.Store(AccessBuilder::ForContextSlot(Context::SCOPE_INFO_INDEX), scope_info); a.Store(AccessBuilder::ForContextSlot(Context::PREVIOUS_INDEX), context); @@ -1253,15 +1252,13 @@ Reduction JSCreateLowering::ReduceJSCreateCatchContext(Node* node) { Node* effect = NodeProperties::GetEffectInput(node); Node* control = NodeProperties::GetControlInput(node); Node* context = NodeProperties::GetContextInput(node); - Node* extension = jsgraph()->TheHoleConstant(); AllocationBuilder a(jsgraph(), effect, control); - STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == 3); // Ensure fully covered. + STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == 2); // Ensure fully covered. a.AllocateContext(Context::MIN_CONTEXT_SLOTS + 1, native_context().catch_context_map()); a.Store(AccessBuilder::ForContextSlot(Context::SCOPE_INFO_INDEX), scope_info); a.Store(AccessBuilder::ForContextSlot(Context::PREVIOUS_INDEX), context); - a.Store(AccessBuilder::ForContextSlot(Context::EXTENSION_INDEX), extension); a.Store(AccessBuilder::ForContextSlot(Context::THROWN_OBJECT_INDEX), exception); RelaxControls(node); @@ -1280,15 +1277,13 @@ Reduction JSCreateLowering::ReduceJSCreateBlockContext(Node* node) { Node* effect = NodeProperties::GetEffectInput(node); Node* control = NodeProperties::GetControlInput(node); Node* context = NodeProperties::GetContextInput(node); - Node* extension = jsgraph()->TheHoleConstant(); AllocationBuilder a(jsgraph(), effect, control); - STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == 3); // Ensure fully covered. + STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == 2); // Ensure fully covered. a.AllocateContext(context_length, native_context().block_context_map()); a.Store(AccessBuilder::ForContextSlot(Context::SCOPE_INFO_INDEX), scope_info); a.Store(AccessBuilder::ForContextSlot(Context::PREVIOUS_INDEX), context); - a.Store(AccessBuilder::ForContextSlot(Context::EXTENSION_INDEX), extension); for (int i = Context::MIN_CONTEXT_SLOTS; i < context_length; ++i) { a.Store(AccessBuilder::ForContextSlot(i), jsgraph()->UndefinedConstant()); } @@ -1506,7 +1501,7 @@ Node* JSCreateLowering::AllocateAliasedArguments( a.Store(AccessBuilder::ForFixedArrayElement(), jsgraph()->Constant(1), arguments); for (int i = 0; i < mapped_count; ++i) { - int idx = Context::MIN_CONTEXT_SLOTS + parameter_count - 1 - i; + int idx = shared.context_header_size() + parameter_count - 1 - i; a.Store(AccessBuilder::ForFixedArrayElement(), jsgraph()->Constant(i + 2), jsgraph()->Constant(idx)); } @@ -1539,12 +1534,12 @@ Node* JSCreateLowering::AllocateAliasedArguments( // The unmapped argument values are stored yet another indirection away and // then linked into the parameter map below, whereas mapped argument values // (i.e. the first {mapped_count} elements) are replaced with a hole instead. - Node* arguments = + Node* arguments = effect = graph()->NewNode(simplified()->NewArgumentsElements(mapped_count), arguments_frame, arguments_length, effect); // Actually allocate the backing store. - AllocationBuilder a(jsgraph(), arguments, control); + AllocationBuilder a(jsgraph(), effect, control); a.AllocateArray(mapped_count + 2, MapRef(broker(), factory()->sloppy_arguments_elements_map())); a.Store(AccessBuilder::ForFixedArrayElement(), jsgraph()->Constant(0), @@ -1552,7 +1547,7 @@ Node* JSCreateLowering::AllocateAliasedArguments( a.Store(AccessBuilder::ForFixedArrayElement(), jsgraph()->Constant(1), arguments); for (int i = 0; i < mapped_count; ++i) { - int idx = Context::MIN_CONTEXT_SLOTS + parameter_count - 1 - i; + int idx = shared.context_header_size() + parameter_count - 1 - i; Node* value = graph()->NewNode( common()->Select(MachineRepresentation::kTagged), graph()->NewNode(simplified()->NumberLessThan(), jsgraph()->Constant(i), diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc index d419a804a5..b0252fe0d0 100644 --- a/src/compiler/js-generic-lowering.cc +++ b/src/compiler/js-generic-lowering.cc @@ -378,6 +378,10 @@ void JSGenericLowering::LowerJSOrdinaryHasInstance(Node* node) { ReplaceWithStubCall(node, callable, flags); } +void JSGenericLowering::LowerJSHasContextExtension(Node* node) { + UNREACHABLE(); // Eliminated in typed lowering. +} + void JSGenericLowering::LowerJSLoadContext(Node* node) { UNREACHABLE(); // Eliminated in typed lowering. } diff --git a/src/compiler/js-heap-broker.cc b/src/compiler/js-heap-broker.cc index 6dcf585cff..e8c4f6e59c 100644 --- a/src/compiler/js-heap-broker.cc +++ b/src/compiler/js-heap-broker.cc @@ -1629,6 +1629,7 @@ class SharedFunctionInfoData : public HeapObjectData { Handle object); int builtin_id() const { return builtin_id_; } + int context_header_size() const { return context_header_size_; } BytecodeArrayData* GetBytecodeArray() const { return GetBytecodeArray_; } void SetSerializedForCompilation(JSHeapBroker* broker, FeedbackVectorRef feedback); @@ -1656,6 +1657,7 @@ class SharedFunctionInfoData : public HeapObjectData { private: int const builtin_id_; + int context_header_size_; BytecodeArrayData* const GetBytecodeArray_; ZoneUnorderedSet, Handle::hash, Handle::equal_to> @@ -1673,6 +1675,7 @@ SharedFunctionInfoData::SharedFunctionInfoData( : HeapObjectData(broker, storage, object), builtin_id_(object->HasBuiltinId() ? object->builtin_id() : Builtins::kNoBuiltinId), + context_header_size_(object->scope_info().ContextHeaderLength()), GetBytecodeArray_( object->HasBytecodeArray() ? broker->GetOrCreateData(object->GetBytecodeArray()) @@ -4028,6 +4031,12 @@ bool SharedFunctionInfoRef::IsSerializedForCompilation( return data()->AsSharedFunctionInfo()->IsSerializedForCompilation(feedback); } +int SharedFunctionInfoRef::context_header_size() const { + IF_BROKER_DISABLED_ACCESS_HANDLE_C(SharedFunctionInfo, + scope_info().ContextHeaderLength); + return data()->AsSharedFunctionInfo()->context_header_size(); +} + void JSObjectRef::SerializeObjectCreateMap() { if (broker()->mode() == JSHeapBroker::kDisabled) return; CHECK_EQ(broker()->mode(), JSHeapBroker::kSerializing); diff --git a/src/compiler/js-operator.cc b/src/compiler/js-operator.cc index b9c5b9ba5a..5c885ded14 100644 --- a/src/compiler/js-operator.cc +++ b/src/compiler/js-operator.cc @@ -1153,6 +1153,15 @@ const Operator* JSOperatorBuilder::StoreGlobal(LanguageMode language_mode, parameters); // parameter } +const Operator* JSOperatorBuilder::HasContextExtension(size_t depth) { + return new (zone()) Operator1( // -- + IrOpcode::kJSHasContextExtension, // opcode + Operator::kNoWrite | Operator::kNoThrow, // flags + "JSHasContextExtension", // name + 0, 1, 0, 1, 1, 0, // counts + depth); // parameter +} + const Operator* JSOperatorBuilder::LoadContext(size_t depth, size_t index, bool immutable) { ContextAccess access(depth, index, immutable); diff --git a/src/compiler/js-operator.h b/src/compiler/js-operator.h index 47b0fff05a..d6ebb46340 100644 --- a/src/compiler/js-operator.h +++ b/src/compiler/js-operator.h @@ -862,6 +862,7 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final const Handle& name, const FeedbackSource& feedback); + const Operator* HasContextExtension(size_t depth); const Operator* LoadContext(size_t depth, size_t index, bool immutable); const Operator* StoreContext(size_t depth, size_t index); diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc index 035457c62b..a9172894c6 100644 --- a/src/compiler/js-typed-lowering.cc +++ b/src/compiler/js-typed-lowering.cc @@ -1313,6 +1313,36 @@ Reduction JSTypedLowering::ReduceJSOrdinaryHasInstance(Node* node) { return NoChange(); } +Reduction JSTypedLowering::ReduceJSHasContextExtension(Node* node) { + DCHECK_EQ(IrOpcode::kJSHasContextExtension, node->opcode()); + size_t depth = OpParameter(node->op()); + Node* effect = NodeProperties::GetEffectInput(node); + Node* context = NodeProperties::GetContextInput(node); + Node* control = graph()->start(); + for (size_t i = 0; i < depth; ++i) { + context = effect = graph()->NewNode( + simplified()->LoadField( + AccessBuilder::ForContextSlotKnownPointer(Context::PREVIOUS_INDEX)), + context, effect, control); + } + Node* const scope_info = effect = graph()->NewNode( + simplified()->LoadField( + AccessBuilder::ForContextSlot(Context::SCOPE_INFO_INDEX)), + context, effect, control); + Node* scope_info_flags = effect = graph()->NewNode( + simplified()->LoadField(AccessBuilder::ForScopeInfoFlags()), scope_info, + effect, control); + Node* flags_masked = graph()->NewNode( + simplified()->NumberBitwiseAnd(), scope_info_flags, + jsgraph()->SmiConstant(ScopeInfo::HasContextExtensionField::kMask)); + Node* no_extension = graph()->NewNode( + simplified()->NumberEqual(), flags_masked, jsgraph()->SmiConstant(0)); + Node* has_extension = + graph()->NewNode(simplified()->BooleanNot(), no_extension); + ReplaceWithValue(node, has_extension, effect, control); + return Changed(node); +} + Reduction JSTypedLowering::ReduceJSLoadContext(Node* node) { DCHECK_EQ(IrOpcode::kJSLoadContext, node->opcode()); ContextAccess const& access = ContextAccessOf(node->op()); @@ -2371,6 +2401,8 @@ Reduction JSTypedLowering::Reduce(Node* node) { return ReduceJSForInPrepare(node); case IrOpcode::kJSForInNext: return ReduceJSForInNext(node); + case IrOpcode::kJSHasContextExtension: + return ReduceJSHasContextExtension(node); case IrOpcode::kJSLoadMessage: return ReduceJSLoadMessage(node); case IrOpcode::kJSStoreMessage: diff --git a/src/compiler/js-typed-lowering.h b/src/compiler/js-typed-lowering.h index bcbc3aa16f..9fa6e01a93 100644 --- a/src/compiler/js-typed-lowering.h +++ b/src/compiler/js-typed-lowering.h @@ -51,6 +51,7 @@ class V8_EXPORT_PRIVATE JSTypedLowering final Reduction ReduceJSLoadNamed(Node* node); Reduction ReduceJSHasInPrototypeChain(Node* node); Reduction ReduceJSOrdinaryHasInstance(Node* node); + Reduction ReduceJSHasContextExtension(Node* node); Reduction ReduceJSLoadContext(Node* node); Reduction ReduceJSStoreContext(Node* node); Reduction ReduceJSLoadModule(Node* node); diff --git a/src/compiler/opcodes.h b/src/compiler/opcodes.h index ceef580f26..3bba7d8d5a 100644 --- a/src/compiler/opcodes.h +++ b/src/compiler/opcodes.h @@ -175,6 +175,7 @@ V(JSGetSuperConstructor) #define JS_CONTEXT_OP_LIST(V) \ + V(JSHasContextExtension) \ V(JSLoadContext) \ V(JSStoreContext) \ V(JSCreateFunctionContext) \ diff --git a/src/compiler/operator-properties.cc b/src/compiler/operator-properties.cc index 731a6c8496..6b2fb8bf57 100644 --- a/src/compiler/operator-properties.cc +++ b/src/compiler/operator-properties.cc @@ -76,6 +76,7 @@ bool OperatorProperties::NeedsExactContext(const Operator* op) { case IrOpcode::kJSDeleteProperty: case IrOpcode::kJSGeneratorStore: case IrOpcode::kJSHasProperty: + case IrOpcode::kJSHasContextExtension: case IrOpcode::kJSLoadContext: case IrOpcode::kJSLoadModule: case IrOpcode::kJSLoadNamed: diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc index 3d6ecd0a35..b3d7d4970a 100644 --- a/src/compiler/typer.cc +++ b/src/compiler/typer.cc @@ -1475,6 +1475,9 @@ Type Typer::Visitor::TypeJSGetSuperConstructor(Node* node) { } // JS context operators. +Type Typer::Visitor::TypeJSHasContextExtension(Node* node) { + return Type::Boolean(); +} Type Typer::Visitor::TypeJSLoadContext(Node* node) { ContextAccess const& access = ContextAccessOf(node->op()); diff --git a/src/compiler/verifier.cc b/src/compiler/verifier.cc index d58d49c0a6..032b3d2ff3 100644 --- a/src/compiler/verifier.cc +++ b/src/compiler/verifier.cc @@ -800,6 +800,9 @@ void Verifier::Visitor::Check(Node* node, const AllNodes& all) { CheckTypeIs(node, Type::Callable()); break; + case IrOpcode::kJSHasContextExtension: + CheckTypeIs(node, Type::Boolean()); + break; case IrOpcode::kJSLoadContext: // Type can be anything. CheckTypeIs(node, Type::Any()); diff --git a/src/debug/debug-scopes.cc b/src/debug/debug-scopes.cc index 512b85fb09..66f55ce7e7 100644 --- a/src/debug/debug-scopes.cc +++ b/src/debug/debug-scopes.cc @@ -722,7 +722,7 @@ bool ScopeIterator::VisitContextLocals(const Visitor& visitor, for (int i = 0; i < scope_info->ContextLocalCount(); ++i) { Handle name(scope_info->ContextLocalName(i), isolate_); if (ScopeInfo::VariableIsSynthetic(*name)) continue; - int context_index = Context::MIN_CONTEXT_SLOTS + i; + int context_index = scope_info->ContextHeaderLength() + i; Handle value(context->get(context_index), isolate_); // Reflect variables under TDZ as undefined in scope object. if (value->IsTheHole(isolate_)) continue; diff --git a/src/diagnostics/objects-printer.cc b/src/diagnostics/objects-printer.cc index 19a1b27734..11460ba240 100644 --- a/src/diagnostics/objects-printer.cc +++ b/src/diagnostics/objects-printer.cc @@ -983,7 +983,6 @@ void PrintContextWithHeader(std::ostream& os, Context context, os << "\n - length: " << context.length(); os << "\n - scope_info: " << Brief(context.scope_info()); os << "\n - previous: " << Brief(context.unchecked_previous()); - os << "\n - extension: " << Brief(context.extension()); os << "\n - native_context: " << Brief(context.native_context()); PrintFixedArrayElements(os, context); os << "\n"; @@ -2303,6 +2302,9 @@ void ScopeInfo::ScopeInfoPrint(std::ostream& os) { // NOLINT if (HasInferredFunctionName()) { os << "\n - inferred function name: " << Brief(InferredFunctionName()); } + if (HasContextExtension()) { + os << "\n - has context extension field"; + } if (CanElideThisHoleChecks()) { os << "\n - can elide this hole checks"; } diff --git a/src/heap/factory.cc b/src/heap/factory.cc index 9567e7130e..8d5b27e67c 100644 --- a/src/heap/factory.cc +++ b/src/heap/factory.cc @@ -1443,7 +1443,6 @@ Handle Factory::NewScriptContext(Handle outer, variadic_part_length, AllocationType::kOld); context->set_scope_info(*scope_info); context->set_previous(*outer); - context->set_extension(*the_hole_value()); DCHECK(context->IsScriptContext()); return context; } @@ -1490,7 +1489,6 @@ Handle Factory::NewFunctionContext(Handle outer, variadic_part_length, AllocationType::kYoung); context->set_scope_info(*scope_info); context->set_previous(*outer); - context->set_extension(*the_hole_value()); return context; } @@ -1506,7 +1504,6 @@ Handle Factory::NewCatchContext(Handle previous, variadic_part_length, AllocationType::kYoung); context->set_scope_info(*scope_info); context->set_previous(*previous); - context->set_extension(*the_hole_value()); context->set(Context::THROWN_OBJECT_INDEX, *thrown_object); return context; } @@ -1516,13 +1513,14 @@ Handle Factory::NewDebugEvaluateContext(Handle previous, Handle extension, Handle wrapped, Handle blacklist) { - STATIC_ASSERT(Context::BLACK_LIST_INDEX == Context::MIN_CONTEXT_SLOTS + 1); + STATIC_ASSERT(Context::BLACK_LIST_INDEX == + Context::MIN_CONTEXT_EXTENDED_SLOTS + 1); DCHECK(scope_info->IsDebugEvaluateScope()); Handle ext = extension.is_null() - ? Handle::cast(the_hole_value()) + ? Handle::cast(undefined_value()) : Handle::cast(extension); // TODO(ishell): Take the details from DebugEvaluateContextContext class. - int variadic_part_length = Context::MIN_CONTEXT_SLOTS + 2; + int variadic_part_length = Context::MIN_CONTEXT_EXTENDED_SLOTS + 2; Handle c = NewContext(isolate()->debug_evaluate_context_map(), Context::SizeFor(variadic_part_length), variadic_part_length, AllocationType::kYoung); @@ -1539,7 +1537,7 @@ Handle Factory::NewWithContext(Handle previous, Handle extension) { DCHECK_EQ(scope_info->scope_type(), WITH_SCOPE); // TODO(ishell): Take the details from WithContext class. - int variadic_part_length = Context::MIN_CONTEXT_SLOTS; + int variadic_part_length = Context::MIN_CONTEXT_EXTENDED_SLOTS; Handle context = NewContext( isolate()->with_context_map(), Context::SizeFor(variadic_part_length), variadic_part_length, AllocationType::kYoung); @@ -1559,7 +1557,6 @@ Handle Factory::NewBlockContext(Handle previous, variadic_part_length, AllocationType::kYoung); context->set_scope_info(*scope_info); context->set_previous(*previous); - context->set_extension(*the_hole_value()); return context; } @@ -1571,7 +1568,6 @@ Handle Factory::NewBuiltinContext(Handle native_context, variadic_part_length, AllocationType::kYoung); context->set_scope_info(ReadOnlyRoots(isolate()).empty_scope_info()); context->set_previous(*native_context); - context->set_extension(*the_hole_value()); return context; } diff --git a/src/interpreter/interpreter-assembler.cc b/src/interpreter/interpreter-assembler.cc index a55e074b3a..d42863108e 100644 --- a/src/interpreter/interpreter-assembler.cc +++ b/src/interpreter/interpreter-assembler.cc @@ -211,15 +211,15 @@ void InterpreterAssembler::GotoIfHasContextExtensionUpToDepth( Goto(&context_search); BIND(&context_search); { - // Check if context has an extension slot + // Check if context has an extension slot. TNode has_extension = - LoadContextHasExtensionField(cur_context.value()); + LoadScopeInfoHasExtensionField(LoadScopeInfo(cur_context.value())); GotoIfNot(has_extension, &no_extension); - // Jump to the target if the extension slot is not a hole. + // Jump to the target if the extension slot is not an undefined value. TNode extension_slot = LoadContextElement(cur_context.value(), Context::EXTENSION_INDEX); - Branch(TaggedNotEqual(extension_slot, TheHoleConstant()), target, + Branch(TaggedNotEqual(extension_slot, UndefinedConstant()), target, &no_extension); BIND(&no_extension); diff --git a/src/objects/contexts-inl.h b/src/objects/contexts-inl.h index 2c58122ec3..f2ad032b4c 100644 --- a/src/objects/contexts-inl.h +++ b/src/objects/contexts-inl.h @@ -115,9 +115,10 @@ void Context::set_previous(Context context) { set(PREVIOUS_INDEX, context); } Object Context::next_context_link() { return get(Context::NEXT_CONTEXT_LINK); } bool Context::has_extension() { - return static_cast( - HasExtensionField::decode(length_and_extension_flag())) && - !extension().IsTheHole(); + return (scope_info().HasContextExtension() || + static_cast( + HasExtensionField::decode(length_and_extension_flag()))) && + !extension().IsUndefined(); } HeapObject Context::extension() { diff --git a/src/objects/contexts.cc b/src/objects/contexts.cc index f0364c2398..80be273907 100644 --- a/src/objects/contexts.cc +++ b/src/objects/contexts.cc @@ -91,7 +91,7 @@ JSObject Context::extension_object() { DCHECK(IsNativeContext() || IsFunctionContext() || IsBlockContext() || IsEvalContext() || IsCatchContext()); HeapObject object = extension(); - if (object.IsTheHole()) return JSObject(); + if (object.IsUndefined()) return JSObject(); DCHECK(object.IsJSContextExtensionObject() || (IsNativeContext() && object.IsJSGlobalObject())); return JSObject::cast(object); @@ -197,11 +197,11 @@ Handle Context::Lookup(Handle context, Handle name, } // 1. Check global objects, subjects of with, and extension objects. - DCHECK_IMPLIES(context->IsEvalContext(), + DCHECK_IMPLIES(context->IsEvalContext() && context->has_extension(), context->extension().IsTheHole(isolate)); if ((context->IsNativeContext() || context->IsWithContext() || context->IsFunctionContext() || context->IsBlockContext()) && - !context->extension_receiver().is_null()) { + context->has_extension() && !context->extension_receiver().is_null()) { Handle object(context->extension_receiver(), isolate); if (context->IsNativeContext()) { @@ -467,7 +467,8 @@ void NativeContext::IncrementErrorsThrown() { int NativeContext::GetErrorsThrown() { return errors_thrown().value(); } -STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == 3); +STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == 2); +STATIC_ASSERT(Context::MIN_CONTEXT_EXTENDED_SLOTS == 3); STATIC_ASSERT(NativeContext::kScopeInfoOffset == Context::OffsetOfElementAt(NativeContext::SCOPE_INFO_INDEX)); STATIC_ASSERT(NativeContext::kPreviousOffset == diff --git a/src/objects/contexts.h b/src/objects/contexts.h index dd5711680d..c3053ae2dc 100644 --- a/src/objects/contexts.h +++ b/src/objects/contexts.h @@ -429,12 +429,14 @@ class ScriptContextTable : public FixedArray { // // [ previous ] A pointer to the previous context. // -// [ extension ] Additional data. +// [ extension ] Additional data. This slot is only available when +// extension_bit is set. Check using has_extension. // // For native contexts, it contains the global object. // For module contexts, it contains the module object. // For await contexts, it contains the generator object. -// For block contexts, it may contain an "extension object". +// For var block contexts, it may contain an "extension +// object". // For with contexts, it contains an "extension object". // // An "extension object" is used to dynamically extend a @@ -445,9 +447,10 @@ class ScriptContextTable : public FixedArray { // extension object is the original purpose of this context // slot, hence the name.) // -// In addition, function contexts may have statically allocated context slots -// to store local variables/functions that are accessed from inner functions -// (via static context addresses) or through 'eval' (dynamic context lookups). +// In addition, function contexts with sloppy eval may have statically +// allocated context slots to store local variables/functions that are accessed +// from inner functions (via static context addresses) or through 'eval' +// (dynamic context lookups). // The native context contains additional slots for fast access to native // properties. // @@ -485,7 +488,8 @@ class Context : public HeapObject { DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, TORQUE_GENERATED_CONTEXT_FIELDS) - // TODO(v8:8989): [torque] Support marker constants. + + // TODO(v8:8989): [torque] Support marker constants /* TODO(ishell): remove this fixedArray-like header size. */ static const int kFixedArrayLikeHeaderSize = kScopeInfoOffset; static const int kStartOfTaggedFieldsOffset = kScopeInfoOffset; @@ -494,10 +498,11 @@ class Context : public HeapObject { /* is removed in favour of offset-based access to common fields. */ \ static const int kTodoHeaderSize = kHeaderSize; + // If the extension slot exists, it is the first slot after the header. + static const int kExtensionOffset = kHeaderSize; + // Garbage collection support. V8_INLINE static constexpr int SizeFor(int length) { - // TODO(ishell): switch to kTodoHeaderSize based approach once we no longer - // reference common Context fields via index return kFixedArrayLikeHeaderSize + length * kTaggedSize; } @@ -519,6 +524,8 @@ class Context : public HeapObject { // These slots are in all contexts. SCOPE_INFO_INDEX, PREVIOUS_INDEX, + + // This slot only exists if the extension_flag bit is set. EXTENSION_INDEX, // These slots are only in native contexts. @@ -538,16 +545,21 @@ class Context : public HeapObject { FIRST_JS_ARRAY_MAP_SLOT = JS_ARRAY_PACKED_SMI_ELEMENTS_MAP_INDEX, // TODO(shell): Remove, once it becomes zero - MIN_CONTEXT_SLOTS = GLOBAL_PROXY_INDEX, + MIN_CONTEXT_SLOTS = EXTENSION_INDEX, + MIN_CONTEXT_EXTENDED_SLOTS = EXTENSION_INDEX + 1, // This slot holds the thrown value in catch contexts. THROWN_OBJECT_INDEX = MIN_CONTEXT_SLOTS, // These slots hold values in debug evaluate contexts. - WRAPPED_CONTEXT_INDEX = MIN_CONTEXT_SLOTS, - BLACK_LIST_INDEX = MIN_CONTEXT_SLOTS + 1 + WRAPPED_CONTEXT_INDEX = MIN_CONTEXT_EXTENDED_SLOTS, + BLACK_LIST_INDEX = MIN_CONTEXT_EXTENDED_SLOTS + 1 }; + static const int kExtensionSize = + (MIN_CONTEXT_EXTENDED_SLOTS - MIN_CONTEXT_SLOTS) * kTaggedSize; + static const int kExtendedHeaderSize = kHeaderSize + kExtensionSize; + // A region of native context entries containing maps for functions created // by Builtins::kFastNewClosure. static const int FIRST_FUNCTION_MAP_INDEX = SLOPPY_FUNCTION_MAP_INDEX; @@ -696,7 +708,7 @@ class NativeContext : public Context { #define NATIVE_CONTEXT_FIELDS_DEF(V) \ /* TODO(ishell): move definition of common context offsets to Context. */ \ V(kStartOfNativeContextFieldsOffset, \ - (FIRST_WEAK_SLOT - MIN_CONTEXT_SLOTS) * kTaggedSize) \ + (FIRST_WEAK_SLOT - MIN_CONTEXT_EXTENDED_SLOTS) * kTaggedSize) \ V(kEndOfStrongFieldsOffset, 0) \ V(kStartOfWeakFieldsOffset, \ (NATIVE_CONTEXT_SLOTS - FIRST_WEAK_SLOT) * kTaggedSize) \ @@ -708,7 +720,7 @@ class NativeContext : public Context { /* Total size. */ \ V(kSize, 0) - DEFINE_FIELD_OFFSET_CONSTANTS(Context::kTodoHeaderSize, + DEFINE_FIELD_OFFSET_CONSTANTS(Context::kExtendedHeaderSize, NATIVE_CONTEXT_FIELDS_DEF) #undef NATIVE_CONTEXT_FIELDS_DEF diff --git a/src/objects/scope-info.cc b/src/objects/scope-info.cc index 7db65d67db..b7a7dc2138 100644 --- a/src/objects/scope-info.cc +++ b/src/objects/scope-info.cc @@ -210,7 +210,8 @@ Handle ScopeInfo::Create(Isolate* isolate, Zone* zone, Scope* scope, scope->ForceContextForLanguageMode()) | PrivateNameLookupSkipsOuterClassField::encode( scope->private_name_lookup_skips_outer_class()) | - CanElideThisHoleChecksField::encode(can_elide_this_hole_checks); + CanElideThisHoleChecksField::encode(can_elide_this_hole_checks) | + HasContextExtensionField::encode(scope->HasContextExtension()); scope_info.SetFlags(flags); scope_info.SetParameterCount(parameter_count); @@ -227,7 +228,7 @@ Handle ScopeInfo::Create(Isolate* isolate, Zone* zone, Scope* scope, case VariableLocation::CONTEXT: { // Due to duplicate parameters, context locals aren't guaranteed to // come in order. - int local_index = var->index() - Context::MIN_CONTEXT_SLOTS; + int local_index = var->index() - scope->ContextHeaderLength(); DCHECK_LE(0, local_index); DCHECK_LT(local_index, context_local_count); uint32_t info = @@ -273,7 +274,7 @@ Handle ScopeInfo::Create(Isolate* isolate, Zone* zone, Scope* scope, for (int i = 0; i < parameter_count; i++) { Variable* parameter = scope->AsDeclarationScope()->parameter(i); if (parameter->location() != VariableLocation::CONTEXT) continue; - int index = parameter->index() - Context::MIN_CONTEXT_SLOTS; + int index = parameter->index() - scope->ContextHeaderLength(); int info_index = context_local_info_base + index; int info = Smi::ToInt(scope_info.get(info_index)); info = ParameterNumberField::update(info, i); @@ -284,7 +285,7 @@ Handle ScopeInfo::Create(Isolate* isolate, Zone* zone, Scope* scope, if (scope->AsDeclarationScope()->has_this_declaration()) { Variable* var = scope->AsDeclarationScope()->receiver(); if (var->location() == VariableLocation::CONTEXT) { - int local_index = var->index() - Context::MIN_CONTEXT_SLOTS; + int local_index = var->index() - scope->ContextHeaderLength(); uint32_t info = VariableModeField::encode(var->mode()) | InitFlagField::encode(var->initialization_flag()) | @@ -397,7 +398,8 @@ Handle ScopeInfo::CreateForWithScope( IsDebugEvaluateScopeField::encode(false) | ForceContextAllocationField::encode(false) | PrivateNameLookupSkipsOuterClassField::encode(false) | - CanElideThisHoleChecksField::encode(false); + CanElideThisHoleChecksField::encode(false) | + HasContextExtensionField::encode(false); scope_info->SetFlags(flags); scope_info->SetParameterCount(0); @@ -414,7 +416,7 @@ Handle ScopeInfo::CreateForWithScope( } DCHECK_EQ(index, scope_info->length()); DCHECK_EQ(0, scope_info->ParameterCount()); - DCHECK_EQ(Context::MIN_CONTEXT_SLOTS, scope_info->ContextLength()); + DCHECK_EQ(scope_info->ContextHeaderLength(), scope_info->ContextLength()); return scope_info; } @@ -467,7 +469,8 @@ Handle ScopeInfo::CreateForBootstrapping(Isolate* isolate, IsDebugEvaluateScopeField::encode(false) | ForceContextAllocationField::encode(false) | PrivateNameLookupSkipsOuterClassField::encode(false) | - CanElideThisHoleChecksField::encode(false); + CanElideThisHoleChecksField::encode(false) | + HasContextExtensionField::encode(false); scope_info->SetFlags(flags); scope_info->SetParameterCount(parameter_count); scope_info->SetContextLocalCount(context_local_count); @@ -492,7 +495,7 @@ Handle ScopeInfo::CreateForBootstrapping(Isolate* isolate, // And here we record that this scopeinfo binds a receiver. DCHECK_EQ(index, scope_info->ReceiverInfoIndex()); - const int receiver_index = Context::MIN_CONTEXT_SLOTS + 0; + const int receiver_index = scope_info->ContextHeaderLength(); if (!is_empty_function) { scope_info->set(index++, Smi::FromInt(receiver_index)); } @@ -516,7 +519,8 @@ Handle ScopeInfo::CreateForBootstrapping(Isolate* isolate, if (type == FUNCTION_SCOPE) { DCHECK_EQ(scope_info->ContextLength(), 0); } else { - DCHECK_EQ(scope_info->ContextLength(), Context::MIN_CONTEXT_SLOTS + 1); + DCHECK_EQ(scope_info->ContextLength(), + scope_info->ContextHeaderLength() + 1); } return scope_info; @@ -564,13 +568,22 @@ int ScopeInfo::ContextLength() const { scope_type() == MODULE_SCOPE; if (has_context) { - return Context::MIN_CONTEXT_SLOTS + context_locals + + return ContextHeaderLength() + context_locals + (function_name_context_slot ? 1 : 0); } } return 0; } +bool ScopeInfo::HasContextExtension() const { + return HasContextExtensionField::decode(Flags()); +} + +int ScopeInfo::ContextHeaderLength() const { + return HasContextExtension() ? Context::MIN_CONTEXT_EXTENDED_SLOTS + : Context::MIN_CONTEXT_SLOTS; +} + bool ScopeInfo::HasReceiver() const { if (length() == 0) return false; return NONE != ReceiverVariableField::decode(Flags()); @@ -822,7 +835,7 @@ int ScopeInfo::ContextSlotIndex(ScopeInfo scope_info, String name, *is_static_flag = scope_info.ContextLocalIsStaticFlag(var); *init_flag = scope_info.ContextLocalInitFlag(var); *maybe_assigned_flag = scope_info.ContextLocalMaybeAssignedFlag(var); - int result = Context::MIN_CONTEXT_SLOTS + var; + int result = scope_info.ContextHeaderLength() + var; DCHECK_LT(result, scope_info.ContextLength()); return result; diff --git a/src/objects/scope-info.h b/src/objects/scope-info.h index 0698b89303..3bcded1237 100644 --- a/src/objects/scope-info.h +++ b/src/objects/scope-info.h @@ -58,12 +58,14 @@ class ScopeInfo : public FixedArray { // Return the number of context slots for code if a context is allocated. This // number consists of three parts: - // 1. Size of fixed header for every context: Context::MIN_CONTEXT_SLOTS + // 1. Size of header for every context. // 2. One context slot per context allocated local. // 3. One context slot for the function name if it is context allocated. // Parameters allocated in the context count as context allocated locals. If // no contexts are allocated for this scope ContextLength returns 0. int ContextLength() const; + bool HasContextExtension() const; + int ContextHeaderLength() const; // Does this scope declare a "this" binding? bool HasReceiver() const; @@ -236,6 +238,8 @@ class ScopeInfo : public FixedArray { kVariablePartIndex }; + static const int kFlagsOffset = OffsetOfElementAt(Fields::kFlags); + // Used for the function name variable for named function expressions, and for // the receiver. enum VariableAllocationInfo { NONE, STACK, CONTEXT, UNUSED }; @@ -266,6 +270,7 @@ class ScopeInfo : public FixedArray { ForceContextAllocationField::Next; using CanElideThisHoleChecksField = PrivateNameLookupSkipsOuterClassField::Next; + using HasContextExtensionField = CanElideThisHoleChecksField::Next; STATIC_ASSERT(kLastFunctionKind <= FunctionKindField::kMax); diff --git a/src/profiler/heap-snapshot-generator.cc b/src/profiler/heap-snapshot-generator.cc index 3bf56bd91c..23c84601b9 100644 --- a/src/profiler/heap-snapshot-generator.cc +++ b/src/profiler/heap-snapshot-generator.cc @@ -989,9 +989,11 @@ void V8HeapExplorer::ExtractContextReferences(HeapEntry* entry, FixedArray::OffsetOfElementAt(Context::SCOPE_INFO_INDEX)); SetInternalReference(entry, "previous", context.get(Context::PREVIOUS_INDEX), FixedArray::OffsetOfElementAt(Context::PREVIOUS_INDEX)); - SetInternalReference(entry, "extension", - context.get(Context::EXTENSION_INDEX), - FixedArray::OffsetOfElementAt(Context::EXTENSION_INDEX)); + if (context.has_extension()) { + SetInternalReference( + entry, "extension", context.get(Context::EXTENSION_INDEX), + FixedArray::OffsetOfElementAt(Context::EXTENSION_INDEX)); + } if (context.IsNativeContext()) { TagObject(context.normalized_map_cache(), "(context norm. map cache)"); diff --git a/src/runtime/runtime-scopes.cc b/src/runtime/runtime-scopes.cc index 812b09b1f0..36326c931c 100644 --- a/src/runtime/runtime-scopes.cc +++ b/src/runtime/runtime-scopes.cc @@ -252,7 +252,7 @@ Object DeclareEvalHelper(Isolate* isolate, Handle name, value, NONE, is_var, is_function, RedeclarationType::kTypeError); } - if (context->extension().IsJSGlobalObject()) { + if (context->has_extension() && context->extension().IsJSGlobalObject()) { Handle global(JSGlobalObject::cast(context->extension()), isolate); return DeclareGlobal(isolate, global, name, value, NONE, is_var, @@ -439,7 +439,7 @@ Handle NewSloppyArguments(Isolate* isolate, Handle callee, int parameter = scope_info->ContextLocalParameterNumber(i); if (parameter >= mapped_count) continue; arguments->set_the_hole(parameter); - Smi slot = Smi::FromInt(Context::MIN_CONTEXT_SLOTS + i); + Smi slot = Smi::FromInt(scope_info->ContextHeaderLength() + i); parameter_map->set(parameter + 2, slot); } } else { diff --git a/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden b/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden index abba5b29a3..27fd92e9e2 100644 --- a/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden +++ b/test/cctest/interpreter/bytecode_expectations/AsyncGenerators.golden @@ -45,7 +45,7 @@ bytecodes: [ B(SetPendingMessage), B(Ldar), R(4), B(PushContext), R(5), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(7), B(Mov), R(0), R(6), B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(6), U8(2), @@ -152,7 +152,7 @@ bytecodes: [ B(SetPendingMessage), B(Ldar), R(4), B(PushContext), R(5), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(7), B(Mov), R(0), R(6), B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(6), U8(2), @@ -332,7 +332,7 @@ bytecodes: [ B(SetPendingMessage), B(Ldar), R(7), B(PushContext), R(8), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(10), B(Mov), R(0), R(9), B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(9), U8(2), @@ -553,7 +553,7 @@ bytecodes: [ B(SetPendingMessage), B(Ldar), R(4), B(PushContext), R(5), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(7), B(Mov), R(0), R(6), B(InvokeIntrinsic), U8(Runtime::k_AsyncGeneratorReject), R(6), U8(2), diff --git a/test/cctest/interpreter/bytecode_expectations/AsyncModules.golden b/test/cctest/interpreter/bytecode_expectations/AsyncModules.golden index 2702336be4..43283d0f61 100644 --- a/test/cctest/interpreter/bytecode_expectations/AsyncModules.golden +++ b/test/cctest/interpreter/bytecode_expectations/AsyncModules.golden @@ -67,7 +67,7 @@ bytecodes: [ B(SetPendingMessage), B(Ldar), R(3), B(PushContext), R(4), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(6), B(LdaTrue), B(Star), R(7), @@ -149,7 +149,7 @@ bytecodes: [ B(SetPendingMessage), B(Ldar), R(3), B(PushContext), R(4), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(6), B(LdaTrue), B(Star), R(7), @@ -237,7 +237,7 @@ bytecodes: [ B(SetPendingMessage), B(Ldar), R(4), B(PushContext), R(5), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(7), B(LdaTrue), B(Star), R(8), @@ -326,7 +326,7 @@ bytecodes: [ B(SetPendingMessage), B(Ldar), R(4), B(PushContext), R(5), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(7), B(LdaTrue), B(Star), R(8), diff --git a/test/cctest/interpreter/bytecode_expectations/BasicLoops.golden b/test/cctest/interpreter/bytecode_expectations/BasicLoops.golden index 58c2a86420..a5f97d46c4 100644 --- a/test/cctest/interpreter/bytecode_expectations/BasicLoops.golden +++ b/test/cctest/interpreter/bytecode_expectations/BasicLoops.golden @@ -703,19 +703,19 @@ bytecodes: [ B(CreateBlockContext), U8(0), B(PushContext), R(3), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(CreateClosure), U8(1), U8(0), U8(2), B(Star), R(2), /* 73 S> */ B(LdaSmi), I8(1), - /* 73 E> */ B(StaCurrentContextSlot), U8(3), + /* 73 E> */ B(StaCurrentContextSlot), U8(2), /* 102 S> */ B(Mov), R(2), R(1), - /* 106 S> */ B(LdaCurrentContextSlot), U8(3), + /* 106 S> */ B(LdaCurrentContextSlot), U8(2), B(JumpIfToBooleanFalse), U8(6), /* 113 S> */ B(PopContext), R(3), B(Jump), U8(10), - /* 126 S> */ B(LdaCurrentContextSlot), U8(3), + /* 126 S> */ B(LdaCurrentContextSlot), U8(2), B(Inc), U8(0), - /* 127 E> */ B(StaCurrentContextSlot), U8(3), + /* 127 E> */ B(StaCurrentContextSlot), U8(2), B(PopContext), R(3), B(JumpLoop), U8(41), I8(0), B(LdaUndefined), diff --git a/test/cctest/interpreter/bytecode_expectations/BreakableBlocks.golden b/test/cctest/interpreter/bytecode_expectations/BreakableBlocks.golden index 4bc0b3aad7..0e8f696b70 100644 --- a/test/cctest/interpreter/bytecode_expectations/BreakableBlocks.golden +++ b/test/cctest/interpreter/bytecode_expectations/BreakableBlocks.golden @@ -107,11 +107,11 @@ bytecodes: [ B(CreateBlockContext), U8(0), B(PushContext), R(2), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(CreateClosure), U8(1), U8(0), U8(2), B(Star), R(1), /* 53 S> */ B(LdaSmi), I8(10), - /* 53 E> */ B(StaCurrentContextSlot), U8(3), + /* 53 E> */ B(StaCurrentContextSlot), U8(2), /* 85 S> */ B(Mov), R(1), R(0), B(Ldar), R(1), /* 88 S> */ B(Jump), U8(2), @@ -146,28 +146,28 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(1), B(PushContext), R(2), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 30 E> */ B(StackCheck), /* 42 S> */ B(LdaSmi), I8(1), - /* 42 E> */ B(StaCurrentContextSlot), U8(3), + /* 42 E> */ B(StaCurrentContextSlot), U8(2), B(CreateBlockContext), U8(1), B(PushContext), R(3), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(CreateClosure), U8(2), U8(0), U8(2), B(Star), R(1), /* 76 S> */ B(LdaSmi), I8(2), - /* 76 E> */ B(StaCurrentContextSlot), U8(3), + /* 76 E> */ B(StaCurrentContextSlot), U8(2), /* 113 S> */ B(Mov), R(1), R(0), - /* 118 S> */ B(LdaCurrentContextSlot), U8(3), + /* 118 S> */ B(LdaCurrentContextSlot), U8(2), B(JumpIfToBooleanFalse), U8(6), /* 125 S> */ B(PopContext), R(3), B(Jump), U8(8), /* 142 S> */ B(LdaSmi), I8(3), - /* 144 E> */ B(StaCurrentContextSlot), U8(3), + /* 144 E> */ B(StaCurrentContextSlot), U8(2), B(PopContext), R(3), /* 155 S> */ B(LdaSmi), I8(4), - /* 157 E> */ B(StaCurrentContextSlot), U8(3), + /* 157 E> */ B(StaCurrentContextSlot), U8(2), B(LdaUndefined), /* 162 S> */ B(Return), ] diff --git a/test/cctest/interpreter/bytecode_expectations/CallLookupSlot.golden b/test/cctest/interpreter/bytecode_expectations/CallLookupSlot.golden index fcad4894f0..d44536b5b6 100644 --- a/test/cctest/interpreter/bytecode_expectations/CallLookupSlot.golden +++ b/test/cctest/interpreter/bytecode_expectations/CallLookupSlot.golden @@ -13,7 +13,7 @@ frame size: 10 parameter count: 1 bytecode array length: 75 bytecodes: [ - B(CreateFunctionContext), U8(0), U8(3), + B(CreateFunctionContext), U8(0), U8(4), B(PushContext), R(1), B(Ldar), R(this), B(StaCurrentContextSlot), U8(3), diff --git a/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden b/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden index 74db94f43f..32a8580570 100644 --- a/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden +++ b/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden @@ -100,9 +100,9 @@ bytecodes: [ B(PushContext), R(1), /* 30 E> */ B(StackCheck), /* 43 S> */ B(LdaConstant), U8(1), - /* 43 E> */ B(StaCurrentContextSlot), U8(3), + /* 43 E> */ B(StaCurrentContextSlot), U8(2), /* 57 S> */ B(LdaConstant), U8(2), - /* 57 E> */ B(StaCurrentContextSlot), U8(4), + /* 57 E> */ B(StaCurrentContextSlot), U8(3), B(CreateBlockContext), U8(3), B(PushContext), R(2), B(LdaTheHole), @@ -111,11 +111,11 @@ bytecodes: [ B(Star), R(3), B(LdaConstant), U8(4), B(Star), R(4), - /* 75 S> */ B(LdaImmutableContextSlot), R(2), U8(3), U8(0), + /* 75 S> */ B(LdaImmutableContextSlot), R(2), U8(2), U8(0), B(ToName), R(7), B(CreateClosure), U8(6), U8(1), U8(2), B(Star), R(8), - /* 106 S> */ B(LdaImmutableContextSlot), R(2), U8(4), U8(0), + /* 106 S> */ B(LdaImmutableContextSlot), R(2), U8(3), U8(0), B(ToName), R(9), B(LdaConstant), U8(7), B(TestEqualStrict), R(9), U8(0), @@ -159,7 +159,7 @@ bytecodes: [ B(PushContext), R(1), /* 30 E> */ B(StackCheck), /* 46 S> */ B(LdaZero), - /* 46 E> */ B(StaCurrentContextSlot), U8(3), + /* 46 E> */ B(StaCurrentContextSlot), U8(2), B(CreateBlockContext), U8(1), B(PushContext), R(2), B(LdaTheHole), diff --git a/test/cctest/interpreter/bytecode_expectations/CompoundExpressions.golden b/test/cctest/interpreter/bytecode_expectations/CompoundExpressions.golden index 0901d36522..58a3383b9d 100644 --- a/test/cctest/interpreter/bytecode_expectations/CompoundExpressions.golden +++ b/test/cctest/interpreter/bytecode_expectations/CompoundExpressions.golden @@ -108,11 +108,11 @@ bytecodes: [ B(PushContext), R(0), /* 30 E> */ B(StackCheck), /* 42 S> */ B(LdaSmi), I8(1), - /* 42 E> */ B(StaCurrentContextSlot), U8(3), + /* 42 E> */ B(StaCurrentContextSlot), U8(2), /* 45 S> */ B(CreateClosure), U8(1), U8(0), U8(2), - /* 75 S> */ B(LdaCurrentContextSlot), U8(3), + /* 75 S> */ B(LdaCurrentContextSlot), U8(2), B(BitwiseOrSmi), I8(24), U8(0), - /* 77 E> */ B(StaCurrentContextSlot), U8(3), + /* 77 E> */ B(StaCurrentContextSlot), U8(2), B(LdaUndefined), /* 84 S> */ B(Return), ] diff --git a/test/cctest/interpreter/bytecode_expectations/ConstVariableContextSlot.golden b/test/cctest/interpreter/bytecode_expectations/ConstVariableContextSlot.golden index 1f632e5910..1f91c8e87d 100644 --- a/test/cctest/interpreter/bytecode_expectations/ConstVariableContextSlot.golden +++ b/test/cctest/interpreter/bytecode_expectations/ConstVariableContextSlot.golden @@ -16,10 +16,10 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(1), B(PushContext), R(0), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 30 E> */ B(StackCheck), /* 44 S> */ B(LdaSmi), I8(10), - /* 44 E> */ B(StaCurrentContextSlot), U8(3), + /* 44 E> */ B(StaCurrentContextSlot), U8(2), B(LdaUndefined), /* 74 S> */ B(Return), ] @@ -40,11 +40,11 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(1), B(PushContext), R(0), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 30 E> */ B(StackCheck), /* 44 S> */ B(LdaSmi), I8(10), - /* 44 E> */ B(StaCurrentContextSlot), U8(3), - /* 74 S> */ B(LdaImmutableCurrentContextSlot), U8(3), + /* 44 E> */ B(StaCurrentContextSlot), U8(2), + /* 74 S> */ B(LdaImmutableCurrentContextSlot), U8(2), /* 83 S> */ B(Return), ] constant pool: [ @@ -64,14 +64,14 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(1), B(PushContext), R(0), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 30 E> */ B(StackCheck), /* 44 S> */ B(LdaSmi), I8(20), B(Star), R(1), - B(LdaCurrentContextSlot), U8(3), + B(LdaCurrentContextSlot), U8(2), /* 47 E> */ B(ThrowReferenceErrorIfHole), U8(1), B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0), - /* 44 E> */ B(StaCurrentContextSlot), U8(3), + /* 44 E> */ B(StaCurrentContextSlot), U8(2), B(LdaUndefined), /* 80 S> */ B(Return), ] @@ -93,10 +93,10 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(1), B(PushContext), R(0), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 30 E> */ B(StackCheck), /* 44 S> */ B(LdaSmi), I8(10), - /* 44 E> */ B(StaCurrentContextSlot), U8(3), + /* 44 E> */ B(StaCurrentContextSlot), U8(2), /* 48 S> */ B(LdaSmi), I8(20), /* 50 E> */ B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0), B(LdaUndefined), diff --git a/test/cctest/interpreter/bytecode_expectations/ContextParameters.golden b/test/cctest/interpreter/bytecode_expectations/ContextParameters.golden index 5ba5df57c2..1c0c155a1d 100644 --- a/test/cctest/interpreter/bytecode_expectations/ContextParameters.golden +++ b/test/cctest/interpreter/bytecode_expectations/ContextParameters.golden @@ -18,7 +18,7 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(1), B(PushContext), R(0), B(Ldar), R(arg0), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 10 E> */ B(StackCheck), /* 19 S> */ B(CreateClosure), U8(1), U8(0), U8(2), /* 51 S> */ B(Return), @@ -42,11 +42,11 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(1), B(PushContext), R(1), B(Ldar), R(arg0), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 10 E> */ B(StackCheck), /* 27 S> */ B(CreateClosure), U8(1), U8(0), U8(2), B(Star), R(0), - /* 53 S> */ B(LdaCurrentContextSlot), U8(3), + /* 53 S> */ B(LdaCurrentContextSlot), U8(2), /* 65 S> */ B(Return), ] constant pool: [ @@ -68,9 +68,9 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(2), B(PushContext), R(0), B(Ldar), R(arg0), - B(StaCurrentContextSlot), U8(4), - B(Ldar), R(arg2), B(StaCurrentContextSlot), U8(3), + B(Ldar), R(arg2), + B(StaCurrentContextSlot), U8(2), /* 10 E> */ B(StackCheck), /* 29 S> */ B(CreateClosure), U8(1), U8(0), U8(2), /* 60 S> */ B(Return), @@ -95,7 +95,7 @@ bytecodes: [ B(PushContext), R(0), /* 10 E> */ B(StackCheck), /* 26 S> */ B(Ldar), R(this), - /* 26 E> */ B(StaCurrentContextSlot), U8(3), + /* 26 E> */ B(StaCurrentContextSlot), U8(2), /* 32 S> */ B(CreateClosure), U8(1), U8(0), U8(2), /* 64 S> */ B(Return), ] diff --git a/test/cctest/interpreter/bytecode_expectations/ContextVariables.golden b/test/cctest/interpreter/bytecode_expectations/ContextVariables.golden index b3549da48f..978790bc8f 100644 --- a/test/cctest/interpreter/bytecode_expectations/ContextVariables.golden +++ b/test/cctest/interpreter/bytecode_expectations/ContextVariables.golden @@ -38,7 +38,7 @@ bytecodes: [ B(PushContext), R(0), /* 30 E> */ B(StackCheck), /* 42 S> */ B(LdaSmi), I8(1), - /* 42 E> */ B(StaCurrentContextSlot), U8(3), + /* 42 E> */ B(StaCurrentContextSlot), U8(2), /* 45 S> */ B(CreateClosure), U8(1), U8(0), U8(2), /* 74 S> */ B(Return), ] @@ -61,9 +61,9 @@ bytecodes: [ B(PushContext), R(0), /* 30 E> */ B(StackCheck), /* 42 S> */ B(LdaSmi), I8(1), - /* 42 E> */ B(StaCurrentContextSlot), U8(3), + /* 42 E> */ B(StaCurrentContextSlot), U8(2), /* 53 S> */ B(LdaSmi), I8(2), - /* 53 E> */ B(StaCurrentContextSlot), U8(4), + /* 53 E> */ B(StaCurrentContextSlot), U8(3), /* 56 S> */ B(CreateClosure), U8(1), U8(0), U8(2), /* 91 S> */ B(Return), ] @@ -88,7 +88,7 @@ bytecodes: [ /* 41 S> */ B(CreateClosure), U8(1), U8(0), U8(2), B(Star), R(1), /* 64 E> */ B(CallUndefinedReceiver0), R(1), U8(0), - /* 68 S> */ B(LdaCurrentContextSlot), U8(3), + /* 68 S> */ B(LdaCurrentContextSlot), U8(2), /* 77 S> */ B(Return), ] constant pool: [ @@ -111,16 +111,16 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(1), B(PushContext), R(0), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 30 E> */ B(StackCheck), /* 56 S> */ B(LdaSmi), I8(1), - /* 56 E> */ B(StaCurrentContextSlot), U8(3), + /* 56 E> */ B(StaCurrentContextSlot), U8(2), B(CreateBlockContext), U8(1), B(PushContext), R(1), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 69 S> */ B(LdaSmi), I8(2), - /* 69 E> */ B(StaCurrentContextSlot), U8(3), + /* 69 E> */ B(StaCurrentContextSlot), U8(2), /* 72 S> */ B(CreateClosure), U8(2), U8(0), U8(2), /* 101 S> */ B(Return), ] @@ -386,532 +386,535 @@ snippet: " var a1144 = 0; var a1145 = 0; var a1146 = 0; + var a1147 = 0; eval(); var b = 100; return b " frame size: 3 parameter count: 1 -bytecode array length: 791 +bytecode array length: 797 bytecodes: [ - B(CreateFunctionContext), U8(0), U8(255), + B(Wide), B(CreateFunctionContext), U16(0), U16(256), B(PushContext), R(1), B(Ldar), R(this), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(CreateUnmappedArguments), B(Wide), B(StaCurrentContextSlot), U16(257), B(Ldar), R(0), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), /* 30 E> */ B(StackCheck), /* 59 S> */ B(LdaZero), - /* 59 E> */ B(StaCurrentContextSlot), U8(5), + /* 59 E> */ B(StaCurrentContextSlot), U8(4), /* 73 S> */ B(LdaZero), - /* 73 E> */ B(StaCurrentContextSlot), U8(6), + /* 73 E> */ B(StaCurrentContextSlot), U8(5), /* 87 S> */ B(LdaZero), - /* 87 E> */ B(StaCurrentContextSlot), U8(7), + /* 87 E> */ B(StaCurrentContextSlot), U8(6), /* 101 S> */ B(LdaZero), - /* 101 E> */ B(StaCurrentContextSlot), U8(8), + /* 101 E> */ B(StaCurrentContextSlot), U8(7), /* 115 S> */ B(LdaZero), - /* 115 E> */ B(StaCurrentContextSlot), U8(9), + /* 115 E> */ B(StaCurrentContextSlot), U8(8), /* 129 S> */ B(LdaZero), - /* 129 E> */ B(StaCurrentContextSlot), U8(10), + /* 129 E> */ B(StaCurrentContextSlot), U8(9), /* 143 S> */ B(LdaZero), - /* 143 E> */ B(StaCurrentContextSlot), U8(11), + /* 143 E> */ B(StaCurrentContextSlot), U8(10), /* 157 S> */ B(LdaZero), - /* 157 E> */ B(StaCurrentContextSlot), U8(12), + /* 157 E> */ B(StaCurrentContextSlot), U8(11), /* 171 S> */ B(LdaZero), - /* 171 E> */ B(StaCurrentContextSlot), U8(13), + /* 171 E> */ B(StaCurrentContextSlot), U8(12), /* 185 S> */ B(LdaZero), - /* 185 E> */ B(StaCurrentContextSlot), U8(14), + /* 185 E> */ B(StaCurrentContextSlot), U8(13), /* 199 S> */ B(LdaZero), - /* 199 E> */ B(StaCurrentContextSlot), U8(15), + /* 199 E> */ B(StaCurrentContextSlot), U8(14), /* 213 S> */ B(LdaZero), - /* 213 E> */ B(StaCurrentContextSlot), U8(16), + /* 213 E> */ B(StaCurrentContextSlot), U8(15), /* 227 S> */ B(LdaZero), - /* 227 E> */ B(StaCurrentContextSlot), U8(17), + /* 227 E> */ B(StaCurrentContextSlot), U8(16), /* 241 S> */ B(LdaZero), - /* 241 E> */ B(StaCurrentContextSlot), U8(18), + /* 241 E> */ B(StaCurrentContextSlot), U8(17), /* 255 S> */ B(LdaZero), - /* 255 E> */ B(StaCurrentContextSlot), U8(19), + /* 255 E> */ B(StaCurrentContextSlot), U8(18), /* 269 S> */ B(LdaZero), - /* 269 E> */ B(StaCurrentContextSlot), U8(20), + /* 269 E> */ B(StaCurrentContextSlot), U8(19), /* 283 S> */ B(LdaZero), - /* 283 E> */ B(StaCurrentContextSlot), U8(21), + /* 283 E> */ B(StaCurrentContextSlot), U8(20), /* 297 S> */ B(LdaZero), - /* 297 E> */ B(StaCurrentContextSlot), U8(22), + /* 297 E> */ B(StaCurrentContextSlot), U8(21), /* 311 S> */ B(LdaZero), - /* 311 E> */ B(StaCurrentContextSlot), U8(23), + /* 311 E> */ B(StaCurrentContextSlot), U8(22), /* 325 S> */ B(LdaZero), - /* 325 E> */ B(StaCurrentContextSlot), U8(24), + /* 325 E> */ B(StaCurrentContextSlot), U8(23), /* 339 S> */ B(LdaZero), - /* 339 E> */ B(StaCurrentContextSlot), U8(25), + /* 339 E> */ B(StaCurrentContextSlot), U8(24), /* 353 S> */ B(LdaZero), - /* 353 E> */ B(StaCurrentContextSlot), U8(26), + /* 353 E> */ B(StaCurrentContextSlot), U8(25), /* 367 S> */ B(LdaZero), - /* 367 E> */ B(StaCurrentContextSlot), U8(27), + /* 367 E> */ B(StaCurrentContextSlot), U8(26), /* 381 S> */ B(LdaZero), - /* 381 E> */ B(StaCurrentContextSlot), U8(28), + /* 381 E> */ B(StaCurrentContextSlot), U8(27), /* 395 S> */ B(LdaZero), - /* 395 E> */ B(StaCurrentContextSlot), U8(29), + /* 395 E> */ B(StaCurrentContextSlot), U8(28), /* 409 S> */ B(LdaZero), - /* 409 E> */ B(StaCurrentContextSlot), U8(30), + /* 409 E> */ B(StaCurrentContextSlot), U8(29), /* 423 S> */ B(LdaZero), - /* 423 E> */ B(StaCurrentContextSlot), U8(31), + /* 423 E> */ B(StaCurrentContextSlot), U8(30), /* 437 S> */ B(LdaZero), - /* 437 E> */ B(StaCurrentContextSlot), U8(32), + /* 437 E> */ B(StaCurrentContextSlot), U8(31), /* 451 S> */ B(LdaZero), - /* 451 E> */ B(StaCurrentContextSlot), U8(33), + /* 451 E> */ B(StaCurrentContextSlot), U8(32), /* 465 S> */ B(LdaZero), - /* 465 E> */ B(StaCurrentContextSlot), U8(34), + /* 465 E> */ B(StaCurrentContextSlot), U8(33), /* 479 S> */ B(LdaZero), - /* 479 E> */ B(StaCurrentContextSlot), U8(35), + /* 479 E> */ B(StaCurrentContextSlot), U8(34), /* 493 S> */ B(LdaZero), - /* 493 E> */ B(StaCurrentContextSlot), U8(36), + /* 493 E> */ B(StaCurrentContextSlot), U8(35), /* 507 S> */ B(LdaZero), - /* 507 E> */ B(StaCurrentContextSlot), U8(37), + /* 507 E> */ B(StaCurrentContextSlot), U8(36), /* 521 S> */ B(LdaZero), - /* 521 E> */ B(StaCurrentContextSlot), U8(38), + /* 521 E> */ B(StaCurrentContextSlot), U8(37), /* 535 S> */ B(LdaZero), - /* 535 E> */ B(StaCurrentContextSlot), U8(39), + /* 535 E> */ B(StaCurrentContextSlot), U8(38), /* 549 S> */ B(LdaZero), - /* 549 E> */ B(StaCurrentContextSlot), U8(40), + /* 549 E> */ B(StaCurrentContextSlot), U8(39), /* 563 S> */ B(LdaZero), - /* 563 E> */ B(StaCurrentContextSlot), U8(41), + /* 563 E> */ B(StaCurrentContextSlot), U8(40), /* 577 S> */ B(LdaZero), - /* 577 E> */ B(StaCurrentContextSlot), U8(42), + /* 577 E> */ B(StaCurrentContextSlot), U8(41), /* 591 S> */ B(LdaZero), - /* 591 E> */ B(StaCurrentContextSlot), U8(43), + /* 591 E> */ B(StaCurrentContextSlot), U8(42), /* 605 S> */ B(LdaZero), - /* 605 E> */ B(StaCurrentContextSlot), U8(44), + /* 605 E> */ B(StaCurrentContextSlot), U8(43), /* 619 S> */ B(LdaZero), - /* 619 E> */ B(StaCurrentContextSlot), U8(45), + /* 619 E> */ B(StaCurrentContextSlot), U8(44), /* 633 S> */ B(LdaZero), - /* 633 E> */ B(StaCurrentContextSlot), U8(46), + /* 633 E> */ B(StaCurrentContextSlot), U8(45), /* 647 S> */ B(LdaZero), - /* 647 E> */ B(StaCurrentContextSlot), U8(47), + /* 647 E> */ B(StaCurrentContextSlot), U8(46), /* 661 S> */ B(LdaZero), - /* 661 E> */ B(StaCurrentContextSlot), U8(48), + /* 661 E> */ B(StaCurrentContextSlot), U8(47), /* 675 S> */ B(LdaZero), - /* 675 E> */ B(StaCurrentContextSlot), U8(49), + /* 675 E> */ B(StaCurrentContextSlot), U8(48), /* 689 S> */ B(LdaZero), - /* 689 E> */ B(StaCurrentContextSlot), U8(50), + /* 689 E> */ B(StaCurrentContextSlot), U8(49), /* 703 S> */ B(LdaZero), - /* 703 E> */ B(StaCurrentContextSlot), U8(51), + /* 703 E> */ B(StaCurrentContextSlot), U8(50), /* 717 S> */ B(LdaZero), - /* 717 E> */ B(StaCurrentContextSlot), U8(52), + /* 717 E> */ B(StaCurrentContextSlot), U8(51), /* 731 S> */ B(LdaZero), - /* 731 E> */ B(StaCurrentContextSlot), U8(53), + /* 731 E> */ B(StaCurrentContextSlot), U8(52), /* 745 S> */ B(LdaZero), - /* 745 E> */ B(StaCurrentContextSlot), U8(54), + /* 745 E> */ B(StaCurrentContextSlot), U8(53), /* 759 S> */ B(LdaZero), - /* 759 E> */ B(StaCurrentContextSlot), U8(55), + /* 759 E> */ B(StaCurrentContextSlot), U8(54), /* 773 S> */ B(LdaZero), - /* 773 E> */ B(StaCurrentContextSlot), U8(56), + /* 773 E> */ B(StaCurrentContextSlot), U8(55), /* 787 S> */ B(LdaZero), - /* 787 E> */ B(StaCurrentContextSlot), U8(57), + /* 787 E> */ B(StaCurrentContextSlot), U8(56), /* 801 S> */ B(LdaZero), - /* 801 E> */ B(StaCurrentContextSlot), U8(58), + /* 801 E> */ B(StaCurrentContextSlot), U8(57), /* 815 S> */ B(LdaZero), - /* 815 E> */ B(StaCurrentContextSlot), U8(59), + /* 815 E> */ B(StaCurrentContextSlot), U8(58), /* 829 S> */ B(LdaZero), - /* 829 E> */ B(StaCurrentContextSlot), U8(60), + /* 829 E> */ B(StaCurrentContextSlot), U8(59), /* 843 S> */ B(LdaZero), - /* 843 E> */ B(StaCurrentContextSlot), U8(61), + /* 843 E> */ B(StaCurrentContextSlot), U8(60), /* 857 S> */ B(LdaZero), - /* 857 E> */ B(StaCurrentContextSlot), U8(62), + /* 857 E> */ B(StaCurrentContextSlot), U8(61), /* 871 S> */ B(LdaZero), - /* 871 E> */ B(StaCurrentContextSlot), U8(63), + /* 871 E> */ B(StaCurrentContextSlot), U8(62), /* 885 S> */ B(LdaZero), - /* 885 E> */ B(StaCurrentContextSlot), U8(64), + /* 885 E> */ B(StaCurrentContextSlot), U8(63), /* 899 S> */ B(LdaZero), - /* 899 E> */ B(StaCurrentContextSlot), U8(65), + /* 899 E> */ B(StaCurrentContextSlot), U8(64), /* 913 S> */ B(LdaZero), - /* 913 E> */ B(StaCurrentContextSlot), U8(66), + /* 913 E> */ B(StaCurrentContextSlot), U8(65), /* 927 S> */ B(LdaZero), - /* 927 E> */ B(StaCurrentContextSlot), U8(67), + /* 927 E> */ B(StaCurrentContextSlot), U8(66), /* 941 S> */ B(LdaZero), - /* 941 E> */ B(StaCurrentContextSlot), U8(68), + /* 941 E> */ B(StaCurrentContextSlot), U8(67), /* 955 S> */ B(LdaZero), - /* 955 E> */ B(StaCurrentContextSlot), U8(69), + /* 955 E> */ B(StaCurrentContextSlot), U8(68), /* 969 S> */ B(LdaZero), - /* 969 E> */ B(StaCurrentContextSlot), U8(70), + /* 969 E> */ B(StaCurrentContextSlot), U8(69), /* 983 S> */ B(LdaZero), - /* 983 E> */ B(StaCurrentContextSlot), U8(71), + /* 983 E> */ B(StaCurrentContextSlot), U8(70), /* 997 S> */ B(LdaZero), - /* 997 E> */ B(StaCurrentContextSlot), U8(72), + /* 997 E> */ B(StaCurrentContextSlot), U8(71), /* 1011 S> */ B(LdaZero), - /* 1011 E> */ B(StaCurrentContextSlot), U8(73), + /* 1011 E> */ B(StaCurrentContextSlot), U8(72), /* 1025 S> */ B(LdaZero), - /* 1025 E> */ B(StaCurrentContextSlot), U8(74), + /* 1025 E> */ B(StaCurrentContextSlot), U8(73), /* 1039 S> */ B(LdaZero), - /* 1039 E> */ B(StaCurrentContextSlot), U8(75), + /* 1039 E> */ B(StaCurrentContextSlot), U8(74), /* 1053 S> */ B(LdaZero), - /* 1053 E> */ B(StaCurrentContextSlot), U8(76), + /* 1053 E> */ B(StaCurrentContextSlot), U8(75), /* 1067 S> */ B(LdaZero), - /* 1067 E> */ B(StaCurrentContextSlot), U8(77), + /* 1067 E> */ B(StaCurrentContextSlot), U8(76), /* 1081 S> */ B(LdaZero), - /* 1081 E> */ B(StaCurrentContextSlot), U8(78), + /* 1081 E> */ B(StaCurrentContextSlot), U8(77), /* 1095 S> */ B(LdaZero), - /* 1095 E> */ B(StaCurrentContextSlot), U8(79), + /* 1095 E> */ B(StaCurrentContextSlot), U8(78), /* 1109 S> */ B(LdaZero), - /* 1109 E> */ B(StaCurrentContextSlot), U8(80), + /* 1109 E> */ B(StaCurrentContextSlot), U8(79), /* 1123 S> */ B(LdaZero), - /* 1123 E> */ B(StaCurrentContextSlot), U8(81), + /* 1123 E> */ B(StaCurrentContextSlot), U8(80), /* 1137 S> */ B(LdaZero), - /* 1137 E> */ B(StaCurrentContextSlot), U8(82), + /* 1137 E> */ B(StaCurrentContextSlot), U8(81), /* 1151 S> */ B(LdaZero), - /* 1151 E> */ B(StaCurrentContextSlot), U8(83), + /* 1151 E> */ B(StaCurrentContextSlot), U8(82), /* 1165 S> */ B(LdaZero), - /* 1165 E> */ B(StaCurrentContextSlot), U8(84), + /* 1165 E> */ B(StaCurrentContextSlot), U8(83), /* 1179 S> */ B(LdaZero), - /* 1179 E> */ B(StaCurrentContextSlot), U8(85), + /* 1179 E> */ B(StaCurrentContextSlot), U8(84), /* 1193 S> */ B(LdaZero), - /* 1193 E> */ B(StaCurrentContextSlot), U8(86), + /* 1193 E> */ B(StaCurrentContextSlot), U8(85), /* 1207 S> */ B(LdaZero), - /* 1207 E> */ B(StaCurrentContextSlot), U8(87), + /* 1207 E> */ B(StaCurrentContextSlot), U8(86), /* 1221 S> */ B(LdaZero), - /* 1221 E> */ B(StaCurrentContextSlot), U8(88), + /* 1221 E> */ B(StaCurrentContextSlot), U8(87), /* 1235 S> */ B(LdaZero), - /* 1235 E> */ B(StaCurrentContextSlot), U8(89), + /* 1235 E> */ B(StaCurrentContextSlot), U8(88), /* 1249 S> */ B(LdaZero), - /* 1249 E> */ B(StaCurrentContextSlot), U8(90), + /* 1249 E> */ B(StaCurrentContextSlot), U8(89), /* 1263 S> */ B(LdaZero), - /* 1263 E> */ B(StaCurrentContextSlot), U8(91), + /* 1263 E> */ B(StaCurrentContextSlot), U8(90), /* 1277 S> */ B(LdaZero), - /* 1277 E> */ B(StaCurrentContextSlot), U8(92), + /* 1277 E> */ B(StaCurrentContextSlot), U8(91), /* 1291 S> */ B(LdaZero), - /* 1291 E> */ B(StaCurrentContextSlot), U8(93), + /* 1291 E> */ B(StaCurrentContextSlot), U8(92), /* 1305 S> */ B(LdaZero), - /* 1305 E> */ B(StaCurrentContextSlot), U8(94), + /* 1305 E> */ B(StaCurrentContextSlot), U8(93), /* 1319 S> */ B(LdaZero), - /* 1319 E> */ B(StaCurrentContextSlot), U8(95), + /* 1319 E> */ B(StaCurrentContextSlot), U8(94), /* 1333 S> */ B(LdaZero), - /* 1333 E> */ B(StaCurrentContextSlot), U8(96), + /* 1333 E> */ B(StaCurrentContextSlot), U8(95), /* 1347 S> */ B(LdaZero), - /* 1347 E> */ B(StaCurrentContextSlot), U8(97), + /* 1347 E> */ B(StaCurrentContextSlot), U8(96), /* 1361 S> */ B(LdaZero), - /* 1361 E> */ B(StaCurrentContextSlot), U8(98), + /* 1361 E> */ B(StaCurrentContextSlot), U8(97), /* 1375 S> */ B(LdaZero), - /* 1375 E> */ B(StaCurrentContextSlot), U8(99), + /* 1375 E> */ B(StaCurrentContextSlot), U8(98), /* 1389 S> */ B(LdaZero), - /* 1389 E> */ B(StaCurrentContextSlot), U8(100), + /* 1389 E> */ B(StaCurrentContextSlot), U8(99), /* 1403 S> */ B(LdaZero), - /* 1403 E> */ B(StaCurrentContextSlot), U8(101), + /* 1403 E> */ B(StaCurrentContextSlot), U8(100), /* 1417 S> */ B(LdaZero), - /* 1417 E> */ B(StaCurrentContextSlot), U8(102), + /* 1417 E> */ B(StaCurrentContextSlot), U8(101), /* 1431 S> */ B(LdaZero), - /* 1431 E> */ B(StaCurrentContextSlot), U8(103), + /* 1431 E> */ B(StaCurrentContextSlot), U8(102), /* 1445 S> */ B(LdaZero), - /* 1445 E> */ B(StaCurrentContextSlot), U8(104), + /* 1445 E> */ B(StaCurrentContextSlot), U8(103), /* 1459 S> */ B(LdaZero), - /* 1459 E> */ B(StaCurrentContextSlot), U8(105), + /* 1459 E> */ B(StaCurrentContextSlot), U8(104), /* 1473 S> */ B(LdaZero), - /* 1473 E> */ B(StaCurrentContextSlot), U8(106), + /* 1473 E> */ B(StaCurrentContextSlot), U8(105), /* 1487 S> */ B(LdaZero), - /* 1487 E> */ B(StaCurrentContextSlot), U8(107), + /* 1487 E> */ B(StaCurrentContextSlot), U8(106), /* 1501 S> */ B(LdaZero), - /* 1501 E> */ B(StaCurrentContextSlot), U8(108), + /* 1501 E> */ B(StaCurrentContextSlot), U8(107), /* 1516 S> */ B(LdaZero), - /* 1516 E> */ B(StaCurrentContextSlot), U8(109), + /* 1516 E> */ B(StaCurrentContextSlot), U8(108), /* 1531 S> */ B(LdaZero), - /* 1531 E> */ B(StaCurrentContextSlot), U8(110), + /* 1531 E> */ B(StaCurrentContextSlot), U8(109), /* 1546 S> */ B(LdaZero), - /* 1546 E> */ B(StaCurrentContextSlot), U8(111), + /* 1546 E> */ B(StaCurrentContextSlot), U8(110), /* 1561 S> */ B(LdaZero), - /* 1561 E> */ B(StaCurrentContextSlot), U8(112), + /* 1561 E> */ B(StaCurrentContextSlot), U8(111), /* 1576 S> */ B(LdaZero), - /* 1576 E> */ B(StaCurrentContextSlot), U8(113), + /* 1576 E> */ B(StaCurrentContextSlot), U8(112), /* 1591 S> */ B(LdaZero), - /* 1591 E> */ B(StaCurrentContextSlot), U8(114), + /* 1591 E> */ B(StaCurrentContextSlot), U8(113), /* 1606 S> */ B(LdaZero), - /* 1606 E> */ B(StaCurrentContextSlot), U8(115), + /* 1606 E> */ B(StaCurrentContextSlot), U8(114), /* 1621 S> */ B(LdaZero), - /* 1621 E> */ B(StaCurrentContextSlot), U8(116), + /* 1621 E> */ B(StaCurrentContextSlot), U8(115), /* 1636 S> */ B(LdaZero), - /* 1636 E> */ B(StaCurrentContextSlot), U8(117), + /* 1636 E> */ B(StaCurrentContextSlot), U8(116), /* 1651 S> */ B(LdaZero), - /* 1651 E> */ B(StaCurrentContextSlot), U8(118), + /* 1651 E> */ B(StaCurrentContextSlot), U8(117), /* 1666 S> */ B(LdaZero), - /* 1666 E> */ B(StaCurrentContextSlot), U8(119), + /* 1666 E> */ B(StaCurrentContextSlot), U8(118), /* 1681 S> */ B(LdaZero), - /* 1681 E> */ B(StaCurrentContextSlot), U8(120), + /* 1681 E> */ B(StaCurrentContextSlot), U8(119), /* 1696 S> */ B(LdaZero), - /* 1696 E> */ B(StaCurrentContextSlot), U8(121), + /* 1696 E> */ B(StaCurrentContextSlot), U8(120), /* 1711 S> */ B(LdaZero), - /* 1711 E> */ B(StaCurrentContextSlot), U8(122), + /* 1711 E> */ B(StaCurrentContextSlot), U8(121), /* 1726 S> */ B(LdaZero), - /* 1726 E> */ B(StaCurrentContextSlot), U8(123), + /* 1726 E> */ B(StaCurrentContextSlot), U8(122), /* 1741 S> */ B(LdaZero), - /* 1741 E> */ B(StaCurrentContextSlot), U8(124), + /* 1741 E> */ B(StaCurrentContextSlot), U8(123), /* 1756 S> */ B(LdaZero), - /* 1756 E> */ B(StaCurrentContextSlot), U8(125), + /* 1756 E> */ B(StaCurrentContextSlot), U8(124), /* 1771 S> */ B(LdaZero), - /* 1771 E> */ B(StaCurrentContextSlot), U8(126), + /* 1771 E> */ B(StaCurrentContextSlot), U8(125), /* 1786 S> */ B(LdaZero), - /* 1786 E> */ B(StaCurrentContextSlot), U8(127), + /* 1786 E> */ B(StaCurrentContextSlot), U8(126), /* 1801 S> */ B(LdaZero), - /* 1801 E> */ B(StaCurrentContextSlot), U8(128), + /* 1801 E> */ B(StaCurrentContextSlot), U8(127), /* 1816 S> */ B(LdaZero), - /* 1816 E> */ B(StaCurrentContextSlot), U8(129), + /* 1816 E> */ B(StaCurrentContextSlot), U8(128), /* 1831 S> */ B(LdaZero), - /* 1831 E> */ B(StaCurrentContextSlot), U8(130), + /* 1831 E> */ B(StaCurrentContextSlot), U8(129), /* 1846 S> */ B(LdaZero), - /* 1846 E> */ B(StaCurrentContextSlot), U8(131), + /* 1846 E> */ B(StaCurrentContextSlot), U8(130), /* 1861 S> */ B(LdaZero), - /* 1861 E> */ B(StaCurrentContextSlot), U8(132), + /* 1861 E> */ B(StaCurrentContextSlot), U8(131), /* 1876 S> */ B(LdaZero), - /* 1876 E> */ B(StaCurrentContextSlot), U8(133), + /* 1876 E> */ B(StaCurrentContextSlot), U8(132), /* 1891 S> */ B(LdaZero), - /* 1891 E> */ B(StaCurrentContextSlot), U8(134), + /* 1891 E> */ B(StaCurrentContextSlot), U8(133), /* 1906 S> */ B(LdaZero), - /* 1906 E> */ B(StaCurrentContextSlot), U8(135), + /* 1906 E> */ B(StaCurrentContextSlot), U8(134), /* 1921 S> */ B(LdaZero), - /* 1921 E> */ B(StaCurrentContextSlot), U8(136), + /* 1921 E> */ B(StaCurrentContextSlot), U8(135), /* 1936 S> */ B(LdaZero), - /* 1936 E> */ B(StaCurrentContextSlot), U8(137), + /* 1936 E> */ B(StaCurrentContextSlot), U8(136), /* 1951 S> */ B(LdaZero), - /* 1951 E> */ B(StaCurrentContextSlot), U8(138), + /* 1951 E> */ B(StaCurrentContextSlot), U8(137), /* 1966 S> */ B(LdaZero), - /* 1966 E> */ B(StaCurrentContextSlot), U8(139), + /* 1966 E> */ B(StaCurrentContextSlot), U8(138), /* 1981 S> */ B(LdaZero), - /* 1981 E> */ B(StaCurrentContextSlot), U8(140), + /* 1981 E> */ B(StaCurrentContextSlot), U8(139), /* 1996 S> */ B(LdaZero), - /* 1996 E> */ B(StaCurrentContextSlot), U8(141), + /* 1996 E> */ B(StaCurrentContextSlot), U8(140), /* 2011 S> */ B(LdaZero), - /* 2011 E> */ B(StaCurrentContextSlot), U8(142), + /* 2011 E> */ B(StaCurrentContextSlot), U8(141), /* 2026 S> */ B(LdaZero), - /* 2026 E> */ B(StaCurrentContextSlot), U8(143), + /* 2026 E> */ B(StaCurrentContextSlot), U8(142), /* 2041 S> */ B(LdaZero), - /* 2041 E> */ B(StaCurrentContextSlot), U8(144), + /* 2041 E> */ B(StaCurrentContextSlot), U8(143), /* 2056 S> */ B(LdaZero), - /* 2056 E> */ B(StaCurrentContextSlot), U8(145), + /* 2056 E> */ B(StaCurrentContextSlot), U8(144), /* 2071 S> */ B(LdaZero), - /* 2071 E> */ B(StaCurrentContextSlot), U8(146), + /* 2071 E> */ B(StaCurrentContextSlot), U8(145), /* 2086 S> */ B(LdaZero), - /* 2086 E> */ B(StaCurrentContextSlot), U8(147), + /* 2086 E> */ B(StaCurrentContextSlot), U8(146), /* 2101 S> */ B(LdaZero), - /* 2101 E> */ B(StaCurrentContextSlot), U8(148), + /* 2101 E> */ B(StaCurrentContextSlot), U8(147), /* 2116 S> */ B(LdaZero), - /* 2116 E> */ B(StaCurrentContextSlot), U8(149), + /* 2116 E> */ B(StaCurrentContextSlot), U8(148), /* 2131 S> */ B(LdaZero), - /* 2131 E> */ B(StaCurrentContextSlot), U8(150), + /* 2131 E> */ B(StaCurrentContextSlot), U8(149), /* 2146 S> */ B(LdaZero), - /* 2146 E> */ B(StaCurrentContextSlot), U8(151), + /* 2146 E> */ B(StaCurrentContextSlot), U8(150), /* 2161 S> */ B(LdaZero), - /* 2161 E> */ B(StaCurrentContextSlot), U8(152), + /* 2161 E> */ B(StaCurrentContextSlot), U8(151), /* 2176 S> */ B(LdaZero), - /* 2176 E> */ B(StaCurrentContextSlot), U8(153), + /* 2176 E> */ B(StaCurrentContextSlot), U8(152), /* 2191 S> */ B(LdaZero), - /* 2191 E> */ B(StaCurrentContextSlot), U8(154), + /* 2191 E> */ B(StaCurrentContextSlot), U8(153), /* 2206 S> */ B(LdaZero), - /* 2206 E> */ B(StaCurrentContextSlot), U8(155), + /* 2206 E> */ B(StaCurrentContextSlot), U8(154), /* 2221 S> */ B(LdaZero), - /* 2221 E> */ B(StaCurrentContextSlot), U8(156), + /* 2221 E> */ B(StaCurrentContextSlot), U8(155), /* 2236 S> */ B(LdaZero), - /* 2236 E> */ B(StaCurrentContextSlot), U8(157), + /* 2236 E> */ B(StaCurrentContextSlot), U8(156), /* 2251 S> */ B(LdaZero), - /* 2251 E> */ B(StaCurrentContextSlot), U8(158), + /* 2251 E> */ B(StaCurrentContextSlot), U8(157), /* 2266 S> */ B(LdaZero), - /* 2266 E> */ B(StaCurrentContextSlot), U8(159), + /* 2266 E> */ B(StaCurrentContextSlot), U8(158), /* 2281 S> */ B(LdaZero), - /* 2281 E> */ B(StaCurrentContextSlot), U8(160), + /* 2281 E> */ B(StaCurrentContextSlot), U8(159), /* 2296 S> */ B(LdaZero), - /* 2296 E> */ B(StaCurrentContextSlot), U8(161), + /* 2296 E> */ B(StaCurrentContextSlot), U8(160), /* 2311 S> */ B(LdaZero), - /* 2311 E> */ B(StaCurrentContextSlot), U8(162), + /* 2311 E> */ B(StaCurrentContextSlot), U8(161), /* 2326 S> */ B(LdaZero), - /* 2326 E> */ B(StaCurrentContextSlot), U8(163), + /* 2326 E> */ B(StaCurrentContextSlot), U8(162), /* 2341 S> */ B(LdaZero), - /* 2341 E> */ B(StaCurrentContextSlot), U8(164), + /* 2341 E> */ B(StaCurrentContextSlot), U8(163), /* 2356 S> */ B(LdaZero), - /* 2356 E> */ B(StaCurrentContextSlot), U8(165), + /* 2356 E> */ B(StaCurrentContextSlot), U8(164), /* 2371 S> */ B(LdaZero), - /* 2371 E> */ B(StaCurrentContextSlot), U8(166), + /* 2371 E> */ B(StaCurrentContextSlot), U8(165), /* 2386 S> */ B(LdaZero), - /* 2386 E> */ B(StaCurrentContextSlot), U8(167), + /* 2386 E> */ B(StaCurrentContextSlot), U8(166), /* 2401 S> */ B(LdaZero), - /* 2401 E> */ B(StaCurrentContextSlot), U8(168), + /* 2401 E> */ B(StaCurrentContextSlot), U8(167), /* 2416 S> */ B(LdaZero), - /* 2416 E> */ B(StaCurrentContextSlot), U8(169), + /* 2416 E> */ B(StaCurrentContextSlot), U8(168), /* 2431 S> */ B(LdaZero), - /* 2431 E> */ B(StaCurrentContextSlot), U8(170), + /* 2431 E> */ B(StaCurrentContextSlot), U8(169), /* 2446 S> */ B(LdaZero), - /* 2446 E> */ B(StaCurrentContextSlot), U8(171), + /* 2446 E> */ B(StaCurrentContextSlot), U8(170), /* 2461 S> */ B(LdaZero), - /* 2461 E> */ B(StaCurrentContextSlot), U8(172), + /* 2461 E> */ B(StaCurrentContextSlot), U8(171), /* 2476 S> */ B(LdaZero), - /* 2476 E> */ B(StaCurrentContextSlot), U8(173), + /* 2476 E> */ B(StaCurrentContextSlot), U8(172), /* 2491 S> */ B(LdaZero), - /* 2491 E> */ B(StaCurrentContextSlot), U8(174), + /* 2491 E> */ B(StaCurrentContextSlot), U8(173), /* 2506 S> */ B(LdaZero), - /* 2506 E> */ B(StaCurrentContextSlot), U8(175), + /* 2506 E> */ B(StaCurrentContextSlot), U8(174), /* 2521 S> */ B(LdaZero), - /* 2521 E> */ B(StaCurrentContextSlot), U8(176), + /* 2521 E> */ B(StaCurrentContextSlot), U8(175), /* 2536 S> */ B(LdaZero), - /* 2536 E> */ B(StaCurrentContextSlot), U8(177), + /* 2536 E> */ B(StaCurrentContextSlot), U8(176), /* 2551 S> */ B(LdaZero), - /* 2551 E> */ B(StaCurrentContextSlot), U8(178), + /* 2551 E> */ B(StaCurrentContextSlot), U8(177), /* 2566 S> */ B(LdaZero), - /* 2566 E> */ B(StaCurrentContextSlot), U8(179), + /* 2566 E> */ B(StaCurrentContextSlot), U8(178), /* 2581 S> */ B(LdaZero), - /* 2581 E> */ B(StaCurrentContextSlot), U8(180), + /* 2581 E> */ B(StaCurrentContextSlot), U8(179), /* 2596 S> */ B(LdaZero), - /* 2596 E> */ B(StaCurrentContextSlot), U8(181), + /* 2596 E> */ B(StaCurrentContextSlot), U8(180), /* 2611 S> */ B(LdaZero), - /* 2611 E> */ B(StaCurrentContextSlot), U8(182), + /* 2611 E> */ B(StaCurrentContextSlot), U8(181), /* 2626 S> */ B(LdaZero), - /* 2626 E> */ B(StaCurrentContextSlot), U8(183), + /* 2626 E> */ B(StaCurrentContextSlot), U8(182), /* 2641 S> */ B(LdaZero), - /* 2641 E> */ B(StaCurrentContextSlot), U8(184), + /* 2641 E> */ B(StaCurrentContextSlot), U8(183), /* 2656 S> */ B(LdaZero), - /* 2656 E> */ B(StaCurrentContextSlot), U8(185), + /* 2656 E> */ B(StaCurrentContextSlot), U8(184), /* 2671 S> */ B(LdaZero), - /* 2671 E> */ B(StaCurrentContextSlot), U8(186), + /* 2671 E> */ B(StaCurrentContextSlot), U8(185), /* 2686 S> */ B(LdaZero), - /* 2686 E> */ B(StaCurrentContextSlot), U8(187), + /* 2686 E> */ B(StaCurrentContextSlot), U8(186), /* 2701 S> */ B(LdaZero), - /* 2701 E> */ B(StaCurrentContextSlot), U8(188), + /* 2701 E> */ B(StaCurrentContextSlot), U8(187), /* 2716 S> */ B(LdaZero), - /* 2716 E> */ B(StaCurrentContextSlot), U8(189), + /* 2716 E> */ B(StaCurrentContextSlot), U8(188), /* 2731 S> */ B(LdaZero), - /* 2731 E> */ B(StaCurrentContextSlot), U8(190), + /* 2731 E> */ B(StaCurrentContextSlot), U8(189), /* 2746 S> */ B(LdaZero), - /* 2746 E> */ B(StaCurrentContextSlot), U8(191), + /* 2746 E> */ B(StaCurrentContextSlot), U8(190), /* 2761 S> */ B(LdaZero), - /* 2761 E> */ B(StaCurrentContextSlot), U8(192), + /* 2761 E> */ B(StaCurrentContextSlot), U8(191), /* 2776 S> */ B(LdaZero), - /* 2776 E> */ B(StaCurrentContextSlot), U8(193), + /* 2776 E> */ B(StaCurrentContextSlot), U8(192), /* 2791 S> */ B(LdaZero), - /* 2791 E> */ B(StaCurrentContextSlot), U8(194), + /* 2791 E> */ B(StaCurrentContextSlot), U8(193), /* 2806 S> */ B(LdaZero), - /* 2806 E> */ B(StaCurrentContextSlot), U8(195), + /* 2806 E> */ B(StaCurrentContextSlot), U8(194), /* 2821 S> */ B(LdaZero), - /* 2821 E> */ B(StaCurrentContextSlot), U8(196), + /* 2821 E> */ B(StaCurrentContextSlot), U8(195), /* 2836 S> */ B(LdaZero), - /* 2836 E> */ B(StaCurrentContextSlot), U8(197), + /* 2836 E> */ B(StaCurrentContextSlot), U8(196), /* 2851 S> */ B(LdaZero), - /* 2851 E> */ B(StaCurrentContextSlot), U8(198), + /* 2851 E> */ B(StaCurrentContextSlot), U8(197), /* 2866 S> */ B(LdaZero), - /* 2866 E> */ B(StaCurrentContextSlot), U8(199), + /* 2866 E> */ B(StaCurrentContextSlot), U8(198), /* 2881 S> */ B(LdaZero), - /* 2881 E> */ B(StaCurrentContextSlot), U8(200), + /* 2881 E> */ B(StaCurrentContextSlot), U8(199), /* 2896 S> */ B(LdaZero), - /* 2896 E> */ B(StaCurrentContextSlot), U8(201), + /* 2896 E> */ B(StaCurrentContextSlot), U8(200), /* 2911 S> */ B(LdaZero), - /* 2911 E> */ B(StaCurrentContextSlot), U8(202), + /* 2911 E> */ B(StaCurrentContextSlot), U8(201), /* 2926 S> */ B(LdaZero), - /* 2926 E> */ B(StaCurrentContextSlot), U8(203), + /* 2926 E> */ B(StaCurrentContextSlot), U8(202), /* 2941 S> */ B(LdaZero), - /* 2941 E> */ B(StaCurrentContextSlot), U8(204), + /* 2941 E> */ B(StaCurrentContextSlot), U8(203), /* 2956 S> */ B(LdaZero), - /* 2956 E> */ B(StaCurrentContextSlot), U8(205), + /* 2956 E> */ B(StaCurrentContextSlot), U8(204), /* 2971 S> */ B(LdaZero), - /* 2971 E> */ B(StaCurrentContextSlot), U8(206), + /* 2971 E> */ B(StaCurrentContextSlot), U8(205), /* 2986 S> */ B(LdaZero), - /* 2986 E> */ B(StaCurrentContextSlot), U8(207), + /* 2986 E> */ B(StaCurrentContextSlot), U8(206), /* 3001 S> */ B(LdaZero), - /* 3001 E> */ B(StaCurrentContextSlot), U8(208), + /* 3001 E> */ B(StaCurrentContextSlot), U8(207), /* 3016 S> */ B(LdaZero), - /* 3016 E> */ B(StaCurrentContextSlot), U8(209), + /* 3016 E> */ B(StaCurrentContextSlot), U8(208), /* 3031 S> */ B(LdaZero), - /* 3031 E> */ B(StaCurrentContextSlot), U8(210), + /* 3031 E> */ B(StaCurrentContextSlot), U8(209), /* 3046 S> */ B(LdaZero), - /* 3046 E> */ B(StaCurrentContextSlot), U8(211), + /* 3046 E> */ B(StaCurrentContextSlot), U8(210), /* 3061 S> */ B(LdaZero), - /* 3061 E> */ B(StaCurrentContextSlot), U8(212), + /* 3061 E> */ B(StaCurrentContextSlot), U8(211), /* 3076 S> */ B(LdaZero), - /* 3076 E> */ B(StaCurrentContextSlot), U8(213), + /* 3076 E> */ B(StaCurrentContextSlot), U8(212), /* 3091 S> */ B(LdaZero), - /* 3091 E> */ B(StaCurrentContextSlot), U8(214), + /* 3091 E> */ B(StaCurrentContextSlot), U8(213), /* 3106 S> */ B(LdaZero), - /* 3106 E> */ B(StaCurrentContextSlot), U8(215), + /* 3106 E> */ B(StaCurrentContextSlot), U8(214), /* 3121 S> */ B(LdaZero), - /* 3121 E> */ B(StaCurrentContextSlot), U8(216), + /* 3121 E> */ B(StaCurrentContextSlot), U8(215), /* 3136 S> */ B(LdaZero), - /* 3136 E> */ B(StaCurrentContextSlot), U8(217), + /* 3136 E> */ B(StaCurrentContextSlot), U8(216), /* 3151 S> */ B(LdaZero), - /* 3151 E> */ B(StaCurrentContextSlot), U8(218), + /* 3151 E> */ B(StaCurrentContextSlot), U8(217), /* 3166 S> */ B(LdaZero), - /* 3166 E> */ B(StaCurrentContextSlot), U8(219), + /* 3166 E> */ B(StaCurrentContextSlot), U8(218), /* 3181 S> */ B(LdaZero), - /* 3181 E> */ B(StaCurrentContextSlot), U8(220), + /* 3181 E> */ B(StaCurrentContextSlot), U8(219), /* 3196 S> */ B(LdaZero), - /* 3196 E> */ B(StaCurrentContextSlot), U8(221), + /* 3196 E> */ B(StaCurrentContextSlot), U8(220), /* 3211 S> */ B(LdaZero), - /* 3211 E> */ B(StaCurrentContextSlot), U8(222), + /* 3211 E> */ B(StaCurrentContextSlot), U8(221), /* 3226 S> */ B(LdaZero), - /* 3226 E> */ B(StaCurrentContextSlot), U8(223), + /* 3226 E> */ B(StaCurrentContextSlot), U8(222), /* 3241 S> */ B(LdaZero), - /* 3241 E> */ B(StaCurrentContextSlot), U8(224), + /* 3241 E> */ B(StaCurrentContextSlot), U8(223), /* 3256 S> */ B(LdaZero), - /* 3256 E> */ B(StaCurrentContextSlot), U8(225), + /* 3256 E> */ B(StaCurrentContextSlot), U8(224), /* 3271 S> */ B(LdaZero), - /* 3271 E> */ B(StaCurrentContextSlot), U8(226), + /* 3271 E> */ B(StaCurrentContextSlot), U8(225), /* 3286 S> */ B(LdaZero), - /* 3286 E> */ B(StaCurrentContextSlot), U8(227), + /* 3286 E> */ B(StaCurrentContextSlot), U8(226), /* 3301 S> */ B(LdaZero), - /* 3301 E> */ B(StaCurrentContextSlot), U8(228), + /* 3301 E> */ B(StaCurrentContextSlot), U8(227), /* 3316 S> */ B(LdaZero), - /* 3316 E> */ B(StaCurrentContextSlot), U8(229), + /* 3316 E> */ B(StaCurrentContextSlot), U8(228), /* 3331 S> */ B(LdaZero), - /* 3331 E> */ B(StaCurrentContextSlot), U8(230), + /* 3331 E> */ B(StaCurrentContextSlot), U8(229), /* 3346 S> */ B(LdaZero), - /* 3346 E> */ B(StaCurrentContextSlot), U8(231), + /* 3346 E> */ B(StaCurrentContextSlot), U8(230), /* 3361 S> */ B(LdaZero), - /* 3361 E> */ B(StaCurrentContextSlot), U8(232), + /* 3361 E> */ B(StaCurrentContextSlot), U8(231), /* 3376 S> */ B(LdaZero), - /* 3376 E> */ B(StaCurrentContextSlot), U8(233), + /* 3376 E> */ B(StaCurrentContextSlot), U8(232), /* 3391 S> */ B(LdaZero), - /* 3391 E> */ B(StaCurrentContextSlot), U8(234), + /* 3391 E> */ B(StaCurrentContextSlot), U8(233), /* 3406 S> */ B(LdaZero), - /* 3406 E> */ B(StaCurrentContextSlot), U8(235), + /* 3406 E> */ B(StaCurrentContextSlot), U8(234), /* 3421 S> */ B(LdaZero), - /* 3421 E> */ B(StaCurrentContextSlot), U8(236), + /* 3421 E> */ B(StaCurrentContextSlot), U8(235), /* 3436 S> */ B(LdaZero), - /* 3436 E> */ B(StaCurrentContextSlot), U8(237), + /* 3436 E> */ B(StaCurrentContextSlot), U8(236), /* 3451 S> */ B(LdaZero), - /* 3451 E> */ B(StaCurrentContextSlot), U8(238), + /* 3451 E> */ B(StaCurrentContextSlot), U8(237), /* 3466 S> */ B(LdaZero), - /* 3466 E> */ B(StaCurrentContextSlot), U8(239), + /* 3466 E> */ B(StaCurrentContextSlot), U8(238), /* 3481 S> */ B(LdaZero), - /* 3481 E> */ B(StaCurrentContextSlot), U8(240), + /* 3481 E> */ B(StaCurrentContextSlot), U8(239), /* 3496 S> */ B(LdaZero), - /* 3496 E> */ B(StaCurrentContextSlot), U8(241), + /* 3496 E> */ B(StaCurrentContextSlot), U8(240), /* 3511 S> */ B(LdaZero), - /* 3511 E> */ B(StaCurrentContextSlot), U8(242), + /* 3511 E> */ B(StaCurrentContextSlot), U8(241), /* 3526 S> */ B(LdaZero), - /* 3526 E> */ B(StaCurrentContextSlot), U8(243), + /* 3526 E> */ B(StaCurrentContextSlot), U8(242), /* 3541 S> */ B(LdaZero), - /* 3541 E> */ B(StaCurrentContextSlot), U8(244), + /* 3541 E> */ B(StaCurrentContextSlot), U8(243), /* 3556 S> */ B(LdaZero), - /* 3556 E> */ B(StaCurrentContextSlot), U8(245), + /* 3556 E> */ B(StaCurrentContextSlot), U8(244), /* 3571 S> */ B(LdaZero), - /* 3571 E> */ B(StaCurrentContextSlot), U8(246), + /* 3571 E> */ B(StaCurrentContextSlot), U8(245), /* 3586 S> */ B(LdaZero), - /* 3586 E> */ B(StaCurrentContextSlot), U8(247), + /* 3586 E> */ B(StaCurrentContextSlot), U8(246), /* 3601 S> */ B(LdaZero), - /* 3601 E> */ B(StaCurrentContextSlot), U8(248), + /* 3601 E> */ B(StaCurrentContextSlot), U8(247), /* 3616 S> */ B(LdaZero), - /* 3616 E> */ B(StaCurrentContextSlot), U8(249), + /* 3616 E> */ B(StaCurrentContextSlot), U8(248), /* 3631 S> */ B(LdaZero), - /* 3631 E> */ B(StaCurrentContextSlot), U8(250), + /* 3631 E> */ B(StaCurrentContextSlot), U8(249), /* 3646 S> */ B(LdaZero), - /* 3646 E> */ B(StaCurrentContextSlot), U8(251), + /* 3646 E> */ B(StaCurrentContextSlot), U8(250), /* 3661 S> */ B(LdaZero), - /* 3661 E> */ B(StaCurrentContextSlot), U8(252), + /* 3661 E> */ B(StaCurrentContextSlot), U8(251), /* 3676 S> */ B(LdaZero), - /* 3676 E> */ B(StaCurrentContextSlot), U8(253), + /* 3676 E> */ B(StaCurrentContextSlot), U8(252), /* 3691 S> */ B(LdaZero), - /* 3691 E> */ B(StaCurrentContextSlot), U8(254), + /* 3691 E> */ B(StaCurrentContextSlot), U8(253), /* 3706 S> */ B(LdaZero), - /* 3706 E> */ B(StaCurrentContextSlot), U8(255), - /* 3709 S> */ B(LdaGlobal), U8(1), U8(0), + /* 3706 E> */ B(StaCurrentContextSlot), U8(254), + /* 3721 S> */ B(LdaZero), + /* 3721 E> */ B(StaCurrentContextSlot), U8(255), + /* 3724 S> */ B(LdaGlobal), U8(1), U8(0), B(Star), R(2), - /* 3709 E> */ B(CallUndefinedReceiver0), R(2), U8(2), - /* 3725 S> */ B(LdaSmi), I8(100), - /* 3725 E> */ B(Wide), B(StaCurrentContextSlot), U16(256), - /* 3730 S> */ B(Wide), B(LdaCurrentContextSlot), U16(256), - /* 3738 S> */ B(Return), + /* 3724 E> */ B(CallUndefinedReceiver0), R(2), U8(2), + /* 3740 S> */ B(LdaSmi), I8(100), + /* 3740 E> */ B(Wide), B(StaCurrentContextSlot), U16(256), + /* 3745 S> */ B(Wide), B(LdaCurrentContextSlot), U16(256), + /* 3753 S> */ B(Return), ] constant pool: [ SCOPE_INFO_TYPE, diff --git a/test/cctest/interpreter/bytecode_expectations/CountOperators.golden b/test/cctest/interpreter/bytecode_expectations/CountOperators.golden index 6acb493766..05e892b639 100644 --- a/test/cctest/interpreter/bytecode_expectations/CountOperators.golden +++ b/test/cctest/interpreter/bytecode_expectations/CountOperators.golden @@ -213,12 +213,12 @@ bytecodes: [ B(PushContext), R(1), /* 30 E> */ B(StackCheck), /* 42 S> */ B(LdaSmi), I8(1), - /* 42 E> */ B(StaCurrentContextSlot), U8(3), + /* 42 E> */ B(StaCurrentContextSlot), U8(2), /* 53 S> */ B(CreateClosure), U8(1), U8(0), U8(2), B(Star), R(0), - /* 78 S> */ B(LdaCurrentContextSlot), U8(3), + /* 78 S> */ B(LdaCurrentContextSlot), U8(2), B(Inc), U8(0), - /* 87 E> */ B(StaCurrentContextSlot), U8(3), + /* 87 E> */ B(StaCurrentContextSlot), U8(2), /* 89 S> */ B(Return), ] constant pool: [ @@ -240,14 +240,14 @@ bytecodes: [ B(PushContext), R(1), /* 30 E> */ B(StackCheck), /* 42 S> */ B(LdaSmi), I8(1), - /* 42 E> */ B(StaCurrentContextSlot), U8(3), + /* 42 E> */ B(StaCurrentContextSlot), U8(2), /* 53 S> */ B(CreateClosure), U8(1), U8(0), U8(2), B(Star), R(0), - /* 78 S> */ B(LdaCurrentContextSlot), U8(3), + /* 78 S> */ B(LdaCurrentContextSlot), U8(2), B(ToNumeric), U8(0), B(Star), R(2), B(Dec), U8(0), - /* 86 E> */ B(StaCurrentContextSlot), U8(3), + /* 86 E> */ B(StaCurrentContextSlot), U8(2), B(Ldar), R(2), /* 89 S> */ B(Return), ] diff --git a/test/cctest/interpreter/bytecode_expectations/CreateArguments.golden b/test/cctest/interpreter/bytecode_expectations/CreateArguments.golden index 3c24990241..e55a33179c 100644 --- a/test/cctest/interpreter/bytecode_expectations/CreateArguments.golden +++ b/test/cctest/interpreter/bytecode_expectations/CreateArguments.golden @@ -77,7 +77,7 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(1), B(PushContext), R(1), B(Ldar), R(arg0), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(CreateMappedArguments), B(Star), R(0), /* 10 E> */ B(StackCheck), @@ -103,11 +103,11 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(3), B(PushContext), R(1), B(Ldar), R(arg0), - B(StaCurrentContextSlot), U8(5), - B(Ldar), R(arg1), B(StaCurrentContextSlot), U8(4), - B(Ldar), R(arg2), + B(Ldar), R(arg1), B(StaCurrentContextSlot), U8(3), + B(Ldar), R(arg2), + B(StaCurrentContextSlot), U8(2), B(CreateMappedArguments), B(Star), R(0), /* 10 E> */ B(StackCheck), diff --git a/test/cctest/interpreter/bytecode_expectations/Delete.golden b/test/cctest/interpreter/bytecode_expectations/Delete.golden index b240dd242f..a095e30b90 100644 --- a/test/cctest/interpreter/bytecode_expectations/Delete.golden +++ b/test/cctest/interpreter/bytecode_expectations/Delete.golden @@ -104,9 +104,9 @@ bytecodes: [ B(PushContext), R(0), /* 30 E> */ B(StackCheck), /* 56 S> */ B(CreateObjectLiteral), U8(1), U8(0), U8(41), - /* 56 E> */ B(StaCurrentContextSlot), U8(3), + /* 56 E> */ B(StaCurrentContextSlot), U8(2), /* 64 S> */ B(CreateClosure), U8(2), U8(0), U8(2), - /* 93 S> */ B(LdaImmutableCurrentContextSlot), U8(3), + /* 93 S> */ B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(1), B(LdaSmi), I8(1), B(DeletePropertyStrict), R(1), diff --git a/test/cctest/interpreter/bytecode_expectations/Eval.golden b/test/cctest/interpreter/bytecode_expectations/Eval.golden index 22b17ec769..dd299c733b 100644 --- a/test/cctest/interpreter/bytecode_expectations/Eval.golden +++ b/test/cctest/interpreter/bytecode_expectations/Eval.golden @@ -13,7 +13,7 @@ frame size: 10 parameter count: 1 bytecode array length: 59 bytecodes: [ - B(CreateFunctionContext), U8(0), U8(3), + B(CreateFunctionContext), U8(0), U8(4), B(PushContext), R(1), B(Ldar), R(this), B(StaCurrentContextSlot), U8(3), diff --git a/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden b/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden index 1cb228ca20..41ae688d7b 100644 --- a/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden +++ b/test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden @@ -145,7 +145,7 @@ bytecodes: [ B(SetPendingMessage), B(Ldar), R(4), B(PushContext), R(5), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(7), B(LdaTrue), B(Star), R(8), @@ -318,7 +318,7 @@ bytecodes: [ B(SetPendingMessage), B(Ldar), R(4), B(PushContext), R(5), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(7), B(LdaTrue), B(Star), R(8), @@ -495,7 +495,7 @@ bytecodes: [ B(SetPendingMessage), B(Ldar), R(4), B(PushContext), R(5), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(7), B(LdaTrue), B(Star), R(8), @@ -634,7 +634,7 @@ bytecodes: [ B(SetPendingMessage), B(Ldar), R(2), B(PushContext), R(3), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(5), B(LdaFalse), B(Star), R(6), diff --git a/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden b/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden index 50c4566a98..83bc2377dd 100644 --- a/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden +++ b/test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden @@ -111,7 +111,7 @@ frame size: 20 parameter count: 2 bytecode array length: 239 bytecodes: [ - B(CreateFunctionContext), U8(0), U8(4), + B(CreateFunctionContext), U8(0), U8(5), B(PushContext), R(2), B(Ldar), R(this), B(StaCurrentContextSlot), U8(4), @@ -125,7 +125,7 @@ bytecodes: [ B(CreateBlockContext), U8(1), B(PushContext), R(3), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 34 S> */ B(LdaContextSlot), R(3), U8(3), U8(0), B(Star), R(6), B(GetIterator), R(6), U8(0), U8(2), @@ -152,9 +152,9 @@ bytecodes: [ B(CreateBlockContext), U8(5), B(PushContext), R(11), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 29 S> */ B(Ldar), R(0), - /* 29 E> */ B(StaCurrentContextSlot), U8(3), + /* 29 E> */ B(StaCurrentContextSlot), U8(2), /* 41 S> */ B(LdaLookupGlobalSlot), U8(6), U8(12), U8(3), B(Star), R(12), B(LdaConstant), U8(7), @@ -273,9 +273,9 @@ bytecodes: [ B(CreateBlockContext), U8(3), B(PushContext), R(9), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 29 S> */ B(Ldar), R(0), - /* 29 E> */ B(StaCurrentContextSlot), U8(3), + /* 29 E> */ B(StaCurrentContextSlot), U8(2), /* 41 S> */ B(CreateClosure), U8(4), U8(0), U8(2), B(Star), R(10), /* 67 E> */ B(CallUndefinedReceiver0), R(10), U8(12), @@ -782,7 +782,7 @@ bytecodes: [ B(SetPendingMessage), B(Ldar), R(5), B(PushContext), R(6), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(8), B(LdaFalse), B(Star), R(9), @@ -915,7 +915,7 @@ bytecodes: [ B(SetPendingMessage), B(Ldar), R(4), B(PushContext), R(5), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(7), B(LdaTrue), B(Star), R(8), diff --git a/test/cctest/interpreter/bytecode_expectations/IIFEWithOneshotOpt.golden b/test/cctest/interpreter/bytecode_expectations/IIFEWithOneshotOpt.golden index 516ca89563..57cf87abbd 100644 --- a/test/cctest/interpreter/bytecode_expectations/IIFEWithOneshotOpt.golden +++ b/test/cctest/interpreter/bytecode_expectations/IIFEWithOneshotOpt.golden @@ -756,11 +756,11 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(1), B(PushContext), R(1), B(Ldar), R(arg0), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(CreateMappedArguments), B(Star), R(0), /* 46 E> */ B(StackCheck), - /* 53 S> */ B(LdaCurrentContextSlot), U8(3), + /* 53 S> */ B(LdaCurrentContextSlot), U8(2), B(Star), R(2), B(LdaSmi), I8(3), /* 57 E> */ B(StaNamedPropertyNoFeedback), R(2), U8(1), U8(0), @@ -789,11 +789,11 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(1), B(PushContext), R(1), B(Ldar), R(arg0), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(CreateMappedArguments), B(Star), R(0), /* 30 E> */ B(StackCheck), - /* 37 S> */ B(LdaCurrentContextSlot), U8(3), + /* 37 S> */ B(LdaCurrentContextSlot), U8(2), B(Star), R(2), B(LdaSmi), I8(3), /* 41 E> */ B(StaNamedPropertyNoFeedback), R(2), U8(1), U8(0), diff --git a/test/cctest/interpreter/bytecode_expectations/LetVariableContextSlot.golden b/test/cctest/interpreter/bytecode_expectations/LetVariableContextSlot.golden index 03b7f335c9..d662191b1e 100644 --- a/test/cctest/interpreter/bytecode_expectations/LetVariableContextSlot.golden +++ b/test/cctest/interpreter/bytecode_expectations/LetVariableContextSlot.golden @@ -16,10 +16,10 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(1), B(PushContext), R(0), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 30 E> */ B(StackCheck), /* 42 S> */ B(LdaSmi), I8(10), - /* 42 E> */ B(StaCurrentContextSlot), U8(3), + /* 42 E> */ B(StaCurrentContextSlot), U8(2), B(LdaUndefined), /* 72 S> */ B(Return), ] @@ -40,11 +40,11 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(1), B(PushContext), R(0), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 30 E> */ B(StackCheck), /* 42 S> */ B(LdaSmi), I8(10), - /* 42 E> */ B(StaCurrentContextSlot), U8(3), - /* 72 S> */ B(LdaImmutableCurrentContextSlot), U8(3), + /* 42 E> */ B(StaCurrentContextSlot), U8(2), + /* 72 S> */ B(LdaImmutableCurrentContextSlot), U8(2), /* 81 S> */ B(Return), ] constant pool: [ @@ -64,15 +64,15 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(1), B(PushContext), R(0), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 30 E> */ B(StackCheck), /* 42 S> */ B(LdaSmi), I8(20), B(Star), R(1), - B(LdaCurrentContextSlot), U8(3), + B(LdaCurrentContextSlot), U8(2), /* 45 E> */ B(ThrowReferenceErrorIfHole), U8(1), B(Ldar), R(1), - B(StaCurrentContextSlot), U8(3), - /* 42 E> */ B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), + /* 42 E> */ B(StaCurrentContextSlot), U8(2), B(LdaUndefined), /* 78 S> */ B(Return), ] @@ -94,12 +94,12 @@ bytecodes: [ B(CreateFunctionContext), U8(0), U8(1), B(PushContext), R(0), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 30 E> */ B(StackCheck), /* 42 S> */ B(LdaSmi), I8(10), - /* 42 E> */ B(StaCurrentContextSlot), U8(3), + /* 42 E> */ B(StaCurrentContextSlot), U8(2), /* 46 S> */ B(LdaSmi), I8(20), - /* 48 E> */ B(StaCurrentContextSlot), U8(3), + /* 48 E> */ B(StaCurrentContextSlot), U8(2), B(LdaUndefined), /* 80 S> */ B(Return), ] diff --git a/test/cctest/interpreter/bytecode_expectations/LookupSlot.golden b/test/cctest/interpreter/bytecode_expectations/LookupSlot.golden index 051b819142..d3bfda4285 100644 --- a/test/cctest/interpreter/bytecode_expectations/LookupSlot.golden +++ b/test/cctest/interpreter/bytecode_expectations/LookupSlot.golden @@ -14,7 +14,7 @@ frame size: 10 parameter count: 1 bytecode array length: 63 bytecodes: [ - B(CreateFunctionContext), U8(0), U8(3), + B(CreateFunctionContext), U8(0), U8(4), B(PushContext), R(1), B(Ldar), R(this), B(StaCurrentContextSlot), U8(3), @@ -59,7 +59,7 @@ frame size: 10 parameter count: 1 bytecode array length: 64 bytecodes: [ - B(CreateFunctionContext), U8(0), U8(3), + B(CreateFunctionContext), U8(0), U8(4), B(PushContext), R(1), B(Ldar), R(this), B(StaCurrentContextSlot), U8(3), @@ -105,7 +105,7 @@ frame size: 10 parameter count: 1 bytecode array length: 64 bytecodes: [ - B(CreateFunctionContext), U8(0), U8(3), + B(CreateFunctionContext), U8(0), U8(4), B(PushContext), R(1), B(Ldar), R(this), B(StaCurrentContextSlot), U8(3), @@ -156,7 +156,7 @@ frame size: 10 parameter count: 1 bytecode array length: 63 bytecodes: [ - B(CreateFunctionContext), U8(0), U8(3), + B(CreateFunctionContext), U8(0), U8(4), B(PushContext), R(1), B(Ldar), R(this), B(StaCurrentContextSlot), U8(3), @@ -181,7 +181,7 @@ bytecodes: [ B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(4), U8(6), B(Star), R(2), /* 44 E> */ B(CallUndefinedReceiver1), R(2), R(3), U8(2), - /* 66 S> */ B(LdaLookupContextSlot), U8(3), U8(5), U8(1), + /* 66 S> */ B(LdaLookupContextSlot), U8(3), U8(4), U8(1), /* 75 S> */ B(Return), ] constant pool: [ @@ -206,7 +206,7 @@ frame size: 10 parameter count: 1 bytecode array length: 63 bytecodes: [ - B(CreateFunctionContext), U8(0), U8(3), + B(CreateFunctionContext), U8(0), U8(4), B(PushContext), R(1), B(Ldar), R(this), B(StaCurrentContextSlot), U8(3), diff --git a/test/cctest/interpreter/bytecode_expectations/OuterContextVariables.golden b/test/cctest/interpreter/bytecode_expectations/OuterContextVariables.golden index 626b3419fe..146715e03a 100644 --- a/test/cctest/interpreter/bytecode_expectations/OuterContextVariables.golden +++ b/test/cctest/interpreter/bytecode_expectations/OuterContextVariables.golden @@ -23,9 +23,9 @@ parameter count: 1 bytecode array length: 13 bytecodes: [ /* 97 E> */ B(StackCheck), - /* 102 S> */ B(LdaImmutableContextSlot), R(context), U8(3), U8(1), + /* 102 S> */ B(LdaImmutableContextSlot), R(context), U8(2), U8(1), B(Star), R(0), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), /* 118 E> */ B(Mul), R(0), U8(0), /* 129 S> */ B(Return), ] @@ -51,8 +51,8 @@ parameter count: 1 bytecode array length: 9 bytecodes: [ /* 97 E> */ B(StackCheck), - /* 102 S> */ B(LdaImmutableCurrentContextSlot), U8(3), - /* 111 E> */ B(StaContextSlot), R(context), U8(3), U8(1), + /* 102 S> */ B(LdaImmutableCurrentContextSlot), U8(2), + /* 111 E> */ B(StaContextSlot), R(context), U8(2), U8(1), B(LdaUndefined), /* 123 S> */ B(Return), ] diff --git a/test/cctest/interpreter/bytecode_expectations/PrivateAccessorAccess.golden b/test/cctest/interpreter/bytecode_expectations/PrivateAccessorAccess.golden index c4fde8caa8..3d3b72cfdc 100644 --- a/test/cctest/interpreter/bytecode_expectations/PrivateAccessorAccess.golden +++ b/test/cctest/interpreter/bytecode_expectations/PrivateAccessorAccess.golden @@ -27,13 +27,13 @@ parameter count: 1 bytecode array length: 95 bytecodes: [ /* 67 E> */ B(StackCheck), - B(LdaCurrentContextSlot), U8(4), + B(LdaCurrentContextSlot), U8(3), B(Star), R(1), B(Mov), R(this), R(0), B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(0), U8(2), - /* 76 S> */ B(LdaCurrentContextSlot), U8(3), + /* 76 S> */ B(LdaCurrentContextSlot), U8(2), B(Star), R(3), - B(LdaCurrentContextSlot), U8(4), + B(LdaCurrentContextSlot), U8(3), /* 81 E> */ B(LdaKeyedProperty), R(this), U8(0), B(CallRuntime), U16(Runtime::kLoadPrivateGetter), R(3), U8(1), B(Star), R(4), @@ -45,16 +45,16 @@ bytecodes: [ B(CallProperty1), R(5), R(this), R(4), U8(5), /* 91 S> */ B(LdaSmi), I8(1), B(Star), R(2), - B(LdaCurrentContextSlot), U8(3), + B(LdaCurrentContextSlot), U8(2), B(Star), R(4), - B(LdaCurrentContextSlot), U8(4), + B(LdaCurrentContextSlot), U8(3), /* 96 E> */ B(LdaKeyedProperty), R(this), U8(7), B(CallRuntime), U16(Runtime::kLoadPrivateSetter), R(4), U8(1), B(Star), R(5), B(CallProperty1), R(5), R(this), R(2), U8(9), - /* 108 S> */ B(LdaCurrentContextSlot), U8(3), + /* 108 S> */ B(LdaCurrentContextSlot), U8(2), B(Star), R(3), - B(LdaCurrentContextSlot), U8(4), + B(LdaCurrentContextSlot), U8(3), /* 120 E> */ B(LdaKeyedProperty), R(this), U8(11), B(CallRuntime), U16(Runtime::kLoadPrivateGetter), R(3), U8(1), B(Star), R(4), @@ -80,7 +80,7 @@ parameter count: 1 bytecode array length: 29 bytecodes: [ /* 48 E> */ B(StackCheck), - B(LdaCurrentContextSlot), U8(4), + B(LdaCurrentContextSlot), U8(3), B(Star), R(1), B(Mov), R(this), R(0), B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(0), U8(2), @@ -111,7 +111,7 @@ parameter count: 1 bytecode array length: 29 bytecodes: [ /* 41 E> */ B(StackCheck), - B(LdaCurrentContextSlot), U8(4), + B(LdaCurrentContextSlot), U8(3), B(Star), R(1), B(Mov), R(this), R(0), B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(0), U8(2), @@ -142,7 +142,7 @@ parameter count: 1 bytecode array length: 29 bytecodes: [ /* 48 E> */ B(StackCheck), - B(LdaCurrentContextSlot), U8(4), + B(LdaCurrentContextSlot), U8(3), B(Star), R(1), B(Mov), R(this), R(0), B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(0), U8(2), @@ -173,7 +173,7 @@ parameter count: 1 bytecode array length: 29 bytecodes: [ /* 41 E> */ B(StackCheck), - B(LdaCurrentContextSlot), U8(4), + B(LdaCurrentContextSlot), U8(3), B(Star), R(1), B(Mov), R(this), R(0), B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(0), U8(2), diff --git a/test/cctest/interpreter/bytecode_expectations/PrivateAccessorDeclaration.golden b/test/cctest/interpreter/bytecode_expectations/PrivateAccessorDeclaration.golden index 2a181fdb01..3a698d8e25 100644 --- a/test/cctest/interpreter/bytecode_expectations/PrivateAccessorDeclaration.golden +++ b/test/cctest/interpreter/bytecode_expectations/PrivateAccessorDeclaration.golden @@ -25,7 +25,7 @@ bytecodes: [ B(LdaConstant), U8(2), B(Star), R(3), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(3), U8(1), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(LdaTheHole), B(Star), R(6), B(CreateClosure), U8(3), U8(0), U8(2), @@ -40,7 +40,7 @@ bytecodes: [ B(CreateClosure), U8(5), U8(2), U8(2), B(Star), R(6), B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(5), U8(2), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(PopContext), R(1), B(Mov), R(2), R(0), B(LdaUndefined), @@ -75,7 +75,7 @@ bytecodes: [ B(LdaConstant), U8(2), B(Star), R(3), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(3), U8(1), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(LdaTheHole), B(Star), R(6), B(CreateClosure), U8(3), U8(0), U8(2), @@ -90,7 +90,7 @@ bytecodes: [ B(LdaNull), B(Star), R(6), B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(5), U8(2), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(PopContext), R(1), B(Mov), R(2), R(0), B(LdaUndefined), @@ -124,7 +124,7 @@ bytecodes: [ B(LdaConstant), U8(2), B(Star), R(3), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(3), U8(1), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(LdaTheHole), B(Star), R(6), B(CreateClosure), U8(3), U8(0), U8(2), @@ -139,7 +139,7 @@ bytecodes: [ B(CreateClosure), U8(4), U8(1), U8(2), B(Star), R(6), B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(5), U8(2), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(PopContext), R(1), B(Mov), R(2), R(0), B(LdaUndefined), @@ -179,7 +179,7 @@ bytecodes: [ B(LdaConstant), U8(2), B(Star), R(4), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(4), U8(1), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(LdaTheHole), B(Star), R(7), B(CreateClosure), U8(3), U8(0), U8(2), @@ -194,7 +194,7 @@ bytecodes: [ B(CreateClosure), U8(5), U8(2), U8(2), B(Star), R(7), B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(6), U8(2), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(PopContext), R(2), B(Mov), R(3), R(0), /* 38 E> */ B(CreateBlockContext), U8(6), @@ -202,7 +202,7 @@ bytecodes: [ B(LdaConstant), U8(8), B(Star), R(4), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(4), U8(1), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), /* 118 E> */ B(CreateClosure), U8(9), U8(3), U8(2), B(Star), R(3), B(LdaConstant), U8(7), @@ -216,7 +216,7 @@ bytecodes: [ B(CreateClosure), U8(11), U8(5), U8(2), B(Star), R(7), B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(6), U8(2), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(PopContext), R(2), B(Mov), R(3), R(1), B(LdaUndefined), @@ -274,7 +274,7 @@ bytecodes: [ B(LdaConstant), U8(6), B(Star), R(4), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(4), U8(1), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), /* 77 E> */ B(CreateClosure), U8(7), U8(2), U8(2), B(Star), R(3), B(LdaConstant), U8(5), @@ -290,7 +290,7 @@ bytecodes: [ B(LdaNull), B(Star), R(7), B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(6), U8(2), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(PopContext), R(2), B(Mov), R(3), R(1), /* 122 S> */ B(Ldar), R(1), @@ -348,7 +348,7 @@ bytecodes: [ B(LdaConstant), U8(6), B(Star), R(4), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(4), U8(1), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), /* 80 E> */ B(CreateClosure), U8(7), U8(2), U8(2), B(Star), R(3), B(LdaConstant), U8(5), @@ -364,7 +364,7 @@ bytecodes: [ B(Ldar), R(5), B(StaNamedProperty), R(7), U8(9), U8(0), B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(6), U8(2), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(PopContext), R(2), B(Mov), R(3), R(1), /* 126 S> */ B(Ldar), R(1), diff --git a/test/cctest/interpreter/bytecode_expectations/PrivateClassFields.golden b/test/cctest/interpreter/bytecode_expectations/PrivateClassFields.golden index 7ef39c30ab..90ae0a6688 100644 --- a/test/cctest/interpreter/bytecode_expectations/PrivateClassFields.golden +++ b/test/cctest/interpreter/bytecode_expectations/PrivateClassFields.golden @@ -34,7 +34,7 @@ bytecodes: [ B(LdaConstant), U8(2), B(Star), R(4), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(4), U8(1), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(LdaTheHole), B(Star), R(6), B(CreateClosure), U8(3), U8(0), U8(2), @@ -56,7 +56,7 @@ bytecodes: [ B(LdaConstant), U8(2), B(Star), R(4), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(4), U8(1), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(LdaTheHole), B(Star), R(6), B(CreateClosure), U8(8), U8(2), U8(2), @@ -140,7 +140,7 @@ bytecodes: [ B(LdaConstant), U8(2), B(Star), R(5), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(5), U8(1), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(LdaTheHole), B(Star), R(11), B(CreateClosure), U8(4), U8(0), U8(2), @@ -170,13 +170,13 @@ bytecodes: [ B(LdaConstant), U8(2), B(Star), R(5), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(5), U8(1), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(LdaConstant), U8(10), B(Star), R(5), B(LdaConstant), U8(10), B(Star), R(5), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(5), U8(1), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(LdaTheHole), B(Star), R(11), B(CreateClosure), U8(12), U8(3), U8(2), @@ -210,7 +210,7 @@ bytecodes: [ B(LdaConstant), U8(2), B(Star), R(5), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(5), U8(1), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 356 E> */ B(CreateClosure), U8(19), U8(8), U8(2), B(Star), R(4), B(LdaConstant), U8(18), diff --git a/test/cctest/interpreter/bytecode_expectations/PrivateMethodAccess.golden b/test/cctest/interpreter/bytecode_expectations/PrivateMethodAccess.golden index 5b7745cd7c..b5a8e34146 100644 --- a/test/cctest/interpreter/bytecode_expectations/PrivateMethodAccess.golden +++ b/test/cctest/interpreter/bytecode_expectations/PrivateMethodAccess.golden @@ -22,13 +22,13 @@ parameter count: 1 bytecode array length: 28 bytecodes: [ /* 44 E> */ B(StackCheck), - B(LdaCurrentContextSlot), U8(4), + B(LdaCurrentContextSlot), U8(3), B(Star), R(1), B(Mov), R(this), R(0), B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(0), U8(2), - /* 49 S> */ B(LdaCurrentContextSlot), U8(4), + /* 49 S> */ B(LdaCurrentContextSlot), U8(3), /* 61 E> */ B(LdaKeyedProperty), R(this), U8(0), - B(LdaCurrentContextSlot), U8(3), + B(LdaCurrentContextSlot), U8(2), B(Star), R(2), /* 63 E> */ B(CallAnyReceiver), R(2), R(this), U8(1), U8(2), /* 66 S> */ B(Return), @@ -53,7 +53,7 @@ parameter count: 1 bytecode array length: 29 bytecodes: [ /* 44 E> */ B(StackCheck), - B(LdaCurrentContextSlot), U8(4), + B(LdaCurrentContextSlot), U8(3), B(Star), R(1), B(Mov), R(this), R(0), B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(0), U8(2), @@ -85,7 +85,7 @@ parameter count: 1 bytecode array length: 29 bytecodes: [ /* 44 E> */ B(StackCheck), - B(LdaCurrentContextSlot), U8(4), + B(LdaCurrentContextSlot), U8(3), B(Star), R(1), B(Mov), R(this), R(0), B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(0), U8(2), diff --git a/test/cctest/interpreter/bytecode_expectations/PrivateMethodDeclaration.golden b/test/cctest/interpreter/bytecode_expectations/PrivateMethodDeclaration.golden index 388269d88b..b7b4748d40 100644 --- a/test/cctest/interpreter/bytecode_expectations/PrivateMethodDeclaration.golden +++ b/test/cctest/interpreter/bytecode_expectations/PrivateMethodDeclaration.golden @@ -24,7 +24,7 @@ bytecodes: [ B(LdaConstant), U8(2), B(Star), R(3), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(3), U8(1), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(LdaTheHole), B(Star), R(6), B(CreateClosure), U8(3), U8(0), U8(2), @@ -35,7 +35,7 @@ bytecodes: [ B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(3), B(Star), R(4), B(CreateClosure), U8(4), U8(1), U8(2), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(PopContext), R(1), B(Mov), R(5), R(0), B(LdaUndefined), @@ -72,7 +72,7 @@ bytecodes: [ B(LdaConstant), U8(2), B(Star), R(4), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(4), U8(1), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(LdaTheHole), B(Star), R(7), B(CreateClosure), U8(3), U8(0), U8(2), @@ -83,7 +83,7 @@ bytecodes: [ B(CallRuntime), U16(Runtime::kDefineClass), R(5), U8(3), B(Star), R(5), B(CreateClosure), U8(4), U8(1), U8(2), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(PopContext), R(2), B(Mov), R(6), R(0), /* 38 E> */ B(CreateBlockContext), U8(5), @@ -91,7 +91,7 @@ bytecodes: [ B(LdaConstant), U8(7), B(Star), R(4), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(4), U8(1), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), /* 93 E> */ B(CreateClosure), U8(8), U8(2), U8(2), B(Star), R(3), B(LdaConstant), U8(6), @@ -101,7 +101,7 @@ bytecodes: [ B(CallRuntime), U16(Runtime::kDefineClass), R(5), U8(3), B(Star), R(5), B(CreateClosure), U8(9), U8(3), U8(2), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(PopContext), R(2), B(Mov), R(6), R(1), B(LdaUndefined), @@ -156,7 +156,7 @@ bytecodes: [ B(LdaConstant), U8(6), B(Star), R(4), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(4), U8(1), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), /* 77 E> */ B(CreateClosure), U8(7), U8(2), U8(2), B(Star), R(3), B(LdaConstant), U8(5), @@ -166,7 +166,7 @@ bytecodes: [ B(CallRuntime), U16(Runtime::kDefineClass), R(5), U8(3), B(Star), R(5), B(CreateClosure), U8(8), U8(3), U8(2), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(Star), R(6), B(Ldar), R(5), B(StaNamedProperty), R(6), U8(9), U8(0), diff --git a/test/cctest/interpreter/bytecode_expectations/PublicClassFields.golden b/test/cctest/interpreter/bytecode_expectations/PublicClassFields.golden index 93e3eaed6a..ab5fcf5c4c 100644 --- a/test/cctest/interpreter/bytecode_expectations/PublicClassFields.golden +++ b/test/cctest/interpreter/bytecode_expectations/PublicClassFields.golden @@ -29,7 +29,7 @@ bytecodes: [ B(CreateBlockContext), U8(0), B(PushContext), R(2), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(LdaTheHole), B(Star), R(6), B(CreateClosure), U8(2), U8(0), U8(2), @@ -37,7 +37,7 @@ bytecodes: [ B(LdaConstant), U8(1), B(Star), R(4), /* 60 S> */ B(LdaConstant), U8(3), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(Star), R(7), B(Mov), R(3), R(5), B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4), @@ -50,7 +50,7 @@ bytecodes: [ /* 38 E> */ B(CreateBlockContext), U8(6), B(PushContext), R(2), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(LdaTheHole), B(Star), R(6), B(CreateClosure), U8(8), U8(2), U8(2), @@ -58,7 +58,7 @@ bytecodes: [ B(LdaConstant), U8(7), B(Star), R(4), /* 99 S> */ B(LdaConstant), U8(3), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(Star), R(7), B(Mov), R(3), R(5), B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4), @@ -128,7 +128,7 @@ bytecodes: [ B(CreateBlockContext), U8(0), B(PushContext), R(3), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(LdaTheHole), B(Star), R(11), B(CreateClosure), U8(3), U8(0), U8(2), @@ -143,7 +143,7 @@ bytecodes: [ B(LdaConstant), U8(1), B(Star), R(5), /* 77 S> */ B(LdaConstant), U8(5), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(Star), R(8), B(Mov), R(4), R(6), B(Mov), R(10), R(7), @@ -157,7 +157,7 @@ bytecodes: [ /* 38 E> */ B(CreateBlockContext), U8(8), B(PushContext), R(3), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(LdaTheHole), B(Star), R(11), B(CreateClosure), U8(11), U8(3), U8(2), @@ -172,7 +172,7 @@ bytecodes: [ B(LdaConstant), U8(9), B(Star), R(5), /* 133 S> */ B(LdaConstant), U8(5), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(Star), R(8), B(CreateClosure), U8(13), U8(5), U8(2), B(Star), R(9), @@ -188,13 +188,13 @@ bytecodes: [ /* 90 E> */ B(CreateBlockContext), U8(15), B(PushContext), R(3), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 236 E> */ B(CreateClosure), U8(17), U8(7), U8(2), B(Star), R(4), B(LdaConstant), U8(16), B(Star), R(5), /* 256 S> */ B(LdaConstant), U8(5), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(Star), R(8), B(Mov), R(4), R(6), B(Mov), R(1), R(7), diff --git a/test/cctest/interpreter/bytecode_expectations/StandardForLoop.golden b/test/cctest/interpreter/bytecode_expectations/StandardForLoop.golden index cdb05253af..3afa915e19 100644 --- a/test/cctest/interpreter/bytecode_expectations/StandardForLoop.golden +++ b/test/cctest/interpreter/bytecode_expectations/StandardForLoop.golden @@ -48,7 +48,7 @@ frame size: 15 parameter count: 1 bytecode array length: 165 bytecodes: [ - B(CreateFunctionContext), U8(0), U8(3), + B(CreateFunctionContext), U8(0), U8(4), B(PushContext), R(4), B(Ldar), R(this), B(StaCurrentContextSlot), U8(3), @@ -60,10 +60,10 @@ bytecodes: [ B(CreateBlockContext), U8(1), B(PushContext), R(5), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), /* 30 S> */ B(LdaZero), - /* 30 E> */ B(StaCurrentContextSlot), U8(3), - B(LdaCurrentContextSlot), U8(3), + /* 30 E> */ B(StaCurrentContextSlot), U8(2), + B(LdaCurrentContextSlot), U8(2), B(Star), R(0), B(LdaSmi), I8(1), B(Star), R(1), @@ -71,21 +71,21 @@ bytecodes: [ B(CreateBlockContext), U8(2), B(PushContext), R(6), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(Ldar), R(0), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(LdaSmi), I8(1), B(TestEqual), R(1), U8(0), B(JumpIfFalse), U8(7), B(LdaZero), B(Star), R(1), B(Jump), U8(8), - /* 43 S> */ B(LdaCurrentContextSlot), U8(3), + /* 43 S> */ B(LdaCurrentContextSlot), U8(2), B(Inc), U8(1), - /* 43 E> */ B(StaCurrentContextSlot), U8(3), + /* 43 E> */ B(StaCurrentContextSlot), U8(2), B(LdaSmi), I8(1), B(Star), R(2), - /* 35 S> */ B(LdaCurrentContextSlot), U8(3), + /* 35 S> */ B(LdaCurrentContextSlot), U8(2), B(Star), R(7), B(LdaSmi), I8(10), /* 35 E> */ B(TestLessThan), R(7), U8(2), @@ -115,7 +115,7 @@ bytecodes: [ /* 48 E> */ B(CallUndefinedReceiver1), R(7), R(8), U8(6), B(LdaZero), B(Star), R(2), - B(LdaCurrentContextSlot), U8(3), + B(LdaCurrentContextSlot), U8(2), B(Star), R(0), B(JumpLoop), U8(56), I8(1), B(LdaSmi), I8(1), @@ -160,21 +160,21 @@ bytecodes: [ B(CreateBlockContext), U8(0), B(PushContext), R(4), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(Ldar), R(0), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(LdaSmi), I8(1), B(TestEqual), R(1), U8(0), B(JumpIfFalse), U8(7), B(LdaZero), B(Star), R(1), B(Jump), U8(8), - /* 43 S> */ B(LdaCurrentContextSlot), U8(3), + /* 43 S> */ B(LdaCurrentContextSlot), U8(2), B(Inc), U8(1), - /* 43 E> */ B(StaCurrentContextSlot), U8(3), + /* 43 E> */ B(StaCurrentContextSlot), U8(2), B(LdaSmi), I8(1), B(Star), R(2), - /* 35 S> */ B(LdaCurrentContextSlot), U8(3), + /* 35 S> */ B(LdaCurrentContextSlot), U8(2), B(Star), R(5), B(LdaSmi), I8(10), /* 35 E> */ B(TestLessThan), R(5), U8(2), @@ -191,7 +191,7 @@ bytecodes: [ /* 74 E> */ B(CallUndefinedReceiver0), R(5), U8(4), B(LdaZero), B(Star), R(2), - B(LdaCurrentContextSlot), U8(3), + B(LdaCurrentContextSlot), U8(2), B(Star), R(0), B(JumpLoop), U8(24), I8(1), B(LdaSmi), I8(1), @@ -404,7 +404,7 @@ bytecodes: [ B(SetPendingMessage), B(Ldar), R(3), B(PushContext), R(4), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(6), B(LdaFalse), B(Star), R(7), @@ -474,7 +474,7 @@ bytecodes: [ B(SetPendingMessage), B(Ldar), R(2), B(PushContext), R(3), - B(LdaImmutableCurrentContextSlot), U8(3), + B(LdaImmutableCurrentContextSlot), U8(2), B(Star), R(5), B(LdaTrue), B(Star), R(6), diff --git a/test/cctest/interpreter/bytecode_expectations/StaticClassFields.golden b/test/cctest/interpreter/bytecode_expectations/StaticClassFields.golden index 9d436d364b..e456906b2b 100644 --- a/test/cctest/interpreter/bytecode_expectations/StaticClassFields.golden +++ b/test/cctest/interpreter/bytecode_expectations/StaticClassFields.golden @@ -33,9 +33,9 @@ bytecodes: [ B(CreateBlockContext), U8(0), B(PushContext), R(2), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(LdaTheHole), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(LdaTheHole), B(Star), R(6), B(CreateClosure), U8(2), U8(0), U8(2), @@ -43,7 +43,7 @@ bytecodes: [ B(LdaConstant), U8(1), B(Star), R(4), /* 60 S> */ B(LdaConstant), U8(3), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(Star), R(7), /* 92 S> */ B(LdaConstant), U8(4), B(Star), R(8), @@ -53,7 +53,7 @@ bytecodes: [ B(JumpIfFalse), U8(7), B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0), B(Ldar), R(8), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(5), B(Star), R(4), B(CreateClosure), U8(6), U8(1), U8(2), @@ -67,9 +67,9 @@ bytecodes: [ /* 38 E> */ B(CreateBlockContext), U8(9), B(PushContext), R(2), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(LdaTheHole), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(LdaTheHole), B(Star), R(6), B(CreateClosure), U8(11), U8(3), U8(2), @@ -77,7 +77,7 @@ bytecodes: [ B(LdaConstant), U8(10), B(Star), R(4), /* 131 S> */ B(LdaConstant), U8(3), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(Star), R(7), /* 176 S> */ B(LdaConstant), U8(4), B(Star), R(8), @@ -87,7 +87,7 @@ bytecodes: [ B(JumpIfFalse), U8(7), B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0), B(Ldar), R(8), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(5), B(Star), R(4), B(CreateClosure), U8(12), U8(4), U8(2), @@ -168,9 +168,9 @@ bytecodes: [ B(CreateBlockContext), U8(0), B(PushContext), R(3), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(LdaTheHole), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(LdaTheHole), B(Star), R(11), B(CreateClosure), U8(3), U8(0), U8(2), @@ -185,7 +185,7 @@ bytecodes: [ B(LdaConstant), U8(1), B(Star), R(5), /* 77 S> */ B(LdaConstant), U8(5), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(Star), R(8), /* 109 S> */ B(LdaConstant), U8(6), B(Star), R(9), @@ -196,7 +196,7 @@ bytecodes: [ B(JumpIfFalse), U8(7), B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0), B(Ldar), R(9), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(CallRuntime), U16(Runtime::kDefineClass), R(5), U8(5), B(Star), R(5), B(CreateClosure), U8(8), U8(2), U8(2), @@ -210,9 +210,9 @@ bytecodes: [ /* 38 E> */ B(CreateBlockContext), U8(11), B(PushContext), R(3), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(LdaTheHole), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(LdaTheHole), B(Star), R(11), B(CreateClosure), U8(14), U8(4), U8(2), @@ -227,7 +227,7 @@ bytecodes: [ B(LdaConstant), U8(12), B(Star), R(5), /* 165 S> */ B(LdaConstant), U8(5), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(Star), R(8), /* 210 S> */ B(LdaConstant), U8(6), B(Star), R(9), @@ -238,7 +238,7 @@ bytecodes: [ B(JumpIfFalse), U8(7), B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0), B(Ldar), R(9), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(CreateClosure), U8(16), U8(6), U8(2), B(Star), R(10), B(CallRuntime), U16(Runtime::kDefineClass), R(5), U8(6), @@ -254,15 +254,15 @@ bytecodes: [ /* 122 E> */ B(CreateBlockContext), U8(19), B(PushContext), R(3), B(LdaTheHole), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(LdaTheHole), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), /* 313 E> */ B(CreateClosure), U8(21), U8(9), U8(2), B(Star), R(4), B(LdaConstant), U8(20), B(Star), R(5), /* 333 S> */ B(LdaConstant), U8(5), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(Star), R(8), /* 378 S> */ B(LdaConstant), U8(6), B(Star), R(9), @@ -273,7 +273,7 @@ bytecodes: [ B(JumpIfFalse), U8(7), B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0), B(Ldar), R(9), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(CallRuntime), U16(Runtime::kDefineClass), R(5), U8(5), B(Star), R(5), B(CreateClosure), U8(22), U8(10), U8(2), diff --git a/test/cctest/interpreter/bytecode_expectations/StaticPrivateMethodAccess.golden b/test/cctest/interpreter/bytecode_expectations/StaticPrivateMethodAccess.golden index edaaab653d..dde0b71294 100644 --- a/test/cctest/interpreter/bytecode_expectations/StaticPrivateMethodAccess.golden +++ b/test/cctest/interpreter/bytecode_expectations/StaticPrivateMethodAccess.golden @@ -22,7 +22,7 @@ parameter count: 1 bytecode array length: 36 bytecodes: [ /* 51 E> */ B(StackCheck), - /* 56 S> */ B(LdaCurrentContextSlot), U8(4), + /* 56 S> */ B(LdaCurrentContextSlot), U8(3), B(TestReferenceEqual), R(this), B(Mov), R(this), R(1), B(JumpIfTrue), U8(18), @@ -32,7 +32,7 @@ bytecodes: [ B(Star), R(3), B(CallRuntime), U16(Runtime::kNewTypeError), R(2), U8(2), B(Throw), - B(LdaCurrentContextSlot), U8(3), + B(LdaCurrentContextSlot), U8(2), B(Star), R(0), /* 70 E> */ B(CallAnyReceiver), R(0), R(1), U8(1), U8(0), /* 73 S> */ B(Return), @@ -120,9 +120,9 @@ parameter count: 1 bytecode array length: 143 bytecodes: [ /* 81 E> */ B(StackCheck), - /* 90 S> */ B(LdaCurrentContextSlot), U8(3), + /* 90 S> */ B(LdaCurrentContextSlot), U8(2), B(Star), R(1), - B(LdaCurrentContextSlot), U8(4), + B(LdaCurrentContextSlot), U8(3), /* 94 E> */ B(TestReferenceEqual), R(this), B(Mov), R(this), R(0), B(JumpIfTrue), U8(18), @@ -142,9 +142,9 @@ bytecodes: [ B(CallProperty1), R(3), R(0), R(2), U8(3), /* 105 S> */ B(LdaSmi), I8(1), B(Star), R(0), - B(LdaCurrentContextSlot), U8(3), + B(LdaCurrentContextSlot), U8(2), B(Star), R(2), - B(LdaCurrentContextSlot), U8(4), + B(LdaCurrentContextSlot), U8(3), /* 109 E> */ B(TestReferenceEqual), R(this), B(Mov), R(this), R(1), B(JumpIfTrue), U8(18), @@ -157,9 +157,9 @@ bytecodes: [ B(CallRuntime), U16(Runtime::kLoadPrivateSetter), R(2), U8(1), B(Star), R(3), B(CallProperty1), R(3), R(1), R(0), U8(5), - /* 122 S> */ B(LdaCurrentContextSlot), U8(3), + /* 122 S> */ B(LdaCurrentContextSlot), U8(2), B(Star), R(1), - B(LdaCurrentContextSlot), U8(4), + B(LdaCurrentContextSlot), U8(3), /* 133 E> */ B(TestReferenceEqual), R(this), B(Mov), R(this), R(0), B(JumpIfTrue), U8(18), diff --git a/test/cctest/interpreter/bytecode_expectations/StaticPrivateMethodDeclaration.golden b/test/cctest/interpreter/bytecode_expectations/StaticPrivateMethodDeclaration.golden index 1211a83d3e..808c91267f 100644 --- a/test/cctest/interpreter/bytecode_expectations/StaticPrivateMethodDeclaration.golden +++ b/test/cctest/interpreter/bytecode_expectations/StaticPrivateMethodDeclaration.golden @@ -31,7 +31,7 @@ bytecodes: [ B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(3), B(Star), R(3), B(CreateClosure), U8(3), U8(1), U8(2), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(PopContext), R(1), B(Mov), R(4), R(0), B(LdaUndefined), @@ -75,7 +75,7 @@ bytecodes: [ B(LdaNull), B(Star), R(5), B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(4), U8(2), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(PopContext), R(1), B(Mov), R(2), R(0), B(LdaUndefined), @@ -119,7 +119,7 @@ bytecodes: [ B(CreateClosure), U8(3), U8(1), U8(2), B(Star), R(5), B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(4), U8(2), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(PopContext), R(1), B(Mov), R(2), R(0), B(LdaUndefined), @@ -164,7 +164,7 @@ bytecodes: [ B(CreateClosure), U8(4), U8(2), U8(2), B(Star), R(5), B(CallRuntime), U16(Runtime::kCreatePrivateAccessors), R(4), U8(2), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(PopContext), R(1), B(Mov), R(2), R(0), B(LdaUndefined), @@ -199,7 +199,7 @@ bytecodes: [ B(LdaConstant), U8(2), B(Star), R(3), B(CallRuntime), U16(Runtime::kCreatePrivateNameSymbol), R(3), U8(1), - B(StaCurrentContextSlot), U8(5), + B(StaCurrentContextSlot), U8(4), B(LdaTheHole), B(Star), R(6), B(CreateClosure), U8(3), U8(0), U8(2), @@ -210,9 +210,9 @@ bytecodes: [ B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(3), B(Star), R(4), B(CreateClosure), U8(4), U8(1), U8(2), - B(StaCurrentContextSlot), U8(3), + B(StaCurrentContextSlot), U8(2), B(CreateClosure), U8(5), U8(2), U8(2), - B(StaCurrentContextSlot), U8(4), + B(StaCurrentContextSlot), U8(3), B(PopContext), R(1), B(Mov), R(5), R(0), B(LdaUndefined), diff --git a/test/cctest/interpreter/test-bytecode-generator.cc b/test/cctest/interpreter/test-bytecode-generator.cc index 0043a07505..4e92709edd 100644 --- a/test/cctest/interpreter/test-bytecode-generator.cc +++ b/test/cctest/interpreter/test-bytecode-generator.cc @@ -59,15 +59,13 @@ namespace interpreter { #define REPEAT_64_UNIQUE_VARS() REPEAT_32_UNIQUE_VARS() REPEAT_32_UNIQUE_VARS() #define REPEAT_128_UNIQUE_VARS() REPEAT_64_UNIQUE_VARS() REPEAT_64_UNIQUE_VARS() -#define REPEAT_251_UNIQUE_VARS() \ +#define REPEAT_252_UNIQUE_VARS() \ REPEAT_128_UNIQUE_VARS() \ REPEAT_64_UNIQUE_VARS() \ REPEAT_32_UNIQUE_VARS() \ REPEAT_16_UNIQUE_VARS() \ REPEAT_8_UNIQUE_VARS() \ - UNIQUE_VAR() \ - UNIQUE_VAR() \ - UNIQUE_VAR() + REPEAT_4_UNIQUE_VARS() #define REPEAT_2_LOAD_UNIQUE_PROPERTY() \ LOAD_UNIQUE_PROPERTY() LOAD_UNIQUE_PROPERTY() @@ -1740,7 +1738,7 @@ TEST(ContextVariables) { // The wide check below relies on MIN_CONTEXT_SLOTS + 3 + 250 == 256, if this // ever changes, the REPEAT_XXX should be changed to output the correct number // of unique variables to trigger the wide slot load / store. - STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS + 3 + 250 == 256); + STATIC_ASSERT(Context::MIN_CONTEXT_EXTENDED_SLOTS + 3 + 250 == 256); InitializedIgnitionHandleScope scope; BytecodeExpectationsPrinter printer(CcTest::isolate()); @@ -1758,7 +1756,7 @@ TEST(ContextVariables) { "{ let b = 2; return function() { a + b; }; }\n", "'use strict';\n" - REPEAT_251_UNIQUE_VARS() + REPEAT_252_UNIQUE_VARS() "eval();\n" "var b = 100;\n" "return b\n", @@ -3549,7 +3547,7 @@ TEST(TemplateLiterals) { #undef REPEAT_32_UNIQUE_VARS #undef REPEAT_64_UNIQUE_VARS #undef REPEAT_128_UNIQUE_VARS -#undef REPEAT_251_UNIQUE_VARS +#undef REPEAT_252_UNIQUE_VARS #undef LOAD_UNIQUE_PROPERTY #undef REPEAT_2_LOAD_UNIQUE_PROPERTY #undef REPEAT_4_LOAD_UNIQUE_PROPERTY diff --git a/test/cctest/test-code-stub-assembler.cc b/test/cctest/test-code-stub-assembler.cc index 08dc342bab..aa036d6760 100644 --- a/test/cctest/test-code-stub-assembler.cc +++ b/test/cctest/test-code-stub-assembler.cc @@ -2567,7 +2567,6 @@ TEST(CreatePromiseResolvingFunctionsContext) { CHECK(result->IsContext()); Handle context_js = Handle::cast(result); CHECK_EQ(isolate->native_context()->scope_info(), context_js->scope_info()); - CHECK_EQ(ReadOnlyRoots(isolate).the_hole_value(), context_js->extension()); CHECK_EQ(*isolate->native_context(), context_js->native_context()); CHECK(context_js->get(PromiseBuiltins::kPromiseSlot).IsJSPromise()); CHECK_EQ(ReadOnlyRoots(isolate).false_value(), @@ -2731,7 +2730,6 @@ TEST(CreatePromiseGetCapabilitiesExecutorContext) { Handle context_js = Handle::cast(result_obj); CHECK_EQ(PromiseBuiltins::kCapabilitiesContextLength, context_js->length()); CHECK_EQ(isolate->native_context()->scope_info(), context_js->scope_info()); - CHECK_EQ(ReadOnlyRoots(isolate).the_hole_value(), context_js->extension()); CHECK_EQ(*isolate->native_context(), context_js->native_context()); CHECK( context_js->get(PromiseBuiltins::kCapabilitySlot).IsPromiseCapability()); @@ -2779,7 +2777,6 @@ TEST(NewPromiseCapability) { for (auto&& callback : callbacks) { Handle context(Context::cast(callback->context()), isolate); CHECK_EQ(isolate->native_context()->scope_info(), context->scope_info()); - CHECK_EQ(ReadOnlyRoots(isolate).the_hole_value(), context->extension()); CHECK_EQ(*isolate->native_context(), context->native_context()); CHECK_EQ(PromiseBuiltins::kPromiseContextLength, context->length()); CHECK_EQ(context->get(PromiseBuiltins::kPromiseSlot), result->promise()); diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc index 7784a7f855..259c16dc9d 100644 --- a/test/cctest/test-heap-profiler.cc +++ b/test/cctest/test-heap-profiler.cc @@ -2580,7 +2580,7 @@ TEST(ManyLocalsInSharedContext) { env->GetIsolate(), ok_object, v8::HeapGraphEdge::kInternal, "context"); CHECK(context_object); // Check the objects are not duplicated in the context. - CHECK_EQ(v8::internal::Context::MIN_CONTEXT_SLOTS + num_objects - 1, + CHECK_EQ(v8::internal::Context::MIN_CONTEXT_EXTENDED_SLOTS + num_objects - 1, context_object->GetChildrenCount()); // Check all the objects have got their names. // ... well check just every 15th because otherwise it's too slow in debug. diff --git a/test/mjsunit/regress/regress-crbug-1016056.js b/test/mjsunit/regress/regress-crbug-1016056.js new file mode 100644 index 0000000000..8e2d290f63 --- /dev/null +++ b/test/mjsunit/regress/regress-crbug-1016056.js @@ -0,0 +1,18 @@ +// 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. + +// Flags: --allow-natives-syntax + +function f(args) { + eval(); + return arguments[0]; +} +%PrepareFunctionForOptimization(f); +function g() { + return f(1); +} +%PrepareFunctionForOptimization(g); +assertEquals(1, g()); +%OptimizeFunctionOnNextCall(g); +assertEquals(1, g()); diff --git a/test/unittests/compiler/js-create-lowering-unittest.cc b/test/unittests/compiler/js-create-lowering-unittest.cc index fb5254903d..9b82cf9ec1 100644 --- a/test/unittests/compiler/js-create-lowering-unittest.cc +++ b/test/unittests/compiler/js-create-lowering-unittest.cc @@ -182,11 +182,12 @@ TEST_F(JSCreateLoweringTest, JSCreateWithContext) { Reduce(graph()->NewNode(javascript()->CreateWithContext(scope_info), object, context, effect, control)); ASSERT_TRUE(r.Changed()); - EXPECT_THAT(r.replacement(), - IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( - Context::MIN_CONTEXT_SLOTS)), - IsBeginRegion(_), control), - _)); + EXPECT_THAT( + r.replacement(), + IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( + Context::MIN_CONTEXT_EXTENDED_SLOTS)), + IsBeginRegion(_), control), + _)); } // ----------------------------------------------------------------------------- diff --git a/tools/gen-postmortem-metadata.py b/tools/gen-postmortem-metadata.py index 0dcbf5d0f3..5371298bb1 100644 --- a/tools/gen-postmortem-metadata.py +++ b/tools/gen-postmortem-metadata.py @@ -195,8 +195,6 @@ consts_misc = [ 'value': 'Context::SCOPE_INFO_INDEX' }, { 'name': 'context_idx_prev', 'value': 'Context::PREVIOUS_INDEX' }, - { 'name': 'context_idx_ext', - 'value': 'Context::EXTENSION_INDEX' }, { 'name': 'context_min_slots', 'value': 'Context::MIN_CONTEXT_SLOTS' }, { 'name': 'native_context_embedder_data_offset',