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