Commit 66e03c88 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

PPC/s390: [wasm] Merge the WasmContext into WasmInstanceObject

Port a6d974fe

Original Commit Message:

    This change makes lifetime management of WasmCode much simpler.
    By using the WasmInstanceObject as the context for WASM code execution,
    including the pointer to the memory base and indirect function tables,
    this keeps the instance alive when WASM code is on the stack, since
    the instance object is passed as a parameter and spilled onto the stack.
    This is in preparation of sharing the code between instances and
    isolates.

R=titzer@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: I03c3ecff296cca929c69489e769a5dab60b93830
Reviewed-on: https://chromium-review.googlesource.com/1003117Reviewed-by: 's avatarJoran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#52491}
parent 5dd33fdb
......@@ -2623,9 +2623,9 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
__ LoadSmiLiteral(cp, Smi::kZero);
__ CallRuntime(Runtime::kWasmCompileLazy);
// The entrypoint address is the first return value.
__ mov(r11, kReturnRegister0);
__ mr(r11, kReturnRegister0);
// The WASM instance is the second return value.
__ mov(wasm_instance_reg, kReturnRegister1);
__ mr(wasm_instance_reg, kReturnRegister1);
// Restore registers.
__ MultiPopDoubles(fp_regs);
......
......@@ -2630,9 +2630,9 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
__ LoadSmiLiteral(cp, Smi::kZero);
__ CallRuntime(Runtime::kWasmCompileLazy);
// The entrypoint address is the first return value.
__ mov(ip, r2);
__ LoadRR(ip, r2);
// The WASM instance is the second return value.
__ movq(wasm_instance_reg, kReturnRegister1);
__ LoadRR(wasm_instance_reg, kReturnRegister1);
// Restore registers.
__ MultiPopDoubles(fp_regs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment