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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 219 |
220 // Closes the HandleScope (invalidating all handles | 220 // Closes the HandleScope (invalidating all handles |
221 // created in the scope of the HandleScope) and returns | 221 // created in the scope of the HandleScope) and returns |
222 // a Handle backed by the parent scope holding the | 222 // a Handle backed by the parent scope holding the |
223 // value of the argument handle. | 223 // value of the argument handle. |
224 template <typename T> | 224 template <typename T> |
225 Handle<T> CloseAndEscape(Handle<T> handle_value); | 225 Handle<T> CloseAndEscape(Handle<T> handle_value); |
226 | 226 |
227 Isolate* isolate() { return isolate_; } | 227 Isolate* isolate() { return isolate_; } |
228 | 228 |
| 229 // Limit for number of handles with --check_handle-count. This is |
| 230 // large enough to compile natives and pass unit tests with some |
| 231 // slack for future changes to natives. |
| 232 static const int kCheckHandleThreshold = 30 * 1024; |
| 233 |
229 private: | 234 private: |
230 // Prevent heap allocation or illegal handle scopes. | 235 // Prevent heap allocation or illegal handle scopes. |
231 HandleScope(const HandleScope&); | 236 HandleScope(const HandleScope&); |
232 void operator=(const HandleScope&); | 237 void operator=(const HandleScope&); |
233 void* operator new(size_t size); | 238 void* operator new(size_t size); |
234 void operator delete(void* size_t); | 239 void operator delete(void* size_t); |
235 | 240 |
236 Isolate* isolate_; | 241 Isolate* isolate_; |
237 Object** prev_next_; | 242 Object** prev_next_; |
238 Object** prev_limit_; | 243 Object** prev_limit_; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 312 |
308 void Initialize() { | 313 void Initialize() { |
309 next = limit = NULL; | 314 next = limit = NULL; |
310 level = 0; | 315 level = 0; |
311 } | 316 } |
312 }; | 317 }; |
313 | 318 |
314 } } // namespace v8::internal | 319 } } // namespace v8::internal |
315 | 320 |
316 #endif // V8_HANDLES_H_ | 321 #endif // V8_HANDLES_H_ |
OLD | NEW |