Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(623)

Side by Side Diff: src/ppc/debug-ppc.cc

Issue 714093002: PowerPC specific sub-directories. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ppc/cpu-ppc.cc ('k') | src/ppc/deoptimizer-ppc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_PPC
8 8
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/debug.h" 10 #include "src/debug.h"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 14
15 bool BreakLocationIterator::IsDebugBreakAtReturn() { 15 bool BreakLocationIterator::IsDebugBreakAtReturn() {
16 return Debug::IsDebugBreakAtReturn(rinfo()); 16 return Debug::IsDebugBreakAtReturn(rinfo());
17 } 17 }
18 18
19 19
20 void BreakLocationIterator::SetDebugBreakAtReturn() { 20 void BreakLocationIterator::SetDebugBreakAtReturn() {
21 // Patch the code changing the return from JS function sequence from 21 // Patch the code changing the return from JS function sequence from
22 // mov sp, fp 22 //
23 // ldmia sp!, {fp, lr} 23 // LeaveFrame
24 // add sp, sp, #4 24 // blr
25 // bx lr 25 //
26 // to a call to the debug break return code. 26 // to a call to the debug break return code.
27 // ldr ip, [pc, #0] 27 // this uses a FIXED_SEQUENCE to load an address constant
28 // blx ip 28 //
29 // <debug break return code entry point address> 29 // mov r0, <address>
30 // bkpt 0 30 // mtlr r0
31 // blrl
32 // bkpt
33 //
31 CodePatcher patcher(rinfo()->pc(), Assembler::kJSReturnSequenceInstructions); 34 CodePatcher patcher(rinfo()->pc(), Assembler::kJSReturnSequenceInstructions);
32 patcher.masm()->ldr(v8::internal::ip, MemOperand(v8::internal::pc, 0)); 35 Assembler::BlockTrampolinePoolScope block_trampoline_pool(patcher.masm());
33 patcher.masm()->blx(v8::internal::ip); 36 patcher.masm()->mov(
34 patcher.Emit( 37 v8::internal::r0,
35 debug_info_->GetIsolate()->builtins()->Return_DebugBreak()->entry()); 38 Operand(reinterpret_cast<intptr_t>(debug_info_->GetIsolate()
39 ->builtins()
40 ->Return_DebugBreak()
41 ->entry())));
42 patcher.masm()->mtctr(v8::internal::r0);
43 patcher.masm()->bctrl();
36 patcher.masm()->bkpt(0); 44 patcher.masm()->bkpt(0);
37 } 45 }
38 46
39 47
40 // Restore the JS frame exit code. 48 // Restore the JS frame exit code.
41 void BreakLocationIterator::ClearDebugBreakAtReturn() { 49 void BreakLocationIterator::ClearDebugBreakAtReturn() {
42 rinfo()->PatchCode(original_rinfo()->pc(), 50 rinfo()->PatchCode(original_rinfo()->pc(),
43 Assembler::kJSReturnSequenceInstructions); 51 Assembler::kJSReturnSequenceInstructions);
44 } 52 }
45 53
46 54
47 // A debug break in the frame exit code is identified by the JS frame exit code 55 // A debug break in the frame exit code is identified by the JS frame exit code
48 // having been patched with a call instruction. 56 // having been patched with a call instruction.
49 bool Debug::IsDebugBreakAtReturn(RelocInfo* rinfo) { 57 bool Debug::IsDebugBreakAtReturn(RelocInfo* rinfo) {
50 DCHECK(RelocInfo::IsJSReturn(rinfo->rmode())); 58 DCHECK(RelocInfo::IsJSReturn(rinfo->rmode()));
51 return rinfo->IsPatchedReturnSequence(); 59 return rinfo->IsPatchedReturnSequence();
52 } 60 }
53 61
54 62
55 bool BreakLocationIterator::IsDebugBreakAtSlot() { 63 bool BreakLocationIterator::IsDebugBreakAtSlot() {
56 DCHECK(IsDebugBreakSlot()); 64 DCHECK(IsDebugBreakSlot());
57 // Check whether the debug break slot instructions have been patched. 65 // Check whether the debug break slot instructions have been patched.
58 return rinfo()->IsPatchedDebugBreakSlotSequence(); 66 return rinfo()->IsPatchedDebugBreakSlotSequence();
59 } 67 }
60 68
61 69
62 void BreakLocationIterator::SetDebugBreakAtSlot() { 70 void BreakLocationIterator::SetDebugBreakAtSlot() {
63 DCHECK(IsDebugBreakSlot()); 71 DCHECK(IsDebugBreakSlot());
64 // Patch the code changing the debug break slot code from 72 // Patch the code changing the debug break slot code from
65 // mov r2, r2 73 //
66 // mov r2, r2 74 // ori r3, r3, 0
67 // mov r2, r2 75 // ori r3, r3, 0
68 // to a call to the debug break slot code. 76 // ori r3, r3, 0
69 // ldr ip, [pc, #0] 77 // ori r3, r3, 0
70 // blx ip 78 // ori r3, r3, 0
71 // <debug break slot code entry point address> 79 //
80 // to a call to the debug break code, using a FIXED_SEQUENCE.
81 //
82 // mov r0, <address>
83 // mtlr r0
84 // blrl
85 //
72 CodePatcher patcher(rinfo()->pc(), Assembler::kDebugBreakSlotInstructions); 86 CodePatcher patcher(rinfo()->pc(), Assembler::kDebugBreakSlotInstructions);
73 patcher.masm()->ldr(v8::internal::ip, MemOperand(v8::internal::pc, 0)); 87 Assembler::BlockTrampolinePoolScope block_trampoline_pool(patcher.masm());
74 patcher.masm()->blx(v8::internal::ip); 88 patcher.masm()->mov(
75 patcher.Emit( 89 v8::internal::r0,
76 debug_info_->GetIsolate()->builtins()->Slot_DebugBreak()->entry()); 90 Operand(reinterpret_cast<intptr_t>(
91 debug_info_->GetIsolate()->builtins()->Slot_DebugBreak()->entry())));
92 patcher.masm()->mtctr(v8::internal::r0);
93 patcher.masm()->bctrl();
77 } 94 }
78 95
79 96
80 void BreakLocationIterator::ClearDebugBreakAtSlot() { 97 void BreakLocationIterator::ClearDebugBreakAtSlot() {
81 DCHECK(IsDebugBreakSlot()); 98 DCHECK(IsDebugBreakSlot());
82 rinfo()->PatchCode(original_rinfo()->pc(), 99 rinfo()->PatchCode(original_rinfo()->pc(),
83 Assembler::kDebugBreakSlotInstructions); 100 Assembler::kDebugBreakSlotInstructions);
84 } 101 }
85 102
86 103
87 #define __ ACCESS_MASM(masm) 104 #define __ ACCESS_MASM(masm)
88 105
89 106
90 static void Generate_DebugBreakCallHelper(MacroAssembler* masm, 107 static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
91 RegList object_regs, 108 RegList object_regs,
92 RegList non_object_regs) { 109 RegList non_object_regs) {
93 { 110 {
94 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); 111 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
95 112
96 // Load padding words on stack. 113 // Load padding words on stack.
97 __ mov(ip, Operand(Smi::FromInt(LiveEdit::kFramePaddingValue))); 114 __ LoadSmiLiteral(ip, Smi::FromInt(LiveEdit::kFramePaddingValue));
98 for (int i = 0; i < LiveEdit::kFramePaddingInitialSize; i++) { 115 for (int i = 0; i < LiveEdit::kFramePaddingInitialSize; i++) {
99 __ push(ip); 116 __ push(ip);
100 } 117 }
101 __ mov(ip, Operand(Smi::FromInt(LiveEdit::kFramePaddingInitialSize))); 118 __ LoadSmiLiteral(ip, Smi::FromInt(LiveEdit::kFramePaddingInitialSize));
102 __ push(ip); 119 __ push(ip);
103 120
104 // Store the registers containing live values on the expression stack to 121 // Store the registers containing live values on the expression stack to
105 // make sure that these are correctly updated during GC. Non object values 122 // make sure that these are correctly updated during GC. Non object values
106 // are stored as a smi causing it to be untouched by GC. 123 // are stored as a smi causing it to be untouched by GC.
107 DCHECK((object_regs & ~kJSCallerSaved) == 0); 124 DCHECK((object_regs & ~kJSCallerSaved) == 0);
108 DCHECK((non_object_regs & ~kJSCallerSaved) == 0); 125 DCHECK((non_object_regs & ~kJSCallerSaved) == 0);
109 DCHECK((object_regs & non_object_regs) == 0); 126 DCHECK((object_regs & non_object_regs) == 0);
110 if ((object_regs | non_object_regs) != 0) { 127 if ((object_regs | non_object_regs) != 0) {
111 for (int i = 0; i < kNumJSCallerSaved; i++) { 128 for (int i = 0; i < kNumJSCallerSaved; i++) {
112 int r = JSCallerSavedCode(i); 129 int r = JSCallerSavedCode(i);
113 Register reg = { r }; 130 Register reg = {r};
114 if ((non_object_regs & (1 << r)) != 0) { 131 if ((non_object_regs & (1 << r)) != 0) {
115 if (FLAG_debug_code) { 132 if (FLAG_debug_code) {
116 __ tst(reg, Operand(0xc0000000)); 133 __ TestUnsignedSmiCandidate(reg, r0);
117 __ Assert(eq, kUnableToEncodeValueAsSmi); 134 __ Assert(eq, kUnableToEncodeValueAsSmi, cr0);
118 } 135 }
119 __ SmiTag(reg); 136 __ SmiTag(reg);
120 } 137 }
121 } 138 }
122 __ stm(db_w, sp, object_regs | non_object_regs); 139 __ MultiPush(object_regs | non_object_regs);
123 } 140 }
124 141
125 #ifdef DEBUG 142 #ifdef DEBUG
126 __ RecordComment("// Calling from debug break to runtime - come in - over"); 143 __ RecordComment("// Calling from debug break to runtime - come in - over");
127 #endif 144 #endif
128 __ mov(r0, Operand::Zero()); // no arguments 145 __ mov(r3, Operand::Zero()); // no arguments
129 __ mov(r1, Operand(ExternalReference::debug_break(masm->isolate()))); 146 __ mov(r4, Operand(ExternalReference::debug_break(masm->isolate())));
130 147
131 CEntryStub ceb(masm->isolate(), 1); 148 CEntryStub ceb(masm->isolate(), 1);
132 __ CallStub(&ceb); 149 __ CallStub(&ceb);
133 150
134 // Restore the register values from the expression stack. 151 // Restore the register values from the expression stack.
135 if ((object_regs | non_object_regs) != 0) { 152 if ((object_regs | non_object_regs) != 0) {
136 __ ldm(ia_w, sp, object_regs | non_object_regs); 153 __ MultiPop(object_regs | non_object_regs);
137 for (int i = 0; i < kNumJSCallerSaved; i++) { 154 for (int i = 0; i < kNumJSCallerSaved; i++) {
138 int r = JSCallerSavedCode(i); 155 int r = JSCallerSavedCode(i);
139 Register reg = { r }; 156 Register reg = {r};
140 if ((non_object_regs & (1 << r)) != 0) { 157 if ((non_object_regs & (1 << r)) != 0) {
141 __ SmiUntag(reg); 158 __ SmiUntag(reg);
142 } 159 }
143 if (FLAG_debug_code && 160 if (FLAG_debug_code &&
144 (((object_regs |non_object_regs) & (1 << r)) == 0)) { 161 (((object_regs | non_object_regs) & (1 << r)) == 0)) {
145 __ mov(reg, Operand(kDebugZapValue)); 162 __ mov(reg, Operand(kDebugZapValue));
146 } 163 }
147 } 164 }
148 } 165 }
149 166
150 // Don't bother removing padding bytes pushed on the stack 167 // Don't bother removing padding bytes pushed on the stack
151 // as the frame is going to be restored right away. 168 // as the frame is going to be restored right away.
152 169
153 // Leave the internal frame. 170 // Leave the internal frame.
154 } 171 }
155 172
156 // Now that the break point has been handled, resume normal execution by 173 // Now that the break point has been handled, resume normal execution by
157 // jumping to the target address intended by the caller and that was 174 // jumping to the target address intended by the caller and that was
158 // overwritten by the address of DebugBreakXXX. 175 // overwritten by the address of DebugBreakXXX.
159 ExternalReference after_break_target = 176 ExternalReference after_break_target =
160 ExternalReference::debug_after_break_target_address(masm->isolate()); 177 ExternalReference::debug_after_break_target_address(masm->isolate());
161 __ mov(ip, Operand(after_break_target)); 178 __ mov(ip, Operand(after_break_target));
162 __ ldr(ip, MemOperand(ip)); 179 __ LoadP(ip, MemOperand(ip));
163 __ Jump(ip); 180 __ JumpToJSEntry(ip);
164 } 181 }
165 182
166 183
167 void DebugCodegen::GenerateCallICStubDebugBreak(MacroAssembler* masm) { 184 void DebugCodegen::GenerateCallICStubDebugBreak(MacroAssembler* masm) {
168 // Register state for CallICStub 185 // Register state for CallICStub
169 // ----------- S t a t e ------------- 186 // ----------- S t a t e -------------
170 // -- r1 : function 187 // -- r4 : function
171 // -- r3 : slot in feedback array (smi) 188 // -- r6 : slot in feedback array (smi)
172 // ----------------------------------- 189 // -----------------------------------
173 Generate_DebugBreakCallHelper(masm, r1.bit() | r3.bit(), 0); 190 Generate_DebugBreakCallHelper(masm, r4.bit() | r6.bit(), 0);
174 } 191 }
175 192
176 193
177 void DebugCodegen::GenerateLoadICDebugBreak(MacroAssembler* masm) { 194 void DebugCodegen::GenerateLoadICDebugBreak(MacroAssembler* masm) {
178 // Calling convention for IC load (from ic-arm.cc). 195 // Calling convention for IC load (from ic-ppc.cc).
179 Register receiver = LoadDescriptor::ReceiverRegister(); 196 Register receiver = LoadDescriptor::ReceiverRegister();
180 Register name = LoadDescriptor::NameRegister(); 197 Register name = LoadDescriptor::NameRegister();
181 RegList regs = receiver.bit() | name.bit(); 198 RegList regs = receiver.bit() | name.bit();
182 if (FLAG_vector_ics) { 199 if (FLAG_vector_ics) {
183 regs |= VectorLoadICTrampolineDescriptor::SlotRegister().bit(); 200 regs |= VectorLoadICTrampolineDescriptor::SlotRegister().bit();
184 } 201 }
185 Generate_DebugBreakCallHelper(masm, regs, 0); 202 Generate_DebugBreakCallHelper(masm, regs, 0);
186 } 203 }
187 204
188 205
189 void DebugCodegen::GenerateStoreICDebugBreak(MacroAssembler* masm) { 206 void DebugCodegen::GenerateStoreICDebugBreak(MacroAssembler* masm) {
190 // Calling convention for IC store (from ic-arm.cc). 207 // Calling convention for IC store (from ic-ppc.cc).
191 Register receiver = StoreDescriptor::ReceiverRegister(); 208 Register receiver = StoreDescriptor::ReceiverRegister();
192 Register name = StoreDescriptor::NameRegister(); 209 Register name = StoreDescriptor::NameRegister();
193 Register value = StoreDescriptor::ValueRegister(); 210 Register value = StoreDescriptor::ValueRegister();
194 Generate_DebugBreakCallHelper( 211 Generate_DebugBreakCallHelper(masm, receiver.bit() | name.bit() | value.bit(),
195 masm, receiver.bit() | name.bit() | value.bit(), 0); 212 0);
196 } 213 }
197 214
198 215
199 void DebugCodegen::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) { 216 void DebugCodegen::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) {
200 // Calling convention for keyed IC load (from ic-arm.cc). 217 // Calling convention for keyed IC load (from ic-ppc.cc).
201 GenerateLoadICDebugBreak(masm); 218 GenerateLoadICDebugBreak(masm);
202 } 219 }
203 220
204 221
205 void DebugCodegen::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) { 222 void DebugCodegen::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) {
206 // Calling convention for IC keyed store call (from ic-arm.cc). 223 // Calling convention for IC keyed store call (from ic-ppc.cc).
207 Register receiver = StoreDescriptor::ReceiverRegister(); 224 Register receiver = StoreDescriptor::ReceiverRegister();
208 Register name = StoreDescriptor::NameRegister(); 225 Register name = StoreDescriptor::NameRegister();
209 Register value = StoreDescriptor::ValueRegister(); 226 Register value = StoreDescriptor::ValueRegister();
210 Generate_DebugBreakCallHelper( 227 Generate_DebugBreakCallHelper(masm, receiver.bit() | name.bit() | value.bit(),
211 masm, receiver.bit() | name.bit() | value.bit(), 0); 228 0);
212 } 229 }
213 230
214 231
215 void DebugCodegen::GenerateCompareNilICDebugBreak(MacroAssembler* masm) { 232 void DebugCodegen::GenerateCompareNilICDebugBreak(MacroAssembler* masm) {
216 // Register state for CompareNil IC 233 // Register state for CompareNil IC
217 // ----------- S t a t e ------------- 234 // ----------- S t a t e -------------
218 // -- r0 : value 235 // -- r3 : value
219 // ----------------------------------- 236 // -----------------------------------
220 Generate_DebugBreakCallHelper(masm, r0.bit(), 0); 237 Generate_DebugBreakCallHelper(masm, r3.bit(), 0);
221 } 238 }
222 239
223 240
224 void DebugCodegen::GenerateReturnDebugBreak(MacroAssembler* masm) { 241 void DebugCodegen::GenerateReturnDebugBreak(MacroAssembler* masm) {
225 // In places other than IC call sites it is expected that r0 is TOS which 242 // In places other than IC call sites it is expected that r3 is TOS which
226 // is an object - this is not generally the case so this should be used with 243 // is an object - this is not generally the case so this should be used with
227 // care. 244 // care.
228 Generate_DebugBreakCallHelper(masm, r0.bit(), 0); 245 Generate_DebugBreakCallHelper(masm, r3.bit(), 0);
229 } 246 }
230 247
231 248
232 void DebugCodegen::GenerateCallFunctionStubDebugBreak(MacroAssembler* masm) { 249 void DebugCodegen::GenerateCallFunctionStubDebugBreak(MacroAssembler* masm) {
233 // Register state for CallFunctionStub (from code-stubs-arm.cc). 250 // Register state for CallFunctionStub (from code-stubs-ppc.cc).
234 // ----------- S t a t e ------------- 251 // ----------- S t a t e -------------
235 // -- r1 : function 252 // -- r4 : function
236 // ----------------------------------- 253 // -----------------------------------
237 Generate_DebugBreakCallHelper(masm, r1.bit(), 0); 254 Generate_DebugBreakCallHelper(masm, r4.bit(), 0);
238 } 255 }
239 256
240 257
241 void DebugCodegen::GenerateCallConstructStubDebugBreak(MacroAssembler* masm) { 258 void DebugCodegen::GenerateCallConstructStubDebugBreak(MacroAssembler* masm) {
242 // Calling convention for CallConstructStub (from code-stubs-arm.cc) 259 // Calling convention for CallConstructStub (from code-stubs-ppc.cc)
243 // ----------- S t a t e ------------- 260 // ----------- S t a t e -------------
244 // -- r0 : number of arguments (not smi) 261 // -- r3 : number of arguments (not smi)
245 // -- r1 : constructor function 262 // -- r4 : constructor function
246 // ----------------------------------- 263 // -----------------------------------
247 Generate_DebugBreakCallHelper(masm, r1.bit(), r0.bit()); 264 Generate_DebugBreakCallHelper(masm, r4.bit(), r3.bit());
248 } 265 }
249 266
250 267
251 void DebugCodegen::GenerateCallConstructStubRecordDebugBreak( 268 void DebugCodegen::GenerateCallConstructStubRecordDebugBreak(
252 MacroAssembler* masm) { 269 MacroAssembler* masm) {
253 // Calling convention for CallConstructStub (from code-stubs-arm.cc) 270 // Calling convention for CallConstructStub (from code-stubs-ppc.cc)
254 // ----------- S t a t e ------------- 271 // ----------- S t a t e -------------
255 // -- r0 : number of arguments (not smi) 272 // -- r3 : number of arguments (not smi)
256 // -- r1 : constructor function 273 // -- r4 : constructor function
257 // -- r2 : feedback array 274 // -- r5 : feedback array
258 // -- r3 : feedback slot (smi) 275 // -- r6 : feedback slot (smi)
259 // ----------------------------------- 276 // -----------------------------------
260 Generate_DebugBreakCallHelper(masm, r1.bit() | r2.bit() | r3.bit(), r0.bit()); 277 Generate_DebugBreakCallHelper(masm, r4.bit() | r5.bit() | r6.bit(), r3.bit());
261 } 278 }
262 279
263 280
264 void DebugCodegen::GenerateSlot(MacroAssembler* masm) { 281 void DebugCodegen::GenerateSlot(MacroAssembler* masm) {
265 // Generate enough nop's to make space for a call instruction. Avoid emitting 282 // Generate enough nop's to make space for a call instruction. Avoid emitting
266 // the constant pool in the debug break slot code. 283 // the trampoline pool in the debug break slot code.
267 Assembler::BlockConstPoolScope block_const_pool(masm); 284 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm);
268 Label check_codesize; 285 Label check_codesize;
269 __ bind(&check_codesize); 286 __ bind(&check_codesize);
270 __ RecordDebugBreakSlot(); 287 __ RecordDebugBreakSlot();
271 for (int i = 0; i < Assembler::kDebugBreakSlotInstructions; i++) { 288 for (int i = 0; i < Assembler::kDebugBreakSlotInstructions; i++) {
272 __ nop(MacroAssembler::DEBUG_BREAK_NOP); 289 __ nop(MacroAssembler::DEBUG_BREAK_NOP);
273 } 290 }
274 DCHECK_EQ(Assembler::kDebugBreakSlotInstructions, 291 DCHECK_EQ(Assembler::kDebugBreakSlotInstructions,
275 masm->InstructionsGeneratedSince(&check_codesize)); 292 masm->InstructionsGeneratedSince(&check_codesize));
276 } 293 }
277 294
278 295
279 void DebugCodegen::GenerateSlotDebugBreak(MacroAssembler* masm) { 296 void DebugCodegen::GenerateSlotDebugBreak(MacroAssembler* masm) {
280 // In the places where a debug break slot is inserted no registers can contain 297 // In the places where a debug break slot is inserted no registers can contain
281 // object pointers. 298 // object pointers.
282 Generate_DebugBreakCallHelper(masm, 0, 0); 299 Generate_DebugBreakCallHelper(masm, 0, 0);
283 } 300 }
284 301
285 302
286 void DebugCodegen::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { 303 void DebugCodegen::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
287 __ Ret(); 304 __ Ret();
288 } 305 }
289 306
290 307
291 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { 308 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
292 ExternalReference restarter_frame_function_slot = 309 ExternalReference restarter_frame_function_slot =
293 ExternalReference::debug_restarter_frame_function_pointer_address( 310 ExternalReference::debug_restarter_frame_function_pointer_address(
294 masm->isolate()); 311 masm->isolate());
295 __ mov(ip, Operand(restarter_frame_function_slot)); 312 __ mov(ip, Operand(restarter_frame_function_slot));
296 __ mov(r1, Operand::Zero()); 313 __ li(r4, Operand::Zero());
297 __ str(r1, MemOperand(ip, 0)); 314 __ StoreP(r4, MemOperand(ip, 0));
298 315
299 // Load the function pointer off of our current stack frame. 316 // Load the function pointer off of our current stack frame.
300 __ ldr(r1, MemOperand(fp, 317 __ LoadP(r4, MemOperand(fp, StandardFrameConstants::kConstantPoolOffset -
301 StandardFrameConstants::kConstantPoolOffset - kPointerSize)); 318 kPointerSize));
302 319
303 // Pop return address, frame and constant pool pointer (if 320 // Pop return address, frame and constant pool pointer (if
304 // FLAG_enable_ool_constant_pool). 321 // FLAG_enable_ool_constant_pool).
305 __ LeaveFrame(StackFrame::INTERNAL); 322 __ LeaveFrame(StackFrame::INTERNAL);
306 323
307 { ConstantPoolUnavailableScope constant_pool_unavailable(masm); 324 // Load context from the function.
308 // Load context from the function. 325 __ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset));
309 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
310 326
311 // Get function code. 327 // Get function code.
312 __ ldr(ip, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); 328 __ LoadP(ip, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
313 __ ldr(ip, FieldMemOperand(ip, SharedFunctionInfo::kCodeOffset)); 329 __ LoadP(ip, FieldMemOperand(ip, SharedFunctionInfo::kCodeOffset));
314 __ add(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); 330 __ addi(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag));
315 331
316 // Re-run JSFunction, r1 is function, cp is context. 332 // Re-run JSFunction, r4 is function, cp is context.
317 __ Jump(ip); 333 __ Jump(ip);
318 }
319 } 334 }
320 335
321 336
322 const bool LiveEdit::kFrameDropperSupported = true; 337 const bool LiveEdit::kFrameDropperSupported = true;
323 338
324 #undef __ 339 #undef __
340 }
341 } // namespace v8::internal
325 342
326 } } // namespace v8::internal 343 #endif // V8_TARGET_ARCH_PPC
327
328 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/ppc/cpu-ppc.cc ('k') | src/ppc/deoptimizer-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698