Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1701 } | 1701 } |
| 1702 | 1702 |
| 1703 | 1703 |
| 1704 // Megamorphic call is currently implemented as IC call but through a stub | 1704 // Megamorphic call is currently implemented as IC call but through a stub |
| 1705 // that does not check/count function invocations. | 1705 // that does not check/count function invocations. |
| 1706 void StubCode::GenerateMegamorphicCallStub(Assembler* assembler) { | 1706 void StubCode::GenerateMegamorphicCallStub(Assembler* assembler) { |
| 1707 GenerateNArgsCheckInlineCacheStub(assembler, 1); | 1707 GenerateNArgsCheckInlineCacheStub(assembler, 1); |
| 1708 } | 1708 } |
| 1709 | 1709 |
| 1710 | 1710 |
| 1711 // ECX: ICData | 1711 // EDX, EXC: May contain arguments to runtime stub. |
| 1712 void StubCode::GenerateBreakpointEqNullStub(Assembler* assembler) { | 1712 void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) { |
| 1713 __ EnterStubFrame(); | 1713 __ EnterStubFrame(); |
| 1714 // Save runtime args. | |
| 1714 __ pushl(ECX); | 1715 __ pushl(ECX); |
| 1715 __ CallRuntime(kBreakpointEqualNullHandlerRuntimeEntry); | 1716 __ pushl(EDX); |
| 1717 // Room for result. Debugger stub returns address of the | |
| 1718 // unpatched runtime stub. | |
| 1719 __ pushl(Immediate(0)); | |
|
siva
2013/05/23 01:11:26
const Immediate& raw_null = Immediate(reinterpret_
hausner
2013/05/23 18:32:12
Done.
| |
| 1720 __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry); | |
| 1721 __ popl(EAX); // Address of original stub. | |
| 1722 __ popl(EDX); // Restore arguments. | |
| 1716 __ popl(ECX); | 1723 __ popl(ECX); |
| 1717 __ LeaveFrame(); | 1724 __ LeaveFrame(); |
| 1718 __ jmp(&StubCode::EqualityWithNullArgLabel()); | 1725 __ jmp(EAX); // Jump to original stub. |
| 1719 } | |
| 1720 | |
| 1721 | |
| 1722 // EDX: Arguments descriptor array. | |
| 1723 void StubCode::GenerateBreakpointClosureStub(Assembler* assembler) { | |
| 1724 __ EnterStubFrame(); | |
| 1725 __ pushl(EDX); // Push arguments descriptor. | |
| 1726 __ CallRuntime(kBreakpointClosureHandlerRuntimeEntry); | |
| 1727 __ popl(EDX); // Restore arguments descriptor. | |
| 1728 __ LeaveFrame(); | |
| 1729 __ jmp(&StubCode::CallClosureFunctionLabel()); | |
| 1730 } | 1726 } |
| 1731 | 1727 |
| 1732 | 1728 |
| 1733 // EDX: Arguments descriptor array. | 1729 // EDX: Arguments descriptor array. |
| 1734 // TOS(0): return address (Dart code). | 1730 // TOS(0): return address (Dart code). |
| 1735 void StubCode::GenerateBreakpointStaticStub(Assembler* assembler) { | 1731 void StubCode::GenerateBreakpointStaticStub(Assembler* assembler) { |
| 1736 // Create a stub frame as we are pushing some objects on the stack before | 1732 // Create a stub frame as we are pushing some objects on the stack before |
| 1737 // calling into the runtime. | 1733 // calling into the runtime. |
| 1738 __ EnterStubFrame(); | 1734 __ EnterStubFrame(); |
| 1739 __ pushl(EDX); // Preserve arguments descriptor. | 1735 __ pushl(EDX); // Preserve arguments descriptor. |
| 1740 const Immediate& raw_null = | 1736 const Immediate& raw_null = |
| 1741 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 1737 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 1742 __ pushl(raw_null); // Room for result. | 1738 __ pushl(raw_null); // Room for result. |
| 1743 __ CallRuntime(kBreakpointStaticHandlerRuntimeEntry); | 1739 __ CallRuntime(kBreakpointStaticHandlerRuntimeEntry); |
| 1744 __ popl(EAX); // Code object. | 1740 __ popl(EAX); // Code object. |
| 1745 __ popl(EDX); // Restore arguments descriptor. | 1741 __ popl(EDX); // Restore arguments descriptor. |
| 1746 __ LeaveFrame(); | 1742 __ LeaveFrame(); |
| 1747 | 1743 |
| 1748 // Now call the static function. The breakpoint handler function | 1744 // Now call the static function. The breakpoint handler function |
| 1749 // ensures that the call target is compiled. | 1745 // ensures that the call target is compiled. |
| 1746 // Note that we can't just jump to the CallStatic function stub | |
| 1747 // here since that stub would patch the call site with the | |
| 1748 // static function address. | |
| 1750 __ movl(ECX, FieldAddress(EAX, Code::instructions_offset())); | 1749 __ movl(ECX, FieldAddress(EAX, Code::instructions_offset())); |
| 1751 __ addl(ECX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); | 1750 __ addl(ECX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); |
| 1752 __ jmp(ECX); | 1751 __ jmp(ECX); |
| 1753 } | 1752 } |
| 1754 | 1753 |
| 1755 | 1754 |
| 1756 // TOS(0): return address (Dart code). | 1755 // TOS(0): return address (Dart code). |
| 1757 void StubCode::GenerateBreakpointReturnStub(Assembler* assembler) { | 1756 void StubCode::GenerateBreakpointReturnStub(Assembler* assembler) { |
| 1758 // Create a stub frame as we are pushing some objects on the stack before | 1757 // Create a stub frame as we are pushing some objects on the stack before |
| 1759 // calling into the runtime. | 1758 // calling into the runtime. |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2146 __ Bind(&done); | 2145 __ Bind(&done); |
| 2147 __ popl(temp); | 2146 __ popl(temp); |
| 2148 __ popl(right); | 2147 __ popl(right); |
| 2149 __ popl(left); | 2148 __ popl(left); |
| 2150 __ ret(); | 2149 __ ret(); |
| 2151 } | 2150 } |
| 2152 | 2151 |
| 2153 } // namespace dart | 2152 } // namespace dart |
| 2154 | 2153 |
| 2155 #endif // defined TARGET_ARCH_IA32 | 2154 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |