[mips][wasm] Add builtin and runtime function for debug breaks
port 59bda19
https://crrev.com/c/2036082
Original Commit Message:
This CL adds the "WasmDebugBreak" builtin for x64, ia32, arm and arm64.
It stores all wasm parameter registers to the stack and calls the
respective runtime function.
The runtime function does not do anything yet, but the
inspector/debugger/wasm-set-breakpoint-liftoff test will already execute
both the builtin and the runtime function.
Change-Id: I7e74116f711d9d2599f6f1a6d47b972bad101f8c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2041214
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Yu Yin <xwafish@gmail.com>
Cr-Commit-Position: refs/heads/master@{#66146}
This commit is contained in:
parent
58b45cca2f
commit
f5f15871f5
@ -23,6 +23,7 @@
|
||||
#include "src/objects/objects-inl.h"
|
||||
#include "src/objects/smi.h"
|
||||
#include "src/runtime/runtime.h"
|
||||
#include "src/wasm/wasm-linkage.h"
|
||||
#include "src/wasm/wasm-objects.h"
|
||||
|
||||
namespace v8 {
|
||||
@ -2419,6 +2420,34 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
|
||||
__ Jump(kScratchReg, v0, 0);
|
||||
}
|
||||
|
||||
void Builtins::Generate_WasmDebugBreak(MacroAssembler* masm) {
|
||||
HardAbortScope hard_abort(masm); // Avoid calls to Abort.
|
||||
{
|
||||
// TODO(clemensb): Use a separate frame type and make it inspectable.
|
||||
FrameScope scope(masm, StackFrame::INTERNAL);
|
||||
|
||||
// Save all parameter registers. They might hold live values, we restore
|
||||
// them after the runtime call.
|
||||
RegList gp_regs = 0;
|
||||
for (Register reg : wasm::kGpParamRegisters) gp_regs |= reg.bit();
|
||||
RegList fp_regs = 0;
|
||||
for (DoubleRegister reg : wasm::kFpParamRegisters) fp_regs |= reg.bit();
|
||||
|
||||
__ MultiPush(gp_regs);
|
||||
__ MultiPushFPU(fp_regs);
|
||||
|
||||
// Initialize the JavaScript context with 0. CEntry will use it to
|
||||
// set the current context on the isolate.
|
||||
__ Move(cp, Smi::zero());
|
||||
__ CallRuntime(Runtime::kWasmDebugBreak, 0);
|
||||
|
||||
// Restore registers.
|
||||
__ MultiPopFPU(fp_regs);
|
||||
__ MultiPop(gp_regs);
|
||||
}
|
||||
__ Ret();
|
||||
}
|
||||
|
||||
void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
SaveFPRegsMode save_doubles, ArgvMode argv_mode,
|
||||
bool builtin_exit_frame) {
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "src/objects/objects-inl.h"
|
||||
#include "src/objects/smi.h"
|
||||
#include "src/runtime/runtime.h"
|
||||
#include "src/wasm/wasm-linkage.h"
|
||||
#include "src/wasm/wasm-objects.h"
|
||||
|
||||
namespace v8 {
|
||||
@ -2458,6 +2459,34 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
|
||||
__ Jump(v0);
|
||||
}
|
||||
|
||||
void Builtins::Generate_WasmDebugBreak(MacroAssembler* masm) {
|
||||
HardAbortScope hard_abort(masm); // Avoid calls to Abort.
|
||||
{
|
||||
// TODO(clemensb): Use a separate frame type and make it inspectable.
|
||||
FrameScope scope(masm, StackFrame::INTERNAL);
|
||||
|
||||
// Save all parameter registers. They might hold live values, we restore
|
||||
// them after the runtime call.
|
||||
RegList gp_regs = 0;
|
||||
for (Register reg : wasm::kGpParamRegisters) gp_regs |= reg.bit();
|
||||
RegList fp_regs = 0;
|
||||
for (DoubleRegister reg : wasm::kFpParamRegisters) fp_regs |= reg.bit();
|
||||
|
||||
__ MultiPush(gp_regs);
|
||||
__ MultiPushFPU(fp_regs);
|
||||
|
||||
// Initialize the JavaScript context with 0. CEntry will use it to
|
||||
// set the current context on the isolate.
|
||||
__ Move(cp, Smi::zero());
|
||||
__ CallRuntime(Runtime::kWasmDebugBreak, 0);
|
||||
|
||||
// Restore registers.
|
||||
__ MultiPopFPU(fp_regs);
|
||||
__ MultiPop(gp_regs);
|
||||
}
|
||||
__ Ret();
|
||||
}
|
||||
|
||||
void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
SaveFPRegsMode save_doubles, ArgvMode argv_mode,
|
||||
bool builtin_exit_frame) {
|
||||
|
Loading…
Reference in New Issue
Block a user