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

Side by Side Diff: runtime/vm/stub_code_ia32.cc

Issue 9484002: StepOver, StepInto, StepOut (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_x64.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 (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/code_generator.h" 8 #include "vm/code_generator.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/object_store.h" 10 #include "vm/object_store.h"
(...skipping 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after
1709 1709
1710 // Now call the static function. The breakpoint handler function 1710 // Now call the static function. The breakpoint handler function
1711 // ensures that the call target is compiled. 1711 // ensures that the call target is compiled.
1712 __ movl(EAX, FieldAddress(ECX, Function::code_offset())); 1712 __ movl(EAX, FieldAddress(ECX, Function::code_offset()));
1713 __ movl(ECX, FieldAddress(EAX, Code::instructions_offset())); 1713 __ movl(ECX, FieldAddress(EAX, Code::instructions_offset()));
1714 __ addl(ECX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); 1714 __ addl(ECX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
1715 __ jmp(ECX); 1715 __ jmp(ECX);
1716 } 1716 }
1717 1717
1718 1718
1719 // TOS(0): return address (Dart code).
1720 void StubCode::GenerateBreakpointReturnStub(Assembler* assembler) {
1721 __ EnterFrame(0);
1722 __ pushl(EAX);
1723 __ CallRuntimeFromStub(kBreakpointReturnHandlerRuntimeEntry);
1724 __ popl(EAX);
1725 __ LeaveFrame();
1726
1727 // Instead of returning to the patched Dart function, emulate the
1728 // smashed return code pattern and return to the function's caller.
1729 __ popl(ECX); // Discard return address to patched dart code.
1730 // Execute function epilog code that was smashed in the Dart code.
1731 __ LeaveFrame();
1732 __ ret();
1733 }
1734
1735
1719 // ECX: Inline cache data array. 1736 // ECX: Inline cache data array.
1720 // EDX: Arguments array. 1737 // EDX: Arguments array.
1721 // TOS(0): return address (Dart code). 1738 // TOS(0): return address (Dart code).
1722 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) { 1739 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) {
1723 __ EnterFrame(0); 1740 __ EnterFrame(0);
1724 __ pushl(ECX); 1741 __ pushl(ECX);
1725 __ pushl(EDX); 1742 __ pushl(EDX);
1726 __ CallRuntimeFromStub(kBreakpointDynamicHandlerRuntimeEntry); 1743 __ CallRuntimeFromStub(kBreakpointDynamicHandlerRuntimeEntry);
1727 __ popl(EDX); 1744 __ popl(EDX);
1728 __ popl(ECX); 1745 __ popl(ECX);
1729 __ LeaveFrame(); 1746 __ LeaveFrame();
1730 // Now call the dynamic function. 1747
1748 // Find out which dispatch stub to call.
1749 Label ic_cache_one_arg;
1750 __ movl(EBX, FieldAddress(ECX, ICData::num_args_tested_offset()));
1751 const Immediate value =
1752 Immediate(reinterpret_cast<int32_t>(Smi::New(1)));
1753 __ cmpl(EBX, value);
1754 __ j(EQUAL, &ic_cache_one_arg, Assembler::kNearJump);
1755 __ jmp(&StubCode::TwoArgsCheckInlineCacheLabel());
1756 __ Bind(&ic_cache_one_arg);
1731 __ jmp(&StubCode::OneArgCheckInlineCacheLabel()); 1757 __ jmp(&StubCode::OneArgCheckInlineCacheLabel());
1732 } 1758 }
1733 1759
1734 } // namespace dart 1760 } // namespace dart
1735 1761
1736 #endif // defined TARGET_ARCH_IA32 1762 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698