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

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

Issue 2761773004: PPC/s390: [wasm] Lazy compilation for asm.js (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | src/builtins/s390/builtins-s390.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/ppc/builtins-ppc.cc
diff --git a/src/builtins/ppc/builtins-ppc.cc b/src/builtins/ppc/builtins-ppc.cc
index 3efae357b4bb5a8c4a5257016dda546c0e620b20..14341704360b8456b9972a11293cb590f5553a87 100644
--- a/src/builtins/ppc/builtins-ppc.cc
+++ b/src/builtins/ppc/builtins-ppc.cc
@@ -3027,6 +3027,35 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
}
}
+void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
+ {
+ FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
+
+ // Save all parameter registers (see wasm-linkage.cc). They might be
+ // overwritten in the runtime call below. We don't have any callee-saved
+ // registers in wasm, so no need to store anything else.
+ const RegList gp_regs = r3.bit() | r4.bit() | r5.bit() | r6.bit() |
+ r7.bit() | r8.bit() | r9.bit() | r10.bit();
+ const RegList fp_regs = d1.bit() | d2.bit() | d3.bit() | d4.bit() |
+ d5.bit() | d6.bit() | d7.bit() | d8.bit();
+ __ MultiPush(gp_regs);
+ __ MultiPushDoubles(fp_regs);
+
+ // Initialize cp register with kZero, CEntryStub will use it to set the
+ // current context on the isolate.
+ __ LoadSmiLiteral(cp, Smi::kZero);
+ __ CallRuntime(Runtime::kWasmCompileLazy);
+ // Store returned instruction start in ip.
+ __ addi(ip, r3, Operand(Code::kHeaderSize - kHeapObjectTag));
+
+ // Restore registers.
+ __ MultiPopDoubles(fp_regs);
+ __ MultiPop(gp_regs);
+ }
+ // Now jump to the instructions of the returned code object.
+ __ Jump(ip);
+}
+
#undef __
} // namespace internal
} // namespace v8
« no previous file with comments | « no previous file | src/builtins/s390/builtins-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698