Skip to content

Commit

Permalink
[mips][wasm][debug] Implement instrumentation breakpoint
Browse files Browse the repository at this point in the history
Besides, fix extra arguments when restarting frame.

Port: 15f3392
Port: 94b294b

Change-Id: Iaf6b1d6b3eda0ea90ed651b22bb9bd871a5edb36
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2710207
Reviewed-by: Zhao Jiazhong <[email protected]>
Commit-Queue: Zhao Jiazhong <[email protected]>
Auto-Submit: Liu yu <[email protected]>
Cr-Commit-Position: refs/heads/master@{#72882}
  • Loading branch information
LiuYu396 authored and Commit Bot committed Feb 20, 2021
1 parent 5b24556 commit 8f72f31
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
6 changes: 2 additions & 4 deletions src/debug/mips/debug-mips.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ void DebugCodegen::GenerateFrameDropperTrampoline(MacroAssembler* masm) {
// - Restart the frame by calling the function.
__ mov(fp, a1);
__ lw(a1, MemOperand(fp, StandardFrameConstants::kFunctionOffset));
__ lw(a0, MemOperand(fp, StandardFrameConstants::kArgCOffset));

// Pop return address and frame.
__ LeaveFrame(StackFrame::INTERNAL);

__ lw(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
__ lhu(a0,
FieldMemOperand(a0, SharedFunctionInfo::kFormalParameterCountOffset));
__ mov(a2, a0);
__ li(a2, Operand(kDontAdaptArgumentsSentinel));

__ InvokeFunction(a1, a2, a0, JUMP_FUNCTION);
}
Expand Down
6 changes: 2 additions & 4 deletions src/debug/mips64/debug-mips64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ void DebugCodegen::GenerateFrameDropperTrampoline(MacroAssembler* masm) {
// - Restart the frame by calling the function.
__ mov(fp, a1);
__ Ld(a1, MemOperand(fp, StandardFrameConstants::kFunctionOffset));
__ Ld(a0, MemOperand(fp, StandardFrameConstants::kArgCOffset));

// Pop return address and frame.
__ LeaveFrame(StackFrame::INTERNAL);

__ Ld(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
__ Lhu(a0,
FieldMemOperand(a0, SharedFunctionInfo::kFormalParameterCountOffset));
__ mov(a2, a0);
__ li(a2, Operand(kDontAdaptArgumentsSentinel));

__ InvokeFunction(a1, a2, a0, JUMP_FUNCTION);
}
Expand Down
12 changes: 10 additions & 2 deletions src/wasm/baseline/mips/liftoff-assembler-mips.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,16 @@ void LiftoffAssembler::LoadFromInstance(Register dst, int32_t offset,
int size) {
DCHECK_LE(0, offset);
lw(dst, liftoff::GetInstanceOperand());
DCHECK_EQ(4, size);
lw(dst, MemOperand(dst, offset));
switch (size) {
case 1:
lb(dst, MemOperand(dst, offset));
break;
case 4:
lw(dst, MemOperand(dst, offset));
break;
default:
UNIMPLEMENTED();
}
}

void LiftoffAssembler::LoadTaggedPointerFromInstance(Register dst,
Expand Down
17 changes: 12 additions & 5 deletions src/wasm/baseline/mips64/liftoff-assembler-mips64.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,18 @@ void LiftoffAssembler::LoadFromInstance(Register dst, int32_t offset,
int size) {
DCHECK_LE(0, offset);
Ld(dst, liftoff::GetInstanceOperand());
DCHECK(size == 4 || size == 8);
if (size == 4) {
Lw(dst, MemOperand(dst, offset));
} else {
Ld(dst, MemOperand(dst, offset));
switch (size) {
case 1:
Lb(dst, MemOperand(dst, offset));
break;
case 4:
Lw(dst, MemOperand(dst, offset));
break;
case 8:
Ld(dst, MemOperand(dst, offset));
break;
default:
UNIMPLEMENTED();
}
}

Expand Down

0 comments on commit 8f72f31

Please sign in to comment.