Commit d3432575 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[Liftoff] [cleanup] Move code out of platform dependent method

Before doing an indirect call, we always have to call {PrepareCall}.
Thus move this code out into platform-independent code. This also
slightly simplifies the API for {CallIndirect}.

R=ahaas@chromium.org

Bug: v8:6600
Change-Id: Id88ae5a9e73d1b6526131a5789205eda12b660de
Reviewed-on: https://chromium-review.googlesource.com/911369
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51230}
parent a021b6c4
......@@ -201,8 +201,7 @@ void LiftoffAssembler::CallRuntime(Zone* zone, Runtime::FunctionId fid) {
void LiftoffAssembler::CallIndirect(wasm::FunctionSig* sig,
compiler::CallDescriptor* call_descriptor,
Register target,
uint32_t* max_used_spill_slot) {
Register target) {
UNIMPLEMENTED();
}
......
......@@ -201,8 +201,7 @@ void LiftoffAssembler::CallRuntime(Zone* zone, Runtime::FunctionId fid) {
void LiftoffAssembler::CallIndirect(wasm::FunctionSig* sig,
compiler::CallDescriptor* call_descriptor,
Register target,
uint32_t* max_used_spill_slot) {
Register target) {
UNIMPLEMENTED();
}
......
......@@ -734,9 +734,7 @@ void LiftoffAssembler::CallRuntime(Zone* zone, Runtime::FunctionId fid) {
void LiftoffAssembler::CallIndirect(wasm::FunctionSig* sig,
compiler::CallDescriptor* call_descriptor,
Register target,
uint32_t* max_used_spill_slot) {
PrepareCall(sig, call_descriptor, max_used_spill_slot, &target);
Register target) {
if (target == no_reg) {
add(esp, Immediate(kPointerSize));
call(Operand(esp, -4));
......
......@@ -409,11 +409,10 @@ class LiftoffAssembler : public TurboAssembler {
inline void CallNativeWasmCode(Address addr);
inline void CallRuntime(Zone* zone, Runtime::FunctionId fid);
// TODO(clemensh): Remove {max_used_spill_slot} once we support arbitrary
// stack sizes.
// Indirect call: If {target == no_reg}, then pop the target from the stack.
inline void CallIndirect(wasm::FunctionSig* sig,
compiler::CallDescriptor* call_descriptor,
Register target, uint32_t* max_used_spill_slot);
Register target);
// Reserve space in the current frame, store address to space in {addr}.
inline void AllocateStackSlot(Register addr, uint32_t size);
......
......@@ -1182,8 +1182,9 @@ class LiftoffCompiler {
GetLoweredCallDescriptor(compilation_zone_, call_descriptor);
uint32_t max_used_spill_slot = 0;
__ CallIndirect(operand.sig, call_descriptor, scratch.gp(),
&max_used_spill_slot);
Register target = scratch.gp();
__ PrepareCall(operand.sig, call_descriptor, &max_used_spill_slot, &target);
__ CallIndirect(operand.sig, call_descriptor, target);
if (max_used_spill_slot >
__ num_locals() + LiftoffAssembler::kMaxValueStackHeight) {
unsupported(decoder, "value stack grows too large in indirect call");
......
......@@ -246,8 +246,7 @@ void LiftoffAssembler::CallRuntime(Zone* zone, Runtime::FunctionId fid) {
void LiftoffAssembler::CallIndirect(wasm::FunctionSig* sig,
compiler::CallDescriptor* call_descriptor,
Register target,
uint32_t* max_used_spill_slot) {
Register target) {
UNIMPLEMENTED();
}
......
......@@ -241,8 +241,7 @@ void LiftoffAssembler::CallRuntime(Zone* zone, Runtime::FunctionId fid) {
void LiftoffAssembler::CallIndirect(wasm::FunctionSig* sig,
compiler::CallDescriptor* call_descriptor,
Register target,
uint32_t* max_used_spill_slot) {
Register target) {
UNIMPLEMENTED();
}
......
......@@ -201,8 +201,7 @@ void LiftoffAssembler::CallRuntime(Zone* zone, Runtime::FunctionId fid) {
void LiftoffAssembler::CallIndirect(wasm::FunctionSig* sig,
compiler::CallDescriptor* call_descriptor,
Register target,
uint32_t* max_used_spill_slot) {
Register target) {
UNIMPLEMENTED();
}
......
......@@ -201,8 +201,7 @@ void LiftoffAssembler::CallRuntime(Zone* zone, Runtime::FunctionId fid) {
void LiftoffAssembler::CallIndirect(wasm::FunctionSig* sig,
compiler::CallDescriptor* call_descriptor,
Register target,
uint32_t* max_used_spill_slot) {
Register target) {
UNIMPLEMENTED();
}
......
......@@ -649,9 +649,7 @@ void LiftoffAssembler::CallRuntime(Zone* zone, Runtime::FunctionId fid) {
void LiftoffAssembler::CallIndirect(wasm::FunctionSig* sig,
compiler::CallDescriptor* call_descriptor,
Register target,
uint32_t* max_used_spill_slot) {
PrepareCall(sig, call_descriptor, max_used_spill_slot, &target);
Register target) {
if (target == no_reg) {
popq(kScratchRegister);
target = kScratchRegister;
......
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