Chromium Code Reviews| 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)) { |
|
zra
2015/02/17 19:45:24
Should this be <= ?
koda
2015/02/17 20:01:15
No, made it exclusive and documented that.
|
| + 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); |
|
zra
2015/02/17 19:45:24
Or should this be >= ?
Or is current == stack_poi
koda
2015/02/17 20:01:15
With out current usage, it's not possible, since w
|
| + current = current->previous_; |
| + } |
| +#endif // DEBUG |
| +} |
| + |
| } // namespace dart |