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 "include/v8.h" | 8 #include "include/v8.h" |
9 #include "src/base/functional.h" | 9 #include "src/base/functional.h" |
10 #include "src/base/macros.h" | 10 #include "src/base/macros.h" |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 template <typename V> | 333 template <typename V> |
334 class IdentityMap; | 334 class IdentityMap; |
335 class RootIndexMap; | 335 class RootIndexMap; |
336 | 336 |
337 | 337 |
338 // A CanonicalHandleScope does not open a new HandleScope. It changes the | 338 // A CanonicalHandleScope does not open a new HandleScope. It changes the |
339 // existing HandleScope so that Handles created within are canonicalized. | 339 // existing HandleScope so that Handles created within are canonicalized. |
340 // This does not apply to nested inner HandleScopes unless a nested | 340 // This does not apply to nested inner HandleScopes unless a nested |
341 // CanonicalHandleScope is introduced. Handles are only canonicalized within | 341 // CanonicalHandleScope is introduced. Handles are only canonicalized within |
342 // the same CanonicalHandleScope, but not across nested ones. | 342 // the same CanonicalHandleScope, but not across nested ones. |
343 class CanonicalHandleScope final { | 343 class V8_EXPORT_PRIVATE CanonicalHandleScope final { |
344 public: | 344 public: |
345 explicit CanonicalHandleScope(Isolate* isolate); | 345 explicit CanonicalHandleScope(Isolate* isolate); |
346 ~CanonicalHandleScope(); | 346 ~CanonicalHandleScope(); |
347 | 347 |
348 private: | 348 private: |
349 V8_EXPORT_PRIVATE Object** Lookup(Object* object); | 349 Object** Lookup(Object* object); |
350 | 350 |
351 Isolate* isolate_; | 351 Isolate* isolate_; |
352 Zone zone_; | 352 Zone zone_; |
353 RootIndexMap* root_index_map_; | 353 RootIndexMap* root_index_map_; |
354 IdentityMap<Object**>* identity_map_; | 354 IdentityMap<Object**>* identity_map_; |
355 // Ordinary nested handle scopes within the current one are not canonical. | 355 // Ordinary nested handle scopes within the current one are not canonical. |
356 int canonical_level_; | 356 int canonical_level_; |
357 // We may have nested canonical scopes. Handles are canonical within each one. | 357 // We may have nested canonical scopes. Handles are canonical within each one. |
358 CanonicalHandleScope* prev_canonical_scope_; | 358 CanonicalHandleScope* prev_canonical_scope_; |
359 | 359 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 next = limit = NULL; | 413 next = limit = NULL; |
414 sealed_level = level = 0; | 414 sealed_level = level = 0; |
415 canonical_scope = NULL; | 415 canonical_scope = NULL; |
416 } | 416 } |
417 }; | 417 }; |
418 | 418 |
419 } // namespace internal | 419 } // namespace internal |
420 } // namespace v8 | 420 } // namespace v8 |
421 | 421 |
422 #endif // V8_HANDLES_H_ | 422 #endif // V8_HANDLES_H_ |
OLD | NEW |