diff --git a/src/builtins/ppc/builtins-ppc.cc b/src/builtins/ppc/builtins-ppc.cc index 24b227755b..7204855edb 100644 --- a/src/builtins/ppc/builtins-ppc.cc +++ b/src/builtins/ppc/builtins-ppc.cc @@ -568,6 +568,8 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { { FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); __ Push(r4, r7); + // Push hole as receiver since we do not use it for stepping. + __ PushRoot(Heap::kTheHoleValueRootIndex); __ CallRuntime(Runtime::kDebugOnFunctionCall); __ Pop(r4); __ LoadP(r7, FieldMemOperand(r4, JSGeneratorObject::kFunctionOffset)); diff --git a/src/builtins/s390/builtins-s390.cc b/src/builtins/s390/builtins-s390.cc index e9444b7835..28b773c477 100644 --- a/src/builtins/s390/builtins-s390.cc +++ b/src/builtins/s390/builtins-s390.cc @@ -570,6 +570,8 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { { FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); __ Push(r3, r6); + // Push hole as receiver since we do not use it for stepping. + __ PushRoot(Heap::kTheHoleValueRootIndex); __ CallRuntime(Runtime::kDebugOnFunctionCall); __ Pop(r3); __ LoadP(r6, FieldMemOperand(r3, JSGeneratorObject::kFunctionOffset)); diff --git a/src/debug/ppc/debug-ppc.cc b/src/debug/ppc/debug-ppc.cc index 047f76a1de..f3bd7c86ec 100644 --- a/src/debug/ppc/debug-ppc.cc +++ b/src/debug/ppc/debug-ppc.cc @@ -37,8 +37,13 @@ void DebugCodegen::GenerateFrameDropperTrampoline(MacroAssembler* masm) { __ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); __ LeaveFrame(StackFrame::INTERNAL); __ LoadP(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); - __ LoadP( - r3, FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset)); +#if V8_TARGET_ARCH_PPC64 + __ lwz(r3, FieldMemOperand( + r3, SharedFunctionInfo::kFormalParameterCountOffset + 4)); +#else + __ lwz(r3, + FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset)); +#endif __ mr(r5, r3); ParameterCount dummy1(r5); diff --git a/src/debug/s390/debug-s390.cc b/src/debug/s390/debug-s390.cc index 2fdbcc8fd0..e7bc6f56c0 100644 --- a/src/debug/s390/debug-s390.cc +++ b/src/debug/s390/debug-s390.cc @@ -39,8 +39,13 @@ void DebugCodegen::GenerateFrameDropperTrampoline(MacroAssembler* masm) { __ LoadP(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); __ LeaveFrame(StackFrame::INTERNAL); __ LoadP(r2, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset)); +#if V8_TARGET_ARCH_S390X + __ LoadW(r2, FieldMemOperand( + r2, SharedFunctionInfo::kFormalParameterCountOffset + 4)); +#else __ LoadP( r2, FieldMemOperand(r2, SharedFunctionInfo::kFormalParameterCountOffset)); +#endif __ LoadRR(r4, r2); ParameterCount dummy1(r4); diff --git a/src/ppc/macro-assembler-ppc.cc b/src/ppc/macro-assembler-ppc.cc index 7747c9a4a2..720ba5c192 100644 --- a/src/ppc/macro-assembler-ppc.cc +++ b/src/ppc/macro-assembler-ppc.cc @@ -1204,6 +1204,14 @@ void MacroAssembler::CheckDebugHook(Register fun, Register new_target, beq(&skip_hook); { + // Load receiver to pass it later to DebugOnFunctionCall hook. + if (actual.is_reg()) { + mr(r7, actual.reg()); + } else { + mov(r7, Operand(actual.immediate())); + } + ShiftLeftImm(r7, r7, Operand(kPointerSizeLog2)); + LoadPX(r7, MemOperand(sp, r7)); FrameScope frame(this, has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); if (expected.is_reg()) { @@ -1217,7 +1225,7 @@ void MacroAssembler::CheckDebugHook(Register fun, Register new_target, if (new_target.is_valid()) { Push(new_target); } - Push(fun, fun); + Push(fun, fun, r7); CallRuntime(Runtime::kDebugOnFunctionCall); Pop(fun); if (new_target.is_valid()) { diff --git a/src/s390/macro-assembler-s390.cc b/src/s390/macro-assembler-s390.cc index ad074026e1..24f764fb33 100644 --- a/src/s390/macro-assembler-s390.cc +++ b/src/s390/macro-assembler-s390.cc @@ -1225,6 +1225,14 @@ void MacroAssembler::CheckDebugHook(Register fun, Register new_target, bne(&skip_hook); { + // Load receiver to pass it later to DebugOnFunctionCall hook. + if (actual.is_reg()) { + LoadRR(r6, actual.reg()); + } else { + mov(r6, Operand(actual.immediate())); + } + ShiftLeftP(r6, r6, Operand(kPointerSizeLog2)); + LoadP(r6, MemOperand(sp, r6)); FrameScope frame(this, has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); if (expected.is_reg()) { @@ -1238,7 +1246,7 @@ void MacroAssembler::CheckDebugHook(Register fun, Register new_target, if (new_target.is_valid()) { Push(new_target); } - Push(fun, fun); + Push(fun, fun, r6); CallRuntime(Runtime::kDebugOnFunctionCall); Pop(fun); if (new_target.is_valid()) {