Upgrade V8 to 5.1.281.57 DO NOT MERGE
FPIIM-449
Change-Id: Id981b686b4d587ac31697662eb98bb34be42ad90
(cherry picked from commit 3b9bc31999c9787eb726ecdbfd5796bfdec32a18)
diff --git a/src/debug/ppc/debug-ppc.cc b/src/debug/ppc/debug-ppc.cc
index aab5399..a160bc2 100644
--- a/src/debug/ppc/debug-ppc.cc
+++ b/src/debug/ppc/debug-ppc.cc
@@ -83,9 +83,15 @@
__ LoadSmiLiteral(ip, Smi::FromInt(LiveEdit::kFramePaddingInitialSize));
__ push(ip);
- if (mode == SAVE_RESULT_REGISTER) __ push(r3);
-
- __ mov(r3, Operand::Zero()); // no arguments
+ // Push arguments for DebugBreak call.
+ if (mode == SAVE_RESULT_REGISTER) {
+ // Break on return.
+ __ push(r3);
+ } else {
+ // Non-return breaks.
+ __ Push(masm->isolate()->factory()->the_hole_value());
+ }
+ __ mov(r3, Operand(1));
__ mov(r4,
Operand(ExternalReference(
Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate())));
@@ -96,12 +102,14 @@
if (FLAG_debug_code) {
for (int i = 0; i < kNumJSCallerSaved; i++) {
Register reg = {JSCallerSavedCode(i)};
- __ mov(reg, Operand(kDebugZapValue));
+ // Do not clobber r3 if mode is SAVE_RESULT_REGISTER. It will
+ // contain return value of the function.
+ if (!(reg.is(r3) && (mode == SAVE_RESULT_REGISTER))) {
+ __ mov(reg, Operand(kDebugZapValue));
+ }
}
}
- if (mode == SAVE_RESULT_REGISTER) __ pop(r3);
-
// Don't bother removing padding bytes pushed on the stack
// as the frame is going to be restored right away.
@@ -121,8 +129,7 @@
void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
// Load the function pointer off of our current stack frame.
- __ LoadP(r4, MemOperand(fp, StandardFrameConstants::kConstantPoolOffset -
- kPointerSize));
+ __ LoadP(r4, MemOperand(fp, FrameDropperFrameConstants::kFunctionOffset));
// Pop return address and frame
__ LeaveFrame(StackFrame::INTERNAL);