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

Side by Side Diff: src/handles.h

Issue 10698031: Revert the change adding CompilationHandleScope. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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 | « src/compiler.cc ('k') | src/handles.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 // Closes the given scope, but lets this handle escape. See 89 // Closes the given scope, but lets this handle escape. See
90 // implementation in api.h. 90 // implementation in api.h.
91 inline Handle<T> EscapeFrom(v8::HandleScope* scope); 91 inline Handle<T> EscapeFrom(v8::HandleScope* scope);
92 92
93 private: 93 private:
94 T** location_; 94 T** location_;
95 }; 95 };
96 96
97 97
98 class HandleScopeImplementer;
99
100
101 // A stack-allocated class that governs a number of local handles. 98 // A stack-allocated class that governs a number of local handles.
102 // After a handle scope has been created, all local handles will be 99 // After a handle scope has been created, all local handles will be
103 // allocated within that handle scope until either the handle scope is 100 // allocated within that handle scope until either the handle scope is
104 // deleted or another handle scope is created. If there is already a 101 // deleted or another handle scope is created. If there is already a
105 // handle scope and a new one is created, all allocations will take 102 // handle scope and a new one is created, all allocations will take
106 // place in the new handle scope until it is deleted. After that, 103 // place in the new handle scope until it is deleted. After that,
107 // new handles will again be allocated in the original handle scope. 104 // new handles will again be allocated in the original handle scope.
108 // 105 //
109 // After the handle scope of a local handle has been deleted the 106 // After the handle scope of a local handle has been deleted the
110 // garbage collector will no longer track the object stored in the 107 // garbage collector will no longer track the object stored in the
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 Object** prev_next_; 150 Object** prev_next_;
154 Object** prev_limit_; 151 Object** prev_limit_;
155 152
156 // Extend the handle scope making room for more handles. 153 // Extend the handle scope making room for more handles.
157 static internal::Object** Extend(); 154 static internal::Object** Extend();
158 155
159 // Zaps the handles in the half-open interval [start, end). 156 // Zaps the handles in the half-open interval [start, end).
160 static void ZapRange(internal::Object** start, internal::Object** end); 157 static void ZapRange(internal::Object** start, internal::Object** end);
161 158
162 friend class v8::HandleScope; 159 friend class v8::HandleScope;
163 friend class v8::internal::HandleScopeImplementer;
164 friend class v8::ImplementationUtilities; 160 friend class v8::ImplementationUtilities;
165 }; 161 };
166 162
167 163
168 class DeferredHandles;
169
170
171 class DeferredHandleScope {
172 public:
173 explicit DeferredHandleScope(Isolate* isolate);
174 // The DeferredHandles object returned stores the Handles created
175 // since the creation of this DeferredHandleScope. The Handles are
176 // alive as long as the DeferredHandles object is alive.
177 DeferredHandles* Detach();
178 ~DeferredHandleScope();
179
180 private:
181 Object** prev_limit_;
182 Object** prev_next_;
183 HandleScopeImplementer* impl_;
184
185 #ifdef DEBUG
186 bool handles_detached_;
187 int prev_level_;
188 #endif
189
190 friend class HandleScopeImplementer;
191 };
192
193
194 // ---------------------------------------------------------------------------- 164 // ----------------------------------------------------------------------------
195 // Handle operations. 165 // Handle operations.
196 // They might invoke garbage collection. The result is an handle to 166 // They might invoke garbage collection. The result is an handle to
197 // an object of expected type, or the handle is an error if running out 167 // an object of expected type, or the handle is an error if running out
198 // of space or encountering an internal error. 168 // of space or encountering an internal error.
199 169
200 // Flattens a string. 170 // Flattens a string.
201 void FlattenString(Handle<String> str); 171 void FlattenString(Handle<String> str);
202 172
203 // Flattens a string and returns the underlying external or sequential 173 // Flattens a string and returns the underlying external or sequential
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 inline NoHandleAllocation(); 293 inline NoHandleAllocation();
324 inline ~NoHandleAllocation(); 294 inline ~NoHandleAllocation();
325 private: 295 private:
326 int level_; 296 int level_;
327 #endif 297 #endif
328 }; 298 };
329 299
330 } } // namespace v8::internal 300 } } // namespace v8::internal
331 301
332 #endif // V8_HANDLES_H_ 302 #endif // V8_HANDLES_H_
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698