| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 6 | 6 |
| 7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
| 8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 76 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
| 77 | 77 |
| 78 // Load padding words on stack. | 78 // Load padding words on stack. |
| 79 __ LoadSmiLiteral(ip, Smi::FromInt(LiveEdit::kFramePaddingValue)); | 79 __ LoadSmiLiteral(ip, Smi::FromInt(LiveEdit::kFramePaddingValue)); |
| 80 for (int i = 0; i < LiveEdit::kFramePaddingInitialSize; i++) { | 80 for (int i = 0; i < LiveEdit::kFramePaddingInitialSize; i++) { |
| 81 __ push(ip); | 81 __ push(ip); |
| 82 } | 82 } |
| 83 __ LoadSmiLiteral(ip, Smi::FromInt(LiveEdit::kFramePaddingInitialSize)); | 83 __ LoadSmiLiteral(ip, Smi::FromInt(LiveEdit::kFramePaddingInitialSize)); |
| 84 __ push(ip); | 84 __ push(ip); |
| 85 | 85 |
| 86 // Push arguments for DebugBreak call. | 86 if (mode == SAVE_RESULT_REGISTER) __ push(r3); |
| 87 if (mode == SAVE_RESULT_REGISTER) { | 87 |
| 88 // Break on return. | 88 __ mov(r3, Operand::Zero()); // no arguments |
| 89 __ push(r3); | |
| 90 } else { | |
| 91 // Non-return breaks. | |
| 92 __ Push(masm->isolate()->factory()->the_hole_value()); | |
| 93 } | |
| 94 __ mov(r3, Operand(1)); | |
| 95 __ mov(r4, | 89 __ mov(r4, |
| 96 Operand(ExternalReference( | 90 Operand(ExternalReference( |
| 97 Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate()))); | 91 Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate()))); |
| 98 | 92 |
| 99 CEntryStub ceb(masm->isolate(), 1); | 93 CEntryStub ceb(masm->isolate(), 1); |
| 100 __ CallStub(&ceb); | 94 __ CallStub(&ceb); |
| 101 | 95 |
| 102 if (FLAG_debug_code) { | 96 if (FLAG_debug_code) { |
| 103 for (int i = 0; i < kNumJSCallerSaved; i++) { | 97 for (int i = 0; i < kNumJSCallerSaved; i++) { |
| 104 Register reg = {JSCallerSavedCode(i)}; | 98 Register reg = {JSCallerSavedCode(i)}; |
| 105 // Do not clobber r3 if SAVE_RESULT_REGISTER is set. It will | 99 __ mov(reg, Operand(kDebugZapValue)); |
| 106 // contain return value of the function. | |
| 107 if (!(reg.is(r3) && SAVE_RESULT_REGISTER)) { | |
| 108 __ mov(reg, Operand(kDebugZapValue)); | |
| 109 } | |
| 110 } | 100 } |
| 111 } | 101 } |
| 112 | 102 |
| 103 if (mode == SAVE_RESULT_REGISTER) __ pop(r3); |
| 104 |
| 113 // Don't bother removing padding bytes pushed on the stack | 105 // Don't bother removing padding bytes pushed on the stack |
| 114 // as the frame is going to be restored right away. | 106 // as the frame is going to be restored right away. |
| 115 | 107 |
| 116 // Leave the internal frame. | 108 // Leave the internal frame. |
| 117 } | 109 } |
| 118 | 110 |
| 119 // Now that the break point has been handled, resume normal execution by | 111 // Now that the break point has been handled, resume normal execution by |
| 120 // jumping to the target address intended by the caller and that was | 112 // jumping to the target address intended by the caller and that was |
| 121 // overwritten by the address of DebugBreakXXX. | 113 // overwritten by the address of DebugBreakXXX. |
| 122 ExternalReference after_break_target = | 114 ExternalReference after_break_target = |
| (...skipping 30 matching lines...) Expand all Loading... |
| 153 } | 145 } |
| 154 | 146 |
| 155 | 147 |
| 156 const bool LiveEdit::kFrameDropperSupported = true; | 148 const bool LiveEdit::kFrameDropperSupported = true; |
| 157 | 149 |
| 158 #undef __ | 150 #undef __ |
| 159 } // namespace internal | 151 } // namespace internal |
| 160 } // namespace v8 | 152 } // namespace v8 |
| 161 | 153 |
| 162 #endif // V8_TARGET_ARCH_PPC | 154 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |