@@ -1560,96 +1560,6 @@ void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) {
15601560 Generate_InterpreterEnterBytecode (masm);
15611561}
15621562
1563- void Builtins::Generate_InstantiateAsmJs (MacroAssembler* masm) {
1564- // ----------- S t a t e -------------
1565- // -- x0 : argument count (preserved for callee)
1566- // -- x1 : new target (preserved for callee)
1567- // -- x3 : target function (preserved for callee)
1568- // -----------------------------------
1569- Register argc = x0;
1570- Register new_target = x1;
1571- Register target = x3;
1572-
1573- Label failed;
1574- {
1575- FrameScope scope (masm, StackFrame::INTERNAL );
1576-
1577- // Push argument count, a copy of the target function and the new target,
1578- // together with some padding to maintain 16-byte alignment.
1579- __ SmiTag (argc);
1580- __ Push (argc, new_target, target, padreg);
1581-
1582- // Push another copy of new target as a parameter to the runtime call and
1583- // copy the rest of the arguments from caller (stdlib, foreign, heap).
1584- Label args_done;
1585- Register undef = x10;
1586- Register scratch1 = x12;
1587- Register scratch2 = x13;
1588- Register scratch3 = x14;
1589- __ LoadRoot (undef, RootIndex::kUndefinedValue );
1590-
1591- Label at_least_one_arg;
1592- Label three_args;
1593- DCHECK_EQ (0 , Smi::zero ().ptr ());
1594- __ Cbnz (argc, &at_least_one_arg);
1595-
1596- // No arguments.
1597- __ Push (new_target, undef, undef, undef);
1598- __ B (&args_done);
1599-
1600- __ Bind (&at_least_one_arg);
1601- // Load two arguments, though we may only use one (for the one arg case).
1602- __ Ldp (scratch2, scratch1,
1603- MemOperand (fp, StandardFrameConstants::kCallerSPOffset ));
1604-
1605- // Set flags for determining the value of smi-tagged argc.
1606- // lt => 1, eq => 2, gt => 3.
1607- __ CmpTagged (argc, Smi::FromInt (2 ));
1608- __ B (gt, &three_args);
1609-
1610- // One or two arguments.
1611- // If there is one argument (flags are lt), scratch2 contains that argument,
1612- // and scratch1 must be undefined.
1613- __ CmovX (scratch1, scratch2, lt);
1614- __ CmovX (scratch2, undef, lt);
1615- __ Push (new_target, scratch1, scratch2, undef);
1616- __ B (&args_done);
1617-
1618- // Three arguments.
1619- __ Bind (&three_args);
1620- __ Ldr (scratch3, MemOperand (fp, StandardFrameConstants::kCallerSPOffset +
1621- 2 * kSystemPointerSize ));
1622- __ Push (new_target, scratch3, scratch1, scratch2);
1623-
1624- __ Bind (&args_done);
1625-
1626- // Call runtime, on success unwind frame, and parent frame.
1627- __ CallRuntime (Runtime::kInstantiateAsmJs , 4 );
1628-
1629- // A smi 0 is returned on failure, an object on success.
1630- __ JumpIfSmi (x0, &failed);
1631-
1632- // Peek the argument count from the stack, untagging at the same time.
1633- __ SmiUntag (x4, MemOperand (sp, 3 * kSystemPointerSize ));
1634- __ Drop (4 );
1635- scope.GenerateLeaveFrame ();
1636-
1637- // Drop arguments and receiver.
1638- __ DropArguments (x4, TurboAssembler::kCountExcludesReceiver );
1639- __ Ret ();
1640-
1641- __ Bind (&failed);
1642- // Restore target function and new target.
1643- __ Pop (padreg, target, new_target, argc);
1644- __ SmiUntag (argc);
1645- }
1646- // On failure, tail call back to regular js by re-calling the function
1647- // which has be reset to the compile lazy builtin.
1648- __ LoadTaggedPointerField (
1649- x4, FieldMemOperand (new_target, JSFunction::kCodeOffset ));
1650- __ JumpCodeObject (x4);
1651- }
1652-
16531563namespace {
16541564void Generate_ContinueToBuiltinHelper (MacroAssembler* masm,
16551565 bool java_script_builtin,
0 commit comments