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(JumpToFrame) \ | 28 V(JumpToFrame) \ |
29 V(RunExceptionHandler) \ | 29 V(RunExceptionHandler) \ |
| 30 V(DeoptForRewind) \ |
30 V(UpdateStoreBuffer) \ | 31 V(UpdateStoreBuffer) \ |
31 V(PrintStopMessage) \ | 32 V(PrintStopMessage) \ |
32 V(CallToRuntime) \ | 33 V(CallToRuntime) \ |
33 V(LazyCompile) \ | 34 V(LazyCompile) \ |
34 V(CallBootstrapCFunction) \ | 35 V(CallBootstrapCFunction) \ |
35 V(CallNativeCFunction) \ | 36 V(CallNativeCFunction) \ |
36 V(FixCallersTarget) \ | 37 V(FixCallersTarget) \ |
37 V(CallStaticFunction) \ | 38 V(CallStaticFunction) \ |
38 V(OptimizeFunction) \ | 39 V(OptimizeFunction) \ |
39 V(InvokeDartCode) \ | 40 V(InvokeDartCode) \ |
(...skipping 28 matching lines...) Expand all Loading... |
68 V(Subtype2TestCache) \ | 69 V(Subtype2TestCache) \ |
69 V(Subtype3TestCache) \ | 70 V(Subtype3TestCache) \ |
70 V(CallClosureNoSuchMethod) \ | 71 V(CallClosureNoSuchMethod) \ |
71 V(FrameAwaitingMaterialization) | 72 V(FrameAwaitingMaterialization) |
72 | 73 |
73 #else | 74 #else |
74 #define VM_STUB_CODE_LIST(V) \ | 75 #define VM_STUB_CODE_LIST(V) \ |
75 V(LazyCompile) \ | 76 V(LazyCompile) \ |
76 V(OptimizeFunction) \ | 77 V(OptimizeFunction) \ |
77 V(RunExceptionHandler) \ | 78 V(RunExceptionHandler) \ |
| 79 V(DeoptForRewind) \ |
78 V(FixCallersTarget) \ | 80 V(FixCallersTarget) \ |
79 V(Deoptimize) \ | 81 V(Deoptimize) \ |
80 V(DeoptimizeLazyFromReturn) \ | 82 V(DeoptimizeLazyFromReturn) \ |
81 V(DeoptimizeLazyFromThrow) \ | 83 V(DeoptimizeLazyFromThrow) \ |
82 V(FrameAwaitingMaterialization) | 84 V(FrameAwaitingMaterialization) |
83 | 85 |
84 #endif // !defined(TARGET_ARCH_DBC) | 86 #endif // !defined(TARGET_ARCH_DBC) |
85 | 87 |
86 // Is it permitted for the stubs above to refer to Object::null(), which is | 88 // Is it permitted for the stubs above to refer to Object::null(), which is |
87 // allocated in the VM isolate and shared across all isolates. | 89 // allocated in the VM isolate and shared across all isolates. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 Token::Kind kind, | 190 Token::Kind kind, |
189 bool optimized = false); | 191 bool optimized = false); |
190 static void GenerateUsageCounterIncrement(Assembler* assembler, | 192 static void GenerateUsageCounterIncrement(Assembler* assembler, |
191 Register temp_reg); | 193 Register temp_reg); |
192 static void GenerateOptimizedUsageCounterIncrement(Assembler* assembler); | 194 static void GenerateOptimizedUsageCounterIncrement(Assembler* assembler); |
193 }; | 195 }; |
194 | 196 |
195 | 197 |
196 enum DeoptStubKind { kLazyDeoptFromReturn, kLazyDeoptFromThrow, kEagerDeopt }; | 198 enum DeoptStubKind { kLazyDeoptFromReturn, kLazyDeoptFromThrow, kEagerDeopt }; |
197 | 199 |
| 200 // Zap value used to indicate unused CODE_REG in deopt. |
| 201 static const uword kZapCodeReg = 0xf1f1f1f1; |
| 202 |
| 203 // Zap value used to indicate unused return address in deopt. |
| 204 static const uword kZapReturnAddress = 0xe1e1e1e1; |
| 205 |
198 } // namespace dart | 206 } // namespace dart |
199 | 207 |
200 #endif // RUNTIME_VM_STUB_CODE_H_ | 208 #endif // RUNTIME_VM_STUB_CODE_H_ |
OLD | NEW |