Chromium Code Reviews| Index: src/arm/builtins-arm.cc |
| diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc |
| index a8e1df3b4d5dc46c21c850737bd2cfd825de330e..011df98d4be925a65b8188bded6e0738c87d9dee 100644 |
| --- a/src/arm/builtins-arm.cc |
| +++ b/src/arm/builtins-arm.cc |
| @@ -1418,6 +1418,48 @@ void Builtins::Generate_CompileOptimizedConcurrent(MacroAssembler* masm) { |
| GenerateTailCallToReturnedCode(masm, Runtime::kCompileOptimized_Concurrent); |
| } |
| +void Builtins::Generate_InstantiateAsmJs(MacroAssembler* masm) { |
| + // ----------- S t a t e ------------- |
| + // -- r0 : argument count (preserved for callee) |
| + // -- r1 : new target (preserved for callee) |
| + // -- r3 : target function (preserved for callee) |
| + // ----------------------------------- |
| + Label failed; |
| + { |
| + FrameScope scope(masm, StackFrame::INTERNAL); |
| + // Push the number of arguments to the callee. |
| + __ SmiTag(r0); |
| + __ push(r0); |
| + // Push a copy of the target function and the new target. |
| + __ push(r1); |
| + __ push(r3); |
| + |
| + // The function. |
| + __ push(r1); |
| + // Copy arguments from caller (stdlib, foreign, heap). |
| + for (int i = 2; i >= 0; --i) { |
| + __ ldr(r4, MemOperand(fp, StandardFrameConstants::kCallerSPOffset + |
| + i * kPointerSize)); |
| + __ push(r4); |
| + } |
| + // Call runtime, on success unwind frame, and parent frame. |
| + __ CallRuntime(Runtime::kInstantiateAsmJs, 4); |
| + // A smi 0 is returned on failure, an object on success. |
| + __ JumpIfSmi(r0, &failed); |
| + scope.GenerateLeaveFrame(); |
| + __ Drop(4); |
| + __ Ret(); |
| + |
| + __ bind(&failed); |
| + // Restore target function and new target. |
| + __ pop(r3); |
| + __ pop(r1); |
| + __ pop(r0); |
| + __ SmiUntag(r0); |
| + } |
| + // On failure, tail call into generated baseline code. |
| + GenerateTailCallToReturnedCode(masm, Runtime::kCompileBaseline); |
|
Michael Starzinger
2016/06/30 09:39:23
nit: s/CompileBaseline/CompileLazy here. Applies t
bradn
2016/07/01 01:06:08
Ah, that's helpful.
Thanks.
Done
|
| +} |
| static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) { |
| // For now, we are relying on the fact that make_code_young doesn't do any |