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 if (mode == SAVE_RESULT_REGISTER) __ push(r3); | 86 // Push arguments for DebugBreak call. |
87 | 87 if (mode == SAVE_RESULT_REGISTER) { |
88 __ mov(r3, Operand::Zero()); // no arguments | 88 // Break on return. |
| 89 __ push(r3); |
| 90 } else { |
| 91 // Non-return breaks. |
| 92 __ Push(masm->isolate()->factory()->the_hole_value()); |
| 93 } |
| 94 __ mov(r3, Operand(1)); |
89 __ mov(r4, | 95 __ mov(r4, |
90 Operand(ExternalReference( | 96 Operand(ExternalReference( |
91 Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate()))); | 97 Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate()))); |
92 | 98 |
93 CEntryStub ceb(masm->isolate(), 1); | 99 CEntryStub ceb(masm->isolate(), 1); |
94 __ CallStub(&ceb); | 100 __ CallStub(&ceb); |
95 | 101 |
96 if (FLAG_debug_code) { | 102 if (FLAG_debug_code) { |
97 for (int i = 0; i < kNumJSCallerSaved; i++) { | 103 for (int i = 0; i < kNumJSCallerSaved; i++) { |
98 Register reg = {JSCallerSavedCode(i)}; | 104 Register reg = {JSCallerSavedCode(i)}; |
99 __ mov(reg, Operand(kDebugZapValue)); | 105 // Do not clobber r3 if SAVE_RESULT_REGISTER is set. It will |
| 106 // contain return value of the function. |
| 107 if (!(reg.is(r3) && SAVE_RESULT_REGISTER)) { |
| 108 __ mov(reg, Operand(kDebugZapValue)); |
| 109 } |
100 } | 110 } |
101 } | 111 } |
102 | 112 |
103 if (mode == SAVE_RESULT_REGISTER) __ pop(r3); | |
104 | |
105 // Don't bother removing padding bytes pushed on the stack | 113 // Don't bother removing padding bytes pushed on the stack |
106 // as the frame is going to be restored right away. | 114 // as the frame is going to be restored right away. |
107 | 115 |
108 // Leave the internal frame. | 116 // Leave the internal frame. |
109 } | 117 } |
110 | 118 |
111 // Now that the break point has been handled, resume normal execution by | 119 // Now that the break point has been handled, resume normal execution by |
112 // jumping to the target address intended by the caller and that was | 120 // jumping to the target address intended by the caller and that was |
113 // overwritten by the address of DebugBreakXXX. | 121 // overwritten by the address of DebugBreakXXX. |
114 ExternalReference after_break_target = | 122 ExternalReference after_break_target = |
(...skipping 30 matching lines...) Expand all Loading... |
145 } | 153 } |
146 | 154 |
147 | 155 |
148 const bool LiveEdit::kFrameDropperSupported = true; | 156 const bool LiveEdit::kFrameDropperSupported = true; |
149 | 157 |
150 #undef __ | 158 #undef __ |
151 } // namespace internal | 159 } // namespace internal |
152 } // namespace v8 | 160 } // namespace v8 |
153 | 161 |
154 #endif // V8_TARGET_ARCH_PPC | 162 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |