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_ |