| 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 // Destroys stack resources of isolate from its top until stack_pointer. |
| 69 static void Unwind(Isolate* isolate, uword stack_pointer); |
| 70 |
| 68 private: | 71 private: |
| 69 BaseIsolate* const isolate_; // Current isolate for this stack resource. | 72 BaseIsolate* const isolate_; // Current isolate for this stack resource. |
| 70 StackResource* previous_; | 73 StackResource* previous_; |
| 71 | 74 |
| 72 DISALLOW_ALLOCATION(); | 75 DISALLOW_ALLOCATION(); |
| 73 DISALLOW_IMPLICIT_CONSTRUCTORS(StackResource); | 76 DISALLOW_IMPLICIT_CONSTRUCTORS(StackResource); |
| 74 }; | 77 }; |
| 75 | 78 |
| 76 | 79 |
| 77 // Static allocated classes only contain static members and can never | 80 // Static allocated classes only contain static members and can never |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // deallocated by invoking DeleteAll() on the zone they live in. | 114 // deallocated by invoking DeleteAll() on the zone they live in. |
| 112 void operator delete(void* pointer) { UNREACHABLE(); } | 115 void operator delete(void* pointer) { UNREACHABLE(); } |
| 113 | 116 |
| 114 private: | 117 private: |
| 115 DISALLOW_COPY_AND_ASSIGN(ZoneAllocated); | 118 DISALLOW_COPY_AND_ASSIGN(ZoneAllocated); |
| 116 }; | 119 }; |
| 117 | 120 |
| 118 } // namespace dart | 121 } // namespace dart |
| 119 | 122 |
| 120 #endif // VM_ALLOCATION_H_ | 123 #endif // VM_ALLOCATION_H_ |
| OLD | NEW |