Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 10:08:50

0001 // Copyright 2022 the V8 project authors. All rights reserved.
0002 // Use of this source code is governed by a BSD-style license that can be
0003 // found in the LICENSE file.
0004 
0005 #ifndef INCLUDE_CPPGC_HEAP_HANDLE_H_
0006 #define INCLUDE_CPPGC_HEAP_HANDLE_H_
0007 
0008 #include "v8config.h"  // NOLINT(build/include_directory)
0009 
0010 namespace cppgc {
0011 
0012 namespace internal {
0013 class HeapBase;
0014 class WriteBarrierTypeForCagedHeapPolicy;
0015 class WriteBarrierTypeForNonCagedHeapPolicy;
0016 }  // namespace internal
0017 
0018 /**
0019  * Opaque handle used for additional heap APIs.
0020  */
0021 class HeapHandle {
0022  public:
0023   // Deleted copy ctor to avoid treating the type by value.
0024   HeapHandle(const HeapHandle&) = delete;
0025   HeapHandle& operator=(const HeapHandle&) = delete;
0026 
0027  private:
0028   HeapHandle() = default;
0029 
0030   V8_INLINE bool is_incremental_marking_in_progress() const {
0031     return is_incremental_marking_in_progress_;
0032   }
0033 
0034   V8_INLINE bool is_young_generation_enabled() const {
0035     return is_young_generation_enabled_;
0036   }
0037 
0038   bool is_incremental_marking_in_progress_ = false;
0039   bool is_young_generation_enabled_ = false;
0040 
0041   friend class internal::HeapBase;
0042   friend class internal::WriteBarrierTypeForCagedHeapPolicy;
0043   friend class internal::WriteBarrierTypeForNonCagedHeapPolicy;
0044 };
0045 
0046 }  // namespace cppgc
0047 
0048 #endif  // INCLUDE_CPPGC_HEAP_HANDLE_H_