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

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

Issue 2663453004: PPC/s390: [liveedit] reimplement frame restarting. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « src/debug/ppc/debug-ppc.cc ('k') | src/ppc/interface-descriptors-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 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/debug/debug.h" 9 #include "src/debug/debug.h"
10 10
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 Instr current_instr = Assembler::instr_at(pc); 75 Instr current_instr = Assembler::instr_at(pc);
76 return !Assembler::IsNop(current_instr, Assembler::DEBUG_BREAK_NOP); 76 return !Assembler::IsNop(current_instr, Assembler::DEBUG_BREAK_NOP);
77 } 77 }
78 78
79 void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm, 79 void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm,
80 DebugBreakCallHelperMode mode) { 80 DebugBreakCallHelperMode mode) {
81 __ RecordComment("Debug break"); 81 __ RecordComment("Debug break");
82 { 82 {
83 FrameScope scope(masm, StackFrame::INTERNAL); 83 FrameScope scope(masm, StackFrame::INTERNAL);
84 84
85 // Load padding words on stack.
86 __ LoadSmiLiteral(ip, Smi::FromInt(LiveEdit::kFramePaddingValue));
87 for (int i = 0; i < LiveEdit::kFramePaddingInitialSize; i++) {
88 __ push(ip);
89 }
90 __ LoadSmiLiteral(ip, Smi::FromInt(LiveEdit::kFramePaddingInitialSize));
91 __ push(ip);
92
93 // Push arguments for DebugBreak call. 85 // Push arguments for DebugBreak call.
94 if (mode == SAVE_RESULT_REGISTER) { 86 if (mode == SAVE_RESULT_REGISTER) {
95 // Break on return. 87 // Break on return.
96 __ push(r2); 88 __ push(r2);
97 } else { 89 } else {
98 // Non-return breaks. 90 // Non-return breaks.
99 __ Push(masm->isolate()->factory()->the_hole_value()); 91 __ Push(masm->isolate()->factory()->the_hole_value());
100 } 92 }
101 __ mov(r2, Operand(1)); 93 __ mov(r2, Operand(1));
102 __ mov(r3, 94 __ mov(r3,
103 Operand(ExternalReference( 95 Operand(ExternalReference(
104 Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate()))); 96 Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate())));
105 97
106 CEntryStub ceb(masm->isolate(), 1); 98 CEntryStub ceb(masm->isolate(), 1);
107 __ CallStub(&ceb); 99 __ CallStub(&ceb);
108 100
109 if (FLAG_debug_code) { 101 if (FLAG_debug_code) {
110 for (int i = 0; i < kNumJSCallerSaved; i++) { 102 for (int i = 0; i < kNumJSCallerSaved; i++) {
111 Register reg = {JSCallerSavedCode(i)}; 103 Register reg = {JSCallerSavedCode(i)};
112 // Do not clobber r2 if mode is SAVE_RESULT_REGISTER. It will 104 // Do not clobber r2 if mode is SAVE_RESULT_REGISTER. It will
113 // contain return value of the function. 105 // contain return value of the function.
114 if (!(reg.is(r2) && (mode == SAVE_RESULT_REGISTER))) { 106 if (!(reg.is(r2) && (mode == SAVE_RESULT_REGISTER))) {
115 __ mov(reg, Operand(kDebugZapValue)); 107 __ mov(reg, Operand(kDebugZapValue));
116 } 108 }
117 } 109 }
118 } 110 }
119
120 // Don't bother removing padding bytes pushed on the stack
121 // as the frame is going to be restored right away.
122
123 // Leave the internal frame. 111 // Leave the internal frame.
124 } 112 }
113 __ MaybeDropFrames();
125 114
126 // Now that the break point has been handled, resume normal execution by 115 // Return to caller.
127 // jumping to the target address intended by the caller and that was 116 __ Ret();
128 // overwritten by the address of DebugBreakXXX.
129 ExternalReference after_break_target =
130 ExternalReference::debug_after_break_target_address(masm->isolate());
131 __ mov(ip, Operand(after_break_target));
132 __ LoadP(ip, MemOperand(ip));
133 __ JumpToJSEntry(ip);
134 } 117 }
135 118
136 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { 119 void DebugCodegen::GenerateHandleDebuggerStatement(MacroAssembler* masm) {
137 // Load the function pointer off of our current stack frame. 120 {
138 __ LoadP(r3, MemOperand(fp, FrameDropperFrameConstants::kFunctionOffset)); 121 FrameScope scope(masm, StackFrame::INTERNAL);
122 __ CallRuntime(Runtime::kHandleDebuggerStatement, 0);
123 }
124 __ MaybeDropFrames();
139 125
140 // Pop return address and frame 126 // Return to caller.
127 __ Ret();
128 }
129
130 void DebugCodegen::GenerateFrameDropperTrampoline(MacroAssembler* masm) {
131 // Frame is being dropped:
132 // - Drop to the target frame specified by r3.
133 // - Look up current function on the frame.
134 // - Leave the frame.
135 // - Restart the frame by calling the function.
136
137 __ LoadRR(fp, r3);
138 __ LoadP(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
141 __ LeaveFrame(StackFrame::INTERNAL); 139 __ LeaveFrame(StackFrame::INTERNAL);
140 __ LoadP(r2, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset));
141 __ LoadP(
142 r2, FieldMemOperand(r2, SharedFunctionInfo::kFormalParameterCountOffset));
143 __ LoadRR(r4, r2);
142 144
143 ParameterCount dummy(0); 145 ParameterCount dummy1(r4);
144 __ CheckDebugHook(r3, no_reg, dummy, dummy); 146 ParameterCount dummy2(r2);
145 147 __ InvokeFunction(r3, dummy1, dummy2, JUMP_FUNCTION,
146 // Load context from the function. 148 CheckDebugStepCallWrapper());
147 __ LoadP(cp, FieldMemOperand(r3, JSFunction::kContextOffset));
148
149 // Clear new.target as a safety measure.
150 __ LoadRoot(r5, Heap::kUndefinedValueRootIndex);
151
152 // Get function code.
153 __ LoadP(ip, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset));
154 __ LoadP(ip, FieldMemOperand(ip, SharedFunctionInfo::kCodeOffset));
155 __ AddP(ip, Operand(Code::kHeaderSize - kHeapObjectTag));
156
157 // Re-run JSFunction, r3 is function, cp is context.
158 __ Jump(ip);
159 } 149 }
160 150
161 const bool LiveEdit::kFrameDropperSupported = true; 151 const bool LiveEdit::kFrameDropperSupported = true;
162 152
163 #undef __ 153 #undef __
164 } // namespace internal 154 } // namespace internal
165 } // namespace v8 155 } // namespace v8
166 156
167 #endif // V8_TARGET_ARCH_S390 157 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « src/debug/ppc/debug-ppc.cc ('k') | src/ppc/interface-descriptors-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698