| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 // Returns the address to where the raw pointer is stored. | 57 // Returns the address to where the raw pointer is stored. |
| 58 V8_INLINE Object** location() const { | 58 V8_INLINE Object** location() const { |
| 59 SLOW_DCHECK(location_ == nullptr || | 59 SLOW_DCHECK(location_ == nullptr || |
| 60 IsDereferenceAllowed(INCLUDE_DEFERRED_CHECK)); | 60 IsDereferenceAllowed(INCLUDE_DEFERRED_CHECK)); |
| 61 return location_; | 61 return location_; |
| 62 } | 62 } |
| 63 | 63 |
| 64 enum DereferenceCheckMode { INCLUDE_DEFERRED_CHECK, NO_DEFERRED_CHECK }; | 64 enum DereferenceCheckMode { INCLUDE_DEFERRED_CHECK, NO_DEFERRED_CHECK }; |
| 65 #ifdef DEBUG | 65 #ifdef DEBUG |
| 66 bool IsDereferenceAllowed(DereferenceCheckMode mode) const; | 66 bool V8_EXPORT_PRIVATE IsDereferenceAllowed(DereferenceCheckMode mode) const; |
| 67 #else | 67 #else |
| 68 V8_INLINE | 68 V8_INLINE |
| 69 bool IsDereferenceAllowed(DereferenceCheckMode mode) const { return true; } | 69 bool V8_EXPORT_PRIVATE IsDereferenceAllowed(DereferenceCheckMode mode) const { |
| 70 return true; |
| 71 } |
| 70 #endif // DEBUG | 72 #endif // DEBUG |
| 71 | 73 |
| 72 Object** location_; | 74 Object** location_; |
| 73 }; | 75 }; |
| 74 | 76 |
| 75 | 77 |
| 76 // ---------------------------------------------------------------------------- | 78 // ---------------------------------------------------------------------------- |
| 77 // A Handle provides a reference to an object that survives relocation by | 79 // A Handle provides a reference to an object that survives relocation by |
| 78 // the garbage collector. | 80 // the garbage collector. |
| 79 // | 81 // |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 next = limit = NULL; | 413 next = limit = NULL; |
| 412 sealed_level = level = 0; | 414 sealed_level = level = 0; |
| 413 canonical_scope = NULL; | 415 canonical_scope = NULL; |
| 414 } | 416 } |
| 415 }; | 417 }; |
| 416 | 418 |
| 417 } // namespace internal | 419 } // namespace internal |
| 418 } // namespace v8 | 420 } // namespace v8 |
| 419 | 421 |
| 420 #endif // V8_HANDLES_H_ | 422 #endif // V8_HANDLES_H_ |
| OLD | NEW |