Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(506)

Side by Side Diff: runtime/vm/zone.cc

Issue 8523013: Cache isolate in the StackTrace object to that we don't call (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/handles.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 #endif 216 #endif
217 217
218 218
219 Zone::Zone() 219 Zone::Zone()
220 : zone_(), 220 : zone_(),
221 handles_(), 221 handles_(),
222 previous_(NULL) { 222 previous_(NULL) {
223 // Assert that there is no current zone as we only want to scope 223 // Assert that there is no current zone as we only want to scope
224 // zones when transitioning from generated dart code to dart VM 224 // zones when transitioning from generated dart code to dart VM
225 // runtime code. 225 // runtime code.
226 Isolate* isolate = Isolate::Current(); 226 previous_ = isolate()->current_zone();
227 previous_ = isolate->current_zone(); 227 isolate()->set_current_zone(this);
228 Isolate::Current()->set_current_zone(this);
229 } 228 }
230 229
231 230
232 Zone::~Zone() { 231 Zone::~Zone() {
233 Isolate* isolate = Isolate::Current(); 232 ASSERT(isolate()->current_zone() == this);
234 ASSERT(isolate->current_zone() == this); 233 isolate()->set_current_zone(previous_);
235 isolate->set_current_zone(previous_);
236 } 234 }
237 235
238 236
239 void Zone::VisitObjectPointers(ObjectPointerVisitor* visitor) { 237 void Zone::VisitObjectPointers(ObjectPointerVisitor* visitor) {
240 Zone* zone = this; 238 Zone* zone = this;
241 while (zone != NULL) { 239 while (zone != NULL) {
242 zone->handles()->VisitObjectPointers(visitor); 240 zone->handles()->VisitObjectPointers(visitor);
243 zone = zone->previous_; 241 zone = zone->previous_;
244 } 242 }
245 } 243 }
246 244
247 } // namespace dart 245 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/handles.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698