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