| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/zone.h" | 5 #include "vm/zone.h" |
| 6 | 6 |
| 7 #include "vm/assert.h" | 7 #include "vm/assert.h" |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/os.h" | 10 #include "vm/os.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 intptr_t size = 0; | 209 intptr_t size = 0; |
| 210 for (Segment* s = large_segments_; s != NULL; s = s->next()) { | 210 for (Segment* s = large_segments_; s != NULL; s = s->next()) { |
| 211 size += s->size(); | 211 size += s->size(); |
| 212 } | 212 } |
| 213 OS::Print("Size in bytes allocated, Total = %d Large Segments = %d\n", | 213 OS::Print("Size in bytes allocated, Total = %d Large Segments = %d\n", |
| 214 SizeInBytes(), size); | 214 SizeInBytes(), size); |
| 215 } | 215 } |
| 216 #endif | 216 #endif |
| 217 | 217 |
| 218 | 218 |
| 219 Zone::Zone() | 219 Zone::Zone(Isolate* isolate) |
| 220 : zone_(), | 220 : StackResource(isolate), |
| 221 zone_(), |
| 221 handles_(), | 222 handles_(), |
| 222 previous_(NULL) { | 223 previous_(NULL) { |
| 223 // Assert that there is no current zone as we only want to scope | 224 // Assert that there is no current zone as we only want to scope |
| 224 // zones when transitioning from generated dart code to dart VM | 225 // zones when transitioning from generated dart code to dart VM |
| 225 // runtime code. | 226 // runtime code. |
| 226 previous_ = isolate()->current_zone(); | 227 previous_ = isolate->current_zone(); |
| 227 isolate()->set_current_zone(this); | 228 isolate->set_current_zone(this); |
| 228 } | 229 } |
| 229 | 230 |
| 230 | 231 |
| 231 Zone::~Zone() { | 232 Zone::~Zone() { |
| 232 ASSERT(isolate()->current_zone() == this); | 233 ASSERT(isolate()->current_zone() == this); |
| 233 isolate()->set_current_zone(previous_); | 234 isolate()->set_current_zone(previous_); |
| 234 } | 235 } |
| 235 | 236 |
| 236 | 237 |
| 237 void Zone::VisitObjectPointers(ObjectPointerVisitor* visitor) { | 238 void Zone::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
| 238 Zone* zone = this; | 239 Zone* zone = this; |
| 239 while (zone != NULL) { | 240 while (zone != NULL) { |
| 240 zone->handles()->VisitObjectPointers(visitor); | 241 zone->handles()->VisitObjectPointers(visitor); |
| 241 zone = zone->previous_; | 242 zone = zone->previous_; |
| 242 } | 243 } |
| 243 } | 244 } |
| 244 | 245 |
| 245 } // namespace dart | 246 } // namespace dart |
| OLD | NEW |