| Index: test/cctest/interpreter/test-bytecode-generator.cc
|
| diff --git a/test/cctest/interpreter/test-bytecode-generator.cc b/test/cctest/interpreter/test-bytecode-generator.cc
|
| index dcec7f5cd2dbe01a77ed546d79a12547f92b1e9f..b2cac6c226f25336f2df841c543e27e61b73f293 100644
|
| --- a/test/cctest/interpreter/test-bytecode-generator.cc
|
| +++ b/test/cctest/interpreter/test-bytecode-generator.cc
|
| @@ -2213,7 +2213,7 @@ TEST(BreakableBlocks) {
|
| BytecodeGeneratorHelper helper;
|
|
|
| int closure = Register::function_closure().index();
|
| - int context = Register::function_context().index();
|
| + int context = Register::current_context().index();
|
|
|
| ExpectedSnippet<InstanceType> snippets[] = {
|
| {"var x = 0;\n"
|
| @@ -2309,15 +2309,15 @@ TEST(BreakableBlocks) {
|
| B(CallRuntime), U16(Runtime::kPushBlockContext), R(3), U8(2), //
|
| B(PushContext), R(2), //
|
| B(LdaTheHole), //
|
| - B(StaContextSlot), R(2), U8(4), //
|
| + B(StaContextSlot), R(context), U8(4), //
|
| B(CreateClosure), U8(1), U8(0), //
|
| B(Star), R(0), //
|
| B(LdaSmi8), U8(10), //
|
| - B(StaContextSlot), R(2), U8(4), //
|
| + B(StaContextSlot), R(context), U8(4), //
|
| B(Ldar), R(0), //
|
| B(Star), R(1), //
|
| B(Jump), U8(2), //
|
| - B(PopContext), R(context), //
|
| + B(PopContext), R(2), //
|
| B(LdaUndefined), //
|
| B(Return), //
|
| },
|
| @@ -2342,9 +2342,9 @@ TEST(BreakableBlocks) {
|
| U8(1), //
|
| B(PushContext), R(2), //
|
| B(LdaTheHole), //
|
| - B(StaContextSlot), R(2), U8(4), //
|
| + B(StaContextSlot), R(context), U8(4), //
|
| B(LdaSmi8), U8(1), //
|
| - B(StaContextSlot), R(2), U8(4), //
|
| + B(StaContextSlot), R(context), U8(4), //
|
| B(LdaConstant), U8(0), //
|
| B(Star), R(4), //
|
| B(Ldar), R(closure), //
|
| @@ -2352,22 +2352,22 @@ TEST(BreakableBlocks) {
|
| B(CallRuntime), U16(Runtime::kPushBlockContext), R(4), U8(2), //
|
| B(PushContext), R(3), //
|
| B(LdaTheHole), //
|
| - B(StaContextSlot), R(3), U8(4), //
|
| + B(StaContextSlot), R(context), U8(4), //
|
| B(CreateClosure), U8(1), U8(0), //
|
| B(Star), R(0), //
|
| B(LdaSmi8), U8(2), //
|
| - B(StaContextSlot), R(3), U8(4), //
|
| + B(StaContextSlot), R(context), U8(4), //
|
| B(Ldar), R(0), //
|
| B(Star), R(1), //
|
| - B(LdaContextSlot), R(3), U8(4), //
|
| + B(LdaContextSlot), R(context), U8(4), //
|
| B(JumpIfToBooleanFalse), U8(6), //
|
| - B(PopContext), R(2), //
|
| + B(PopContext), R(3), //
|
| B(Jump), U8(9), //
|
| B(LdaSmi8), U8(3), //
|
| - B(StaContextSlot), R(3), U8(4), //
|
| - B(PopContext), R(2), //
|
| + B(StaContextSlot), R(context), U8(4), //
|
| + B(PopContext), R(3), //
|
| B(LdaSmi8), U8(4), //
|
| - B(StaContextSlot), R(2), U8(4), //
|
| + B(StaContextSlot), R(context), U8(4), //
|
| B(LdaUndefined), //
|
| B(Return), //
|
| },
|
| @@ -2389,7 +2389,7 @@ TEST(BasicLoops) {
|
| BytecodeGeneratorHelper helper;
|
|
|
| int closure = Register::function_closure().index();
|
| - int context = Register::function_context().index();
|
| + int context = Register::current_context().index();
|
|
|
| ExpectedSnippet<InstanceType> snippets[] = {
|
| {"var x = 0;\n"
|
| @@ -3027,23 +3027,23 @@ TEST(BasicLoops) {
|
| B(CallRuntime), U16(Runtime::kPushBlockContext), R(4), U8(2), //
|
| B(PushContext), R(3), //
|
| B(LdaTheHole), //
|
| - B(StaContextSlot), R(3), U8(4), //
|
| + B(StaContextSlot), R(context), U8(4), //
|
| B(CreateClosure), U8(1), U8(0), //
|
| B(Star), R(0), //
|
| B(LdaSmi8), U8(1), //
|
| - B(StaContextSlot), R(3), U8(4), //
|
| + B(StaContextSlot), R(context), U8(4), //
|
| B(Ldar), R(0), //
|
| B(Star), R(2), //
|
| - B(LdaContextSlot), R(3), U8(4), //
|
| + B(LdaContextSlot), R(context), U8(4), //
|
| B(JumpIfToBooleanFalse), U8(6), //
|
| - B(PopContext), R(context), //
|
| + B(PopContext), R(3), //
|
| B(Jump), U8(-44), //
|
| - B(LdaContextSlot), R(3), U8(4), //
|
| + B(LdaContextSlot), R(context), U8(4), //
|
| B(ToNumber), //
|
| B(Star), R(4), //
|
| B(Inc), //
|
| - B(StaContextSlot), R(3), U8(4), //
|
| - B(PopContext), R(context), //
|
| + B(StaContextSlot), R(context), U8(4), //
|
| + B(PopContext), R(3), //
|
| B(Jump), U8(-58), //
|
| B(LdaUndefined), //
|
| B(Return), //
|
| @@ -3353,6 +3353,7 @@ TEST(Delete) {
|
| int deep_elements_flags =
|
| ObjectLiteral::kFastElements | ObjectLiteral::kDisableMementos;
|
| int closure = Register::function_closure().index();
|
| + int context = Register::current_context().index();
|
| int first_context_slot = Context::MIN_CONTEXT_SLOTS;
|
|
|
| ExpectedSnippet<InstanceType> snippets[] = {
|
| @@ -3418,9 +3419,9 @@ TEST(Delete) {
|
| B(PushContext), R(0), //
|
| B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
|
| B(Star), R(1), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(CreateClosure), U8(1), U8(0), //
|
| - B(LdaContextSlot), R(0), U8(first_context_slot), //
|
| + B(LdaContextSlot), R(context), U8(first_context_slot), //
|
| B(Star), R(1), //
|
| B(LdaSmi8), U8(1), //
|
| B(DeletePropertyStrict), R(1), //
|
| @@ -3450,7 +3451,7 @@ TEST(GlobalDelete) {
|
| BytecodeGeneratorHelper helper;
|
| Zone zone;
|
|
|
| - int context = Register::function_context().index();
|
| + int context = Register::current_context().index();
|
| int native_context_index = Context::NATIVE_CONTEXT_INDEX;
|
| int global_context_index = Context::EXTENSION_INDEX;
|
| FeedbackVectorSpec feedback_spec(&zone);
|
| @@ -4268,7 +4269,6 @@ TEST(TryCatch) {
|
| BytecodeGeneratorHelper helper;
|
|
|
| int closure = Register::function_closure().index();
|
| - int context = Register::function_context().index();
|
|
|
| ExpectedSnippet<const char*> snippets[] = {
|
| {"try { return 1; } catch(e) { return 2; }",
|
| @@ -4286,7 +4286,7 @@ TEST(TryCatch) {
|
| B(CallRuntime), U16(Runtime::kPushCatchContext), R(2), U8(3), //
|
| B(PushContext), R(0), //
|
| B(LdaSmi8), U8(2), //
|
| - B(PopContext), R(context), //
|
| + B(PopContext), R(0), //
|
| B(Return), //
|
| // TODO(mstarzinger): Potential optimization, elide next bytes.
|
| B(LdaUndefined), //
|
| @@ -4311,7 +4311,7 @@ TEST(TryCatch) {
|
| B(Star), R(5), //
|
| B(CallRuntime), U16(Runtime::kPushCatchContext), R(3), U8(3), //
|
| B(PushContext), R(1), //
|
| - B(PopContext), R(context), //
|
| + B(PopContext), R(1), //
|
| B(LdaSmi8), U8(2), //
|
| B(Star), R(0), //
|
| B(Jump), U8(25), //
|
| @@ -4324,7 +4324,7 @@ TEST(TryCatch) {
|
| B(PushContext), R(1), //
|
| B(LdaSmi8), U8(3), //
|
| B(Star), R(0), //
|
| - B(PopContext), R(context), //
|
| + B(PopContext), R(1), //
|
| B(LdaUndefined), //
|
| B(Return), //
|
| },
|
| @@ -4347,7 +4347,6 @@ TEST(TryFinally) {
|
| BytecodeGeneratorHelper helper;
|
|
|
| int closure = Register::function_closure().index();
|
| - int context = Register::function_context().index();
|
|
|
| ExpectedSnippet<const char*> snippets[] = {
|
| {"var a = 1; try { a = 2; } finally { a = 3; }",
|
| @@ -4399,7 +4398,7 @@ TEST(TryFinally) {
|
| B(PushContext), R(1), //
|
| B(LdaSmi8), U8(20), //
|
| B(Star), R(0), //
|
| - B(PopContext), R(context), //
|
| + B(PopContext), R(1), //
|
| B(LdaSmi8), U8(-1), //
|
| B(Star), R(2), //
|
| B(Jump), U8(7), //
|
| @@ -4440,7 +4439,7 @@ TEST(TryFinally) {
|
| B(PushContext), R(1), //
|
| B(LdaSmi8), U8(2), //
|
| B(Star), R(0), //
|
| - B(PopContext), R(context), //
|
| + B(PopContext), R(1), //
|
| B(Jump), U8(25), //
|
| B(Star), R(7), //
|
| B(LdaConstant), U8(0), //
|
| @@ -4451,7 +4450,7 @@ TEST(TryFinally) {
|
| B(PushContext), R(1), //
|
| B(LdaSmi8), U8(20), //
|
| B(Star), R(0), //
|
| - B(PopContext), R(context), //
|
| + B(PopContext), R(1), //
|
| B(LdaSmi8), U8(-1), //
|
| B(Star), R(2), //
|
| B(Jump), U8(7), //
|
| @@ -4623,7 +4622,7 @@ TEST(ContextVariables) {
|
| i::NewTypeFeedbackVector(helper.isolate(), &feedback_spec);
|
|
|
| int closure = Register::function_closure().index();
|
| - int context = Register::function_context().index();
|
| + int context = Register::current_context().index();
|
| int new_target = Register::new_target().index();
|
| int first_context_slot = Context::MIN_CONTEXT_SLOTS;
|
|
|
| @@ -4652,13 +4651,13 @@ TEST(ContextVariables) {
|
| 1,
|
| 16,
|
| {
|
| - B(CallRuntime), U16(Runtime::kNewFunctionContext), //
|
| - R(closure), U8(1), //
|
| - B(PushContext), R(0), //
|
| - B(LdaSmi8), U8(1), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot), //
|
| - B(CreateClosure), U8(0), U8(0), //
|
| - B(Return), //
|
| + B(CallRuntime), U16(Runtime::kNewFunctionContext), //
|
| + R(closure), U8(1), //
|
| + B(PushContext), R(0), //
|
| + B(LdaSmi8), U8(1), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| + B(CreateClosure), U8(0), U8(0), //
|
| + B(Return), //
|
| },
|
| 1,
|
| {InstanceType::SHARED_FUNCTION_INFO_TYPE}},
|
| @@ -4667,15 +4666,15 @@ TEST(ContextVariables) {
|
| 1,
|
| 21,
|
| {
|
| - B(CallRuntime), U16(Runtime::kNewFunctionContext), //
|
| - R(closure), U8(1), //
|
| - B(PushContext), R(0), //
|
| - B(LdaSmi8), U8(1), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot), //
|
| - B(LdaSmi8), U8(2), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot + 1), //
|
| - B(CreateClosure), U8(0), U8(0), //
|
| - B(Return), //
|
| + B(CallRuntime), U16(Runtime::kNewFunctionContext), //
|
| + R(closure), U8(1), //
|
| + B(PushContext), R(0), //
|
| + B(LdaSmi8), U8(1), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| + B(LdaSmi8), U8(2), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot + 1), //
|
| + B(CreateClosure), U8(0), U8(0), //
|
| + B(Return), //
|
| },
|
| 1,
|
| {InstanceType::SHARED_FUNCTION_INFO_TYPE}},
|
| @@ -4692,7 +4691,7 @@ TEST(ContextVariables) {
|
| B(CreateClosure), U8(0), U8(0), //
|
| B(Star), R(1), //
|
| B(Call), R(1), R(2), U8(0), U8(vector->GetIndex(slot)), //
|
| - B(LdaContextSlot), R(0), U8(first_context_slot), //
|
| + B(LdaContextSlot), R(context), U8(first_context_slot), //
|
| B(Return), //
|
| },
|
| 1,
|
| @@ -4706,9 +4705,9 @@ TEST(ContextVariables) {
|
| R(closure), U8(1), //
|
| B(PushContext), R(0), //
|
| B(LdaTheHole), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(LdaSmi8), U8(1), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(LdaConstant), U8(0), //
|
| B(Star), R(2), //
|
| B(Ldar), R(closure), //
|
| @@ -4716,11 +4715,11 @@ TEST(ContextVariables) {
|
| B(CallRuntime), U16(Runtime::kPushBlockContext), R(2), U8(2), //
|
| B(PushContext), R(1), //
|
| B(LdaTheHole), //
|
| - B(StaContextSlot), R(1), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(LdaSmi8), U8(2), //
|
| - B(StaContextSlot), R(1), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(CreateClosure), U8(1), U8(0), //
|
| - B(PopContext), R(context), //
|
| + B(PopContext), R(0), //
|
| B(Return), //
|
| },
|
| 2,
|
| @@ -4739,22 +4738,22 @@ TEST(ContextVariables) {
|
| U8(1), //
|
| B(PushContext), R(0), //
|
| B(Ldar), THIS(1), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(CreateUnmappedArguments), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot + 1), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot + 1), //
|
| B(Ldar), R(new_target), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot + 2), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot + 2), //
|
| REPEAT_249(COMMA, //
|
| B(LdaZero), //
|
| - B(StaContextSlot), R(0), U8(wide_slot++)), //
|
| + B(StaContextSlot), R(context), U8(wide_slot++)), //
|
| B(LdaUndefined), //
|
| B(Star), R(2), //
|
| B(LdaGlobalStrict), U8(0), U8(1), //
|
| B(Star), R(1), //
|
| B(Call), R(1), R(2), U8(0), U8(0), //
|
| B(LdaSmi8), U8(100), //
|
| - B(StaContextSlotWide), R(0), U16(256), //
|
| - B(LdaContextSlotWide), R(0), U16(256), //
|
| + B(StaContextSlotWide), R(context), U16(256), //
|
| + B(LdaContextSlotWide), R(context), U16(256), //
|
| B(Return), //
|
| },
|
| 1,
|
| @@ -4774,6 +4773,7 @@ TEST(ContextParameters) {
|
| BytecodeGeneratorHelper helper;
|
|
|
| int closure = Register::function_closure().index();
|
| + int context = Register::current_context().index();
|
| int first_context_slot = Context::MIN_CONTEXT_SLOTS;
|
|
|
| ExpectedSnippet<InstanceType> snippets[] = {
|
| @@ -4782,13 +4782,13 @@ TEST(ContextParameters) {
|
| 2,
|
| 16,
|
| {
|
| - B(CallRuntime), U16(Runtime::kNewFunctionContext), //
|
| - R(closure), U8(1), //
|
| - B(PushContext), R(0), //
|
| - B(Ldar), R(helper.kLastParamIndex), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot), //
|
| - B(CreateClosure), U8(0), U8(0), //
|
| - B(Return), //
|
| + B(CallRuntime), U16(Runtime::kNewFunctionContext), //
|
| + R(closure), U8(1), //
|
| + B(PushContext), R(0), //
|
| + B(Ldar), R(helper.kLastParamIndex), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| + B(CreateClosure), U8(0), U8(0), //
|
| + B(Return), //
|
| },
|
| 1,
|
| {InstanceType::SHARED_FUNCTION_INFO_TYPE}},
|
| @@ -4797,15 +4797,15 @@ TEST(ContextParameters) {
|
| 2,
|
| 21,
|
| {
|
| - B(CallRuntime), U16(Runtime::kNewFunctionContext), //
|
| - R(closure), U8(1), //
|
| - B(PushContext), R(1), //
|
| - B(Ldar), R(helper.kLastParamIndex), //
|
| - B(StaContextSlot), R(1), U8(first_context_slot), //
|
| - B(CreateClosure), U8(0), U8(0), //
|
| - B(Star), R(0), //
|
| - B(LdaContextSlot), R(1), U8(first_context_slot), //
|
| - B(Return), //
|
| + B(CallRuntime), U16(Runtime::kNewFunctionContext), //
|
| + R(closure), U8(1), //
|
| + B(PushContext), R(1), //
|
| + B(Ldar), R(helper.kLastParamIndex), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| + B(CreateClosure), U8(0), U8(0), //
|
| + B(Star), R(0), //
|
| + B(LdaContextSlot), R(context), U8(first_context_slot), //
|
| + B(Return), //
|
| },
|
| 1,
|
| {InstanceType::SHARED_FUNCTION_INFO_TYPE}},
|
| @@ -4814,15 +4814,15 @@ TEST(ContextParameters) {
|
| 5,
|
| 21,
|
| {
|
| - B(CallRuntime), U16(Runtime::kNewFunctionContext), //
|
| - R(closure), U8(1), //
|
| - B(PushContext), R(0), //
|
| - B(Ldar), R(helper.kLastParamIndex - 3), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot + 1), //
|
| - B(Ldar), R(helper.kLastParamIndex -1), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot), //
|
| - B(CreateClosure), U8(0), U8(0), //
|
| - B(Return), //
|
| + B(CallRuntime), U16(Runtime::kNewFunctionContext), //
|
| + R(closure), U8(1), //
|
| + B(PushContext), R(0), //
|
| + B(Ldar), R(helper.kLastParamIndex - 3), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot + 1), //
|
| + B(Ldar), R(helper.kLastParamIndex -1), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| + B(CreateClosure), U8(0), U8(0), //
|
| + B(Return), //
|
| },
|
| 1,
|
| {InstanceType::SHARED_FUNCTION_INFO_TYPE}},
|
| @@ -4831,13 +4831,13 @@ TEST(ContextParameters) {
|
| 1,
|
| 16,
|
| {
|
| - B(CallRuntime), U16(Runtime::kNewFunctionContext), //
|
| - R(closure), U8(1), //
|
| - B(PushContext), R(0), //
|
| - B(Ldar), R(helper.kLastParamIndex), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot), //
|
| - B(CreateClosure), U8(0), U8(0), //
|
| - B(Return), //
|
| + B(CallRuntime), U16(Runtime::kNewFunctionContext), //
|
| + R(closure), U8(1), //
|
| + B(PushContext), R(0), //
|
| + B(Ldar), R(helper.kLastParamIndex), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| + B(CreateClosure), U8(0), U8(0), //
|
| + B(Return), //
|
| },
|
| 1,
|
| {InstanceType::SHARED_FUNCTION_INFO_TYPE}},
|
| @@ -4855,7 +4855,7 @@ TEST(OuterContextVariables) {
|
| InitializedHandleScope handle_scope;
|
| BytecodeGeneratorHelper helper;
|
|
|
| - int context = Register::function_context().index();
|
| + int context = Register::current_context().index();
|
| int first_context_slot = Context::MIN_CONTEXT_SLOTS;
|
|
|
| ExpectedSnippet<InstanceType> snippets[] = {
|
| @@ -4931,6 +4931,7 @@ TEST(CountOperators) {
|
| i::NewTypeFeedbackVector(helper.isolate(), &store_feedback_spec);
|
|
|
| int closure = Register::function_closure().index();
|
| + int context = Register::current_context().index();
|
| int first_context_slot = Context::MIN_CONTEXT_SLOTS;
|
|
|
| int object_literal_flags =
|
| @@ -5084,13 +5085,13 @@ TEST(CountOperators) {
|
| U8(1), //
|
| B(PushContext), R(1), //
|
| B(LdaSmi8), U8(1), //
|
| - B(StaContextSlot), R(1), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(CreateClosure), U8(0), U8(0), //
|
| B(Star), R(0), //
|
| - B(LdaContextSlot), R(1), U8(first_context_slot), //
|
| + B(LdaContextSlot), R(context), U8(first_context_slot), //
|
| B(ToNumber), //
|
| B(Inc), //
|
| - B(StaContextSlot), R(1), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(Return), //
|
| },
|
| 1,
|
| @@ -5104,14 +5105,14 @@ TEST(CountOperators) {
|
| U8(1), //
|
| B(PushContext), R(1), //
|
| B(LdaSmi8), U8(1), //
|
| - B(StaContextSlot), R(1), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(CreateClosure), U8(0), U8(0), //
|
| B(Star), R(0), //
|
| - B(LdaContextSlot), R(1), U8(first_context_slot), //
|
| + B(LdaContextSlot), R(context), U8(first_context_slot), //
|
| B(ToNumber), //
|
| B(Star), R(2), //
|
| B(Dec), //
|
| - B(StaContextSlot), R(1), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(Ldar), R(2), //
|
| B(Return), //
|
| },
|
| @@ -5235,6 +5236,7 @@ TEST(CompoundExpressions) {
|
| Zone zone;
|
|
|
| int closure = Register::function_closure().index();
|
| + int context = Register::current_context().index();
|
| int first_context_slot = Context::MIN_CONTEXT_SLOTS;
|
|
|
| FeedbackVectorSpec feedback_spec(&zone);
|
| @@ -5325,13 +5327,13 @@ TEST(CompoundExpressions) {
|
| U8(1), //
|
| B(PushContext), R(0), //
|
| B(LdaSmi8), U8(1), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(CreateClosure), U8(0), U8(0), //
|
| - B(LdaContextSlot), R(0), U8(first_context_slot), //
|
| + B(LdaContextSlot), R(context), U8(first_context_slot), //
|
| B(Star), R(1), //
|
| B(LdaSmi8), U8(24), //
|
| B(BitwiseOr), R(1), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(LdaUndefined), //
|
| B(Return), //
|
| },
|
| @@ -5404,6 +5406,7 @@ TEST(CreateArguments) {
|
| Zone zone;
|
|
|
| int closure = Register::function_closure().index();
|
| + int context = Register::current_context().index();
|
| int first_context_slot = Context::MIN_CONTEXT_SLOTS;
|
|
|
| FeedbackVectorSpec feedback_spec(&zone);
|
| @@ -5452,7 +5455,7 @@ TEST(CreateArguments) {
|
| U8(1), //
|
| B(PushContext), R(1), //
|
| B(Ldar), R(BytecodeGeneratorHelper::kLastParamIndex), //
|
| - B(StaContextSlot), R(1), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(CreateMappedArguments), //
|
| B(Star), R(0), //
|
| B(Star), R(2), //
|
| @@ -5469,11 +5472,11 @@ TEST(CreateArguments) {
|
| U8(1), //
|
| B(PushContext), R(1), //
|
| B(Ldar), R(BytecodeGeneratorHelper::kLastParamIndex - 2), //
|
| - B(StaContextSlot), R(1), U8(first_context_slot + 2), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot + 2), //
|
| B(Ldar), R(BytecodeGeneratorHelper::kLastParamIndex - 1), //
|
| - B(StaContextSlot), R(1), U8(first_context_slot + 1), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot + 1), //
|
| B(Ldar), R(BytecodeGeneratorHelper::kLastParamIndex), //
|
| - B(StaContextSlot), R(1), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(CreateMappedArguments), //
|
| B(Star), R(0), //
|
| B(Return), //
|
| @@ -6793,6 +6796,7 @@ TEST(Eval) {
|
| Zone zone;
|
|
|
| int closure = Register::function_closure().index();
|
| + int context = Register::current_context().index();
|
| int new_target = Register::new_target().index();
|
|
|
| int first_context_slot = Context::MIN_CONTEXT_SLOTS;
|
| @@ -6807,12 +6811,12 @@ TEST(Eval) {
|
| U8(1), //
|
| B(PushContext), R(0), //
|
| B(Ldar), THIS(1), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(CreateMappedArguments), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot + 1), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot + 1), //
|
| B(Ldar), R(new_target), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot + 2), //
|
| - B(Mov), R(0), R(3), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot + 2), //
|
| + B(Mov), R(context), R(3), //
|
| B(LdaConstant), U8(0), //
|
| B(Star), R(4), //
|
| B(CallRuntimeForPair), U16(Runtime::kLoadLookupSlot), //
|
| @@ -6849,6 +6853,7 @@ TEST(LookupSlot) {
|
| BytecodeGeneratorHelper helper;
|
|
|
| int closure = Register::function_closure().index();
|
| + int context = Register::current_context().index();
|
| int first_context_slot = Context::MIN_CONTEXT_SLOTS;
|
| int new_target = Register::new_target().index();
|
|
|
| @@ -6862,12 +6867,12 @@ TEST(LookupSlot) {
|
| U8(1), //
|
| B(PushContext), R(0), //
|
| B(Ldar), THIS(1), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(CreateMappedArguments), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot + 1), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot + 1), //
|
| B(Ldar), R(new_target), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot + 2), //
|
| - B(Mov), R(0), R(3), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot + 2), //
|
| + B(Mov), R(context), R(3), //
|
| B(LdaConstant), U8(0), //
|
| B(Star), R(4), //
|
| B(CallRuntimeForPair), U16(Runtime::kLoadLookupSlot), //
|
| @@ -6899,12 +6904,12 @@ TEST(LookupSlot) {
|
| U8(1), //
|
| B(PushContext), R(0), //
|
| B(Ldar), THIS(1), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(CreateMappedArguments), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot + 1), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot + 1), //
|
| B(Ldar), R(new_target), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot + 2), //
|
| - B(Mov), R(0), R(3), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot + 2), //
|
| + B(Mov), R(context), R(3), //
|
| B(LdaConstant), U8(0), //
|
| B(Star), R(4), //
|
| B(CallRuntimeForPair), U16(Runtime::kLoadLookupSlot), //
|
| @@ -6937,14 +6942,14 @@ TEST(LookupSlot) {
|
| U8(1), //
|
| B(PushContext), R(0), //
|
| B(Ldar), THIS(1), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot), //
|
| B(CreateMappedArguments), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot + 1), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot + 1), //
|
| B(Ldar), R(new_target), //
|
| - B(StaContextSlot), R(0), U8(first_context_slot + 2), //
|
| + B(StaContextSlot), R(context), U8(first_context_slot + 2), //
|
| B(LdaSmi8), U8(20), //
|
| B(StaLookupSlotSloppy), U8(0), //
|
| - B(Mov), R(0), R(3), //
|
| + B(Mov), R(context), R(3), //
|
| B(LdaConstant), U8(1), //
|
| B(Star), R(4), //
|
| B(CallRuntimeForPair), U16(Runtime::kLoadLookupSlot), //
|
| @@ -6990,6 +6995,7 @@ TEST(CallLookupSlot) {
|
| i::NewTypeFeedbackVector(helper.isolate(), &feedback_spec);
|
|
|
| int closure = Register::function_closure().index();
|
| + int context = Register::current_context().index();
|
| int new_target = Register::new_target().index();
|
|
|
| ExpectedSnippet<InstanceType> snippets[] = {
|
| @@ -7002,14 +7008,14 @@ TEST(CallLookupSlot) {
|
| U8(1), //
|
| B(PushContext), R(0), //
|
| B(Ldar), THIS(1), //
|
| - B(StaContextSlot), R(0), U8(4), //
|
| + B(StaContextSlot), R(context), U8(4), //
|
| B(CreateMappedArguments), //
|
| - B(StaContextSlot), R(0), U8(5), //
|
| + B(StaContextSlot), R(context), U8(5), //
|
| B(Ldar), R(new_target), //
|
| - B(StaContextSlot), R(0), U8(6), //
|
| + B(StaContextSlot), R(context), U8(6), //
|
| B(CreateClosure), U8(0), U8(0), //
|
| B(StaLookupSlotSloppy), U8(1), //
|
| - B(Mov), R(0), R(3), //
|
| + B(Mov), R(context), R(3), //
|
| B(LdaConstant), U8(2), //
|
| B(Star), R(4), //
|
| B(CallRuntimeForPair), U16(Runtime::kLoadLookupSlot), //
|
| @@ -7027,7 +7033,7 @@ TEST(CallLookupSlot) {
|
| U8(5), //
|
| B(Star), R(1), //
|
| B(Call), R(1), R(2), U8(1), U8(0), //
|
| - B(Mov), R(0), R(3), //
|
| + B(Mov), R(context), R(3), //
|
| B(LdaConstant), U8(1), //
|
| B(Star), R(4), //
|
| B(CallRuntimeForPair), U16(Runtime::kLoadLookupSlot), //
|
|
|