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

Unified Diff: vm/base_isolate.h

Issue 10008030: Inline the StackResource constructor/destructor. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vm/allocation.cc ('k') | vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/base_isolate.h
===================================================================
--- vm/base_isolate.h (revision 0)
+++ vm/base_isolate.h (revision 0)
@@ -0,0 +1,41 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef VM_BASE_ISOLATE_H_
+#define VM_BASE_ISOLATE_H_
+
+namespace dart {
+
+class HandleScope;
+class StackResource;
+class Zone;
+
+// A BaseIsolate contains just enough functionality to allocate
+// StackResources. This allows us to inline the StackResource
+// constructor/destructor for performance.
+class BaseIsolate {
+ public:
+ StackResource* top_resource() const { return top_resource_; }
+ void set_top_resource(StackResource* value) { top_resource_ = value; }
+
+ Zone* current_zone() const { return current_zone_; }
+ void set_current_zone(Zone* zone) { current_zone_ = zone; }
+
+#if defined(DEBUG)
+ static void AssertCurrent(BaseIsolate* isolate);
+#endif
+
+ protected:
+ BaseIsolate() : top_resource_(NULL), current_zone_(NULL) {}
+ ~BaseIsolate() {
+ // Do not delete stack resources: top_resource_ and current_zone_.
+ }
+
+ StackResource* top_resource_;
+ Zone* current_zone_;
siva 2012/04/06 17:30:14 DISALLOW_COPY_AND_ASSIGN(BaseIsolate);
turnidge 2012/04/06 17:50:40 Done.
+};
+
+} // namespace dart
+
+#endif // VM_BASE_ISOLATE_H_
« no previous file with comments | « vm/allocation.cc ('k') | vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698