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 = 32 * 1024; |
| 212 |
211 private: | 213 private: |
212 // Prevent heap allocation or illegal handle scopes. | 214 // Prevent heap allocation or illegal handle scopes. |
213 HandleScope(const HandleScope&); | 215 HandleScope(const HandleScope&); |
214 void operator=(const HandleScope&); | 216 void operator=(const HandleScope&); |
215 void* operator new(size_t size); | 217 void* operator new(size_t size); |
216 void operator delete(void* size_t); | 218 void operator delete(void* size_t); |
217 | 219 |
218 Isolate* isolate_; | 220 Isolate* isolate_; |
219 Object** prev_next_; | 221 Object** prev_next_; |
220 Object** prev_limit_; | 222 Object** prev_limit_; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 291 |
290 void Initialize() { | 292 void Initialize() { |
291 next = limit = NULL; | 293 next = limit = NULL; |
292 level = 0; | 294 level = 0; |
293 } | 295 } |
294 }; | 296 }; |
295 | 297 |
296 } } // namespace v8::internal | 298 } } // namespace v8::internal |
297 | 299 |
298 #endif // V8_HANDLES_H_ | 300 #endif // V8_HANDLES_H_ |
OLD | NEW |