PPC/s390: [wasm] Introduce specialized WasmCompileLazy frame type.
Port b2abe2cf97
Original Commit Message:
This makes the WasmCompileLazy builtin push a new WASM_COMPILE_LAZY
frame type. We can thereby remove the workaround to return a relocated
instance from the underlying runtime function. It also removes the last
remaining embedded code objects from {WasmCode} objects.
R=mstarzinger@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N
Change-Id: Icdc1ee06a1fade4bb805ae0fadf8219316731cd7
Reviewed-on: https://chromium-review.googlesource.com/1076529
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#53426}
This commit is contained in:
parent
30d7d1a130
commit
8993cff544
@ -2636,12 +2636,13 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
|
||||
|
||||
void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
|
||||
{
|
||||
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
|
||||
FrameAndConstantPoolScope scope(masm, StackFrame::WASM_COMPILE_LAZY);
|
||||
|
||||
// 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.
|
||||
constexpr RegList gp_regs = Register::ListOf<r3, r4, r5, r6, r7, r8, r9>();
|
||||
constexpr RegList gp_regs =
|
||||
Register::ListOf<r3, r4, r5, r6, r7, r8, r9, r10>();
|
||||
constexpr RegList fp_regs =
|
||||
DoubleRegister::ListOf<d1, d2, d3, d4, d5, d6, d7, d8>();
|
||||
__ MultiPush(gp_regs);
|
||||
@ -2653,10 +2654,8 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
|
||||
// set the current context on the isolate.
|
||||
__ LoadSmiLiteral(cp, Smi::kZero);
|
||||
__ CallRuntime(Runtime::kWasmCompileLazy);
|
||||
// The entrypoint address is the first return value.
|
||||
// The entrypoint address is the return value.
|
||||
__ mr(r11, kReturnRegister0);
|
||||
// The WASM instance is the second return value.
|
||||
__ mr(kWasmInstanceRegister, kReturnRegister1);
|
||||
|
||||
// Restore registers.
|
||||
__ MultiPopDoubles(fp_regs);
|
||||
|
@ -2648,7 +2648,7 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
|
||||
|
||||
void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
|
||||
{
|
||||
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
|
||||
FrameAndConstantPoolScope scope(masm, StackFrame::WASM_COMPILE_LAZY);
|
||||
|
||||
// Save all parameter registers (see wasm-linkage.cc). They might be
|
||||
// overwritten in the runtime call below. We don't have any callee-saved
|
||||
@ -2668,10 +2668,8 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
|
||||
// set the current context on the isolate.
|
||||
__ LoadSmiLiteral(cp, Smi::kZero);
|
||||
__ CallRuntime(Runtime::kWasmCompileLazy);
|
||||
// The entrypoint address is the first return value.
|
||||
// The entrypoint address is the return value.
|
||||
__ LoadRR(ip, r2);
|
||||
// The WASM instance is the second return value.
|
||||
__ LoadRR(kWasmInstanceRegister, kReturnRegister1);
|
||||
|
||||
// Restore registers.
|
||||
__ MultiPopDoubles(fp_regs);
|
||||
|
@ -32,6 +32,19 @@ class ExitFrameConstants : public TypedFrameConstants {
|
||||
static constexpr int kCallerSPDisplacement = 2 * kPointerSize;
|
||||
};
|
||||
|
||||
class WasmCompileLazyFrameConstants : public TypedFrameConstants {
|
||||
public:
|
||||
static constexpr int kNumberOfSavedGpParamRegs = 8;
|
||||
static constexpr int kNumberOfSavedFpParamRegs = 8;
|
||||
|
||||
// FP-relative.
|
||||
static constexpr int kWasmInstanceOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
|
||||
static constexpr int kFixedFrameSizeFromFp =
|
||||
TypedFrameConstants::kFixedFrameSizeFromFp +
|
||||
kNumberOfSavedGpParamRegs * kPointerSize +
|
||||
kNumberOfSavedFpParamRegs * kDoubleSize;
|
||||
};
|
||||
|
||||
class JavaScriptFrameConstants : public AllStatic {
|
||||
public:
|
||||
// FP-relative.
|
||||
|
@ -30,6 +30,23 @@ class ExitFrameConstants : public TypedFrameConstants {
|
||||
static constexpr int kCallerSPDisplacement = 2 * kPointerSize;
|
||||
};
|
||||
|
||||
class WasmCompileLazyFrameConstants : public TypedFrameConstants {
|
||||
public:
|
||||
static constexpr int kNumberOfSavedGpParamRegs = 5;
|
||||
#ifdef V8_TARGET_ARCH_S390X
|
||||
static constexpr int kNumberOfSavedFpParamRegs = 4;
|
||||
#else
|
||||
static constexpr int kNumberOfSavedFpParamRegs = 2;
|
||||
#endif
|
||||
|
||||
// FP-relative.
|
||||
static constexpr int kWasmInstanceOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
|
||||
static constexpr int kFixedFrameSizeFromFp =
|
||||
TypedFrameConstants::kFixedFrameSizeFromFp +
|
||||
kNumberOfSavedGpParamRegs * kPointerSize +
|
||||
kNumberOfSavedFpParamRegs * kDoubleSize;
|
||||
};
|
||||
|
||||
class JavaScriptFrameConstants : public AllStatic {
|
||||
public:
|
||||
// FP-relative.
|
||||
|
Loading…
Reference in New Issue
Block a user