| Index: runtime/vm/allocation.cc
|
| ===================================================================
|
| --- runtime/vm/allocation.cc (revision 43776)
|
| +++ runtime/vm/allocation.cc (working copy)
|
| @@ -35,4 +35,20 @@
|
| return Allocate(size, zone);
|
| }
|
|
|
| +
|
| +void StackResource::Unwind(Isolate* isolate, uword stack_pointer) {
|
| + while (isolate->top_resource() != NULL &&
|
| + (reinterpret_cast<uword>(isolate->top_resource()) < stack_pointer)) {
|
| + isolate->top_resource()->~StackResource();
|
| + }
|
| +#if defined(DEBUG)
|
| + // All remaining stack resources should be below stack_pointer.
|
| + StackResource* current = isolate->top_resource();
|
| + while (current != NULL) {
|
| + ASSERT(reinterpret_cast<uword>(current) > stack_pointer);
|
| + current = current->previous_;
|
| + }
|
| +#endif // DEBUG
|
| +}
|
| +
|
| } // namespace dart
|
|
|