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

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

Issue 349703002: MIPS: Support LiveEdit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix comment. Created 6 years, 6 months 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 | « no previous file | src/objects.h » ('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 2012 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 5
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #if V8_TARGET_ARCH_MIPS 9 #if V8_TARGET_ARCH_MIPS
10 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 #define __ ACCESS_MASM(masm) 94 #define __ ACCESS_MASM(masm)
95 95
96 96
97 97
98 static void Generate_DebugBreakCallHelper(MacroAssembler* masm, 98 static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
99 RegList object_regs, 99 RegList object_regs,
100 RegList non_object_regs) { 100 RegList non_object_regs) {
101 { 101 {
102 FrameScope scope(masm, StackFrame::INTERNAL); 102 FrameScope scope(masm, StackFrame::INTERNAL);
103 103
104 // Load padding words on stack.
105 __ li(at, Operand(Smi::FromInt(LiveEdit::kFramePaddingValue)));
106 __ Subu(sp, sp,
107 Operand(kPointerSize * LiveEdit::kFramePaddingInitialSize));
108 for (int i = LiveEdit::kFramePaddingInitialSize - 1; i >= 0; i--) {
109 __ sw(at, MemOperand(sp, kPointerSize * i));
110 }
111 __ li(at, Operand(Smi::FromInt(LiveEdit::kFramePaddingInitialSize)));
112 __ push(at);
113
104 // Store the registers containing live values on the expression stack to 114 // Store the registers containing live values on the expression stack to
105 // make sure that these are correctly updated during GC. Non object values 115 // 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. 116 // are stored as a smi causing it to be untouched by GC.
107 ASSERT((object_regs & ~kJSCallerSaved) == 0); 117 ASSERT((object_regs & ~kJSCallerSaved) == 0);
108 ASSERT((non_object_regs & ~kJSCallerSaved) == 0); 118 ASSERT((non_object_regs & ~kJSCallerSaved) == 0);
109 ASSERT((object_regs & non_object_regs) == 0); 119 ASSERT((object_regs & non_object_regs) == 0);
110 if ((object_regs | non_object_regs) != 0) { 120 if ((object_regs | non_object_regs) != 0) {
111 for (int i = 0; i < kNumJSCallerSaved; i++) { 121 for (int i = 0; i < kNumJSCallerSaved; i++) {
112 int r = JSCallerSavedCode(i); 122 int r = JSCallerSavedCode(i);
113 Register reg = { r }; 123 Register reg = { r };
(...skipping 26 matching lines...) Expand all
140 if ((non_object_regs & (1 << r)) != 0) { 150 if ((non_object_regs & (1 << r)) != 0) {
141 __ srl(reg, reg, kSmiTagSize); 151 __ srl(reg, reg, kSmiTagSize);
142 } 152 }
143 if (FLAG_debug_code && 153 if (FLAG_debug_code &&
144 (((object_regs |non_object_regs) & (1 << r)) == 0)) { 154 (((object_regs |non_object_regs) & (1 << r)) == 0)) {
145 __ li(reg, kDebugZapValue); 155 __ li(reg, kDebugZapValue);
146 } 156 }
147 } 157 }
148 } 158 }
149 159
160 // Don't bother removing padding bytes pushed on the stack
161 // as the frame is going to be restored right away.
162
150 // Leave the internal frame. 163 // Leave the internal frame.
151 } 164 }
152 165
153 // Now that the break point has been handled, resume normal execution by 166 // Now that the break point has been handled, resume normal execution by
154 // jumping to the target address intended by the caller and that was 167 // jumping to the target address intended by the caller and that was
155 // overwritten by the address of DebugBreakXXX. 168 // overwritten by the address of DebugBreakXXX.
156 ExternalReference after_break_target = 169 ExternalReference after_break_target =
157 ExternalReference::debug_after_break_target_address(masm->isolate()); 170 ExternalReference::debug_after_break_target_address(masm->isolate());
158 __ li(t9, Operand(after_break_target)); 171 __ li(t9, Operand(after_break_target));
159 __ lw(t9, MemOperand(t9)); 172 __ lw(t9, MemOperand(t9));
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 296
284 297
285 void DebugCodegen::GenerateSlotDebugBreak(MacroAssembler* masm) { 298 void DebugCodegen::GenerateSlotDebugBreak(MacroAssembler* masm) {
286 // In the places where a debug break slot is inserted no registers can contain 299 // In the places where a debug break slot is inserted no registers can contain
287 // object pointers. 300 // object pointers.
288 Generate_DebugBreakCallHelper(masm, 0, 0); 301 Generate_DebugBreakCallHelper(masm, 0, 0);
289 } 302 }
290 303
291 304
292 void DebugCodegen::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { 305 void DebugCodegen::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
293 masm->Abort(kLiveEditFrameDroppingIsNotSupportedOnMips); 306 __ Ret();
294 } 307 }
295 308
296 309
297 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { 310 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
298 masm->Abort(kLiveEditFrameDroppingIsNotSupportedOnMips); 311 ExternalReference restarter_frame_function_slot =
312 ExternalReference::debug_restarter_frame_function_pointer_address(
313 masm->isolate());
314 __ li(at, Operand(restarter_frame_function_slot));
315 __ sw(zero_reg, MemOperand(at, 0));
316
317 // We do not know our frame height, but set sp based on fp.
318 __ Subu(sp, fp, Operand(kPointerSize));
319
320 __ Pop(ra, fp, a1); // Return address, Frame, Function.
321
322 // Load context from the function.
323 __ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset));
324
325 // Get function code.
326 __ lw(at, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
327 __ lw(at, FieldMemOperand(at, SharedFunctionInfo::kCodeOffset));
328 __ Addu(t9, at, Operand(Code::kHeaderSize - kHeapObjectTag));
329
330 // Re-run JSFunction, a1 is function, cp is context.
331 __ Jump(t9);
299 } 332 }
300 333
301 334
302 const bool LiveEdit::kFrameDropperSupported = false; 335 const bool LiveEdit::kFrameDropperSupported = true;
303 336
304 #undef __ 337 #undef __
305 338
306 } } // namespace v8::internal 339 } } // namespace v8::internal
307 340
308 #endif // V8_TARGET_ARCH_MIPS 341 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698