OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_HANDLES_H_ | 5 #ifndef V8_HANDLES_H_ |
6 #define V8_HANDLES_H_ | 6 #define V8_HANDLES_H_ |
7 | 7 |
8 #include "src/objects.h" | 8 #include "src/objects.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 // Closes the HandleScope (invalidating all handles | 202 // Closes the HandleScope (invalidating all handles |
203 // created in the scope of the HandleScope) and returns | 203 // created in the scope of the HandleScope) and returns |
204 // a Handle backed by the parent scope holding the | 204 // a Handle backed by the parent scope holding the |
205 // value of the argument handle. | 205 // value of the argument handle. |
206 template <typename T> | 206 template <typename T> |
207 Handle<T> CloseAndEscape(Handle<T> handle_value); | 207 Handle<T> CloseAndEscape(Handle<T> handle_value); |
208 | 208 |
209 Isolate* isolate() { return isolate_; } | 209 Isolate* isolate() { return isolate_; } |
210 | 210 |
211 static const int kCheckHandleThreshold = 16 * 1024; | |
212 | |
213 private: | 211 private: |
214 // Prevent heap allocation or illegal handle scopes. | 212 // Prevent heap allocation or illegal handle scopes. |
215 HandleScope(const HandleScope&); | 213 HandleScope(const HandleScope&); |
216 void operator=(const HandleScope&); | 214 void operator=(const HandleScope&); |
217 void* operator new(size_t size); | 215 void* operator new(size_t size); |
218 void operator delete(void* size_t); | 216 void operator delete(void* size_t); |
219 | 217 |
220 Isolate* isolate_; | 218 Isolate* isolate_; |
221 Object** prev_next_; | 219 Object** prev_next_; |
222 Object** prev_limit_; | 220 Object** prev_limit_; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 289 |
292 void Initialize() { | 290 void Initialize() { |
293 next = limit = NULL; | 291 next = limit = NULL; |
294 level = 0; | 292 level = 0; |
295 } | 293 } |
296 }; | 294 }; |
297 | 295 |
298 } } // namespace v8::internal | 296 } } // namespace v8::internal |
299 | 297 |
300 #endif // V8_HANDLES_H_ | 298 #endif // V8_HANDLES_H_ |
OLD | NEW |