| OLD | NEW |
| 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/ic_data.h" | 10 #include "vm/ic_data.h" |
| (...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1544 __ addl(EAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); | 1544 __ addl(EAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); |
| 1545 __ jmp(EAX); | 1545 __ jmp(EAX); |
| 1546 } | 1546 } |
| 1547 | 1547 |
| 1548 | 1548 |
| 1549 // ECX: Function object. | 1549 // ECX: Function object. |
| 1550 // EDX: Arguments array. | 1550 // EDX: Arguments array. |
| 1551 // TOS(0): return address (Dart code). | 1551 // TOS(0): return address (Dart code). |
| 1552 void StubCode::GenerateBreakpointStaticStub(Assembler* assembler) { | 1552 void StubCode::GenerateBreakpointStaticStub(Assembler* assembler) { |
| 1553 __ EnterFrame(0); | 1553 __ EnterFrame(0); |
| 1554 __ pushl(EDX); |
| 1554 __ pushl(ECX); | 1555 __ pushl(ECX); |
| 1555 __ pushl(EDX); | 1556 __ CallRuntimeFromStub(kBreakpointStaticHandlerRuntimeEntry); |
| 1556 __ CallRuntimeFromStub(kBreakpointHandlerRuntimeEntry); | 1557 __ popl(ECX); |
| 1557 __ popl(EDX); | 1558 __ popl(EDX); |
| 1558 __ popl(ECX); | |
| 1559 __ LeaveFrame(); | 1559 __ LeaveFrame(); |
| 1560 // Now call the static function. | 1560 |
| 1561 __ jmp(&StubCode::CallStaticFunctionLabel()); | 1561 // Now call the static function. The breakpoint handler function |
| 1562 // ensures that the call target is compiled. |
| 1563 __ movl(EAX, FieldAddress(ECX, Function::code_offset())); |
| 1564 __ movl(ECX, FieldAddress(EAX, Code::instructions_offset())); |
| 1565 __ addl(ECX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); |
| 1566 __ jmp(ECX); |
| 1562 } | 1567 } |
| 1563 | 1568 |
| 1564 | 1569 |
| 1565 // ECX: Inline cache data array. | 1570 // ECX: Inline cache data array. |
| 1566 // EDX: Arguments array. | 1571 // EDX: Arguments array. |
| 1567 // TOS(0): return address (Dart code). | 1572 // TOS(0): return address (Dart code). |
| 1568 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) { | 1573 void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) { |
| 1569 __ EnterFrame(0); | 1574 __ EnterFrame(0); |
| 1570 __ pushl(ECX); | 1575 __ pushl(ECX); |
| 1571 __ pushl(EDX); | 1576 __ pushl(EDX); |
| 1572 __ CallRuntimeFromStub(kBreakpointHandlerRuntimeEntry); | 1577 __ CallRuntimeFromStub(kBreakpointDynamicHandlerRuntimeEntry); |
| 1573 __ popl(EDX); | 1578 __ popl(EDX); |
| 1574 __ popl(ECX); | 1579 __ popl(ECX); |
| 1575 __ LeaveFrame(); | 1580 __ LeaveFrame(); |
| 1576 // Now call the dynamic function. | 1581 // Now call the dynamic function. |
| 1577 __ jmp(&StubCode::InlineCacheLabel()); | 1582 __ jmp(&StubCode::InlineCacheLabel()); |
| 1578 } | 1583 } |
| 1579 | 1584 |
| 1580 } // namespace dart | 1585 } // namespace dart |
| 1581 | 1586 |
| 1582 #endif // defined TARGET_ARCH_IA32 | 1587 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |