Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #include "vm/allocation.h" | 5 #include "vm/allocation.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
| 9 #include "vm/zone.h" | 9 #include "vm/zone.h" |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 ASSERT(isolate != NULL); | 28 ASSERT(isolate != NULL); |
| 29 return Allocate(size, isolate->current_zone()); | 29 return Allocate(size, isolate->current_zone()); |
| 30 } | 30 } |
| 31 | 31 |
| 32 | 32 |
| 33 void* ZoneAllocated::operator new(uword size, Zone* zone) { | 33 void* ZoneAllocated::operator new(uword size, Zone* zone) { |
| 34 ASSERT(zone == Isolate::Current()->current_zone()); | 34 ASSERT(zone == Isolate::Current()->current_zone()); |
| 35 return Allocate(size, zone); | 35 return Allocate(size, zone); |
| 36 } | 36 } |
| 37 | 37 |
| 38 | |
| 39 void StackResource::Unwind(Isolate* isolate, uword stack_pointer) { | |
| 40 while (isolate->top_resource() != NULL && | |
| 41 (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.
| |
| 42 isolate->top_resource()->~StackResource(); | |
| 43 } | |
| 44 #if defined(DEBUG) | |
| 45 // All remaining stack resources should be below stack_pointer. | |
| 46 StackResource* current = isolate->top_resource(); | |
| 47 while (current != NULL) { | |
| 48 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
| |
| 49 current = current->previous_; | |
| 50 } | |
| 51 #endif // DEBUG | |
| 52 } | |
| 53 | |
| 38 } // namespace dart | 54 } // namespace dart |
| OLD | NEW |