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 #ifndef RUNTIME_VM_STUB_CODE_H_ | 5 #ifndef RUNTIME_VM_STUB_CODE_H_ |
6 #define RUNTIME_VM_STUB_CODE_H_ | 6 #define RUNTIME_VM_STUB_CODE_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 | 10 |
11 namespace dart { | 11 namespace dart { |
12 | 12 |
13 // Forward declarations. | 13 // Forward declarations. |
14 class Code; | 14 class Code; |
15 class Isolate; | 15 class Isolate; |
16 class ObjectPointerVisitor; | 16 class ObjectPointerVisitor; |
17 class RawCode; | 17 class RawCode; |
18 class SnapshotReader; | 18 class SnapshotReader; |
19 class SnapshotWriter; | 19 class SnapshotWriter; |
20 class Serializer; | 20 class Serializer; |
21 class Deserializer; | 21 class Deserializer; |
22 | 22 |
23 // List of stubs created in the VM isolate, these stubs are shared by different | 23 // List of stubs created in the VM isolate, these stubs are shared by different |
24 // isolates running in this dart process. | 24 // isolates running in this dart process. |
25 #if !defined(TARGET_ARCH_DBC) | 25 #if !defined(TARGET_ARCH_DBC) |
26 #define VM_STUB_CODE_LIST(V) \ | 26 #define VM_STUB_CODE_LIST(V) \ |
27 V(GetStackPointer) \ | 27 V(GetStackPointer) \ |
28 V(JumpToExceptionHandler) \ | 28 V(JumpToFrame) \ |
| 29 V(RunExceptionHandler) \ |
29 V(UpdateStoreBuffer) \ | 30 V(UpdateStoreBuffer) \ |
30 V(PrintStopMessage) \ | 31 V(PrintStopMessage) \ |
31 V(CallToRuntime) \ | 32 V(CallToRuntime) \ |
32 V(LazyCompile) \ | 33 V(LazyCompile) \ |
33 V(CallBootstrapCFunction) \ | 34 V(CallBootstrapCFunction) \ |
34 V(CallNativeCFunction) \ | 35 V(CallNativeCFunction) \ |
35 V(FixCallersTarget) \ | 36 V(FixCallersTarget) \ |
36 V(CallStaticFunction) \ | 37 V(CallStaticFunction) \ |
37 V(OptimizeFunction) \ | 38 V(OptimizeFunction) \ |
38 V(InvokeDartCode) \ | 39 V(InvokeDartCode) \ |
(...skipping 27 matching lines...) Expand all Loading... |
66 V(Subtype1TestCache) \ | 67 V(Subtype1TestCache) \ |
67 V(Subtype2TestCache) \ | 68 V(Subtype2TestCache) \ |
68 V(Subtype3TestCache) \ | 69 V(Subtype3TestCache) \ |
69 V(CallClosureNoSuchMethod) \ | 70 V(CallClosureNoSuchMethod) \ |
70 V(FrameAwaitingMaterialization) | 71 V(FrameAwaitingMaterialization) |
71 | 72 |
72 #else | 73 #else |
73 #define VM_STUB_CODE_LIST(V) \ | 74 #define VM_STUB_CODE_LIST(V) \ |
74 V(LazyCompile) \ | 75 V(LazyCompile) \ |
75 V(OptimizeFunction) \ | 76 V(OptimizeFunction) \ |
| 77 V(RunExceptionHandler) \ |
76 V(FixCallersTarget) \ | 78 V(FixCallersTarget) \ |
77 V(Deoptimize) \ | 79 V(Deoptimize) \ |
78 V(DeoptimizeLazyFromReturn) \ | 80 V(DeoptimizeLazyFromReturn) \ |
79 V(DeoptimizeLazyFromThrow) \ | 81 V(DeoptimizeLazyFromThrow) \ |
80 V(FrameAwaitingMaterialization) | 82 V(FrameAwaitingMaterialization) |
81 | 83 |
82 #endif // !defined(TARGET_ARCH_DBC) | 84 #endif // !defined(TARGET_ARCH_DBC) |
83 | 85 |
84 // Is it permitted for the stubs above to refer to Object::null(), which is | 86 // Is it permitted for the stubs above to refer to Object::null(), which is |
85 // allocated in the VM isolate and shared across all isolates. | 87 // allocated in the VM isolate and shared across all isolates. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 133 |
132 static void VisitObjectPointers(ObjectPointerVisitor* visitor); | 134 static void VisitObjectPointers(ObjectPointerVisitor* visitor); |
133 | 135 |
134 // Returns true if stub code has been initialized. | 136 // Returns true if stub code has been initialized. |
135 static bool HasBeenInitialized(); | 137 static bool HasBeenInitialized(); |
136 | 138 |
137 // Check if specified pc is in the dart invocation stub used for | 139 // Check if specified pc is in the dart invocation stub used for |
138 // transitioning into dart code. | 140 // transitioning into dart code. |
139 static bool InInvocationStub(uword pc); | 141 static bool InInvocationStub(uword pc); |
140 | 142 |
141 // Check if the specified pc is in the jump to exception handler stub. | 143 // Check if the specified pc is in the jump to frame stub. |
142 static bool InJumpToExceptionHandlerStub(uword pc); | 144 static bool InJumpToFrameStub(uword pc); |
143 | 145 |
144 // Returns NULL if no stub found. | 146 // Returns NULL if no stub found. |
145 static const char* NameOfStub(uword entry_point); | 147 static const char* NameOfStub(uword entry_point); |
146 | 148 |
147 // Define the shared stub code accessors. | 149 // Define the shared stub code accessors. |
148 #define STUB_CODE_ACCESSOR(name) \ | 150 #define STUB_CODE_ACCESSOR(name) \ |
149 static const StubEntry* name##_entry() { return name##_entry_; } \ | 151 static const StubEntry* name##_entry() { return name##_entry_; } \ |
150 static intptr_t name##Size() { return name##_entry()->Size(); } | 152 static intptr_t name##Size() { return name##_entry()->Size(); } |
151 VM_STUB_CODE_LIST(STUB_CODE_ACCESSOR); | 153 VM_STUB_CODE_LIST(STUB_CODE_ACCESSOR); |
152 #undef STUB_CODE_ACCESSOR | 154 #undef STUB_CODE_ACCESSOR |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 Register temp_reg); | 191 Register temp_reg); |
190 static void GenerateOptimizedUsageCounterIncrement(Assembler* assembler); | 192 static void GenerateOptimizedUsageCounterIncrement(Assembler* assembler); |
191 }; | 193 }; |
192 | 194 |
193 | 195 |
194 enum DeoptStubKind { kLazyDeoptFromReturn, kLazyDeoptFromThrow, kEagerDeopt }; | 196 enum DeoptStubKind { kLazyDeoptFromReturn, kLazyDeoptFromThrow, kEagerDeopt }; |
195 | 197 |
196 } // namespace dart | 198 } // namespace dart |
197 | 199 |
198 #endif // RUNTIME_VM_STUB_CODE_H_ | 200 #endif // RUNTIME_VM_STUB_CODE_H_ |
OLD | NEW |