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

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

Issue 293743005: Introduce x87 port (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: rebase Created 6 years, 7 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/x87/cpu-x87.cc ('k') | src/x87/deoptimizer-x87.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 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 #include "v8.h" 5 #include "v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_X87
8 8
9 #include "codegen.h" 9 #include "codegen.h"
10 #include "debug.h" 10 #include "debug.h"
11 11
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 bool BreakLocationIterator::IsDebugBreakAtReturn() { 16 bool BreakLocationIterator::IsDebugBreakAtReturn() {
17 return Debug::IsDebugBreakAtReturn(rinfo()); 17 return Debug::IsDebugBreakAtReturn(rinfo());
18 } 18 }
19 19
20 20
21 // Patch the JS frame exit code with a debug break call. See 21 // Patch the JS frame exit code with a debug break call. See
22 // CodeGenerator::VisitReturnStatement and VirtualFrame::Exit in codegen-ia32.cc 22 // CodeGenerator::VisitReturnStatement and VirtualFrame::Exit in codegen-x87.cc
23 // for the precise return instructions sequence. 23 // for the precise return instructions sequence.
24 void BreakLocationIterator::SetDebugBreakAtReturn() { 24 void BreakLocationIterator::SetDebugBreakAtReturn() {
25 ASSERT(Assembler::kJSReturnSequenceLength >= 25 ASSERT(Assembler::kJSReturnSequenceLength >=
26 Assembler::kCallInstructionLength); 26 Assembler::kCallInstructionLength);
27 rinfo()->PatchCodeWithCall( 27 rinfo()->PatchCodeWithCall(
28 debug_info_->GetIsolate()->builtins()->Return_DebugBreak()->entry(), 28 debug_info_->GetIsolate()->builtins()->Return_DebugBreak()->entry(),
29 Assembler::kJSReturnSequenceLength - Assembler::kCallInstructionLength); 29 Assembler::kJSReturnSequenceLength - Assembler::kCallInstructionLength);
30 } 30 }
31 31
32 32
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // ----------- S t a t e ------------- 177 // ----------- S t a t e -------------
178 // -- edx : type feedback slot (smi) 178 // -- edx : type feedback slot (smi)
179 // -- edi : function 179 // -- edi : function
180 // ----------------------------------- 180 // -----------------------------------
181 Generate_DebugBreakCallHelper(masm, edx.bit() | edi.bit(), 181 Generate_DebugBreakCallHelper(masm, edx.bit() | edi.bit(),
182 0, false); 182 0, false);
183 } 183 }
184 184
185 185
186 void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) { 186 void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) {
187 // Register state for IC load call (from ic-ia32.cc). 187 // Register state for IC load call (from ic-x87.cc).
188 // ----------- S t a t e ------------- 188 // ----------- S t a t e -------------
189 // -- ecx : name 189 // -- ecx : name
190 // -- edx : receiver 190 // -- edx : receiver
191 // ----------------------------------- 191 // -----------------------------------
192 Generate_DebugBreakCallHelper(masm, ecx.bit() | edx.bit(), 0, false); 192 Generate_DebugBreakCallHelper(masm, ecx.bit() | edx.bit(), 0, false);
193 } 193 }
194 194
195 195
196 void Debug::GenerateStoreICDebugBreak(MacroAssembler* masm) { 196 void Debug::GenerateStoreICDebugBreak(MacroAssembler* masm) {
197 // Register state for IC store call (from ic-ia32.cc). 197 // Register state for IC store call (from ic-x87.cc).
198 // ----------- S t a t e ------------- 198 // ----------- S t a t e -------------
199 // -- eax : value 199 // -- eax : value
200 // -- ecx : name 200 // -- ecx : name
201 // -- edx : receiver 201 // -- edx : receiver
202 // ----------------------------------- 202 // -----------------------------------
203 Generate_DebugBreakCallHelper( 203 Generate_DebugBreakCallHelper(
204 masm, eax.bit() | ecx.bit() | edx.bit(), 0, false); 204 masm, eax.bit() | ecx.bit() | edx.bit(), 0, false);
205 } 205 }
206 206
207 207
208 void Debug::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) { 208 void Debug::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) {
209 // Register state for keyed IC load call (from ic-ia32.cc). 209 // Register state for keyed IC load call (from ic-x87.cc).
210 // ----------- S t a t e ------------- 210 // ----------- S t a t e -------------
211 // -- ecx : key 211 // -- ecx : key
212 // -- edx : receiver 212 // -- edx : receiver
213 // ----------------------------------- 213 // -----------------------------------
214 Generate_DebugBreakCallHelper(masm, ecx.bit() | edx.bit(), 0, false); 214 Generate_DebugBreakCallHelper(masm, ecx.bit() | edx.bit(), 0, false);
215 } 215 }
216 216
217 217
218 void Debug::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) { 218 void Debug::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) {
219 // Register state for keyed IC load call (from ic-ia32.cc). 219 // Register state for keyed IC load call (from ic-x87.cc).
220 // ----------- S t a t e ------------- 220 // ----------- S t a t e -------------
221 // -- eax : value 221 // -- eax : value
222 // -- ecx : key 222 // -- ecx : key
223 // -- edx : receiver 223 // -- edx : receiver
224 // ----------------------------------- 224 // -----------------------------------
225 Generate_DebugBreakCallHelper( 225 Generate_DebugBreakCallHelper(
226 masm, eax.bit() | ecx.bit() | edx.bit(), 0, false); 226 masm, eax.bit() | ecx.bit() | edx.bit(), 0, false);
227 } 227 }
228 228
229 229
230 void Debug::GenerateCompareNilICDebugBreak(MacroAssembler* masm) { 230 void Debug::GenerateCompareNilICDebugBreak(MacroAssembler* masm) {
231 // Register state for CompareNil IC 231 // Register state for CompareNil IC
232 // ----------- S t a t e ------------- 232 // ----------- S t a t e -------------
233 // -- eax : value 233 // -- eax : value
234 // ----------------------------------- 234 // -----------------------------------
235 Generate_DebugBreakCallHelper(masm, eax.bit(), 0, false); 235 Generate_DebugBreakCallHelper(masm, eax.bit(), 0, false);
236 } 236 }
237 237
238 238
239 void Debug::GenerateReturnDebugBreak(MacroAssembler* masm) { 239 void Debug::GenerateReturnDebugBreak(MacroAssembler* masm) {
240 // Register state just before return from JS function (from codegen-ia32.cc). 240 // Register state just before return from JS function (from codegen-x87.cc).
241 // ----------- S t a t e ------------- 241 // ----------- S t a t e -------------
242 // -- eax: return value 242 // -- eax: return value
243 // ----------------------------------- 243 // -----------------------------------
244 Generate_DebugBreakCallHelper(masm, eax.bit(), 0, true); 244 Generate_DebugBreakCallHelper(masm, eax.bit(), 0, true);
245 } 245 }
246 246
247 247
248 void Debug::GenerateCallFunctionStubDebugBreak(MacroAssembler* masm) { 248 void Debug::GenerateCallFunctionStubDebugBreak(MacroAssembler* masm) {
249 // Register state for CallFunctionStub (from code-stubs-ia32.cc). 249 // Register state for CallFunctionStub (from code-stubs-x87.cc).
250 // ----------- S t a t e ------------- 250 // ----------- S t a t e -------------
251 // -- edi: function 251 // -- edi: function
252 // ----------------------------------- 252 // -----------------------------------
253 Generate_DebugBreakCallHelper(masm, edi.bit(), 0, false); 253 Generate_DebugBreakCallHelper(masm, edi.bit(), 0, false);
254 } 254 }
255 255
256 256
257 void Debug::GenerateCallConstructStubDebugBreak(MacroAssembler* masm) { 257 void Debug::GenerateCallConstructStubDebugBreak(MacroAssembler* masm) {
258 // Register state for CallConstructStub (from code-stubs-ia32.cc). 258 // Register state for CallConstructStub (from code-stubs-x87.cc).
259 // eax is the actual number of arguments not encoded as a smi see comment 259 // eax is the actual number of arguments not encoded as a smi see comment
260 // above IC call. 260 // above IC call.
261 // ----------- S t a t e ------------- 261 // ----------- S t a t e -------------
262 // -- eax: number of arguments (not smi) 262 // -- eax: number of arguments (not smi)
263 // -- edi: constructor function 263 // -- edi: constructor function
264 // ----------------------------------- 264 // -----------------------------------
265 // The number of arguments in eax is not smi encoded. 265 // The number of arguments in eax is not smi encoded.
266 Generate_DebugBreakCallHelper(masm, edi.bit(), eax.bit(), false); 266 Generate_DebugBreakCallHelper(masm, edi.bit(), eax.bit(), false);
267 } 267 }
268 268
269 269
270 void Debug::GenerateCallConstructStubRecordDebugBreak(MacroAssembler* masm) { 270 void Debug::GenerateCallConstructStubRecordDebugBreak(MacroAssembler* masm) {
271 // Register state for CallConstructStub (from code-stubs-ia32.cc). 271 // Register state for CallConstructStub (from code-stubs-x87.cc).
272 // eax is the actual number of arguments not encoded as a smi see comment 272 // eax is the actual number of arguments not encoded as a smi see comment
273 // above IC call. 273 // above IC call.
274 // ----------- S t a t e ------------- 274 // ----------- S t a t e -------------
275 // -- eax: number of arguments (not smi) 275 // -- eax: number of arguments (not smi)
276 // -- ebx: feedback array 276 // -- ebx: feedback array
277 // -- edx: feedback slot (smi) 277 // -- edx: feedback slot (smi)
278 // -- edi: constructor function 278 // -- edi: constructor function
279 // ----------------------------------- 279 // -----------------------------------
280 // The number of arguments in eax is not smi encoded. 280 // The number of arguments in eax is not smi encoded.
281 Generate_DebugBreakCallHelper(masm, ebx.bit() | edx.bit() | edi.bit(), 281 Generate_DebugBreakCallHelper(masm, ebx.bit() | edx.bit() | edi.bit(),
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 // Re-run JSFunction, edi is function, esi is context. 329 // Re-run JSFunction, edi is function, esi is context.
330 __ jmp(edx); 330 __ jmp(edx);
331 } 331 }
332 332
333 const bool Debug::kFrameDropperSupported = true; 333 const bool Debug::kFrameDropperSupported = true;
334 334
335 #undef __ 335 #undef __
336 336
337 } } // namespace v8::internal 337 } } // namespace v8::internal
338 338
339 #endif // V8_TARGET_ARCH_IA32 339 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x87/cpu-x87.cc ('k') | src/x87/deoptimizer-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698