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

Side by Side Diff: runtime/vm/base_isolate.h

Issue 187503002: 1. Restructure reusable handles to make individual Scopes for each handle type (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | 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) 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 #ifndef VM_BASE_ISOLATE_H_ 5 #ifndef VM_BASE_ISOLATE_H_
6 #define VM_BASE_ISOLATE_H_ 6 #define VM_BASE_ISOLATE_H_
7 7
8 namespace dart { 8 namespace dart {
9 9
10 class HandleScope; 10 class HandleScope;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 ASSERT(no_callback_scope_depth_ < INT_MAX); 88 ASSERT(no_callback_scope_depth_ < INT_MAX);
89 no_callback_scope_depth_ += 1; 89 no_callback_scope_depth_ += 1;
90 } 90 }
91 91
92 void DecrementNoCallbackScopeDepth() { 92 void DecrementNoCallbackScopeDepth() {
93 ASSERT(no_callback_scope_depth_ > 0); 93 ASSERT(no_callback_scope_depth_ > 0);
94 no_callback_scope_depth_ -= 1; 94 no_callback_scope_depth_ -= 1;
95 } 95 }
96 96
97 #if defined(DEBUG) 97 #if defined(DEBUG)
98 void set_reusable_handle_scope_active(bool value) {
99 reusable_handle_scope_active_ = value;
100 }
101
102 bool reusable_handle_scope_active() {
103 return reusable_handle_scope_active_;
104 }
105 #endif
106
107 #if defined(DEBUG)
108 static void AssertCurrent(BaseIsolate* isolate); 98 static void AssertCurrent(BaseIsolate* isolate);
109 #endif 99 #endif
110 100
111 protected: 101 protected:
112 BaseIsolate() 102 BaseIsolate()
113 : top_resource_(NULL), 103 : top_resource_(NULL),
114 current_zone_(NULL), 104 current_zone_(NULL),
115 #if defined(DEBUG) 105 #if defined(DEBUG)
116 top_handle_scope_(NULL), 106 top_handle_scope_(NULL),
117 no_handle_scope_depth_(0), 107 no_handle_scope_depth_(0),
118 no_gc_scope_depth_(0), 108 no_gc_scope_depth_(0),
119 reusable_handle_scope_active_(false),
120 #endif 109 #endif
121 no_callback_scope_depth_(0) 110 no_callback_scope_depth_(0)
122 {} 111 {}
123 112
124 ~BaseIsolate() { 113 ~BaseIsolate() {
125 // Do not delete stack resources: top_resource_ and current_zone_. 114 // Do not delete stack resources: top_resource_ and current_zone_.
126 } 115 }
127 116
128 StackResource* top_resource_; 117 StackResource* top_resource_;
129 Zone* current_zone_; 118 Zone* current_zone_;
130 #if defined(DEBUG) 119 #if defined(DEBUG)
131 HandleScope* top_handle_scope_; 120 HandleScope* top_handle_scope_;
132 int32_t no_handle_scope_depth_; 121 int32_t no_handle_scope_depth_;
133 int32_t no_gc_scope_depth_; 122 int32_t no_gc_scope_depth_;
134 bool reusable_handle_scope_active_;
135 #endif 123 #endif
136 int32_t no_callback_scope_depth_; 124 int32_t no_callback_scope_depth_;
137 125
138 private: 126 private:
139 DISALLOW_COPY_AND_ASSIGN(BaseIsolate); 127 DISALLOW_COPY_AND_ASSIGN(BaseIsolate);
140 }; 128 };
141 129
142 } // namespace dart 130 } // namespace dart
143 131
144 #endif // VM_BASE_ISOLATE_H_ 132 #endif // VM_BASE_ISOLATE_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698