| 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; |
| 19 class SnapshotWriter; |
| 18 | 20 |
| 19 | 21 |
| 20 // List of stubs created in the VM isolate, these stubs are shared by different | 22 // List of stubs created in the VM isolate, these stubs are shared by different |
| 21 // isolates running in this dart process. | 23 // isolates running in this dart process. |
| 22 #define VM_STUB_CODE_LIST(V) \ | 24 #define VM_STUB_CODE_LIST(V) \ |
| 23 V(GetStackPointer) \ | 25 V(GetStackPointer) \ |
| 24 V(JumpToExceptionHandler) \ | 26 V(JumpToExceptionHandler) \ |
| 25 V(UpdateStoreBuffer) \ | 27 V(UpdateStoreBuffer) \ |
| 26 V(PrintStopMessage) \ | 28 V(PrintStopMessage) \ |
| 27 V(CallToRuntime) \ | 29 V(CallToRuntime) \ |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 }; | 93 }; |
| 92 | 94 |
| 93 | 95 |
| 94 // class StubCode is used to maintain the lifecycle of stubs. | 96 // class StubCode is used to maintain the lifecycle of stubs. |
| 95 class StubCode : public AllStatic { | 97 class StubCode : public AllStatic { |
| 96 public: | 98 public: |
| 97 // Generate all stubs which are shared across all isolates, this is done | 99 // Generate all stubs which are shared across all isolates, this is done |
| 98 // only once and the stub code resides in the vm_isolate heap. | 100 // only once and the stub code resides in the vm_isolate heap. |
| 99 static void InitOnce(); | 101 static void InitOnce(); |
| 100 | 102 |
| 103 static void ReadFrom(SnapshotReader* reader); |
| 104 static void WriteTo(SnapshotWriter* writer); |
| 105 |
| 101 // Generate all stubs which are generated on a per isolate basis as they | 106 // Generate all stubs which are generated on a per isolate basis as they |
| 102 // have embedded objects which are isolate specific. | 107 // have embedded objects which are isolate specific. |
| 103 static void Init(Isolate* isolate); | 108 static void Init(Isolate* isolate); |
| 104 | 109 |
| 105 static void VisitObjectPointers(ObjectPointerVisitor* visitor); | 110 static void VisitObjectPointers(ObjectPointerVisitor* visitor); |
| 106 | 111 |
| 107 // Check if specified pc is in the dart invocation stub used for | 112 // Check if specified pc is in the dart invocation stub used for |
| 108 // transitioning into dart code. | 113 // transitioning into dart code. |
| 109 static bool InInvocationStub(uword pc); | 114 static bool InInvocationStub(uword pc); |
| 110 | 115 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 RangeCollectionMode range_collection_mode, | 176 RangeCollectionMode range_collection_mode, |
| 172 bool optimized = false); | 177 bool optimized = false); |
| 173 static void GenerateUsageCounterIncrement(Assembler* assembler, | 178 static void GenerateUsageCounterIncrement(Assembler* assembler, |
| 174 Register temp_reg); | 179 Register temp_reg); |
| 175 static void GenerateOptimizedUsageCounterIncrement(Assembler* assembler); | 180 static void GenerateOptimizedUsageCounterIncrement(Assembler* assembler); |
| 176 }; | 181 }; |
| 177 | 182 |
| 178 } // namespace dart | 183 } // namespace dart |
| 179 | 184 |
| 180 #endif // VM_STUB_CODE_H_ | 185 #endif // VM_STUB_CODE_H_ |
| OLD | NEW |