Skip to content

Commit

Permalink
Emit parameters before vars/functions
Browse files Browse the repository at this point in the history
Summary:
This change makes hermes closer to the spec by emitting parameters
before vars/functions

Reviewed By: mattbfb

Differential Revision: D39185819

fbshipit-source-id: 3a302f5a88bbfaec153dbfc3e89fea164755984d
  • Loading branch information
jpporto authored and facebook-github-bot committed Sep 9, 2022
1 parent d0dcefc commit dd986f6
Show file tree
Hide file tree
Showing 32 changed files with 293 additions and 293 deletions.
33 changes: 17 additions & 16 deletions lib/IRGen/ESTreeIRGen-func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,23 @@ void ESTreeIRGen::emitFunctionPrologue(
// unused.
curFunction()->createArgumentsInst = Builder.createCreateArgumentsInst();

// Always create the "this" parameter. It needs to be created before we
// initialized the ES5 capture state.
Builder.createParameter(newFunc, "this");

if (doInitES5CaptureState != InitES5CaptureState::No) {
initCaptureStateInES5FunctionHelper();
}

if (doEmitParameters != DoEmitParameters::No) {
// Create function parameters, register them in the scope, and initialize
// them with their income values.
emitParameters(funcNode);
} else {
newFunc->setExpectedParamCountIncludingThis(
countExpectedArgumentsIncludingThis(funcNode));
}

// Create variable declarations for each of the hoisted variables and
// functions. Initialize only the variables to undefined.
for (auto decl : semInfo->varDecls) {
Expand All @@ -513,22 +530,6 @@ void ESTreeIRGen::emitFunctionPrologue(
newFunc, VarDecl::Kind::Var, getNameFieldFromID(fd->_id));
}

// Always create the "this" parameter. It needs to be created before we
// initialized the ES5 capture state.
Builder.createParameter(newFunc, "this");

if (doInitES5CaptureState != InitES5CaptureState::No)
initCaptureStateInES5FunctionHelper();

// Construct the parameter list. Create function parameters and register
// them in the scope.
if (doEmitParameters == DoEmitParameters::Yes) {
emitParameters(funcNode);
} else {
newFunc->setExpectedParamCountIncludingThis(
countExpectedArgumentsIncludingThis(funcNode));
}

// Generate the code for import declarations before generating the rest of the
// body.
for (auto importDecl : semInfo->imports) {
Expand Down
12 changes: 6 additions & 6 deletions test/BCGen/HBC/es6/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ function *args() {
// CHECK-NEXT: ResumeGenerator r7, r6
// CHECK-NEXT: Mov r8, r6
// CHECK-NEXT: JmpTrue L1, r8
// CHECK-NEXT: StoreNPToEnvironment r0, 0, r2
// CHECK-NEXT: StoreToEnvironment r0, 1, r1
// CHECK-NEXT: StoreNPToEnvironment r0, 0, r3
// CHECK-NEXT: StoreToEnvironment r0, 0, r1
// CHECK-NEXT: StoreNPToEnvironment r0, 1, r2
// CHECK-NEXT: StoreNPToEnvironment r0, 1, r3
// CHECK-NEXT: TryGetById r6, r5, 1, "y"
// CHECK-NEXT: JmpFalse L2, r6
// CHECK-NEXT:L5:
// CHECK-NEXT: LoadFromEnvironment r6, r0, 1
// CHECK-NEXT: LoadFromEnvironment r8, r0, 0
// CHECK-NEXT: LoadFromEnvironment r6, r0, 0
// CHECK-NEXT: LoadFromEnvironment r8, r0, 1
// CHECK-NEXT: ToNumeric r9, r8
// CHECK-NEXT: Inc r10, r9
// CHECK-NEXT: StoreToEnvironment r0, 0, r10
// CHECK-NEXT: StoreToEnvironment r0, 1, r10
// CHECK-NEXT: GetByVal r11, r6, r9
// CHECK-NEXT: SaveGenerator L3
// CHECK-NEXT: Ret r11
Expand Down
12 changes: 6 additions & 6 deletions test/BCGen/HBC/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ function daa(a) {
// CHECK-NEXT:function_end

// CHECK:function foo(a)
// CHECK-NEXT:frame = [b, a]
// CHECK-NEXT:frame = [a, b]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = HBCCreateEnvironmentInst
// CHECK-NEXT: %1 = HBCLoadParamInst 1 : number
// CHECK-NEXT: %2 = HBCLoadConstInst undefined : undefined
// CHECK-NEXT: %3 = HBCGetGlobalObjectInst
// CHECK-NEXT: %4 = HBCStoreToEnvironmentInst %0, %2 : undefined, [b]
// CHECK-NEXT: %5 = HBCStoreToEnvironmentInst %0, %1, [a]
// CHECK-NEXT: %4 = HBCStoreToEnvironmentInst %0, %1, [a]
// CHECK-NEXT: %5 = HBCStoreToEnvironmentInst %0, %2 : undefined, [b]
// CHECK-NEXT: %6 = LoadPropertyInst %3 : object, "bar" : string
// CHECK-NEXT: %7 = HBCLoadFromEnvironmentInst %0, [a]
// CHECK-NEXT: %8 = CallInst %6, %2 : undefined, %7
Expand All @@ -85,14 +85,14 @@ function daa(a) {
// CHECK-NEXT:function_end

// CHECK:function daa(a)
// CHECK-NEXT:frame = [b, daa_capture, a]
// CHECK-NEXT:frame = [a, b, daa_capture]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = HBCCreateEnvironmentInst
// CHECK-NEXT: %1 = HBCLoadParamInst 1 : number
// CHECK-NEXT: %2 = HBCLoadConstInst undefined : undefined
// CHECK-NEXT: %3 = HBCLoadConstInst 1 : number
// CHECK-NEXT: %4 = HBCStoreToEnvironmentInst %0, %2 : undefined, [b]
// CHECK-NEXT: %5 = HBCStoreToEnvironmentInst %0, %1, [a]
// CHECK-NEXT: %4 = HBCStoreToEnvironmentInst %0, %1, [a]
// CHECK-NEXT: %5 = HBCStoreToEnvironmentInst %0, %2 : undefined, [b]
// CHECK-NEXT: %6 = HBCCreateFunctionInst %daa_capture(), %0
// CHECK-NEXT: %7 = HBCStoreToEnvironmentInst %0, %6 : closure, [daa_capture]
// CHECK-NEXT: %8 = HBCLoadFromEnvironmentInst %0, [a]
Expand Down
24 changes: 12 additions & 12 deletions test/IRGen/__proto__-shorthand.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ function protoShorthandMix2(func) {
// CHECK-NEXT:function_end

// CHECK:function protoShorthand(func)
// CHECK-NEXT:frame = [__proto__, func]
// CHECK-NEXT:frame = [func, __proto__]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = StoreFrameInst undefined : undefined, [__proto__]
// CHECK-NEXT: %1 = StoreFrameInst %func, [func]
// CHECK-NEXT: %0 = StoreFrameInst %func, [func]
// CHECK-NEXT: %1 = StoreFrameInst undefined : undefined, [__proto__]
// CHECK-NEXT: %2 = StoreFrameInst 42 : number, [__proto__]
// CHECK-NEXT: %3 = LoadFrameInst [__proto__]
// CHECK-NEXT: %4 = AllocObjectLiteralInst "__proto__" : string, %3, "a" : string, 2 : number, "b" : string, 3 : number
Expand All @@ -69,10 +69,10 @@ function protoShorthandMix2(func) {
// CHECK-NEXT:function_end

// CHECK:function protoShorthandDup(func)
// CHECK-NEXT:frame = [__proto__, func]
// CHECK-NEXT:frame = [func, __proto__]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = StoreFrameInst undefined : undefined, [__proto__]
// CHECK-NEXT: %1 = StoreFrameInst %func, [func]
// CHECK-NEXT: %0 = StoreFrameInst %func, [func]
// CHECK-NEXT: %1 = StoreFrameInst undefined : undefined, [__proto__]
// CHECK-NEXT: %2 = StoreFrameInst 42 : number, [__proto__]
// CHECK-NEXT: %3 = AllocObjectInst 1 : number, empty
// CHECK-NEXT: %4 = LoadFrameInst [__proto__]
Expand All @@ -85,10 +85,10 @@ function protoShorthandMix2(func) {
// CHECK-NEXT:function_end

// CHECK:function protoShorthandMix1(func)
// CHECK-NEXT:frame = [__proto__, func]
// CHECK-NEXT:frame = [func, __proto__]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = StoreFrameInst undefined : undefined, [__proto__]
// CHECK-NEXT: %1 = StoreFrameInst %func, [func]
// CHECK-NEXT: %0 = StoreFrameInst %func, [func]
// CHECK-NEXT: %1 = StoreFrameInst undefined : undefined, [__proto__]
// CHECK-NEXT: %2 = StoreFrameInst 42 : number, [__proto__]
// CHECK-NEXT: %3 = AllocObjectInst 1 : number, empty
// CHECK-NEXT: %4 = LoadFrameInst [__proto__]
Expand All @@ -101,10 +101,10 @@ function protoShorthandMix2(func) {
// CHECK-NEXT:function_end

// CHECK:function protoShorthandMix2(func)
// CHECK-NEXT:frame = [__proto__, func]
// CHECK-NEXT:frame = [func, __proto__]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = StoreFrameInst undefined : undefined, [__proto__]
// CHECK-NEXT: %1 = StoreFrameInst %func, [func]
// CHECK-NEXT: %0 = StoreFrameInst %func, [func]
// CHECK-NEXT: %1 = StoreFrameInst undefined : undefined, [__proto__]
// CHECK-NEXT: %2 = StoreFrameInst 42 : number, [__proto__]
// CHECK-NEXT: %3 = AllocObjectInst 0 : number, empty
// CHECK-NEXT: %4 = AllocObjectInst 1 : number, %3 : object
Expand Down
8 changes: 4 additions & 4 deletions test/IRGen/array_object.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ function foo(param) {
// CHECK-NEXT:function_end

// CHECK:function foo(param)
// CHECK-NEXT:frame = [obj, foo, param]
// CHECK-NEXT:frame = [param, obj, foo]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = StoreFrameInst undefined : undefined, [obj]
// CHECK-NEXT: %1 = StoreFrameInst undefined : undefined, [foo]
// CHECK-NEXT: %2 = StoreFrameInst %param, [param]
// CHECK-NEXT: %0 = StoreFrameInst %param, [param]
// CHECK-NEXT: %1 = StoreFrameInst undefined : undefined, [obj]
// CHECK-NEXT: %2 = StoreFrameInst undefined : undefined, [foo]
// CHECK-NEXT: %3 = LoadFrameInst [param]
// CHECK-NEXT: %4 = AllocObjectLiteralInst "1" : string, 2 : number, "key" : string, %3
// CHECK-NEXT: %5 = StoreFrameInst %4 : object, [obj]
Expand Down
83 changes: 41 additions & 42 deletions test/IRGen/async-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ var simpleAsyncFE = async function () {
// CHECK-NEXT:function_end

// CHECK:function ?anon_0_?anon_0_nonSimpleArrayDestructuring(?anon_2_param)
// CHECK-NEXT:frame = [x, x]
// CHECK-NEXT:frame = [x]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = StartGeneratorInst
// CHECK-NEXT: %1 = AllocStackInst $?anon_0_isReturn_prologue
Expand All @@ -161,60 +161,59 @@ var simpleAsyncFE = async function () {
// CHECK-NEXT: %4 = CondBranchInst %3, %BB1, %BB2
// CHECK-NEXT:%BB2:
// CHECK-NEXT: %5 = AllocStackInst $?anon_1_isReturn_entry
// CHECK-NEXT: %6 = StoreFrameInst undefined : undefined, [x]
// CHECK-NEXT: %7 = AllocStackInst $?anon_3_iter
// CHECK-NEXT: %8 = AllocStackInst $?anon_4_sourceOrNext
// CHECK-NEXT: %9 = StoreStackInst %?anon_2_param, %8
// CHECK-NEXT: %10 = IteratorBeginInst %8
// CHECK-NEXT: %11 = StoreStackInst %10, %7
// CHECK-NEXT: %12 = AllocStackInst $?anon_5_iterDone
// CHECK-NEXT: %13 = StoreStackInst undefined : undefined, %12
// CHECK-NEXT: %14 = AllocStackInst $?anon_6_iterValue
// CHECK-NEXT: %15 = StoreStackInst undefined : undefined, %14
// CHECK-NEXT: %16 = BranchInst %BB3
// CHECK-NEXT: %6 = AllocStackInst $?anon_3_iter
// CHECK-NEXT: %7 = AllocStackInst $?anon_4_sourceOrNext
// CHECK-NEXT: %8 = StoreStackInst %?anon_2_param, %7
// CHECK-NEXT: %9 = IteratorBeginInst %7
// CHECK-NEXT: %10 = StoreStackInst %9, %6
// CHECK-NEXT: %11 = AllocStackInst $?anon_5_iterDone
// CHECK-NEXT: %12 = StoreStackInst undefined : undefined, %11
// CHECK-NEXT: %13 = AllocStackInst $?anon_6_iterValue
// CHECK-NEXT: %14 = StoreStackInst undefined : undefined, %13
// CHECK-NEXT: %15 = BranchInst %BB3
// CHECK-NEXT:%BB1:
// CHECK-NEXT: %17 = ReturnInst %2
// CHECK-NEXT: %16 = ReturnInst %2
// CHECK-NEXT:%BB4:
// CHECK-NEXT: %18 = ResumeGeneratorInst %5
// CHECK-NEXT: %19 = LoadStackInst %5
// CHECK-NEXT: %20 = CondBranchInst %19, %BB5, %BB6
// CHECK-NEXT: %17 = ResumeGeneratorInst %5
// CHECK-NEXT: %18 = LoadStackInst %5
// CHECK-NEXT: %19 = CondBranchInst %18, %BB5, %BB6
// CHECK-NEXT:%BB3:
// CHECK-NEXT: %21 = IteratorNextInst %7, %8
// CHECK-NEXT: %22 = LoadStackInst %7
// CHECK-NEXT: %23 = BinaryOperatorInst '===', %22, undefined : undefined
// CHECK-NEXT: %24 = StoreStackInst %23, %12
// CHECK-NEXT: %25 = CondBranchInst %23, %BB7, %BB8
// CHECK-NEXT: %20 = IteratorNextInst %6, %7
// CHECK-NEXT: %21 = LoadStackInst %6
// CHECK-NEXT: %22 = BinaryOperatorInst '===', %21, undefined : undefined
// CHECK-NEXT: %23 = StoreStackInst %22, %11
// CHECK-NEXT: %24 = CondBranchInst %22, %BB7, %BB8
// CHECK-NEXT:%BB8:
// CHECK-NEXT: %26 = StoreStackInst %21, %14
// CHECK-NEXT: %27 = BranchInst %BB7
// CHECK-NEXT: %25 = StoreStackInst %20, %13
// CHECK-NEXT: %26 = BranchInst %BB7
// CHECK-NEXT:%BB7:
// CHECK-NEXT: %28 = LoadStackInst %14
// CHECK-NEXT: %29 = StoreFrameInst %28, [x]
// CHECK-NEXT: %30 = LoadStackInst %12
// CHECK-NEXT: %31 = CondBranchInst %30, %BB9, %BB10
// CHECK-NEXT: %27 = LoadStackInst %13
// CHECK-NEXT: %28 = StoreFrameInst %27, [x]
// CHECK-NEXT: %29 = LoadStackInst %11
// CHECK-NEXT: %30 = CondBranchInst %29, %BB9, %BB10
// CHECK-NEXT:%BB10:
// CHECK-NEXT: %32 = IteratorCloseInst %7, false : boolean
// CHECK-NEXT: %33 = BranchInst %BB9
// CHECK-NEXT: %31 = IteratorCloseInst %6, false : boolean
// CHECK-NEXT: %32 = BranchInst %BB9
// CHECK-NEXT:%BB9:
// CHECK-NEXT: %34 = SaveAndYieldInst undefined : undefined, %BB4
// CHECK-NEXT: %33 = SaveAndYieldInst undefined : undefined, %BB4
// CHECK-NEXT:%BB6:
// CHECK-NEXT: %35 = LoadFrameInst [x]
// CHECK-NEXT: %36 = AllocStackInst $?anon_8_isReturn
// CHECK-NEXT: %37 = SaveAndYieldInst %35, %BB11
// CHECK-NEXT: %34 = LoadFrameInst [x]
// CHECK-NEXT: %35 = AllocStackInst $?anon_8_isReturn
// CHECK-NEXT: %36 = SaveAndYieldInst %34, %BB11
// CHECK-NEXT:%BB5:
// CHECK-NEXT: %38 = ReturnInst %18
// CHECK-NEXT: %37 = ReturnInst %17
// CHECK-NEXT:%BB11:
// CHECK-NEXT: %39 = ResumeGeneratorInst %36
// CHECK-NEXT: %40 = LoadStackInst %36
// CHECK-NEXT: %41 = CondBranchInst %40, %BB12, %BB13
// CHECK-NEXT: %38 = ResumeGeneratorInst %35
// CHECK-NEXT: %39 = LoadStackInst %35
// CHECK-NEXT: %40 = CondBranchInst %39, %BB12, %BB13
// CHECK-NEXT:%BB13:
// CHECK-NEXT: %42 = StoreFrameInst %39, [x]
// CHECK-NEXT: %43 = LoadFrameInst [x]
// CHECK-NEXT: %44 = ReturnInst %43
// CHECK-NEXT: %41 = StoreFrameInst %38, [x]
// CHECK-NEXT: %42 = LoadFrameInst [x]
// CHECK-NEXT: %43 = ReturnInst %42
// CHECK-NEXT:%BB12:
// CHECK-NEXT: %45 = ReturnInst %39
// CHECK-NEXT: %44 = ReturnInst %38
// CHECK-NEXT:%BB14:
// CHECK-NEXT: %46 = ReturnInst undefined : undefined
// CHECK-NEXT: %45 = ReturnInst undefined : undefined
// CHECK-NEXT:function_end

// CHECK:function simpleAsyncFE()
Expand Down
6 changes: 3 additions & 3 deletions test/IRGen/do_while.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ function for_while_do_mixed_test(cond) {
// CHECK-NEXT:function_end

// CHECK:function for_while_do_mixed_test(cond)
// CHECK-NEXT:frame = [i, cond]
// CHECK-NEXT:frame = [cond, i]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = StoreFrameInst undefined : undefined, [i]
// CHECK-NEXT: %1 = StoreFrameInst %cond, [cond]
// CHECK-NEXT: %0 = StoreFrameInst %cond, [cond]
// CHECK-NEXT: %1 = StoreFrameInst undefined : undefined, [i]
// CHECK-NEXT: %2 = StoreFrameInst 0 : number, [i]
// CHECK-NEXT: %3 = BranchInst %BB1
// CHECK-NEXT:%BB2:
Expand Down
24 changes: 12 additions & 12 deletions test/IRGen/es6/arrow-arguments.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ function bar() {
// CHECK-NEXT:function_end

// CHECK:function foo()
// CHECK-NEXT:frame = [arrow1, ?anon_0_this, ?anon_1_new.target, ?anon_2_arguments]
// CHECK-NEXT:frame = [?anon_0_this, ?anon_1_new.target, ?anon_2_arguments, arrow1]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = CreateArgumentsInst
// CHECK-NEXT: %1 = StoreFrameInst undefined : undefined, [arrow1]
// CHECK-NEXT: %2 = StoreFrameInst %this, [?anon_0_this]
// CHECK-NEXT: %3 = GetNewTargetInst
// CHECK-NEXT: %4 = StoreFrameInst %3, [?anon_1_new.target]
// CHECK-NEXT: %5 = StoreFrameInst %0 : object, [?anon_2_arguments]
// CHECK-NEXT: %1 = StoreFrameInst %this, [?anon_0_this]
// CHECK-NEXT: %2 = GetNewTargetInst
// CHECK-NEXT: %3 = StoreFrameInst %2, [?anon_1_new.target]
// CHECK-NEXT: %4 = StoreFrameInst %0 : object, [?anon_2_arguments]
// CHECK-NEXT: %5 = StoreFrameInst undefined : undefined, [arrow1]
// CHECK-NEXT: %6 = CreateFunctionInst %arrow1()
// CHECK-NEXT: %7 = StoreFrameInst %6 : closure, [arrow1]
// CHECK-NEXT: %8 = LoadFrameInst [?anon_2_arguments]
Expand Down Expand Up @@ -129,14 +129,14 @@ function bar() {
// CHECK-NEXT:function_end

// CHECK:function inner()
// CHECK-NEXT:frame = [arrow3, ?anon_0_this, ?anon_1_new.target, ?anon_2_arguments]
// CHECK-NEXT:frame = [?anon_0_this, ?anon_1_new.target, ?anon_2_arguments, arrow3]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = CreateArgumentsInst
// CHECK-NEXT: %1 = StoreFrameInst undefined : undefined, [arrow3]
// CHECK-NEXT: %2 = StoreFrameInst %this, [?anon_0_this]
// CHECK-NEXT: %3 = GetNewTargetInst
// CHECK-NEXT: %4 = StoreFrameInst %3, [?anon_1_new.target]
// CHECK-NEXT: %5 = StoreFrameInst %0 : object, [?anon_2_arguments]
// CHECK-NEXT: %1 = StoreFrameInst %this, [?anon_0_this]
// CHECK-NEXT: %2 = GetNewTargetInst
// CHECK-NEXT: %3 = StoreFrameInst %2, [?anon_1_new.target]
// CHECK-NEXT: %4 = StoreFrameInst %0 : object, [?anon_2_arguments]
// CHECK-NEXT: %5 = StoreFrameInst undefined : undefined, [arrow3]
// CHECK-NEXT: %6 = LoadFrameInst [?anon_2_arguments]
// CHECK-NEXT: %7 = LoadPropertyInst %6, 0 : number
// CHECK-NEXT: %8 = StorePropertyInst %7, globalObject : object, "dummy" : string
Expand Down
22 changes: 11 additions & 11 deletions test/IRGen/es6/arrow-function-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ function outer2() {
// CHECK-NEXT:function_end

// CHECK:function outer1()
// CHECK-NEXT:frame = [innerArrow1, innerArrow2, ?anon_0_this, ?anon_1_new.target]
// CHECK-NEXT:frame = [?anon_0_this, ?anon_1_new.target, innerArrow1, innerArrow2]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = StoreFrameInst undefined : undefined, [innerArrow1]
// CHECK-NEXT: %1 = StoreFrameInst undefined : undefined, [innerArrow2]
// CHECK-NEXT: %2 = StoreFrameInst %this, [?anon_0_this]
// CHECK-NEXT: %3 = GetNewTargetInst
// CHECK-NEXT: %4 = StoreFrameInst %3, [?anon_1_new.target]
// CHECK-NEXT: %0 = StoreFrameInst %this, [?anon_0_this]
// CHECK-NEXT: %1 = GetNewTargetInst
// CHECK-NEXT: %2 = StoreFrameInst %1, [?anon_1_new.target]
// CHECK-NEXT: %3 = StoreFrameInst undefined : undefined, [innerArrow1]
// CHECK-NEXT: %4 = StoreFrameInst undefined : undefined, [innerArrow2]
// CHECK-NEXT: %5 = CreateFunctionInst %innerArrow1()
// CHECK-NEXT: %6 = StoreFrameInst %5 : closure, [innerArrow1]
// CHECK-NEXT: %7 = CreateFunctionInst %innerArrow2()
Expand Down Expand Up @@ -75,12 +75,12 @@ function outer2() {
// CHECK-NEXT:function_end

// CHECK:function outer2()
// CHECK-NEXT:frame = [innerArrow4, inner3, ?anon_0_this, ?anon_1_new.target]
// CHECK-NEXT:frame = [?anon_0_this, ?anon_1_new.target, innerArrow4, inner3]
// CHECK-NEXT:%BB0:
// CHECK-NEXT: %0 = StoreFrameInst undefined : undefined, [innerArrow4]
// CHECK-NEXT: %1 = StoreFrameInst %this, [?anon_0_this]
// CHECK-NEXT: %2 = GetNewTargetInst
// CHECK-NEXT: %3 = StoreFrameInst %2, [?anon_1_new.target]
// CHECK-NEXT: %0 = StoreFrameInst %this, [?anon_0_this]
// CHECK-NEXT: %1 = GetNewTargetInst
// CHECK-NEXT: %2 = StoreFrameInst %1, [?anon_1_new.target]
// CHECK-NEXT: %3 = StoreFrameInst undefined : undefined, [innerArrow4]
// CHECK-NEXT: %4 = CreateFunctionInst %inner3()
// CHECK-NEXT: %5 = StoreFrameInst %4 : closure, [inner3]
// CHECK-NEXT: %6 = CreateFunctionInst %innerArrow4()
Expand Down
Loading

0 comments on commit dd986f6

Please sign in to comment.