Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: src/arm/builtins-arm.cc

Issue 2057403003: Hooking up asm-wasm conversion. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/builtins-arm.cc
diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc
index a8e1df3b4d5dc46c21c850737bd2cfd825de330e..2fd792a01bd3c398f88bcc22eb320f447da1047f 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 back to regular js.
+ GenerateTailCallToReturnedCode(masm, Runtime::kCompileLazy);
+}
static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) {
// For now, we are relying on the fact that make_code_young doesn't do any
« no previous file with comments | « BUILD.gn ('k') | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698