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

Side by Side Diff: src/ia32/macro-assembler-ia32.cc

Issue 561049: Using RelocInfo instead of DebuggerStatementStub (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/ia32/virtual-frame-ia32.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 int r = JSCallerSavedCode(i); 301 int r = JSCallerSavedCode(i);
302 if ((regs & (1 << r)) != 0) { 302 if ((regs & (1 << r)) != 0) {
303 mov(scratch, Operand(base, 0)); 303 mov(scratch, Operand(base, 0));
304 ExternalReference reg_addr = 304 ExternalReference reg_addr =
305 ExternalReference(Debug_Address::Register(i)); 305 ExternalReference(Debug_Address::Register(i));
306 mov(Operand::StaticVariable(reg_addr), scratch); 306 mov(Operand::StaticVariable(reg_addr), scratch);
307 lea(base, Operand(base, kPointerSize)); 307 lea(base, Operand(base, kPointerSize));
308 } 308 }
309 } 309 }
310 } 310 }
311
312 void MacroAssembler::DebugBreak() {
313 Set(eax, Immediate(0));
314 mov(ebx, Immediate(ExternalReference(Runtime::kDebugBreak)));
315 CEntryStub ces(1);
316 call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
317 }
311 #endif 318 #endif
312 319
313 void MacroAssembler::Set(Register dst, const Immediate& x) { 320 void MacroAssembler::Set(Register dst, const Immediate& x) {
314 if (x.is_zero()) { 321 if (x.is_zero()) {
315 xor_(dst, Operand(dst)); // shorter than mov 322 xor_(dst, Operand(dst)); // shorter than mov
316 } else { 323 } else {
317 mov(dst, x); 324 mov(dst, x);
318 } 325 }
319 } 326 }
320 327
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 void MacroAssembler::EnterExitFramePrologue(ExitFrame::Mode mode) { 409 void MacroAssembler::EnterExitFramePrologue(ExitFrame::Mode mode) {
403 // Setup the frame structure on the stack. 410 // Setup the frame structure on the stack.
404 ASSERT(ExitFrameConstants::kCallerSPDisplacement == +2 * kPointerSize); 411 ASSERT(ExitFrameConstants::kCallerSPDisplacement == +2 * kPointerSize);
405 ASSERT(ExitFrameConstants::kCallerPCOffset == +1 * kPointerSize); 412 ASSERT(ExitFrameConstants::kCallerPCOffset == +1 * kPointerSize);
406 ASSERT(ExitFrameConstants::kCallerFPOffset == 0 * kPointerSize); 413 ASSERT(ExitFrameConstants::kCallerFPOffset == 0 * kPointerSize);
407 push(ebp); 414 push(ebp);
408 mov(ebp, Operand(esp)); 415 mov(ebp, Operand(esp));
409 416
410 // Reserve room for entry stack pointer and push the debug marker. 417 // Reserve room for entry stack pointer and push the debug marker.
411 ASSERT(ExitFrameConstants::kSPOffset == -1 * kPointerSize); 418 ASSERT(ExitFrameConstants::kSPOffset == -1 * kPointerSize);
412 push(Immediate(0)); // saved entry sp, patched before call 419 push(Immediate(0)); // Saved entry sp, patched before call.
413 if (mode == ExitFrame::MODE_DEBUG) { 420 push(Immediate(CodeObject())); // Accessed from ExitFrame::code_slot.
414 push(Immediate(0));
415 } else {
416 push(Immediate(CodeObject()));
417 }
418 421
419 // Save the frame pointer and the context in top. 422 // Save the frame pointer and the context in top.
420 ExternalReference c_entry_fp_address(Top::k_c_entry_fp_address); 423 ExternalReference c_entry_fp_address(Top::k_c_entry_fp_address);
421 ExternalReference context_address(Top::k_context_address); 424 ExternalReference context_address(Top::k_context_address);
422 mov(Operand::StaticVariable(c_entry_fp_address), ebp); 425 mov(Operand::StaticVariable(c_entry_fp_address), ebp);
423 mov(Operand::StaticVariable(context_address), esi); 426 mov(Operand::StaticVariable(context_address), esi);
424 } 427 }
425 428
426 void MacroAssembler::EnterExitFrameEpilogue(ExitFrame::Mode mode, int argc) { 429 void MacroAssembler::EnterExitFrameEpilogue(ExitFrame::Mode mode, int argc) {
427 #ifdef ENABLE_DEBUGGER_SUPPORT 430 #ifdef ENABLE_DEBUGGER_SUPPORT
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1604 // Indicate that code has changed. 1607 // Indicate that code has changed.
1605 CPU::FlushICache(address_, size_); 1608 CPU::FlushICache(address_, size_);
1606 1609
1607 // Check that the code was patched as expected. 1610 // Check that the code was patched as expected.
1608 ASSERT(masm_.pc_ == address_ + size_); 1611 ASSERT(masm_.pc_ == address_ + size_);
1609 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 1612 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
1610 } 1613 }
1611 1614
1612 1615
1613 } } // namespace v8::internal 1616 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/ia32/virtual-frame-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698