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 #ifndef VM_ALLOCATION_H_ | 5 #ifndef VM_ALLOCATION_H_ |
6 #define VM_ALLOCATION_H_ | 6 #define VM_ALLOCATION_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/base_isolate.h" | 9 #include "vm/base_isolate.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 BaseIsolate::AssertCurrent(isolate_); | 58 BaseIsolate::AssertCurrent(isolate_); |
59 } | 59 } |
60 #endif | 60 #endif |
61 } | 61 } |
62 | 62 |
63 // We can only create StackResources with Isolates, so provide the original | 63 // We can only create StackResources with Isolates, so provide the original |
64 // isolate to the subclasses. The only reason we have a BaseIsolate in the | 64 // isolate to the subclasses. The only reason we have a BaseIsolate in the |
65 // StackResource is to break the header include cycles. | 65 // StackResource is to break the header include cycles. |
66 Isolate* isolate() const { return reinterpret_cast<Isolate*>(isolate_); } | 66 Isolate* isolate() const { return reinterpret_cast<Isolate*>(isolate_); } |
67 | 67 |
68 // Destroy stack resources of isolate from top until stack_pointer, exclusive. | 68 // Destroy stack resources of isolate until top exit frame. |
69 static void Unwind(Isolate* isolate, uword stack_pointer); | 69 static void Unwind(Isolate* isolate) { UnwindAbove(isolate, NULL); } |
70 // Destroy stack resources of isolate above new_top, exclusive. | 70 // Destroy stack resources of isolate above new_top, exclusive. |
71 static void Unwind(Isolate* isolate, StackResource* new_top); | 71 static void UnwindAbove(Isolate* isolate, StackResource* new_top); |
72 | 72 |
73 private: | 73 private: |
74 BaseIsolate* const isolate_; // Current isolate for this stack resource. | 74 BaseIsolate* const isolate_; // Current isolate for this stack resource. |
75 StackResource* previous_; | 75 StackResource* previous_; |
76 | 76 |
77 DISALLOW_ALLOCATION(); | 77 DISALLOW_ALLOCATION(); |
78 DISALLOW_IMPLICIT_CONSTRUCTORS(StackResource); | 78 DISALLOW_IMPLICIT_CONSTRUCTORS(StackResource); |
79 }; | 79 }; |
80 | 80 |
81 | 81 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // deallocated by invoking DeleteAll() on the zone they live in. | 116 // deallocated by invoking DeleteAll() on the zone they live in. |
117 void operator delete(void* pointer) { UNREACHABLE(); } | 117 void operator delete(void* pointer) { UNREACHABLE(); } |
118 | 118 |
119 private: | 119 private: |
120 DISALLOW_COPY_AND_ASSIGN(ZoneAllocated); | 120 DISALLOW_COPY_AND_ASSIGN(ZoneAllocated); |
121 }; | 121 }; |
122 | 122 |
123 } // namespace dart | 123 } // namespace dart |
124 | 124 |
125 #endif // VM_ALLOCATION_H_ | 125 #endif // VM_ALLOCATION_H_ |
OLD | NEW |