Commit 3088777f authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

PPC/s390: [debug] implement break on entry for builtin functions.

Port 876f37c3

Original Commit Message:

    We reuse most of the infrastructure to set break points, with minor
    differences when we encounter functions where we can only break on entry:
    - PrepareFunctionForBreakPoints simply deopts all functions.
    - Break point objects have the canonical source position 0.
    - Break point is set/checked/cleared via bit on the DebugInfo.
    - Debug::Break do not continue stepping since stepping is implemented via
      regular break points and therefore do not interfere with break on entry.

    I promise to add more tests.

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

Change-Id: I0595652adced533c1032a6c3fd64cddfd4e730da
Reviewed-on: https://chromium-review.googlesource.com/909292
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarJoran Siu <joransiu@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#51186}
parent 2c8663aa
......@@ -1190,14 +1190,33 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected,
void MacroAssembler::CheckDebugHook(Register fun, Register new_target,
const ParameterCount& expected,
const ParameterCount& actual) {
Label skip_hook;
Label skip_hook, call_hook;
ExternalReference debug_is_active =
ExternalReference::debug_is_active_address(isolate());
mov(r7, Operand(debug_is_active));
LoadByte(r7, MemOperand(r7), r0);
extsb(r7, r7);
CmpSmiLiteral(r7, Smi::kZero, r0);
beq(&skip_hook);
ExternalReference debug_hook_avtive =
ExternalReference::debug_hook_on_function_call_address(isolate());
mov(r7, Operand(debug_hook_avtive));
LoadByte(r7, MemOperand(r7), r0);
extsb(r7, r7);
CmpSmiLiteral(r7, Smi::kZero, r0);
beq(&skip_hook);
bne(&call_hook);
LoadP(r7, FieldMemOperand(fun, JSFunction::kSharedFunctionInfoOffset));
LoadP(r7, FieldMemOperand(r7, SharedFunctionInfo::kDebugInfoOffset));
JumpIfSmi(r7, &skip_hook);
LoadP(r7, FieldMemOperand(r7, DebugInfo::kFlagsOffset));
SmiUntag(r0, r7);
andi(r0, r0, Operand(DebugInfo::kBreakAtEntry));
beq(&skip_hook, cr0);
bind(&call_hook);
{
FrameScope frame(this,
has_frame() ? StackFrame::NONE : StackFrame::INTERNAL);
......
......@@ -1216,13 +1216,29 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected,
void MacroAssembler::CheckDebugHook(Register fun, Register new_target,
const ParameterCount& expected,
const ParameterCount& actual) {
Label skip_hook;
Label skip_hook, call_hook;
ExternalReference debug_is_active =
ExternalReference::debug_is_active_address(isolate());
mov(r6, Operand(debug_is_active));
tm(MemOperand(r6), Operand::Zero());
bne(&skip_hook);
ExternalReference debug_hook_avtive =
ExternalReference::debug_hook_on_function_call_address(isolate());
mov(r6, Operand(debug_hook_avtive));
LoadB(r6, MemOperand(r6));
CmpP(r6, Operand::Zero());
tm(MemOperand(r6), Operand::Zero());
beq(&call_hook);
LoadP(r6, FieldMemOperand(fun, JSFunction::kSharedFunctionInfoOffset));
LoadP(r6, FieldMemOperand(r6, SharedFunctionInfo::kDebugInfoOffset));
JumpIfSmi(r6, &skip_hook);
LoadP(r6, FieldMemOperand(r6, DebugInfo::kFlagsOffset));
SmiUntag(r0, r6);
tmll(r0, Operand(DebugInfo::kBreakAtEntry));
beq(&skip_hook);
bind(&call_hook);
{
FrameScope frame(this,
has_frame() ? StackFrame::NONE : StackFrame::INTERNAL);
......
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