| 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 VM_STUB_CODE_H_ | 5 #ifndef VM_STUB_CODE_H_ |
| 6 #define VM_STUB_CODE_H_ | 6 #define 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; |
| 21 class Deserializer; |
| 20 | 22 |
| 21 // 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 |
| 22 // isolates running in this dart process. | 24 // isolates running in this dart process. |
| 23 #if !defined(TARGET_ARCH_DBC) | 25 #if !defined(TARGET_ARCH_DBC) |
| 24 #define VM_STUB_CODE_LIST(V) \ | 26 #define VM_STUB_CODE_LIST(V) \ |
| 25 V(GetStackPointer) \ | 27 V(GetStackPointer) \ |
| 26 V(JumpToExceptionHandler) \ | 28 V(JumpToExceptionHandler) \ |
| 27 V(UpdateStoreBuffer) \ | 29 V(UpdateStoreBuffer) \ |
| 28 V(PrintStopMessage) \ | 30 V(PrintStopMessage) \ |
| 29 V(CallToRuntime) \ | 31 V(CallToRuntime) \ |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 }; | 107 }; |
| 106 | 108 |
| 107 | 109 |
| 108 // class StubCode is used to maintain the lifecycle of stubs. | 110 // class StubCode is used to maintain the lifecycle of stubs. |
| 109 class StubCode : public AllStatic { | 111 class StubCode : public AllStatic { |
| 110 public: | 112 public: |
| 111 // Generate all stubs which are shared across all isolates, this is done | 113 // Generate all stubs which are shared across all isolates, this is done |
| 112 // only once and the stub code resides in the vm_isolate heap. | 114 // only once and the stub code resides in the vm_isolate heap. |
| 113 static void InitOnce(); | 115 static void InitOnce(); |
| 114 | 116 |
| 115 static void ReadFrom(SnapshotReader* reader); | 117 static void Push(Serializer* serializer); |
| 116 static void WriteTo(SnapshotWriter* writer); | 118 static void WriteRef(Serializer* serializer); |
| 119 static void ReadRef(Deserializer* deserializer); |
| 117 | 120 |
| 118 // Generate all stubs which are generated on a per isolate basis as they | 121 // Generate all stubs which are generated on a per isolate basis as they |
| 119 // have embedded objects which are isolate specific. | 122 // have embedded objects which are isolate specific. |
| 120 static void Init(Isolate* isolate); | 123 static void Init(Isolate* isolate); |
| 121 | 124 |
| 122 static void VisitObjectPointers(ObjectPointerVisitor* visitor); | 125 static void VisitObjectPointers(ObjectPointerVisitor* visitor); |
| 123 | 126 |
| 124 // Returns true if stub code has been initialized. | 127 // Returns true if stub code has been initialized. |
| 125 static bool HasBeenInitialized(); | 128 static bool HasBeenInitialized(); |
| 126 | 129 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 198 |
| 196 | 199 |
| 197 enum DeoptStubKind { | 200 enum DeoptStubKind { |
| 198 kLazyDeopt, | 201 kLazyDeopt, |
| 199 kEagerDeopt | 202 kEagerDeopt |
| 200 }; | 203 }; |
| 201 | 204 |
| 202 } // namespace dart | 205 } // namespace dart |
| 203 | 206 |
| 204 #endif // VM_STUB_CODE_H_ | 207 #endif // VM_STUB_CODE_H_ |
| OLD | NEW |