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" |
11 #include "vm/flow_graph_compiler.h" | 11 #include "vm/flow_graph_compiler.h" |
12 #include "vm/instructions.h" | 12 #include "vm/instructions.h" |
13 #include "vm/heap.h" | 13 #include "vm/heap.h" |
14 #include "vm/object_store.h" | 14 #include "vm/object_store.h" |
15 #include "vm/resolver.h" | 15 #include "vm/resolver.h" |
16 #include "vm/scavenger.h" | 16 #include "vm/scavenger.h" |
| 17 #include "vm/stack_frame.h" |
17 #include "vm/stub_code.h" | 18 #include "vm/stub_code.h" |
18 | 19 |
19 | 20 |
20 #define __ assembler-> | 21 #define __ assembler-> |
21 | 22 |
22 namespace dart { | 23 namespace dart { |
23 | 24 |
24 DEFINE_FLAG(bool, inline_alloc, true, "Inline allocation of objects."); | 25 DEFINE_FLAG(bool, inline_alloc, true, "Inline allocation of objects."); |
25 DEFINE_FLAG(bool, use_slow_path, false, | 26 DEFINE_FLAG(bool, use_slow_path, false, |
26 "Set to true for debugging & verifying the slow paths."); | 27 "Set to true for debugging & verifying the slow paths."); |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 | 735 |
735 // Cache the new Context pointer into CTX while executing dart code. | 736 // Cache the new Context pointer into CTX while executing dart code. |
736 __ movl(CTX, Address(EBP, kNewContextOffset)); | 737 __ movl(CTX, Address(EBP, kNewContextOffset)); |
737 __ movl(CTX, Address(CTX, VMHandles::kOffsetOfRawPtrInHandle)); | 738 __ movl(CTX, Address(CTX, VMHandles::kOffsetOfRawPtrInHandle)); |
738 | 739 |
739 // Load Isolate pointer from Context structure into EDI. | 740 // Load Isolate pointer from Context structure into EDI. |
740 __ movl(EDI, FieldAddress(CTX, Context::isolate_offset())); | 741 __ movl(EDI, FieldAddress(CTX, Context::isolate_offset())); |
741 | 742 |
742 // Save the top exit frame info. Use EDX as a temporary register. | 743 // Save the top exit frame info. Use EDX as a temporary register. |
743 // StackFrameIterator reads the top exit frame info saved in this frame. | 744 // StackFrameIterator reads the top exit frame info saved in this frame. |
744 // The constant kExitLinkOffsetInEntryFrame must be kept in sync with the | 745 // The constant kExitLinkSlotFromEntryFp must be kept in sync with the |
745 // code below: kExitLinkOffsetInEntryFrame = -4 * kWordSize. | 746 // code below. |
| 747 ASSERT(kExitLinkSlotFromEntryFp == -4); |
746 __ movl(EDX, Address(EDI, Isolate::top_exit_frame_info_offset())); | 748 __ movl(EDX, Address(EDI, Isolate::top_exit_frame_info_offset())); |
747 __ pushl(EDX); | 749 __ pushl(EDX); |
748 __ movl(Address(EDI, Isolate::top_exit_frame_info_offset()), Immediate(0)); | 750 __ movl(Address(EDI, Isolate::top_exit_frame_info_offset()), Immediate(0)); |
749 | 751 |
750 // Save the old Context pointer. Use ECX as a temporary register. | 752 // Save the old Context pointer. Use ECX as a temporary register. |
751 // Note that VisitObjectPointers will find this saved Context pointer during | 753 // Note that VisitObjectPointers will find this saved Context pointer during |
752 // GC marking, since it traverses any information between SP and | 754 // GC marking, since it traverses any information between SP and |
753 // FP - kExitLinkOffsetInEntryFrame. | 755 // FP - kExitLinkSlotFromEntryFp. |
754 // EntryFrame::SavedContext reads the context saved in this frame. | 756 // EntryFrame::SavedContext reads the context saved in this frame. |
755 // The constant kSavedContextOffsetInEntryFrame must be kept in sync with | 757 // The constant kSavedContextSlotFromEntryFp must be kept in sync with |
756 // the code below: kSavedContextOffsetInEntryFrame = -5 * kWordSize. | 758 // the code below. |
| 759 ASSERT(kSavedContextSlotFromEntryFp == -5); |
757 __ movl(ECX, Address(EDI, Isolate::top_context_offset())); | 760 __ movl(ECX, Address(EDI, Isolate::top_context_offset())); |
758 __ pushl(ECX); | 761 __ pushl(ECX); |
759 | 762 |
760 // Load arguments descriptor array into EDX. | 763 // Load arguments descriptor array into EDX. |
761 __ movl(EDX, Address(EBP, kArgumentsDescOffset)); | 764 __ movl(EDX, Address(EBP, kArgumentsDescOffset)); |
762 __ movl(EDX, Address(EDX, VMHandles::kOffsetOfRawPtrInHandle)); | 765 __ movl(EDX, Address(EDX, VMHandles::kOffsetOfRawPtrInHandle)); |
763 | 766 |
764 // Load number of arguments into EBX. | 767 // Load number of arguments into EBX. |
765 __ movl(EBX, FieldAddress(EDX, ArgumentsDescriptor::count_offset())); | 768 __ movl(EBX, FieldAddress(EDX, ArgumentsDescriptor::count_offset())); |
766 __ SmiUntag(EBX); | 769 __ SmiUntag(EBX); |
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2111 __ Bind(&done); | 2114 __ Bind(&done); |
2112 __ popl(temp); | 2115 __ popl(temp); |
2113 __ popl(right); | 2116 __ popl(right); |
2114 __ popl(left); | 2117 __ popl(left); |
2115 __ ret(); | 2118 __ ret(); |
2116 } | 2119 } |
2117 | 2120 |
2118 } // namespace dart | 2121 } // namespace dart |
2119 | 2122 |
2120 #endif // defined TARGET_ARCH_IA32 | 2123 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |