From 20b13b96f49c6819f6090f17a5ec29d3faec45c6 Mon Sep 17 00:00:00 2001 From: Neil Dhar Date: Fri, 26 Jul 2024 23:30:50 -0700 Subject: [PATCH] Recycle block local registers in fast pass (#1448) Summary: Original Author: neildhar@meta.com Original Git: 6b69a06fc4a498ac467b590985515100c63313c3 Original Reviewed By: avp Original Revision: D59072005 The register allocator has the ability to honour a memory limit that is proportional to the product of the number of instructions and basic blocks in the function being allocated. Unfortunately, functions that hit this limit by definition have a lot of instructions Even in the most degenerate case where every block has one instruction, you need 4000 instructions to hit the 10M limit. This diff tries to improve the quality of generated code in cases where most values are used within the basic block they are defined in. In such cases, we currently make the register available after the end of the block. With this diff, the registers become available after their last use in the block. This is useful for functions with extremely large basic blocks, where the current approach would end up allocating a huge number of registers since the registers cannot be used within the same block. Closes #1448 Reviewed By: avp Differential Revision: D60241766 fbshipit-source-id: 5196333862517cd546d675cf8fe005eb1ed5a790 --- include/hermes/BCGen/RegAlloc.h | 6 +- lib/BCGen/RegAlloc.cpp | 89 ++-- test/BCGen/HBC/async-function.js | 241 +++++------ test/BCGen/HBC/debug_info.js | 2 +- test/BCGen/HBC/es6/generator.js | 145 +++---- test/BCGen/HBC/es6/spread-arguments.js | 74 ++-- test/BCGen/HBC/unique-lit.js | 28 +- .../es6/block-scoping-top-level-scope.js | 404 +++++++++--------- test/IRGen/instance_of.js | 32 +- .../flow/declare-module-import-allowed.js | 72 ++-- test/RA/assign_to_argument.js | 26 +- test/RA/callee.js | 60 +-- 12 files changed, 600 insertions(+), 579 deletions(-) diff --git a/include/hermes/BCGen/RegAlloc.h b/include/hermes/BCGen/RegAlloc.h index 3f759e14ba8..6476e52381b 100644 --- a/include/hermes/BCGen/RegAlloc.h +++ b/include/hermes/BCGen/RegAlloc.h @@ -384,9 +384,9 @@ class RegisterAllocator { /// predecessor blocks. void lowerPhis(ArrayRef order); - /// Allocate the registers for the instructions in the function. The order of - /// the block needs to match the order which we'll use for instruction - /// selection. + /// Allocate the registers for the instructions in the function. The blocks + /// must be in reverse-post-order, and must match the order which we'll use + /// for instruction selection. void allocate(ArrayRef order); /// Reserves consecutive registers that will be manually managed by the user. diff --git a/lib/BCGen/RegAlloc.cpp b/lib/BCGen/RegAlloc.cpp index d28bd99d6a8..6f07632b069 100644 --- a/lib/BCGen/RegAlloc.cpp +++ b/lib/BCGen/RegAlloc.cpp @@ -535,19 +535,6 @@ void RegisterAllocator::coalesce( } } -namespace { -/// Determines whether the Instruction is ever used outside its BasicBlock. -bool isBlockLocal(Instruction *inst) { - BasicBlock *parent = inst->getParent(); - for (auto user : inst->getUsers()) { - if (parent != user->getParent()) { - return false; - } - } - return true; -} -} // namespace - void RegisterAllocator::allocateFastPass(ArrayRef order) { // Make sure Phis and related Movs get the same register for (auto *bb : order) { @@ -563,26 +550,70 @@ void RegisterAllocator::allocateFastPass(ArrayRef order) { } } - llvh::SmallVector blockLocals; + // Bit vector indicating whether a register with a given index is being used + // as a block local register. + llvh::BitVector blockLocals; + + // List of free block local registers. We have to maintain this outside the + // file because we cannot determine interference between local and global + // registers. So we have to ensure that the local registers are only reused + // for other block-local instructions. + llvh::SmallVector freeBlockLocals; + + // A dummy register used for all instructions that have no users. + Register deadReg = file.allocateRegister(); + + // Iterate in reverse, so we can cheaply determine whether an instruction + // is local, and assign it a register accordingly. + for (auto *bb : llvh::reverse(order)) { + for (auto &inst : llvh::reverse(*bb)) { + if (isAllocated(&inst)) { + // If this is using a local register, we know the register is free after + // we visit the definition. + auto reg = getRegister(&inst); + auto idx = reg.getIndex(); + if (idx < blockLocals.size() && blockLocals.test(idx)) + freeBlockLocals.push_back(reg); + } else { + // Unallocated instruction means the result is dead, because all users + // are visited first. Allocate a temporary register. + // Note that we cannot assert that the instruction has no users, because + // there may be users in dead blocks. + updateRegister(&inst, deadReg); + } - // Then just allocate the rest sequentially, while optimizing the case - // where an inst is only ever used in its own block. - for (auto *bb : order) { - for (auto &inst : *bb) { - if (!isAllocated(&inst)) { - Register R = file.allocateRegister(); - updateRegister(&inst, R); - if (inst.getNumUsers() == 0) { - file.killRegister(R); - } else if (isBlockLocal(&inst)) { - blockLocals.push_back(R); + // Allocate a register to unallocated operands. + for (size_t i = 0, e = inst.getNumOperands(); i < e; ++i) { + auto *op = llvh::dyn_cast(inst.getOperand(i)); + + // Skip if op is not an instruction or already has a register. + if (!op || isAllocated(op)) + continue; + + if (op->getParent() != bb) { + // Live across blocks, allocate a global regigster. + updateRegister(op, file.allocateRegister()); + continue; } + + // We know this operand is local because: + // 1. The operand is in the same block as this one. + // 2. All blocks dominated by this block have been visited. + // 3. All users must be dominated by their def, since Phis are + // allocated beforehand. + if (!freeBlockLocals.empty()) { + updateRegister(op, freeBlockLocals.pop_back_val()); + continue; + } + + // No free local register, allocate another one. + Register reg = file.allocateRegister(); + if (blockLocals.size() <= reg.getIndex()) + blockLocals.resize(reg.getIndex() + 1); + blockLocals.set(reg.getIndex()); + updateRegister(op, reg); } } - for (auto ® : blockLocals) { - file.killRegister(reg); - } - blockLocals.clear(); } } diff --git a/test/BCGen/HBC/async-function.js b/test/BCGen/HBC/async-function.js index 9ace0be7e7f..d4c2e5eb072 100644 --- a/test/BCGen/HBC/async-function.js +++ b/test/BCGen/HBC/async-function.js @@ -57,169 +57,162 @@ var simpleAsyncFE = async function () { // CHECK-NEXT: Function ID 6 -> s0 // CHECK-NEXT: Function ID 9 -> s0 -// CHECK:Function(1 params, 11 registers, 0 symbols): +// CHECK:Function(1 params, 4 registers, 0 symbols): // CHECK-NEXT:Offset in debug table: source 0x0000, scope 0x0000, textified callees 0x0000 // CHECK-NEXT: DeclareGlobalVar "simpleAsyncFE" // CHECK-NEXT: DeclareGlobalVar "simpleReturn" // CHECK-NEXT: DeclareGlobalVar "simpleAwait" -// CHECK-NEXT: CreateEnvironment r0 -// CHECK-NEXT: CreateAsyncClosure r1, r0, NCFunction -// CHECK-NEXT: GetGlobalObject r2 -// CHECK-NEXT: PutById r2, r1, 1, "simpleReturn" -// CHECK-NEXT: CreateAsyncClosure r3, r0, NCFunction -// CHECK-NEXT: GetGlobalObject r4 -// CHECK-NEXT: PutById r4, r3, 2, "simpleAwait" -// CHECK-NEXT: LoadConstUndefined r6 -// CHECK-NEXT: Mov r5, r6 -// CHECK-NEXT: CreateAsyncClosure r7, r0, NCFunction -// CHECK-NEXT: GetGlobalObject r8 -// CHECK-NEXT: PutById r8, r7, 3, "simpleAsyncFE" -// CHECK-NEXT: Mov r9, r5 -// CHECK-NEXT: Ret r9 +// CHECK-NEXT: CreateEnvironment r2 +// CHECK-NEXT: CreateAsyncClosure r1, r2, NCFunction +// CHECK-NEXT: GetGlobalObject r3 +// CHECK-NEXT: PutById r3, r1, 1, "simpleReturn" +// CHECK-NEXT: CreateAsyncClosure r1, r2, NCFunction +// CHECK-NEXT: GetGlobalObject r3 +// CHECK-NEXT: PutById r3, r1, 2, "simpleAwait" +// CHECK-NEXT: LoadConstUndefined r3 +// CHECK-NEXT: Mov r1, r3 +// CHECK-NEXT: CreateAsyncClosure r2, r2, NCFunction +// CHECK-NEXT: GetGlobalObject r3 +// CHECK-NEXT: PutById r3, r2, 3, "simpleAsyncFE" +// CHECK-NEXT: Ret r1 -// CHECK:NCFunction(1 params, 20 registers, 0 symbols): +// CHECK:NCFunction(1 params, 16 registers, 0 symbols): // CHECK-NEXT:Offset in debug table: source 0x001f, scope 0x0000, textified callees 0x0000 -// CHECK-NEXT: CreateEnvironment r0 -// CHECK-NEXT: LoadThisNS r1 -// CHECK-NEXT: LoadConstUndefined r3 -// CHECK-NEXT: Mov r2, r3 -// CHECK-NEXT: CreateGeneratorClosure r4, r0, NCFunction -// CHECK-NEXT: GetBuiltinClosure r5, "HermesBuiltin.spawnAsync" -// CHECK-NEXT: ReifyArguments r2 -// CHECK-NEXT: Mov r6, r2 -// CHECK-NEXT: LoadConstUndefined r7 -// CHECK-NEXT: Mov r13, r7 -// CHECK-NEXT: Mov r12, r4 -// CHECK-NEXT: Mov r11, r1 -// CHECK-NEXT: Mov r10, r6 -// CHECK-NEXT: Call r8, r5, 4 -// CHECK-NEXT: Ret r8 +// CHECK-NEXT: CreateEnvironment r3 +// CHECK-NEXT: LoadThisNS r4 +// CHECK-NEXT: LoadConstUndefined r1 +// CHECK-NEXT: Mov r5, r1 +// CHECK-NEXT: CreateGeneratorClosure r3, r3, NCFunction +// CHECK-NEXT: GetBuiltinClosure r1, "HermesBuiltin.spawnAsync" +// CHECK-NEXT: ReifyArguments r5 +// CHECK-NEXT: LoadConstUndefined r2 +// CHECK-NEXT: Mov r9, r2 +// CHECK-NEXT: Mov r8, r3 +// CHECK-NEXT: Mov r7, r4 +// CHECK-NEXT: Mov r6, r5 +// CHECK-NEXT: Call r1, r1, 4 +// CHECK-NEXT: Ret r1 -// CHECK:NCFunction(1 params, 3 registers, 0 symbols): -// CHECK-NEXT: CreateEnvironment r0 -// CHECK-NEXT: CreateGenerator r1, r0, Function +// CHECK:NCFunction(1 params, 2 registers, 0 symbols): +// CHECK-NEXT: CreateEnvironment r1 +// CHECK-NEXT: CreateGenerator r1, r1, Function // CHECK-NEXT: Ret r1 -// CHECK:Function(1 params, 4 registers, 0 symbols): +// CHECK:Function(1 params, 3 registers, 0 symbols): // CHECK-NEXT: StartGenerator // CHECK-NEXT: CreateEnvironment r0 -// CHECK-NEXT: ResumeGenerator r1, r0 -// CHECK-NEXT: Mov r2, r0 +// CHECK-NEXT: ResumeGenerator r1, r2 // CHECK-NEXT: JmpTrue L1, r2 -// CHECK-NEXT: LoadConstUInt8 r0, 1 +// CHECK-NEXT: LoadConstUInt8 r2, 1 // CHECK-NEXT: CompleteGenerator -// CHECK-NEXT: Ret r0 +// CHECK-NEXT: Ret r2 // CHECK-NEXT:L1: // CHECK-NEXT: CompleteGenerator // CHECK-NEXT: Ret r1 -// CHECK:NCFunction(1 params, 21 registers, 1 symbols): +// CHECK:NCFunction(1 params, 16 registers, 1 symbols): // CHECK-NEXT:Offset in debug table: source 0x002c, scope 0x0000, textified callees 0x0000 -// CHECK-NEXT: CreateEnvironment r0 -// CHECK-NEXT: LoadThisNS r1 -// CHECK-NEXT: LoadConstUndefined r3 -// CHECK-NEXT: Mov r2, r3 -// CHECK-NEXT: LoadConstUndefined r4 -// CHECK-NEXT: StoreNPToEnvironment r0, 0, r4 -// CHECK-NEXT: CreateGeneratorClosure r5, r0, NCFunction -// CHECK-NEXT: GetBuiltinClosure r6, "HermesBuiltin.spawnAsync" -// CHECK-NEXT: ReifyArguments r2 -// CHECK-NEXT: Mov r7, r2 -// CHECK-NEXT: LoadConstUndefined r8 -// CHECK-NEXT: Mov r14, r8 -// CHECK-NEXT: Mov r13, r5 -// CHECK-NEXT: Mov r12, r1 -// CHECK-NEXT: Mov r11, r7 -// CHECK-NEXT: Call r9, r6, 4 -// CHECK-NEXT: Ret r9 - -// CHECK:NCFunction(1 params, 4 registers, 1 symbols): -// CHECK-NEXT: CreateEnvironment r0 +// CHECK-NEXT: CreateEnvironment r3 +// CHECK-NEXT: LoadThisNS r4 // CHECK-NEXT: LoadConstUndefined r1 -// CHECK-NEXT: StoreNPToEnvironment r0, 0, r1 -// CHECK-NEXT: CreateGenerator r2, r0, Function -// CHECK-NEXT: Ret r2 +// CHECK-NEXT: Mov r5, r1 +// CHECK-NEXT: LoadConstUndefined r1 +// CHECK-NEXT: StoreNPToEnvironment r3, 0, r1 +// CHECK-NEXT: CreateGeneratorClosure r3, r3, NCFunction +// CHECK-NEXT: GetBuiltinClosure r1, "HermesBuiltin.spawnAsync" +// CHECK-NEXT: ReifyArguments r5 +// CHECK-NEXT: LoadConstUndefined r2 +// CHECK-NEXT: Mov r9, r2 +// CHECK-NEXT: Mov r8, r3 +// CHECK-NEXT: Mov r7, r4 +// CHECK-NEXT: Mov r6, r5 +// CHECK-NEXT: Call r1, r1, 4 +// CHECK-NEXT: Ret r1 + +// CHECK:NCFunction(1 params, 3 registers, 1 symbols): +// CHECK-NEXT: CreateEnvironment r1 +// CHECK-NEXT: LoadConstUndefined r2 +// CHECK-NEXT: StoreNPToEnvironment r1, 0, r2 +// CHECK-NEXT: CreateGenerator r1, r1, Function +// CHECK-NEXT: Ret r1 // CHECK:Function(1 params, 6 registers, 1 symbols): // CHECK-NEXT:Offset in debug table: source 0x0039, scope 0x0000, textified callees 0x0000 // CHECK-NEXT: StartGenerator -// CHECK-NEXT: CreateEnvironment r0 -// CHECK-NEXT: ResumeGenerator r2, r1 -// CHECK-NEXT: Mov r3, r1 +// CHECK-NEXT: CreateEnvironment r4 +// CHECK-NEXT: ResumeGenerator r1, r3 // CHECK-NEXT: JmpTrue L1, r3 -// CHECK-NEXT: LoadConstUndefined r1 -// CHECK-NEXT: StoreNPToEnvironment r0, 0, r1 -// CHECK-NEXT: LoadConstUInt8 r4, 2 +// CHECK-NEXT: LoadConstUndefined r3 +// CHECK-NEXT: StoreNPToEnvironment r4, 0, r3 +// CHECK-NEXT: LoadConstUInt8 r3, 2 // CHECK-NEXT: SaveGenerator L2 -// CHECK-NEXT: Ret r4 +// CHECK-NEXT: Ret r3 // CHECK-NEXT:L2: -// CHECK-NEXT: ResumeGenerator r1, r3 -// CHECK-NEXT: Mov r4, r3 -// CHECK-NEXT: JmpTrue L3, r4 -// CHECK-NEXT: StoreToEnvironment r0, 0, r1 -// CHECK-NEXT: LoadFromEnvironment r4, r0, 0 +// CHECK-NEXT: ResumeGenerator r2, r5 +// CHECK-NEXT: Mov r3, r5 +// CHECK-NEXT: JmpTrue L3, r3 +// CHECK-NEXT: StoreToEnvironment r4, 0, r2 +// CHECK-NEXT: LoadFromEnvironment r3, r4, 0 // CHECK-NEXT: CompleteGenerator -// CHECK-NEXT: Ret r4 +// CHECK-NEXT: Ret r3 // CHECK-NEXT:L3: // CHECK-NEXT: CompleteGenerator -// CHECK-NEXT: Ret r1 +// CHECK-NEXT: Ret r2 // CHECK-NEXT:L1: // CHECK-NEXT: CompleteGenerator -// CHECK-NEXT: Ret r2 +// CHECK-NEXT: Ret r1 -// CHECK:NCFunction(1 params, 21 registers, 1 symbols): +// CHECK:NCFunction(1 params, 16 registers, 1 symbols): // CHECK-NEXT:Offset in debug table: source 0x004f, scope 0x0000, textified callees 0x0000 -// CHECK-NEXT: CreateEnvironment r0 -// CHECK-NEXT: LoadThisNS r1 -// CHECK-NEXT: LoadConstUndefined r3 -// CHECK-NEXT: Mov r2, r3 -// CHECK-NEXT: LoadConstUndefined r4 -// CHECK-NEXT: StoreNPToEnvironment r0, 0, r4 -// CHECK-NEXT: CreateGeneratorClosure r5, r0, NCFunction -// CHECK-NEXT: GetBuiltinClosure r6, "HermesBuiltin.spawnAsync" -// CHECK-NEXT: ReifyArguments r2 -// CHECK-NEXT: Mov r7, r2 -// CHECK-NEXT: LoadConstUndefined r8 -// CHECK-NEXT: Mov r14, r8 -// CHECK-NEXT: Mov r13, r5 -// CHECK-NEXT: Mov r12, r1 -// CHECK-NEXT: Mov r11, r7 -// CHECK-NEXT: Call r9, r6, 4 -// CHECK-NEXT: Ret r9 - -// CHECK:NCFunction(1 params, 4 registers, 1 symbols): -// CHECK-NEXT: CreateEnvironment r0 +// CHECK-NEXT: CreateEnvironment r3 +// CHECK-NEXT: LoadThisNS r4 // CHECK-NEXT: LoadConstUndefined r1 -// CHECK-NEXT: StoreNPToEnvironment r0, 0, r1 -// CHECK-NEXT: CreateGenerator r2, r0, Function -// CHECK-NEXT: Ret r2 +// CHECK-NEXT: Mov r5, r1 +// CHECK-NEXT: LoadConstUndefined r1 +// CHECK-NEXT: StoreNPToEnvironment r3, 0, r1 +// CHECK-NEXT: CreateGeneratorClosure r3, r3, NCFunction +// CHECK-NEXT: GetBuiltinClosure r1, "HermesBuiltin.spawnAsync" +// CHECK-NEXT: ReifyArguments r5 +// CHECK-NEXT: LoadConstUndefined r2 +// CHECK-NEXT: Mov r9, r2 +// CHECK-NEXT: Mov r8, r3 +// CHECK-NEXT: Mov r7, r4 +// CHECK-NEXT: Mov r6, r5 +// CHECK-NEXT: Call r1, r1, 4 +// CHECK-NEXT: Ret r1 + +// CHECK:NCFunction(1 params, 3 registers, 1 symbols): +// CHECK-NEXT: CreateEnvironment r1 +// CHECK-NEXT: LoadConstUndefined r2 +// CHECK-NEXT: StoreNPToEnvironment r1, 0, r2 +// CHECK-NEXT: CreateGenerator r1, r1, Function +// CHECK-NEXT: Ret r1 // CHECK:Function(1 params, 6 registers, 1 symbols): // CHECK-NEXT:Offset in debug table: source 0x005c, scope 0x0000, textified callees 0x0000 // CHECK-NEXT: StartGenerator -// CHECK-NEXT: CreateEnvironment r0 -// CHECK-NEXT: ResumeGenerator r2, r1 -// CHECK-NEXT: Mov r3, r1 +// CHECK-NEXT: CreateEnvironment r4 +// CHECK-NEXT: ResumeGenerator r1, r3 // CHECK-NEXT: JmpTrue L1, r3 -// CHECK-NEXT: LoadConstUndefined r1 -// CHECK-NEXT: StoreNPToEnvironment r0, 0, r1 -// CHECK-NEXT: LoadConstUInt8 r4, 2 +// CHECK-NEXT: LoadConstUndefined r3 +// CHECK-NEXT: StoreNPToEnvironment r4, 0, r3 +// CHECK-NEXT: LoadConstUInt8 r3, 2 // CHECK-NEXT: SaveGenerator L2 -// CHECK-NEXT: Ret r4 +// CHECK-NEXT: Ret r3 // CHECK-NEXT:L2: -// CHECK-NEXT: ResumeGenerator r1, r3 -// CHECK-NEXT: Mov r4, r3 -// CHECK-NEXT: JmpTrue L3, r4 -// CHECK-NEXT: StoreToEnvironment r0, 0, r1 -// CHECK-NEXT: LoadFromEnvironment r4, r0, 0 +// CHECK-NEXT: ResumeGenerator r2, r5 +// CHECK-NEXT: Mov r3, r5 +// CHECK-NEXT: JmpTrue L3, r3 +// CHECK-NEXT: StoreToEnvironment r4, 0, r2 +// CHECK-NEXT: LoadFromEnvironment r3, r4, 0 // CHECK-NEXT: CompleteGenerator -// CHECK-NEXT: Ret r4 +// CHECK-NEXT: Ret r3 // CHECK-NEXT:L3: // CHECK-NEXT: CompleteGenerator -// CHECK-NEXT: Ret r1 +// CHECK-NEXT: Ret r2 // CHECK-NEXT:L1: // CHECK-NEXT: CompleteGenerator -// CHECK-NEXT: Ret r2 +// CHECK-NEXT: Ret r1 // CHECK:Debug filename table: // CHECK-NEXT: 0: {{.*}}async-function.js @@ -233,17 +226,17 @@ var simpleAsyncFE = async function () { // CHECK-NEXT: bc 37: line 10 col 1 scope offset 0x0000 env none // CHECK-NEXT: bc 55: line 19 col 19 scope offset 0x0000 env none // CHECK-NEXT: 0x001f function idx 1, starts at line 10 col 1 -// CHECK-NEXT: bc 36: line 10 col 1 scope offset 0x0000 env none +// CHECK-NEXT: bc 33: line 10 col 1 scope offset 0x0000 env none // CHECK-NEXT: 0x002c function idx 4, starts at line 14 col 1 -// CHECK-NEXT: bc 42: line 14 col 1 scope offset 0x0000 env none +// CHECK-NEXT: bc 39: line 14 col 1 scope offset 0x0000 env none // CHECK-NEXT: 0x0039 function idx 6, starts at line 14 col 1 -// CHECK-NEXT: bc 21: line 15 col 11 scope offset 0x0000 env none -// CHECK-NEXT: bc 25: line 15 col 11 scope offset 0x0000 env none +// CHECK-NEXT: bc 18: line 15 col 11 scope offset 0x0000 env none +// CHECK-NEXT: bc 22: line 15 col 11 scope offset 0x0000 env none // CHECK-NEXT: 0x004f function idx 7, starts at line 19 col 21 -// CHECK-NEXT: bc 42: line 19 col 21 scope offset 0x0000 env none +// CHECK-NEXT: bc 39: line 19 col 21 scope offset 0x0000 env none // CHECK-NEXT: 0x005c function idx 9, starts at line 19 col 21 -// CHECK-NEXT: bc 21: line 20 col 11 scope offset 0x0000 env none -// CHECK-NEXT: bc 25: line 20 col 11 scope offset 0x0000 env none +// CHECK-NEXT: bc 18: line 20 col 11 scope offset 0x0000 env none +// CHECK-NEXT: bc 22: line 20 col 11 scope offset 0x0000 env none // CHECK-NEXT: 0x0072 end of debug source table // CHECK:Debug scope descriptor table: diff --git a/test/BCGen/HBC/debug_info.js b/test/BCGen/HBC/debug_info.js index f6445c36a22..d259f81f125 100644 --- a/test/BCGen/HBC/debug_info.js +++ b/test/BCGen/HBC/debug_info.js @@ -31,7 +31,7 @@ function Fc() { } // CHECK: Function{{.*}} // CHECK-NEXT: Offset in debug table: {{.*}} -// CHECK: Function(1 params, 5 registers, 1 symbols): +// CHECK: Function(1 params, 3 registers, 1 symbols): // CHECK-NEXT: Offset in debug table: {{.*}} // CHECK: Debug filename table: diff --git a/test/BCGen/HBC/es6/generator.js b/test/BCGen/HBC/es6/generator.js index 623aa7525b6..042ff5776ed 100644 --- a/test/BCGen/HBC/es6/generator.js +++ b/test/BCGen/HBC/es6/generator.js @@ -51,100 +51,97 @@ function *args() { // CHECK-NEXT: Function ID 2 -> s0 // CHECK-NEXT: Function ID 4 -> s0 -// CHECK:Function(1 params, 9 registers, 0 symbols): +// CHECK:Function(1 params, 4 registers, 0 symbols): // CHECK-NEXT:Offset in debug table: source 0x0000, scope 0x0000, textified callees 0x0000 // CHECK-NEXT: DeclareGlobalVar "loop" // CHECK-NEXT: DeclareGlobalVar "args" -// CHECK-NEXT: CreateEnvironment r0 -// CHECK-NEXT: CreateGeneratorClosure r1, r0, NCFunction +// CHECK-NEXT: CreateEnvironment r1 +// CHECK-NEXT: CreateGeneratorClosure r2, r1, NCFunction +// CHECK-NEXT: GetGlobalObject r3 +// CHECK-NEXT: PutById r3, r2, 1, "loop" +// CHECK-NEXT: CreateGeneratorClosure r1, r1, NCFunction // CHECK-NEXT: GetGlobalObject r2 -// CHECK-NEXT: PutById r2, r1, 1, "loop" -// CHECK-NEXT: CreateGeneratorClosure r3, r0, NCFunction -// CHECK-NEXT: GetGlobalObject r4 -// CHECK-NEXT: PutById r4, r3, 2, "args" -// CHECK-NEXT: LoadConstUndefined r6 -// CHECK-NEXT: Mov r5, r6 -// CHECK-NEXT: Mov r7, r5 -// CHECK-NEXT: Ret r7 - -// CHECK:NCFunction(2 params, 4 registers, 1 symbols): -// CHECK-NEXT: CreateEnvironment r0 -// CHECK-NEXT: LoadConstUndefined r1 -// CHECK-NEXT: StoreNPToEnvironment r0, 0, r1 -// CHECK-NEXT: CreateGenerator r2, r0, Function -// CHECK-NEXT: Ret r2 +// CHECK-NEXT: PutById r2, r1, 2, "args" +// CHECK-NEXT: LoadConstUndefined r2 +// CHECK-NEXT: Mov r1, r2 +// CHECK-NEXT: Ret r1 + +// CHECK:NCFunction(2 params, 3 registers, 1 symbols): +// CHECK-NEXT: CreateEnvironment r1 +// CHECK-NEXT: LoadConstUndefined r2 +// CHECK-NEXT: StoreNPToEnvironment r1, 0, r2 +// CHECK-NEXT: CreateGenerator r1, r1, Function +// CHECK-NEXT: Ret r1 -// CHECK:Function(2 params, 10 registers, 2 symbols): +// CHECK:Function(2 params, 9 registers, 2 symbols): // CHECK-NEXT:Offset in debug table: source 0x0016, scope 0x0000, textified callees 0x0000 // CHECK-NEXT: StartGenerator -// CHECK-NEXT: CreateEnvironment r0 -// CHECK-NEXT: LoadParam r1, 1 -// CHECK-NEXT: ResumeGenerator r3, r2 -// CHECK-NEXT: Mov r4, r2 -// CHECK-NEXT: JmpTrue L1, r4 -// CHECK-NEXT: StoreToEnvironment r0, 0, r1 -// CHECK-NEXT: LoadConstUndefined r2 -// CHECK-NEXT: StoreNPToEnvironment r0, 1, r2 -// CHECK-NEXT: LoadConstZero r4 -// CHECK-NEXT: StoreNPToEnvironment r0, 1, r4 -// CHECK-NEXT: GetGlobalObject r2 -// CHECK-NEXT: TryGetById r4, r2, 1, "y" -// CHECK-NEXT: JmpFalse L2, r4 +// CHECK-NEXT: CreateEnvironment r6 +// CHECK-NEXT: LoadParam r8, 1 +// CHECK-NEXT: ResumeGenerator r1, r3 +// CHECK-NEXT: JmpTrue L1, r3 +// CHECK-NEXT: StoreToEnvironment r6, 0, r8 +// CHECK-NEXT: LoadConstUndefined r3 +// CHECK-NEXT: StoreNPToEnvironment r6, 1, r3 +// CHECK-NEXT: LoadConstZero r3 +// CHECK-NEXT: StoreNPToEnvironment r6, 1, r3 +// CHECK-NEXT: GetGlobalObject r3 +// CHECK-NEXT: TryGetById r3, r3, 1, "y" +// CHECK-NEXT: JmpFalse L2, r3 // CHECK-NEXT:L5: -// CHECK-NEXT: LoadFromEnvironment r2, r0, 0 -// CHECK-NEXT: LoadFromEnvironment r4, r0, 1 -// CHECK-NEXT: ToNumeric r5, r4 -// CHECK-NEXT: Inc r6, r5 -// CHECK-NEXT: StoreToEnvironment r0, 1, r6 -// CHECK-NEXT: GetByVal r7, r2, r5 +// CHECK-NEXT: LoadFromEnvironment r3, r6, 0 +// CHECK-NEXT: LoadFromEnvironment r5, r6, 1 +// CHECK-NEXT: ToNumeric r5, r5 +// CHECK-NEXT: Inc r7, r5 +// CHECK-NEXT: StoreToEnvironment r6, 1, r7 +// CHECK-NEXT: GetByVal r3, r3, r5 // CHECK-NEXT: SaveGenerator L3 -// CHECK-NEXT: Ret r7 +// CHECK-NEXT: Ret r3 // CHECK-NEXT:L3: -// CHECK-NEXT: ResumeGenerator r2, r8 -// CHECK-NEXT: Mov r4, r8 -// CHECK-NEXT: JmpTrue L4, r4 -// CHECK-NEXT: GetGlobalObject r4 -// CHECK-NEXT: TryGetById r5, r4, 1, "y" -// CHECK-NEXT: JmpTrue L5, r5 +// CHECK-NEXT: ResumeGenerator r2, r4 +// CHECK-NEXT: Mov r3, r4 +// CHECK-NEXT: JmpTrue L4, r3 +// CHECK-NEXT: GetGlobalObject r3 +// CHECK-NEXT: TryGetById r3, r3, 1, "y" +// CHECK-NEXT: JmpTrue L5, r3 // CHECK-NEXT:L2: -// CHECK-NEXT: LoadConstString r4, "DONE LOOPING" +// CHECK-NEXT: LoadConstString r3, "DONE LOOPING" // CHECK-NEXT: CompleteGenerator -// CHECK-NEXT: Ret r4 +// CHECK-NEXT: Ret r3 // CHECK-NEXT:L4: // CHECK-NEXT: CompleteGenerator // CHECK-NEXT: Ret r2 // CHECK-NEXT:L1: // CHECK-NEXT: CompleteGenerator -// CHECK-NEXT: Ret r3 +// CHECK-NEXT: Ret r1 -// CHECK:NCFunction(1 params, 3 registers, 0 symbols): -// CHECK-NEXT: CreateEnvironment r0 -// CHECK-NEXT: CreateGenerator r1, r0, Function +// CHECK:NCFunction(1 params, 2 registers, 0 symbols): +// CHECK-NEXT: CreateEnvironment r1 +// CHECK-NEXT: CreateGenerator r1, r1, Function // CHECK-NEXT: Ret r1 -// CHECK:Function(1 params, 7 registers, 0 symbols): +// CHECK:Function(1 params, 6 registers, 0 symbols): // CHECK-NEXT:Offset in debug table: source 0x0050, scope 0x0000, textified callees 0x0000 // CHECK-NEXT: StartGenerator // CHECK-NEXT: CreateEnvironment r0 -// CHECK-NEXT: ResumeGenerator r1, r0 -// CHECK-NEXT: Mov r2, r0 -// CHECK-NEXT: JmpTrue L1, r2 -// CHECK-NEXT: LoadConstUndefined r2 -// CHECK-NEXT: Mov r0, r2 +// CHECK-NEXT: ResumeGenerator r1, r5 +// CHECK-NEXT: JmpTrue L1, r5 +// CHECK-NEXT: LoadConstUndefined r3 +// CHECK-NEXT: Mov r5, r3 // CHECK-NEXT: LoadConstZero r3 -// CHECK-NEXT: GetArgumentsPropByVal r4, r3, r0 +// CHECK-NEXT: GetArgumentsPropByVal r3, r3, r5 // CHECK-NEXT: SaveGenerator L2 -// CHECK-NEXT: Ret r4 +// CHECK-NEXT: Ret r3 // CHECK-NEXT:L2: -// CHECK-NEXT: ResumeGenerator r0, r5 -// CHECK-NEXT: Mov r2, r5 -// CHECK-NEXT: JmpTrue L3, r2 -// CHECK-NEXT: LoadConstUndefined r2 +// CHECK-NEXT: ResumeGenerator r2, r4 +// CHECK-NEXT: Mov r3, r4 +// CHECK-NEXT: JmpTrue L3, r3 +// CHECK-NEXT: LoadConstUndefined r3 // CHECK-NEXT: CompleteGenerator -// CHECK-NEXT: Ret r2 +// CHECK-NEXT: Ret r3 // CHECK-NEXT:L3: // CHECK-NEXT: CompleteGenerator -// CHECK-NEXT: Ret r0 +// CHECK-NEXT: Ret r2 // CHECK-NEXT:L1: // CHECK-NEXT: CompleteGenerator // CHECK-NEXT: Ret r1 @@ -160,16 +157,16 @@ function *args() { // CHECK-NEXT: bc 19: line 10 col 1 scope offset 0x0000 env none // CHECK-NEXT: bc 32: line 10 col 1 scope offset 0x0000 env none // CHECK-NEXT: 0x0016 function idx 2, starts at line 10 col 1 -// CHECK-NEXT: bc 33: line 12 col 10 scope offset 0x0000 env none -// CHECK-NEXT: bc 50: line 13 col 14 scope offset 0x0000 env none -// CHECK-NEXT: bc 60: line 13 col 12 scope offset 0x0000 env none -// CHECK-NEXT: bc 64: line 13 col 5 scope offset 0x0000 env none -// CHECK-NEXT: bc 68: line 13 col 5 scope offset 0x0000 env none -// CHECK-NEXT: bc 79: line 12 col 10 scope offset 0x0000 env none +// CHECK-NEXT: bc 30: line 12 col 10 scope offset 0x0000 env none +// CHECK-NEXT: bc 47: line 13 col 14 scope offset 0x0000 env none +// CHECK-NEXT: bc 57: line 13 col 12 scope offset 0x0000 env none +// CHECK-NEXT: bc 61: line 13 col 5 scope offset 0x0000 env none +// CHECK-NEXT: bc 65: line 13 col 5 scope offset 0x0000 env none +// CHECK-NEXT: bc 76: line 12 col 10 scope offset 0x0000 env none // CHECK-NEXT: 0x0050 function idx 4, starts at line 18 col 1 -// CHECK-NEXT: bc 19: line 19 col 18 scope offset 0x0000 env none -// CHECK-NEXT: bc 23: line 19 col 3 scope offset 0x0000 env none -// CHECK-NEXT: bc 27: line 19 col 3 scope offset 0x0000 env none +// CHECK-NEXT: bc 16: line 19 col 18 scope offset 0x0000 env none +// CHECK-NEXT: bc 20: line 19 col 3 scope offset 0x0000 env none +// CHECK-NEXT: bc 24: line 19 col 3 scope offset 0x0000 env none // CHECK-NEXT: 0x006f end of debug source table // CHECK:Debug scope descriptor table: diff --git a/test/BCGen/HBC/es6/spread-arguments.js b/test/BCGen/HBC/es6/spread-arguments.js index 5ad2f9eb602..2625719d93b 100644 --- a/test/BCGen/HBC/es6/spread-arguments.js +++ b/test/BCGen/HBC/es6/spread-arguments.js @@ -12,42 +12,42 @@ function foo(fn, x) { new fn(...x); } -// CHECK-LABEL: Function(3 params, 30 registers, 2 symbols): +// CHECK-LABEL:Function(3 params, 17 registers, 2 symbols): // CHECK-NEXT: Offset in debug table: source 0x{{.*}}, scope 0x{{.*}} -// CHECK-NEXT: CreateEnvironment r0 -// CHECK-NEXT: LoadParam r1, 1 -// CHECK-NEXT: LoadParam r2, 2 -// CHECK-NEXT: StoreToEnvironment r0, 0, r1 -// CHECK-NEXT: StoreToEnvironment r0, 1, r2 -// CHECK-NEXT: LoadFromEnvironment r3, r0, 0 -// CHECK-NEXT: LoadConstZero r5 -// CHECK-NEXT: Mov r4, r5 -// CHECK-NEXT: LoadFromEnvironment r6, r0, 1 -// CHECK-NEXT: NewArray r7, 0 +// CHECK-NEXT: CreateEnvironment r3 +// CHECK-NEXT: LoadParam r5, 1 +// CHECK-NEXT: LoadParam r1, 2 +// CHECK-NEXT: StoreToEnvironment r3, 0, r5 +// CHECK-NEXT: StoreToEnvironment r3, 1, r1 +// CHECK-NEXT: LoadFromEnvironment r1, r3, 0 +// CHECK-NEXT: LoadConstZero r2 +// CHECK-NEXT: Mov r5, r2 +// CHECK-NEXT: LoadFromEnvironment r2, r3, 1 +// CHECK-NEXT: NewArray r4, 0 +// CHECK-NEXT: Mov r6, r5 +// CHECK-NEXT: Mov r9, r4 +// CHECK-NEXT: Mov r8, r2 +// CHECK-NEXT: Mov r7, r6 +// CHECK-NEXT: CallBuiltin r2, "HermesBuiltin.arraySpread", 4 +// CHECK-NEXT: Mov r5, r2 +// CHECK-NEXT: LoadConstUndefined r2 +// CHECK-NEXT: Mov r9, r1 // CHECK-NEXT: Mov r8, r4 -// CHECK-NEXT: Mov r22, r7 -// CHECK-NEXT: Mov r21, r6 -// CHECK-NEXT: Mov r20, r8 -// CHECK-NEXT: CallBuiltin r9, "HermesBuiltin.arraySpread", 4 -// CHECK-NEXT: Mov r4, r9 -// CHECK-NEXT: LoadConstUndefined r10 -// CHECK-NEXT: Mov r22, r3 -// CHECK-NEXT: Mov r21, r7 -// CHECK-NEXT: Mov r20, r10 -// CHECK-NEXT: CallBuiltin r11, "HermesBuiltin.apply", 4 -// CHECK-NEXT: LoadFromEnvironment r11, r0, 0 -// CHECK-NEXT: LoadConstZero r13 -// CHECK-NEXT: Mov r12, r13 -// CHECK-NEXT: LoadFromEnvironment r14, r0, 1 -// CHECK-NEXT: NewArray r15, 0 -// CHECK-NEXT: Mov r16, r12 -// CHECK-NEXT: Mov r22, r15 -// CHECK-NEXT: Mov r21, r14 -// CHECK-NEXT: Mov r20, r16 -// CHECK-NEXT: CallBuiltin r17, "HermesBuiltin.arraySpread", 4 -// CHECK-NEXT: Mov r12, r17 -// CHECK-NEXT: Mov r22, r11 -// CHECK-NEXT: Mov r21, r15 -// CHECK-NEXT: CallBuiltin r18, "HermesBuiltin.apply", 3 -// CHECK-NEXT: LoadConstUndefined r18 -// CHECK-NEXT: Ret r18 +// CHECK-NEXT: Mov r7, r2 +// CHECK-NEXT: CallBuiltin r0, "HermesBuiltin.apply", 4 +// CHECK-NEXT: LoadFromEnvironment r1, r3, 0 +// CHECK-NEXT: LoadConstZero r2 +// CHECK-NEXT: Mov r4, r2 +// CHECK-NEXT: LoadFromEnvironment r3, r3, 1 +// CHECK-NEXT: NewArray r2, 0 +// CHECK-NEXT: Mov r5, r4 +// CHECK-NEXT: Mov r9, r2 +// CHECK-NEXT: Mov r8, r3 +// CHECK-NEXT: Mov r7, r5 +// CHECK-NEXT: CallBuiltin r3, "HermesBuiltin.arraySpread", 4 +// CHECK-NEXT: Mov r4, r3 +// CHECK-NEXT: Mov r9, r1 +// CHECK-NEXT: Mov r8, r2 +// CHECK-NEXT: CallBuiltin r0, "HermesBuiltin.apply", 3 +// CHECK-NEXT: LoadConstUndefined r1 +// CHECK-NEXT: Ret r1 diff --git a/test/BCGen/HBC/unique-lit.js b/test/BCGen/HBC/unique-lit.js index 1b6dcab9f92..d18925e35df 100644 --- a/test/BCGen/HBC/unique-lit.js +++ b/test/BCGen/HBC/unique-lit.js @@ -20,24 +20,24 @@ function foo(x) { b = 10; } -//CHECK-LABEL:Function(2 params, 4 registers, 1 symbols): +//CHECK-LABEL:Function(2 params, 3 registers, 1 symbols): //CHECK-NEXT:Offset in debug table: source 0x{{.*}}, scope 0x{{.*}} -//CHECK-NEXT: CreateEnvironment r0 -//CHECK-NEXT: LoadParam r1, 1 -//CHECK-NEXT: StoreToEnvironment r0, 0, r1 -//CHECK-NEXT: LoadFromEnvironment r2, r0, 0 -//CHECK-NEXT: JmpTrue L1, r2 -//CHECK-NEXT: LoadConstUInt8 r0, 10 -//CHECK-NEXT: GetGlobalObject r1 -//CHECK-NEXT: PutById r1, r0, 1, "b" +//CHECK-NEXT: CreateEnvironment r1 +//CHECK-NEXT: LoadParam r2, 1 +//CHECK-NEXT: StoreToEnvironment r1, 0, r2 +//CHECK-NEXT: LoadFromEnvironment r1, r1, 0 +//CHECK-NEXT: JmpTrue L1, r1 +//CHECK-NEXT: LoadConstUInt8 r1, 10 +//CHECK-NEXT: GetGlobalObject r2 +//CHECK-NEXT: PutById r2, r1, 1, "b" //CHECK-NEXT: Jmp L2 //CHECK-NEXT:L1: -//CHECK-NEXT: LoadConstUInt8 r0, 10 -//CHECK-NEXT: GetGlobalObject r1 -//CHECK-NEXT: PutById r1, r0, 2, "a" +//CHECK-NEXT: LoadConstUInt8 r1, 10 +//CHECK-NEXT: GetGlobalObject r2 +//CHECK-NEXT: PutById r2, r1, 2, "a" //CHECK-NEXT:L2: -//CHECK-NEXT: LoadConstUndefined r0 -//CHECK-NEXT: Ret r0 +//CHECK-NEXT: LoadConstUndefined r1 +//CHECK-NEXT: Ret r1 //CHKOPT-LABEL:Function(2 params, 3 registers, 0 symbols): //CHKOPT-NEXT:Offset in debug table: source 0x{{.*}}, scope 0x{{.*}} diff --git a/test/IRGen/es6/block-scoping-top-level-scope.js b/test/IRGen/es6/block-scoping-top-level-scope.js index b07ec763766..2855f2fcdc1 100644 --- a/test/IRGen/es6/block-scoping-top-level-scope.js +++ b/test/IRGen/es6/block-scoping-top-level-scope.js @@ -81,213 +81,212 @@ function StrictHasParamExprs() { // BS-NEXT:i9[ASCII, 166..187] #DC9E65B9: notStrictHasParamExprs // BS-NEXT:i10[ASCII, 188..208] #689EB6F3: notStrictNoParamExprs -// BS:Function(1 params, 13 registers, 0 symbols): +// BS:Function(1 params, 4 registers, 0 symbols): // BS-NEXT:Offset in debug table: source 0x0000, scope 0x0000, textified callees 0x0000 // BS-NEXT: DeclareGlobalVar "notStrictNoParamE"... // BS-NEXT: DeclareGlobalVar "notStrictHasParam"... // BS-NEXT: DeclareGlobalVar "StrictNoParamExpr"... // BS-NEXT: DeclareGlobalVar "StrictHasParamExp"... // BS-NEXT: CreateEnvironment r0 -// BS-NEXT: CreateClosure r1, r0, Function -// BS-NEXT: GetGlobalObject r2 -// BS-NEXT: PutById r2, r1, 1, "notStrictNoParamE"... -// BS-NEXT: CreateClosure r3, r0, Function -// BS-NEXT: GetGlobalObject r4 -// BS-NEXT: PutById r4, r3, 2, "notStrictHasParam"... -// BS-NEXT: CreateClosure r5, r0, Function -// BS-NEXT: GetGlobalObject r6 -// BS-NEXT: PutById r6, r5, 3, "StrictNoParamExpr"... -// BS-NEXT: CreateClosure r7, r0, Function -// BS-NEXT: GetGlobalObject r8 -// BS-NEXT: PutById r8, r7, 4, "StrictHasParamExp"... -// BS-NEXT: LoadConstUndefined r10 -// BS-NEXT: Mov r9, r10 -// BS-NEXT: Mov r11, r9 +// BS-NEXT: CreateClosure r2, r0, Function +// BS-NEXT: GetGlobalObject r3 +// BS-NEXT: PutById r3, r2, 1, "notStrictNoParamE"... +// BS-NEXT: CreateClosure r2, r0, Function +// BS-NEXT: GetGlobalObject r3 +// BS-NEXT: PutById r3, r2, 2, "notStrictHasParam"... +// BS-NEXT: CreateClosure r2, r0, Function +// BS-NEXT: GetGlobalObject r3 +// BS-NEXT: PutById r3, r2, 3, "StrictNoParamExpr"... +// BS-NEXT: CreateClosure r2, r0, Function +// BS-NEXT: GetGlobalObject r3 +// BS-NEXT: PutById r3, r2, 4, "StrictHasParamExp"... +// BS-NEXT: LoadConstUndefined r3 +// BS-NEXT: Mov r2, r3 // BS-NEXT: AsyncBreakCheck -// BS-NEXT: Ret r11 +// BS-NEXT: Ret r2 -// BS:Function(1 params, 5 registers, 1 symbols): +// BS:Function(1 params, 4 registers, 1 symbols): // BS-NEXT:Offset in debug table: source 0x003d, scope 0x0003, textified callees 0x0000 // BS-NEXT: CreateEnvironment r0 // BS-NEXT: CreateInnerEnvironment r1, r0, 0 -// BS-NEXT: CreateClosure r2, r1, Function -// BS-NEXT: StoreToEnvironment r0, 0, r2 +// BS-NEXT: CreateClosure r3, r1, Function +// BS-NEXT: StoreToEnvironment r0, 0, r3 // BS-NEXT: LoadConstUndefined r3 // BS-NEXT: AsyncBreakCheck // BS-NEXT: Ret r3 -// BS:Function(2 params, 8 registers, 2 symbols): +// BS:Function(2 params, 4 registers, 2 symbols): // BS-NEXT:Offset in debug table: source 0x0051, scope 0x000a, textified callees 0x0000 // BS-NEXT: CreateEnvironment r0 -// BS-NEXT: LoadParam r2, 1 -// BS-NEXT: StoreToEnvironment r0, 0, r2 +// BS-NEXT: LoadParam r3, 1 +// BS-NEXT: StoreToEnvironment r0, 0, r3 // BS-NEXT: LoadConstUndefined r3 // BS-NEXT: StoreNPToEnvironment r0, 1, r3 // BS-NEXT: CreateInnerEnvironment r1, r0, 1 -// BS-NEXT: LoadConstUndefined r4 -// BS-NEXT: StoreNPToEnvironment r1, 0, r4 -// BS-NEXT: LoadConstUndefined r5 -// BS-NEXT: StoreNPToEnvironment r1, 0, r5 -// BS-NEXT: LoadConstUndefined r6 +// BS-NEXT: LoadConstUndefined r3 +// BS-NEXT: StoreNPToEnvironment r1, 0, r3 +// BS-NEXT: LoadConstUndefined r3 +// BS-NEXT: StoreNPToEnvironment r1, 0, r3 +// BS-NEXT: LoadConstUndefined r3 // BS-NEXT: AsyncBreakCheck -// BS-NEXT: Ret r6 +// BS-NEXT: Ret r3 -// BS:Function(1 params, 5 registers, 1 symbols): +// BS:Function(1 params, 4 registers, 1 symbols): // BS-NEXT:Offset in debug table: source 0x006f, scope 0x0013, textified callees 0x0000 // BS-NEXT: CreateEnvironment r0 // BS-NEXT: CreateInnerEnvironment r1, r0, 0 -// BS-NEXT: CreateClosure r2, r1, Function -// BS-NEXT: StoreToEnvironment r0, 0, r2 +// BS-NEXT: CreateClosure r3, r1, Function +// BS-NEXT: StoreToEnvironment r0, 0, r3 // BS-NEXT: LoadConstUndefined r3 // BS-NEXT: AsyncBreakCheck // BS-NEXT: Ret r3 -// BS:Function(1 params, 14 registers, 2 symbols): +// BS:Function(1 params, 10 registers, 2 symbols): // BS-NEXT:Offset in debug table: source 0x0083, scope 0x001a, textified callees 0x0000 // BS-NEXT: CreateEnvironment r0 -// BS-NEXT: LoadParam r7, 1 +// BS-NEXT: LoadParam r9, 1 // BS-NEXT: CreateInnerEnvironment r1, r0, 0 // BS-NEXT: LoadConstEmpty r8 // BS-NEXT: StoreToEnvironment r0, 0, r8 -// BS-NEXT: LoadConstUndefined r9 -// BS-NEXT: StrictNeq r10, r7, r9 -// BS-NEXT: Mov r6, r7 +// BS-NEXT: LoadConstUndefined r8 +// BS-NEXT: StrictNeq r8, r9, r8 +// BS-NEXT: Mov r6, r9 // BS-NEXT: AsyncBreakCheck -// BS-NEXT: JmpTrue L1, r10 +// BS-NEXT: JmpTrue L1, r8 // BS-NEXT: CreateInnerEnvironment r2, r1, 1 -// BS-NEXT: CreateClosure r7, r2, Function -// BS-NEXT: StoreToEnvironment r2, 0, r7 +// BS-NEXT: CreateClosure r8, r2, Function +// BS-NEXT: StoreToEnvironment r2, 0, r8 // BS-NEXT: CreateInnerEnvironment r3, r1, 1 // BS-NEXT: CreateClosure r8, r3, Function // BS-NEXT: StoreToEnvironment r3, 0, r8 // BS-NEXT: Mov r6, r8 // BS-NEXT:L1: // BS-NEXT: StoreToEnvironment r0, 0, r6 -// BS-NEXT: LoadFromEnvironment r7, r0, 0 -// BS-NEXT: ThrowIfEmpty r8, r7 +// BS-NEXT: LoadFromEnvironment r8, r0, 0 +// BS-NEXT: ThrowIfEmpty r8, r8 // BS-NEXT: StoreToEnvironment r0, 1, r8 // BS-NEXT: CreateInnerEnvironment r4, r1, 1 -// BS-NEXT: LoadConstUndefined r9 -// BS-NEXT: StoreNPToEnvironment r4, 0, r9 +// BS-NEXT: LoadConstUndefined r8 +// BS-NEXT: StoreNPToEnvironment r4, 0, r8 // BS-NEXT: CreateInnerEnvironment r5, r4, 1 -// BS-NEXT: LoadConstUndefined r10 -// BS-NEXT: StoreNPToEnvironment r5, 0, r10 -// BS-NEXT: LoadConstUndefined r11 -// BS-NEXT: StoreNPToEnvironment r5, 0, r11 -// BS-NEXT: LoadConstUndefined r12 -// BS-NEXT: Ret r12 - -// BS:Function(2 params, 8 registers, 2 symbols): +// BS-NEXT: LoadConstUndefined r8 +// BS-NEXT: StoreNPToEnvironment r5, 0, r8 +// BS-NEXT: LoadConstUndefined r8 +// BS-NEXT: StoreNPToEnvironment r5, 0, r8 +// BS-NEXT: LoadConstUndefined r8 +// BS-NEXT: Ret r8 + +// BS:Function(2 params, 4 registers, 2 symbols): // BS-NEXT:Offset in debug table: source 0x00d3, scope 0x0034, textified callees 0x0000 // BS-NEXT: CreateEnvironment r0 -// BS-NEXT: LoadParam r2, 1 -// BS-NEXT: StoreToEnvironment r0, 0, r2 +// BS-NEXT: LoadParam r3, 1 +// BS-NEXT: StoreToEnvironment r0, 0, r3 // BS-NEXT: LoadConstUndefined r3 // BS-NEXT: StoreNPToEnvironment r0, 1, r3 // BS-NEXT: CreateInnerEnvironment r1, r0, 1 -// BS-NEXT: LoadConstUndefined r4 -// BS-NEXT: StoreNPToEnvironment r1, 0, r4 -// BS-NEXT: LoadConstUndefined r5 -// BS-NEXT: StoreNPToEnvironment r1, 0, r5 -// BS-NEXT: LoadConstUndefined r6 +// BS-NEXT: LoadConstUndefined r3 +// BS-NEXT: StoreNPToEnvironment r1, 0, r3 +// BS-NEXT: LoadConstUndefined r3 +// BS-NEXT: StoreNPToEnvironment r1, 0, r3 +// BS-NEXT: LoadConstUndefined r3 // BS-NEXT: AsyncBreakCheck -// BS-NEXT: Ret r6 +// BS-NEXT: Ret r3 // BS:Function(1 params, 4 registers, 0 symbols): // BS-NEXT:Offset in debug table: source 0x00f1, scope 0x0040, textified callees 0x0000 // BS-NEXT: CreateEnvironment r0 // BS-NEXT: CreateInnerEnvironment r1, r0, 0 -// BS-NEXT: LoadConstUndefined r2 +// BS-NEXT: LoadConstUndefined r3 // BS-NEXT: AsyncBreakCheck -// BS-NEXT: Ret r2 +// BS-NEXT: Ret r3 -// BS:Function(1 params, 4 registers, 1 symbols): +// BS:Function(1 params, 3 registers, 1 symbols): // BS-NEXT:Offset in debug table: source 0x00fb, scope 0x0047, textified callees 0x0000 // BS-NEXT: CreateEnvironment r0 -// BS-NEXT: CreateClosure r1, r0, Function -// BS-NEXT: StoreToEnvironment r0, 0, r1 +// BS-NEXT: CreateClosure r2, r0, Function +// BS-NEXT: StoreToEnvironment r0, 0, r2 // BS-NEXT: LoadConstUndefined r2 // BS-NEXT: AsyncBreakCheck // BS-NEXT: Ret r2 -// BS:Function(2 params, 7 registers, 3 symbols): +// BS:Function(2 params, 3 registers, 3 symbols): // BS-NEXT:Offset in debug table: source 0x0112, scope 0x004c, textified callees 0x0000 // BS-NEXT: CreateEnvironment r0 -// BS-NEXT: LoadParam r1, 1 -// BS-NEXT: StoreToEnvironment r0, 0, r1 +// BS-NEXT: LoadParam r2, 1 +// BS-NEXT: StoreToEnvironment r0, 0, r2 // BS-NEXT: LoadConstUndefined r2 // BS-NEXT: StoreNPToEnvironment r0, 1, r2 -// BS-NEXT: LoadConstUndefined r3 -// BS-NEXT: StoreNPToEnvironment r0, 2, r3 -// BS-NEXT: LoadConstUndefined r4 -// BS-NEXT: StoreNPToEnvironment r0, 2, r4 -// BS-NEXT: LoadConstUndefined r5 +// BS-NEXT: LoadConstUndefined r2 +// BS-NEXT: StoreNPToEnvironment r0, 2, r2 +// BS-NEXT: LoadConstUndefined r2 +// BS-NEXT: StoreNPToEnvironment r0, 2, r2 +// BS-NEXT: LoadConstUndefined r2 // BS-NEXT: AsyncBreakCheck -// BS-NEXT: Ret r5 +// BS-NEXT: Ret r2 -// BS:Function(1 params, 4 registers, 1 symbols): +// BS:Function(1 params, 3 registers, 1 symbols): // BS-NEXT:Offset in debug table: source 0x0135, scope 0x0053, textified callees 0x0000 // BS-NEXT: CreateEnvironment r0 -// BS-NEXT: CreateClosure r1, r0, Function -// BS-NEXT: StoreToEnvironment r0, 0, r1 +// BS-NEXT: CreateClosure r2, r0, Function +// BS-NEXT: StoreToEnvironment r0, 0, r2 // BS-NEXT: LoadConstUndefined r2 // BS-NEXT: AsyncBreakCheck // BS-NEXT: Ret r2 -// BS:Function(1 params, 12 registers, 2 symbols): +// BS:Function(1 params, 8 registers, 2 symbols): // BS-NEXT:Offset in debug table: source 0x014c, scope 0x0058, textified callees 0x0000 // BS-NEXT: CreateEnvironment r0 -// BS-NEXT: LoadParam r5, 1 +// BS-NEXT: LoadParam r7, 1 // BS-NEXT: LoadConstEmpty r6 // BS-NEXT: StoreToEnvironment r0, 0, r6 -// BS-NEXT: LoadConstUndefined r7 -// BS-NEXT: StrictNeq r8, r5, r7 -// BS-NEXT: Mov r4, r5 +// BS-NEXT: LoadConstUndefined r6 +// BS-NEXT: StrictNeq r6, r7, r6 +// BS-NEXT: Mov r4, r7 // BS-NEXT: AsyncBreakCheck -// BS-NEXT: JmpTrue L1, r8 +// BS-NEXT: JmpTrue L1, r6 // BS-NEXT: CreateInnerEnvironment r1, r0, 1 -// BS-NEXT: CreateClosure r5, r1, Function -// BS-NEXT: StoreToEnvironment r1, 0, r5 +// BS-NEXT: CreateClosure r6, r1, Function +// BS-NEXT: StoreToEnvironment r1, 0, r6 // BS-NEXT: CreateInnerEnvironment r2, r0, 1 // BS-NEXT: CreateClosure r6, r2, Function // BS-NEXT: StoreToEnvironment r2, 0, r6 // BS-NEXT: Mov r4, r6 // BS-NEXT:L1: // BS-NEXT: StoreToEnvironment r0, 0, r4 -// BS-NEXT: LoadFromEnvironment r5, r0, 0 -// BS-NEXT: ThrowIfEmpty r6, r5 +// BS-NEXT: LoadFromEnvironment r6, r0, 0 +// BS-NEXT: ThrowIfEmpty r6, r6 // BS-NEXT: StoreToEnvironment r0, 1, r6 // BS-NEXT: CreateInnerEnvironment r3, r0, 2 -// BS-NEXT: LoadConstUndefined r7 -// BS-NEXT: StoreNPToEnvironment r3, 0, r7 -// BS-NEXT: LoadConstUndefined r8 -// BS-NEXT: StoreNPToEnvironment r3, 1, r8 -// BS-NEXT: LoadConstUndefined r9 -// BS-NEXT: StoreNPToEnvironment r3, 1, r9 -// BS-NEXT: LoadConstUndefined r10 -// BS-NEXT: Ret r10 +// BS-NEXT: LoadConstUndefined r6 +// BS-NEXT: StoreNPToEnvironment r3, 0, r6 +// BS-NEXT: LoadConstUndefined r6 +// BS-NEXT: StoreNPToEnvironment r3, 1, r6 +// BS-NEXT: LoadConstUndefined r6 +// BS-NEXT: StoreNPToEnvironment r3, 1, r6 +// BS-NEXT: LoadConstUndefined r6 +// BS-NEXT: Ret r6 -// BS:Function(2 params, 7 registers, 3 symbols): +// BS:Function(2 params, 3 registers, 3 symbols): // BS-NEXT:Offset in debug table: source 0x01ab, scope 0x0070, textified callees 0x0000 // BS-NEXT: CreateEnvironment r0 -// BS-NEXT: LoadParam r1, 1 -// BS-NEXT: StoreToEnvironment r0, 0, r1 +// BS-NEXT: LoadParam r2, 1 +// BS-NEXT: StoreToEnvironment r0, 0, r2 // BS-NEXT: LoadConstUndefined r2 // BS-NEXT: StoreNPToEnvironment r0, 1, r2 -// BS-NEXT: LoadConstUndefined r3 -// BS-NEXT: StoreNPToEnvironment r0, 2, r3 -// BS-NEXT: LoadConstUndefined r4 -// BS-NEXT: StoreNPToEnvironment r0, 2, r4 -// BS-NEXT: LoadConstUndefined r5 +// BS-NEXT: LoadConstUndefined r2 +// BS-NEXT: StoreNPToEnvironment r0, 2, r2 +// BS-NEXT: LoadConstUndefined r2 +// BS-NEXT: StoreNPToEnvironment r0, 2, r2 +// BS-NEXT: LoadConstUndefined r2 // BS-NEXT: AsyncBreakCheck -// BS-NEXT: Ret r5 +// BS-NEXT: Ret r2 // BS:Function(1 params, 3 registers, 0 symbols): // BS-NEXT:Offset in debug table: source 0x01ce, scope 0x007a, textified callees 0x0000 // BS-NEXT: CreateEnvironment r0 -// BS-NEXT: LoadConstUndefined r1 +// BS-NEXT: LoadConstUndefined r2 // BS-NEXT: AsyncBreakCheck -// BS-NEXT: Ret r1 +// BS-NEXT: Ret r2 // BS:Debug filename table: // BS-NEXT: 0: {{.*}}block-scoping-top-level-scope.js @@ -307,7 +306,7 @@ function StrictHasParamExprs() { // BS-NEXT: bc 68: line 11 col 1 scope offset 0x0000 env r0 // BS-NEXT: bc 74: line 11 col 1 scope offset 0x0000 env r0 // BS-NEXT: bc 79: line 11 col 1 scope offset 0x0000 env r0 -// BS-NEXT: bc 83: line 51 col 1 scope offset 0x0000 env r0 +// BS-NEXT: bc 80: line 51 col 1 scope offset 0x0000 env r0 // BS-NEXT: 0x003d function idx 1, starts at line 11 col 1 // BS-NEXT: bc 9: line 11 col 1 scope offset 0x0007 env r1 // BS-NEXT: bc 14: line 11 col 1 scope offset 0x0007 env r1 @@ -491,190 +490,189 @@ function StrictHasParamExprs() { // NOBS-NEXT:i9[ASCII, 166..187] #DC9E65B9: notStrictHasParamExprs // NOBS-NEXT:i10[ASCII, 188..208] #689EB6F3: notStrictNoParamExprs -// NOBS:Function(1 params, 13 registers, 0 symbols): +// NOBS:Function(1 params, 4 registers, 0 symbols): // NOBS-NEXT:Offset in debug table: source 0x0000, scope 0x0000, textified callees 0x0000 // NOBS-NEXT: DeclareGlobalVar "notStrictNoParamE"... // NOBS-NEXT: DeclareGlobalVar "notStrictHasParam"... // NOBS-NEXT: DeclareGlobalVar "StrictNoParamExpr"... // NOBS-NEXT: DeclareGlobalVar "StrictHasParamExp"... // NOBS-NEXT: CreateEnvironment r0 -// NOBS-NEXT: CreateClosure r1, r0, Function -// NOBS-NEXT: GetGlobalObject r2 -// NOBS-NEXT: PutById r2, r1, 1, "notStrictNoParamE"... -// NOBS-NEXT: CreateClosure r3, r0, Function -// NOBS-NEXT: GetGlobalObject r4 -// NOBS-NEXT: PutById r4, r3, 2, "notStrictHasParam"... -// NOBS-NEXT: CreateClosure r5, r0, Function -// NOBS-NEXT: GetGlobalObject r6 -// NOBS-NEXT: PutById r6, r5, 3, "StrictNoParamExpr"... -// NOBS-NEXT: CreateClosure r7, r0, Function -// NOBS-NEXT: GetGlobalObject r8 -// NOBS-NEXT: PutById r8, r7, 4, "StrictHasParamExp"... -// NOBS-NEXT: LoadConstUndefined r10 -// NOBS-NEXT: Mov r9, r10 -// NOBS-NEXT: Mov r11, r9 +// NOBS-NEXT: CreateClosure r2, r0, Function +// NOBS-NEXT: GetGlobalObject r3 +// NOBS-NEXT: PutById r3, r2, 1, "notStrictNoParamE"... +// NOBS-NEXT: CreateClosure r2, r0, Function +// NOBS-NEXT: GetGlobalObject r3 +// NOBS-NEXT: PutById r3, r2, 2, "notStrictHasParam"... +// NOBS-NEXT: CreateClosure r2, r0, Function +// NOBS-NEXT: GetGlobalObject r3 +// NOBS-NEXT: PutById r3, r2, 3, "StrictNoParamExpr"... +// NOBS-NEXT: CreateClosure r2, r0, Function +// NOBS-NEXT: GetGlobalObject r3 +// NOBS-NEXT: PutById r3, r2, 4, "StrictHasParamExp"... +// NOBS-NEXT: LoadConstUndefined r3 +// NOBS-NEXT: Mov r2, r3 // NOBS-NEXT: AsyncBreakCheck -// NOBS-NEXT: Ret r11 +// NOBS-NEXT: Ret r2 -// NOBS:Function(1 params, 4 registers, 1 symbols): +// NOBS:Function(1 params, 3 registers, 1 symbols): // NOBS-NEXT:Offset in debug table: source 0x003d, scope 0x0003, textified callees 0x0000 // NOBS-NEXT: CreateEnvironment r0 -// NOBS-NEXT: CreateClosure r1, r0, Function -// NOBS-NEXT: StoreToEnvironment r0, 0, r1 +// NOBS-NEXT: CreateClosure r2, r0, Function +// NOBS-NEXT: StoreToEnvironment r0, 0, r2 // NOBS-NEXT: LoadConstUndefined r2 // NOBS-NEXT: AsyncBreakCheck // NOBS-NEXT: Ret r2 -// NOBS:Function(2 params, 7 registers, 3 symbols): +// NOBS:Function(2 params, 3 registers, 3 symbols): // NOBS-NEXT:Offset in debug table: source 0x0051, scope 0x0007, textified callees 0x0000 // NOBS-NEXT: CreateEnvironment r0 -// NOBS-NEXT: LoadParam r1, 1 -// NOBS-NEXT: StoreToEnvironment r0, 0, r1 +// NOBS-NEXT: LoadParam r2, 1 +// NOBS-NEXT: StoreToEnvironment r0, 0, r2 // NOBS-NEXT: LoadConstUndefined r2 // NOBS-NEXT: StoreNPToEnvironment r0, 1, r2 -// NOBS-NEXT: LoadConstUndefined r3 -// NOBS-NEXT: StoreNPToEnvironment r0, 2, r3 -// NOBS-NEXT: LoadConstUndefined r4 -// NOBS-NEXT: StoreNPToEnvironment r0, 2, r4 -// NOBS-NEXT: LoadConstUndefined r5 +// NOBS-NEXT: LoadConstUndefined r2 +// NOBS-NEXT: StoreNPToEnvironment r0, 2, r2 +// NOBS-NEXT: LoadConstUndefined r2 +// NOBS-NEXT: StoreNPToEnvironment r0, 2, r2 +// NOBS-NEXT: LoadConstUndefined r2 // NOBS-NEXT: AsyncBreakCheck -// NOBS-NEXT: Ret r5 +// NOBS-NEXT: Ret r2 -// NOBS:Function(1 params, 4 registers, 1 symbols): +// NOBS:Function(1 params, 3 registers, 1 symbols): // NOBS-NEXT:Offset in debug table: source 0x006f, scope 0x000d, textified callees 0x0000 // NOBS-NEXT: CreateEnvironment r0 -// NOBS-NEXT: CreateClosure r1, r0, Function -// NOBS-NEXT: StoreToEnvironment r0, 0, r1 +// NOBS-NEXT: CreateClosure r2, r0, Function +// NOBS-NEXT: StoreToEnvironment r0, 0, r2 // NOBS-NEXT: LoadConstUndefined r2 // NOBS-NEXT: AsyncBreakCheck // NOBS-NEXT: Ret r2 -// NOBS:Function(1 params, 7 registers, 5 symbols): +// NOBS:Function(1 params, 5 registers, 5 symbols): // NOBS-NEXT:Offset in debug table: source 0x0083, scope 0x0011, textified callees 0x0000 // NOBS-NEXT: CreateEnvironment r0 -// NOBS-NEXT: LoadParam r2, 1 +// NOBS-NEXT: LoadParam r4, 1 // NOBS-NEXT: LoadConstUndefined r3 -// NOBS-NEXT: StrictNeq r4, r2, r3 -// NOBS-NEXT: Mov r1, r2 +// NOBS-NEXT: StrictNeq r3, r4, r3 +// NOBS-NEXT: Mov r1, r4 // NOBS-NEXT: AsyncBreakCheck -// NOBS-NEXT: JmpTrue L1, r4 -// NOBS-NEXT: CreateClosure r2, r0, Function -// NOBS-NEXT: StoreToEnvironment r0, 1, r2 +// NOBS-NEXT: JmpTrue L1, r3 +// NOBS-NEXT: CreateClosure r3, r0, Function +// NOBS-NEXT: StoreToEnvironment r0, 1, r3 // NOBS-NEXT: CreateClosure r3, r0, Function // NOBS-NEXT: StoreToEnvironment r0, 2, r3 // NOBS-NEXT: Mov r1, r3 // NOBS-NEXT:L1: // NOBS-NEXT: StoreToEnvironment r0, 0, r1 -// NOBS-NEXT: LoadConstUndefined r2 -// NOBS-NEXT: StoreNPToEnvironment r0, 3, r2 +// NOBS-NEXT: LoadConstUndefined r3 +// NOBS-NEXT: StoreNPToEnvironment r0, 3, r3 // NOBS-NEXT: LoadConstUndefined r3 // NOBS-NEXT: StoreNPToEnvironment r0, 4, r3 -// NOBS-NEXT: LoadConstUndefined r4 -// NOBS-NEXT: StoreNPToEnvironment r0, 4, r4 -// NOBS-NEXT: LoadConstUndefined r5 -// NOBS-NEXT: Ret r5 +// NOBS-NEXT: LoadConstUndefined r3 +// NOBS-NEXT: StoreNPToEnvironment r0, 4, r3 +// NOBS-NEXT: LoadConstUndefined r3 +// NOBS-NEXT: Ret r3 -// NOBS:Function(2 params, 7 registers, 3 symbols): +// NOBS:Function(2 params, 3 registers, 3 symbols): // NOBS-NEXT:Offset in debug table: source 0x00bf, scope 0x001b, textified callees 0x0000 // NOBS-NEXT: CreateEnvironment r0 -// NOBS-NEXT: LoadParam r1, 1 -// NOBS-NEXT: StoreToEnvironment r0, 0, r1 +// NOBS-NEXT: LoadParam r2, 1 +// NOBS-NEXT: StoreToEnvironment r0, 0, r2 // NOBS-NEXT: LoadConstUndefined r2 // NOBS-NEXT: StoreNPToEnvironment r0, 1, r2 -// NOBS-NEXT: LoadConstUndefined r3 -// NOBS-NEXT: StoreNPToEnvironment r0, 2, r3 -// NOBS-NEXT: LoadConstUndefined r4 -// NOBS-NEXT: StoreNPToEnvironment r0, 2, r4 -// NOBS-NEXT: LoadConstUndefined r5 +// NOBS-NEXT: LoadConstUndefined r2 +// NOBS-NEXT: StoreNPToEnvironment r0, 2, r2 +// NOBS-NEXT: LoadConstUndefined r2 +// NOBS-NEXT: StoreNPToEnvironment r0, 2, r2 +// NOBS-NEXT: LoadConstUndefined r2 // NOBS-NEXT: AsyncBreakCheck -// NOBS-NEXT: Ret r5 +// NOBS-NEXT: Ret r2 // NOBS:Function(1 params, 3 registers, 0 symbols): // NOBS-NEXT:Offset in debug table: source 0x00dd, scope 0x0024, textified callees 0x0000 // NOBS-NEXT: CreateEnvironment r0 -// NOBS-NEXT: LoadConstUndefined r1 +// NOBS-NEXT: LoadConstUndefined r2 // NOBS-NEXT: AsyncBreakCheck -// NOBS-NEXT: Ret r1 +// NOBS-NEXT: Ret r2 -// NOBS:Function(1 params, 4 registers, 1 symbols): +// NOBS:Function(1 params, 3 registers, 1 symbols): // NOBS-NEXT:Offset in debug table: source 0x00e6, scope 0x0027, textified callees 0x0000 // NOBS-NEXT: CreateEnvironment r0 -// NOBS-NEXT: CreateClosure r1, r0, Function -// NOBS-NEXT: StoreToEnvironment r0, 0, r1 +// NOBS-NEXT: CreateClosure r2, r0, Function +// NOBS-NEXT: StoreToEnvironment r0, 0, r2 // NOBS-NEXT: LoadConstUndefined r2 // NOBS-NEXT: AsyncBreakCheck // NOBS-NEXT: Ret r2 -// NOBS:Function(2 params, 7 registers, 3 symbols): +// NOBS:Function(2 params, 3 registers, 3 symbols): // NOBS-NEXT:Offset in debug table: source 0x00fa, scope 0x002c, textified callees 0x0000 // NOBS-NEXT: CreateEnvironment r0 -// NOBS-NEXT: LoadParam r1, 1 -// NOBS-NEXT: StoreToEnvironment r0, 0, r1 +// NOBS-NEXT: LoadParam r2, 1 +// NOBS-NEXT: StoreToEnvironment r0, 0, r2 // NOBS-NEXT: LoadConstUndefined r2 // NOBS-NEXT: StoreNPToEnvironment r0, 1, r2 -// NOBS-NEXT: LoadConstUndefined r3 -// NOBS-NEXT: StoreNPToEnvironment r0, 2, r3 -// NOBS-NEXT: LoadConstUndefined r4 -// NOBS-NEXT: StoreNPToEnvironment r0, 2, r4 -// NOBS-NEXT: LoadConstUndefined r5 +// NOBS-NEXT: LoadConstUndefined r2 +// NOBS-NEXT: StoreNPToEnvironment r0, 2, r2 +// NOBS-NEXT: LoadConstUndefined r2 +// NOBS-NEXT: StoreNPToEnvironment r0, 2, r2 +// NOBS-NEXT: LoadConstUndefined r2 // NOBS-NEXT: AsyncBreakCheck -// NOBS-NEXT: Ret r5 +// NOBS-NEXT: Ret r2 -// NOBS:Function(1 params, 4 registers, 1 symbols): +// NOBS:Function(1 params, 3 registers, 1 symbols): // NOBS-NEXT:Offset in debug table: source 0x0118, scope 0x0032, textified callees 0x0000 // NOBS-NEXT: CreateEnvironment r0 -// NOBS-NEXT: CreateClosure r1, r0, Function -// NOBS-NEXT: StoreToEnvironment r0, 0, r1 +// NOBS-NEXT: CreateClosure r2, r0, Function +// NOBS-NEXT: StoreToEnvironment r0, 0, r2 // NOBS-NEXT: LoadConstUndefined r2 // NOBS-NEXT: AsyncBreakCheck // NOBS-NEXT: Ret r2 -// NOBS:Function(1 params, 7 registers, 5 symbols): +// NOBS:Function(1 params, 5 registers, 5 symbols): // NOBS-NEXT:Offset in debug table: source 0x012c, scope 0x0037, textified callees 0x0000 // NOBS-NEXT: CreateEnvironment r0 -// NOBS-NEXT: LoadParam r2, 1 +// NOBS-NEXT: LoadParam r4, 1 // NOBS-NEXT: LoadConstUndefined r3 -// NOBS-NEXT: StrictNeq r4, r2, r3 -// NOBS-NEXT: Mov r1, r2 +// NOBS-NEXT: StrictNeq r3, r4, r3 +// NOBS-NEXT: Mov r1, r4 // NOBS-NEXT: AsyncBreakCheck -// NOBS-NEXT: JmpTrue L1, r4 -// NOBS-NEXT: CreateClosure r2, r0, Function -// NOBS-NEXT: StoreToEnvironment r0, 1, r2 +// NOBS-NEXT: JmpTrue L1, r3 +// NOBS-NEXT: CreateClosure r3, r0, Function +// NOBS-NEXT: StoreToEnvironment r0, 1, r3 // NOBS-NEXT: CreateClosure r3, r0, Function // NOBS-NEXT: StoreToEnvironment r0, 2, r3 // NOBS-NEXT: Mov r1, r3 // NOBS-NEXT:L1: // NOBS-NEXT: StoreToEnvironment r0, 0, r1 -// NOBS-NEXT: LoadConstUndefined r2 -// NOBS-NEXT: StoreNPToEnvironment r0, 3, r2 +// NOBS-NEXT: LoadConstUndefined r3 +// NOBS-NEXT: StoreNPToEnvironment r0, 3, r3 +// NOBS-NEXT: LoadConstUndefined r3 +// NOBS-NEXT: StoreNPToEnvironment r0, 4, r3 // NOBS-NEXT: LoadConstUndefined r3 // NOBS-NEXT: StoreNPToEnvironment r0, 4, r3 -// NOBS-NEXT: LoadConstUndefined r4 -// NOBS-NEXT: StoreNPToEnvironment r0, 4, r4 -// NOBS-NEXT: LoadConstUndefined r5 -// NOBS-NEXT: Ret r5 +// NOBS-NEXT: LoadConstUndefined r3 +// NOBS-NEXT: Ret r3 -// NOBS:Function(2 params, 7 registers, 3 symbols): +// NOBS:Function(2 params, 3 registers, 3 symbols): // NOBS-NEXT:Offset in debug table: source 0x0168, scope 0x0041, textified callees 0x0000 // NOBS-NEXT: CreateEnvironment r0 -// NOBS-NEXT: LoadParam r1, 1 -// NOBS-NEXT: StoreToEnvironment r0, 0, r1 +// NOBS-NEXT: LoadParam r2, 1 +// NOBS-NEXT: StoreToEnvironment r0, 0, r2 // NOBS-NEXT: LoadConstUndefined r2 // NOBS-NEXT: StoreNPToEnvironment r0, 1, r2 -// NOBS-NEXT: LoadConstUndefined r3 -// NOBS-NEXT: StoreNPToEnvironment r0, 2, r3 -// NOBS-NEXT: LoadConstUndefined r4 -// NOBS-NEXT: StoreNPToEnvironment r0, 2, r4 -// NOBS-NEXT: LoadConstUndefined r5 +// NOBS-NEXT: LoadConstUndefined r2 +// NOBS-NEXT: StoreNPToEnvironment r0, 2, r2 +// NOBS-NEXT: LoadConstUndefined r2 +// NOBS-NEXT: StoreNPToEnvironment r0, 2, r2 +// NOBS-NEXT: LoadConstUndefined r2 // NOBS-NEXT: AsyncBreakCheck -// NOBS-NEXT: Ret r5 +// NOBS-NEXT: Ret r2 // NOBS:Function(1 params, 3 registers, 0 symbols): // NOBS-NEXT:Offset in debug table: source 0x018b, scope 0x004a, textified callees 0x0000 // NOBS-NEXT: CreateEnvironment r0 -// NOBS-NEXT: LoadConstUndefined r1 +// NOBS-NEXT: LoadConstUndefined r2 // NOBS-NEXT: AsyncBreakCheck -// NOBS-NEXT: Ret r1 +// NOBS-NEXT: Ret r2 // NOBS:Debug filename table: // NOBS-NEXT: 0: {{.*}}block-scoping-top-level-scope.js @@ -694,7 +692,7 @@ function StrictHasParamExprs() { // NOBS-NEXT: bc 68: line 11 col 1 scope offset 0x0000 env r0 // NOBS-NEXT: bc 74: line 11 col 1 scope offset 0x0000 env r0 // NOBS-NEXT: bc 79: line 11 col 1 scope offset 0x0000 env r0 -// NOBS-NEXT: bc 83: line 51 col 1 scope offset 0x0000 env r0 +// NOBS-NEXT: bc 80: line 51 col 1 scope offset 0x0000 env r0 // NOBS-NEXT: 0x003d function idx 1, starts at line 11 col 1 // NOBS-NEXT: bc 2: line 11 col 1 scope offset 0x0003 env r0 // NOBS-NEXT: bc 7: line 11 col 1 scope offset 0x0003 env r0 diff --git a/test/IRGen/instance_of.js b/test/IRGen/instance_of.js index 5f22e489660..98492e7cd82 100644 --- a/test/IRGen/instance_of.js +++ b/test/IRGen/instance_of.js @@ -18,29 +18,29 @@ function simple_test0(x, y) { // CHECK-NEXT:globals = [simple_test0] // CHECK-NEXT:S{global#0()#1} = [] // CHECK-NEXT:%BB0: -// CHECK-NEXT: $Reg0 %0 = HBCCreateEnvironmentInst %S{global#0()#1} +// CHECK-NEXT: $Reg1 %0 = HBCCreateEnvironmentInst %S{global#0()#1} // CHECK-NEXT: $Reg1 %1 = HBCCreateFunctionInst %simple_test0#0#1()#2, %0 // CHECK-NEXT: $Reg2 %2 = HBCGetGlobalObjectInst -// CHECK-NEXT: $Reg3 %3 = StorePropertyInst %1 : closure, %2 : object, "simple_test0" : string -// CHECK-NEXT: $Reg3 %4 = AllocStackInst $?anon_0_ret -// CHECK-NEXT: $Reg4 %5 = HBCLoadConstInst undefined : undefined -// CHECK-NEXT: $Reg5 %6 = StoreStackInst %5 : undefined, %4 -// CHECK-NEXT: $Reg5 %7 = LoadStackInst %4 -// CHECK-NEXT: $Reg6 %8 = ReturnInst %7 +// CHECK-NEXT: $Reg0 %3 = StorePropertyInst %1 : closure, %2 : object, "simple_test0" : string +// CHECK-NEXT: $Reg1 %4 = AllocStackInst $?anon_0_ret +// CHECK-NEXT: $Reg2 %5 = HBCLoadConstInst undefined : undefined +// CHECK-NEXT: $Reg0 %6 = StoreStackInst %5 : undefined, %4 +// CHECK-NEXT: $Reg1 %7 = LoadStackInst %4 +// CHECK-NEXT: $Reg0 %8 = ReturnInst %7 // CHECK-NEXT:function_end // CHECK:function simple_test0#0#1(x, y)#2 // CHECK-NEXT:S{simple_test0#0#1()#2} = [x#2, y#2] // CHECK-NEXT:%BB0: -// CHECK-NEXT: $Reg0 %0 = HBCCreateEnvironmentInst %S{simple_test0#0#1()#2} -// CHECK-NEXT: $Reg1 %1 = HBCLoadParamInst 1 : number -// CHECK-NEXT: $Reg2 %2 = HBCLoadParamInst 2 : number -// CHECK-NEXT: $Reg3 %3 = HBCStoreToEnvironmentInst %0, %1, [x#2] -// CHECK-NEXT: $Reg3 %4 = HBCStoreToEnvironmentInst %0, %2, [y#2] -// CHECK-NEXT: $Reg3 %5 = HBCLoadFromEnvironmentInst %0, [x#2] -// CHECK-NEXT: $Reg4 %6 = HBCLoadFromEnvironmentInst %0, [y#2] -// CHECK-NEXT: $Reg5 %7 = BinaryOperatorInst 'instanceof', %5, %6 -// CHECK-NEXT: $Reg6 %8 = ReturnInst %7 +// CHECK-NEXT: $Reg2 %0 = HBCCreateEnvironmentInst %S{simple_test0#0#1()#2} +// CHECK-NEXT: $Reg3 %1 = HBCLoadParamInst 1 : number +// CHECK-NEXT: $Reg1 %2 = HBCLoadParamInst 2 : number +// CHECK-NEXT: $Reg0 %3 = HBCStoreToEnvironmentInst %0, %1, [x#2] +// CHECK-NEXT: $Reg0 %4 = HBCStoreToEnvironmentInst %0, %2, [y#2] +// CHECK-NEXT: $Reg1 %5 = HBCLoadFromEnvironmentInst %0, [x#2] +// CHECK-NEXT: $Reg2 %6 = HBCLoadFromEnvironmentInst %0, [y#2] +// CHECK-NEXT: $Reg1 %7 = BinaryOperatorInst 'instanceof', %5, %6 +// CHECK-NEXT: $Reg0 %8 = ReturnInst %7 // CHECK-NEXT:%BB1: // CHECK-NEXT: $??? %9 = HBCLoadConstInst undefined : undefined // CHECK-NEXT: $??? %10 = ReturnInst %9 : undefined diff --git a/test/Parser/flow/declare-module-import-allowed.js b/test/Parser/flow/declare-module-import-allowed.js index dba3fe40360..f94df253ba3 100644 --- a/test/Parser/flow/declare-module-import-allowed.js +++ b/test/Parser/flow/declare-module-import-allowed.js @@ -11,38 +11,40 @@ declare module Foo { import Bar from "baz"; } -// CHECK: { -// CHECK-NEXT: "type": "Program", -// CHECK-NEXT: "body": [ -// CHECK-NEXT: { -// CHECK-NEXT: "type": "DeclareModule", -// CHECK-NEXT: "id": { -// CHECK-NEXT: "type": "Identifier", -// CHECK-NEXT: "name": "Foo" -// CHECK-NEXT: }, -// CHECK-NEXT: "body": { -// CHECK-NEXT: "type": "BlockStatement", -// CHECK-NEXT: "body": [ -// CHECK-NEXT: { -// CHECK-NEXT: "type": "ImportDeclaration", -// CHECK-NEXT: "specifiers": [ -// CHECK-NEXT: { -// CHECK-NEXT: "type": "ImportDefaultSpecifier", -// CHECK-NEXT: "local": { -// CHECK-NEXT: "type": "Identifier", -// CHECK-NEXT: "name": "Bar" -// CHECK-NEXT: } -// CHECK-NEXT: } -// CHECK-NEXT: ], -// CHECK-NEXT: "source": { -// CHECK-NEXT: "type": "StringLiteral", -// CHECK-NEXT: "value": "baz" -// CHECK-NEXT: }, -// CHECK-NEXT: "assertions": [], -// CHECK-NEXT: "importKind": "value" -// CHECK-NEXT: } -// CHECK-NEXT: ] -// CHECK-NEXT: } -// CHECK-NEXT: } -// CHECK-NEXT: ] -// CHECK-NEXT: } +// Auto-generated content below. Please do not modify manually. + +// CHECK:{ +// CHECK-NEXT: "type": "Program", +// CHECK-NEXT: "body": [ +// CHECK-NEXT: { +// CHECK-NEXT: "type": "DeclareModule", +// CHECK-NEXT: "id": { +// CHECK-NEXT: "type": "Identifier", +// CHECK-NEXT: "name": "Foo" +// CHECK-NEXT: }, +// CHECK-NEXT: "body": { +// CHECK-NEXT: "type": "BlockStatement", +// CHECK-NEXT: "body": [ +// CHECK-NEXT: { +// CHECK-NEXT: "type": "ImportDeclaration", +// CHECK-NEXT: "specifiers": [ +// CHECK-NEXT: { +// CHECK-NEXT: "type": "ImportDefaultSpecifier", +// CHECK-NEXT: "local": { +// CHECK-NEXT: "type": "Identifier", +// CHECK-NEXT: "name": "Bar" +// CHECK-NEXT: } +// CHECK-NEXT: } +// CHECK-NEXT: ], +// CHECK-NEXT: "source": { +// CHECK-NEXT: "type": "StringLiteral", +// CHECK-NEXT: "value": "baz" +// CHECK-NEXT: }, +// CHECK-NEXT: "assertions": [], +// CHECK-NEXT: "importKind": "value" +// CHECK-NEXT: } +// CHECK-NEXT: ] +// CHECK-NEXT: } +// CHECK-NEXT: } +// CHECK-NEXT: ] +// CHECK-NEXT:} diff --git a/test/RA/assign_to_argument.js b/test/RA/assign_to_argument.js index 06fac5d93df..36d5a2433e1 100644 --- a/test/RA/assign_to_argument.js +++ b/test/RA/assign_to_argument.js @@ -17,25 +17,25 @@ function foo(a) { // CHECK-NEXT:globals = [foo] // CHECK-NEXT:S{global#0()#1} = [] // CHECK-NEXT:%BB0: -// CHECK-NEXT: $Reg0 %0 = HBCCreateEnvironmentInst %S{global#0()#1} +// CHECK-NEXT: $Reg1 %0 = HBCCreateEnvironmentInst %S{global#0()#1} // CHECK-NEXT: $Reg1 %1 = HBCCreateFunctionInst %foo#0#1()#2, %0 // CHECK-NEXT: $Reg2 %2 = HBCGetGlobalObjectInst -// CHECK-NEXT: $Reg3 %3 = StorePropertyInst %1 : closure, %2 : object, "foo" : string -// CHECK-NEXT: $Reg3 %4 = AllocStackInst $?anon_0_ret -// CHECK-NEXT: $Reg4 %5 = HBCLoadConstInst undefined : undefined -// CHECK-NEXT: $Reg5 %6 = StoreStackInst %5 : undefined, %4 -// CHECK-NEXT: $Reg5 %7 = LoadStackInst %4 -// CHECK-NEXT: $Reg6 %8 = ReturnInst %7 +// CHECK-NEXT: $Reg0 %3 = StorePropertyInst %1 : closure, %2 : object, "foo" : string +// CHECK-NEXT: $Reg1 %4 = AllocStackInst $?anon_0_ret +// CHECK-NEXT: $Reg2 %5 = HBCLoadConstInst undefined : undefined +// CHECK-NEXT: $Reg0 %6 = StoreStackInst %5 : undefined, %4 +// CHECK-NEXT: $Reg1 %7 = LoadStackInst %4 +// CHECK-NEXT: $Reg0 %8 = ReturnInst %7 // CHECK-NEXT:function_end // CHECK:function foo#0#1(a)#2 // CHECK-NEXT:S{foo#0#1()#2} = [a#2] // CHECK-NEXT:%BB0: -// CHECK-NEXT: $Reg0 %0 = HBCCreateEnvironmentInst %S{foo#0#1()#2} -// CHECK-NEXT: $Reg1 %1 = HBCLoadParamInst 1 : number -// CHECK-NEXT: $Reg2 %2 = HBCStoreToEnvironmentInst %0, %1, [a#2] +// CHECK-NEXT: $Reg1 %0 = HBCCreateEnvironmentInst %S{foo#0#1()#2} +// CHECK-NEXT: $Reg2 %1 = HBCLoadParamInst 1 : number +// CHECK-NEXT: $Reg0 %2 = HBCStoreToEnvironmentInst %0, %1, [a#2] // CHECK-NEXT: $Reg2 %3 = HBCLoadFromEnvironmentInst %0, [a#2] -// CHECK-NEXT: $Reg3 %4 = HBCStoreToEnvironmentInst %0, %3, [a#2] -// CHECK-NEXT: $Reg3 %5 = HBCLoadConstInst undefined : undefined -// CHECK-NEXT: $Reg4 %6 = ReturnInst %5 : undefined +// CHECK-NEXT: $Reg0 %4 = HBCStoreToEnvironmentInst %0, %3, [a#2] +// CHECK-NEXT: $Reg1 %5 = HBCLoadConstInst undefined : undefined +// CHECK-NEXT: $Reg0 %6 = ReturnInst %5 : undefined // CHECK-NEXT:function_end diff --git a/test/RA/callee.js b/test/RA/callee.js index fce52af9f73..e20278ba2c5 100644 --- a/test/RA/callee.js +++ b/test/RA/callee.js @@ -19,46 +19,46 @@ function foo(x) { // CHECK-NEXT:globals = [sink, foo] // CHECK-NEXT:S{global#0()#1} = [] // CHECK-NEXT:%BB0: -// CHECK-NEXT: $Reg0 %0 = HBCCreateEnvironmentInst %S{global#0()#1} -// CHECK-NEXT: $Reg1 %1 = HBCCreateFunctionInst %sink#0#1()#2, %0 -// CHECK-NEXT: $Reg2 %2 = HBCGetGlobalObjectInst -// CHECK-NEXT: $Reg3 %3 = StorePropertyInst %1 : closure, %2 : object, "sink" : string -// CHECK-NEXT: $Reg3 %4 = HBCCreateFunctionInst %foo#0#1()#3, %0 -// CHECK-NEXT: $Reg4 %5 = HBCGetGlobalObjectInst -// CHECK-NEXT: $Reg5 %6 = StorePropertyInst %4 : closure, %5 : object, "foo" : string -// CHECK-NEXT: $Reg5 %7 = AllocStackInst $?anon_0_ret -// CHECK-NEXT: $Reg6 %8 = HBCLoadConstInst undefined : undefined -// CHECK-NEXT: $Reg7 %9 = StoreStackInst %8 : undefined, %7 -// CHECK-NEXT: $Reg7 %10 = LoadStackInst %7 -// CHECK-NEXT: $Reg8 %11 = ReturnInst %10 +// CHECK-NEXT: $Reg1 %0 = HBCCreateEnvironmentInst %S{global#0()#1} +// CHECK-NEXT: $Reg2 %1 = HBCCreateFunctionInst %sink#0#1()#2, %0 +// CHECK-NEXT: $Reg3 %2 = HBCGetGlobalObjectInst +// CHECK-NEXT: $Reg0 %3 = StorePropertyInst %1 : closure, %2 : object, "sink" : string +// CHECK-NEXT: $Reg1 %4 = HBCCreateFunctionInst %foo#0#1()#3, %0 +// CHECK-NEXT: $Reg2 %5 = HBCGetGlobalObjectInst +// CHECK-NEXT: $Reg0 %6 = StorePropertyInst %4 : closure, %5 : object, "foo" : string +// CHECK-NEXT: $Reg1 %7 = AllocStackInst $?anon_0_ret +// CHECK-NEXT: $Reg2 %8 = HBCLoadConstInst undefined : undefined +// CHECK-NEXT: $Reg0 %9 = StoreStackInst %8 : undefined, %7 +// CHECK-NEXT: $Reg1 %10 = LoadStackInst %7 +// CHECK-NEXT: $Reg0 %11 = ReturnInst %10 // CHECK-NEXT:function_end // CHECK:function sink#0#1(x, y, z)#2 // CHECK-NEXT:S{sink#0#1()#2} = [x#2, y#2, z#2] // CHECK-NEXT:%BB0: -// CHECK-NEXT: $Reg0 %0 = HBCCreateEnvironmentInst %S{sink#0#1()#2} -// CHECK-NEXT: $Reg1 %1 = HBCLoadParamInst 1 : number -// CHECK-NEXT: $Reg2 %2 = HBCLoadParamInst 2 : number -// CHECK-NEXT: $Reg3 %3 = HBCLoadParamInst 3 : number -// CHECK-NEXT: $Reg4 %4 = HBCStoreToEnvironmentInst %0, %1, [x#2] -// CHECK-NEXT: $Reg4 %5 = HBCStoreToEnvironmentInst %0, %2, [y#2] -// CHECK-NEXT: $Reg4 %6 = HBCStoreToEnvironmentInst %0, %3, [z#2] -// CHECK-NEXT: $Reg4 %7 = HBCLoadConstInst undefined : undefined -// CHECK-NEXT: $Reg5 %8 = ReturnInst %7 : undefined +// CHECK-NEXT: $Reg1 %0 = HBCCreateEnvironmentInst %S{sink#0#1()#2} +// CHECK-NEXT: $Reg4 %1 = HBCLoadParamInst 1 : number +// CHECK-NEXT: $Reg3 %2 = HBCLoadParamInst 2 : number +// CHECK-NEXT: $Reg2 %3 = HBCLoadParamInst 3 : number +// CHECK-NEXT: $Reg0 %4 = HBCStoreToEnvironmentInst %0, %1, [x#2] +// CHECK-NEXT: $Reg0 %5 = HBCStoreToEnvironmentInst %0, %2, [y#2] +// CHECK-NEXT: $Reg0 %6 = HBCStoreToEnvironmentInst %0, %3, [z#2] +// CHECK-NEXT: $Reg1 %7 = HBCLoadConstInst undefined : undefined +// CHECK-NEXT: $Reg0 %8 = ReturnInst %7 : undefined // CHECK-NEXT:function_end // CHECK:function foo#0#1(x)#2 // CHECK-NEXT:S{foo#0#1()#2} = [x#2] // CHECK-NEXT:%BB0: -// CHECK-NEXT: $Reg0 %0 = HBCCreateEnvironmentInst %S{foo#0#1()#2} +// CHECK-NEXT: $Reg2 %0 = HBCCreateEnvironmentInst %S{foo#0#1()#2} // CHECK-NEXT: $Reg1 %1 = HBCLoadParamInst 1 : number -// CHECK-NEXT: $Reg2 %2 = HBCStoreToEnvironmentInst %0, %1, [x#2] +// CHECK-NEXT: $Reg0 %2 = HBCStoreToEnvironmentInst %0, %1, [x#2] // CHECK-NEXT: $Reg2 %3 = HBCLoadFromEnvironmentInst %0, [x#2] -// CHECK-NEXT: $Reg3 %4 = LoadPropertyInst %3, "sink" : string -// CHECK-NEXT: $Reg4 %5 = HBCLoadConstInst 1 : number -// CHECK-NEXT: $Reg5 %6 = HBCLoadConstInst 2 : number -// CHECK-NEXT: $Reg6 %7 = HBCLoadConstInst 3 : number -// CHECK-NEXT: $Reg7 %8 = CallInst %4, undefined : undefined, %3, %5 : number, %6 : number, %7 : number -// CHECK-NEXT: $Reg7 %9 = HBCLoadConstInst undefined : undefined -// CHECK-NEXT: $Reg8 %10 = ReturnInst %9 : undefined +// CHECK-NEXT: $Reg1 %4 = LoadPropertyInst %3, "sink" : string +// CHECK-NEXT: $Reg3 %5 = HBCLoadConstInst 1 : number +// CHECK-NEXT: $Reg4 %6 = HBCLoadConstInst 2 : number +// CHECK-NEXT: $Reg5 %7 = HBCLoadConstInst 3 : number +// CHECK-NEXT: $Reg0 %8 = CallInst %4, undefined : undefined, %3, %5 : number, %6 : number, %7 : number +// CHECK-NEXT: $Reg1 %9 = HBCLoadConstInst undefined : undefined +// CHECK-NEXT: $Reg0 %10 = ReturnInst %9 : undefined // CHECK-NEXT:function_end