libv8 7.3.492.27.1-universal-darwin-17 → 8.4.255.0-universal-darwin-17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/libv8/version.rb +1 -1
- data/vendor/v8/include/cppgc/allocation.h +124 -0
- data/vendor/v8/include/cppgc/garbage-collected.h +192 -0
- data/vendor/v8/include/cppgc/heap.h +50 -0
- data/vendor/v8/include/cppgc/internal/accessors.h +26 -0
- data/vendor/v8/include/cppgc/internal/api-constants.h +44 -0
- data/vendor/v8/include/cppgc/internal/compiler-specific.h +26 -0
- data/vendor/v8/include/cppgc/internal/finalizer-trait.h +90 -0
- data/vendor/v8/include/cppgc/internal/gc-info.h +43 -0
- data/vendor/v8/include/cppgc/internal/logging.h +50 -0
- data/vendor/v8/include/cppgc/internal/persistent-node.h +109 -0
- data/vendor/v8/include/cppgc/internal/pointer-policies.h +133 -0
- data/vendor/v8/include/cppgc/internal/prefinalizer-handler.h +31 -0
- data/vendor/v8/include/cppgc/liveness-broker.h +50 -0
- data/vendor/v8/include/cppgc/macros.h +26 -0
- data/vendor/v8/include/cppgc/member.h +206 -0
- data/vendor/v8/include/cppgc/persistent.h +304 -0
- data/vendor/v8/include/cppgc/platform.h +31 -0
- data/vendor/v8/include/cppgc/prefinalizer.h +54 -0
- data/vendor/v8/include/cppgc/source-location.h +59 -0
- data/vendor/v8/include/cppgc/trace-trait.h +67 -0
- data/vendor/v8/include/cppgc/type-traits.h +109 -0
- data/vendor/v8/include/cppgc/visitor.h +137 -0
- data/vendor/v8/include/libplatform/libplatform.h +13 -19
- data/vendor/v8/include/libplatform/v8-tracing.h +50 -15
- data/vendor/v8/include/v8-fast-api-calls.h +412 -0
- data/vendor/v8/include/v8-inspector-protocol.h +4 -4
- data/vendor/v8/include/v8-inspector.h +60 -29
- data/vendor/v8/include/v8-internal.h +98 -82
- data/vendor/v8/include/v8-platform.h +181 -42
- data/vendor/v8/include/v8-profiler.h +162 -224
- data/vendor/v8/include/v8-util.h +1 -13
- data/vendor/v8/include/v8-version-string.h +1 -1
- data/vendor/v8/include/v8-version.h +4 -4
- data/vendor/v8/include/v8-wasm-trap-handler-posix.h +1 -1
- data/vendor/v8/include/v8-wasm-trap-handler-win.h +1 -1
- data/vendor/v8/include/v8.h +1990 -611
- data/vendor/v8/include/v8config.h +129 -48
- data/vendor/v8/out.gn/libv8/obj/libv8_libbase.a +0 -0
- data/vendor/v8/out.gn/libv8/obj/libv8_libplatform.a +0 -0
- data/vendor/v8/out.gn/libv8/obj/libv8_monolith.a +0 -0
- data/vendor/v8/out.gn/libv8/obj/third_party/icu/libicui18n.a +0 -0
- data/vendor/v8/out.gn/libv8/obj/third_party/icu/libicuuc.a +0 -0
- data/vendor/v8/out.gn/libv8/obj/third_party/zlib/google/libcompression_utils_portable.a +0 -0
- data/vendor/v8/out.gn/libv8/obj/third_party/zlib/libchrome_zlib.a +0 -0
- metadata +34 -8
- data/vendor/v8/include/v8-testing.h +0 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5da12304ae94383abdafa0adecab3580ec87caa38adefb83832b6d2feacf6b01
|
4
|
+
data.tar.gz: fd6bca9eb73d8b5adb403c5ae17fbdfa080dde029ec50be797ee1bd4761eee43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a81ec17a57b78dc23b61f049567c29dfd70ba5638646a56dbf4a791d15df138d6ee0dd53253407603d955d50e94fa55c4022ac4fcd5902f470e4115803b4f28a
|
7
|
+
data.tar.gz: 6f28b2098d2b30e2aee1664023c8c78ee67bf715fc6aa131e92351a99cb31fe2fe383ebce5bf63d765ece9d8e338dfdc6ff7b0d244c5274546940c886d8a47f6
|
data/lib/libv8/version.rb
CHANGED
@@ -0,0 +1,124 @@
|
|
1
|
+
// Copyright 2020 the V8 project authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
|
5
|
+
#ifndef INCLUDE_CPPGC_ALLOCATION_H_
|
6
|
+
#define INCLUDE_CPPGC_ALLOCATION_H_
|
7
|
+
|
8
|
+
#include <stdint.h>
|
9
|
+
#include <atomic>
|
10
|
+
|
11
|
+
#include "cppgc/garbage-collected.h"
|
12
|
+
#include "cppgc/heap.h"
|
13
|
+
#include "cppgc/internal/api-constants.h"
|
14
|
+
#include "cppgc/internal/gc-info.h"
|
15
|
+
|
16
|
+
namespace cppgc {
|
17
|
+
|
18
|
+
template <typename T>
|
19
|
+
class MakeGarbageCollectedTraitBase;
|
20
|
+
|
21
|
+
namespace internal {
|
22
|
+
|
23
|
+
class V8_EXPORT MakeGarbageCollectedTraitInternal {
|
24
|
+
protected:
|
25
|
+
static inline void MarkObjectAsFullyConstructed(const void* payload) {
|
26
|
+
// See api_constants for an explanation of the constants.
|
27
|
+
std::atomic<uint16_t>* atomic_mutable_bitfield =
|
28
|
+
reinterpret_cast<std::atomic<uint16_t>*>(
|
29
|
+
const_cast<uint16_t*>(reinterpret_cast<const uint16_t*>(
|
30
|
+
reinterpret_cast<const uint8_t*>(payload) -
|
31
|
+
api_constants::kFullyConstructedBitFieldOffsetFromPayload)));
|
32
|
+
uint16_t value = atomic_mutable_bitfield->load(std::memory_order_relaxed);
|
33
|
+
value = value | api_constants::kFullyConstructedBitMask;
|
34
|
+
atomic_mutable_bitfield->store(value, std::memory_order_release);
|
35
|
+
}
|
36
|
+
|
37
|
+
static void* Allocate(cppgc::Heap* heap, size_t size, GCInfoIndex index);
|
38
|
+
|
39
|
+
friend class HeapObjectHeader;
|
40
|
+
};
|
41
|
+
|
42
|
+
} // namespace internal
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Base trait that provides utilities for advancers users that have custom
|
46
|
+
* allocation needs (e.g., overriding size). It's expected that users override
|
47
|
+
* MakeGarbageCollectedTrait (see below) and inherit from
|
48
|
+
* MakeGarbageCollectedTraitBase and make use of the low-level primitives
|
49
|
+
* offered to allocate and construct an object.
|
50
|
+
*/
|
51
|
+
template <typename T>
|
52
|
+
class MakeGarbageCollectedTraitBase
|
53
|
+
: private internal::MakeGarbageCollectedTraitInternal {
|
54
|
+
protected:
|
55
|
+
/**
|
56
|
+
* Allocates memory for an object of type T.
|
57
|
+
*
|
58
|
+
* \param heap The heap to allocate this object on.
|
59
|
+
* \param size The size that should be reserved for the object.
|
60
|
+
* \returns the memory to construct an object of type T on.
|
61
|
+
*/
|
62
|
+
static void* Allocate(Heap* heap, size_t size) {
|
63
|
+
// TODO(chromium:1056170): Allow specifying arena for specific embedder
|
64
|
+
// uses.
|
65
|
+
return internal::MakeGarbageCollectedTraitInternal::Allocate(
|
66
|
+
heap, size, internal::GCInfoTrait<T>::Index());
|
67
|
+
}
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Marks an object as fully constructed, resulting in precise handling by the
|
71
|
+
* garbage collector.
|
72
|
+
*
|
73
|
+
* \param payload The base pointer the object is allocated at.
|
74
|
+
*/
|
75
|
+
static void MarkObjectAsFullyConstructed(const void* payload) {
|
76
|
+
internal::MakeGarbageCollectedTraitInternal::MarkObjectAsFullyConstructed(
|
77
|
+
payload);
|
78
|
+
}
|
79
|
+
};
|
80
|
+
|
81
|
+
/**
|
82
|
+
* Default trait class that specifies how to construct an object of type T.
|
83
|
+
* Advanced users may override how an object is constructed using the utilities
|
84
|
+
* that are provided through MakeGarbageCollectedTraitBase.
|
85
|
+
*
|
86
|
+
* Any trait overriding construction must
|
87
|
+
* - allocate through MakeGarbageCollectedTraitBase<T>::Allocate;
|
88
|
+
* - mark the object as fully constructed using
|
89
|
+
* MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed;
|
90
|
+
*/
|
91
|
+
template <typename T>
|
92
|
+
class MakeGarbageCollectedTrait : public MakeGarbageCollectedTraitBase<T> {
|
93
|
+
public:
|
94
|
+
template <typename... Args>
|
95
|
+
static T* Call(Heap* heap, Args&&... args) {
|
96
|
+
static_assert(internal::IsGarbageCollectedType<T>::value,
|
97
|
+
"T needs to be a garbage collected object");
|
98
|
+
static_assert(
|
99
|
+
!internal::IsGarbageCollectedMixinType<T>::value ||
|
100
|
+
sizeof(T) <= internal::api_constants::kLargeObjectSizeThreshold,
|
101
|
+
"GarbageCollectedMixin may not be a large object");
|
102
|
+
void* memory = MakeGarbageCollectedTraitBase<T>::Allocate(heap, sizeof(T));
|
103
|
+
T* object = ::new (memory) T(std::forward<Args>(args)...);
|
104
|
+
MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed(object);
|
105
|
+
return object;
|
106
|
+
}
|
107
|
+
};
|
108
|
+
|
109
|
+
/**
|
110
|
+
* Constructs a managed object of type T where T transitively inherits from
|
111
|
+
* GarbageCollected.
|
112
|
+
*
|
113
|
+
* \param args List of arguments with which an instance of T will be
|
114
|
+
* constructed.
|
115
|
+
* \returns an instance of type T.
|
116
|
+
*/
|
117
|
+
template <typename T, typename... Args>
|
118
|
+
T* MakeGarbageCollected(Heap* heap, Args&&... args) {
|
119
|
+
return MakeGarbageCollectedTrait<T>::Call(heap, std::forward<Args>(args)...);
|
120
|
+
}
|
121
|
+
|
122
|
+
} // namespace cppgc
|
123
|
+
|
124
|
+
#endif // INCLUDE_CPPGC_ALLOCATION_H_
|
@@ -0,0 +1,192 @@
|
|
1
|
+
// Copyright 2020 the V8 project authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
|
5
|
+
#ifndef INCLUDE_CPPGC_GARBAGE_COLLECTED_H_
|
6
|
+
#define INCLUDE_CPPGC_GARBAGE_COLLECTED_H_
|
7
|
+
|
8
|
+
#include <type_traits>
|
9
|
+
|
10
|
+
#include "cppgc/internal/api-constants.h"
|
11
|
+
#include "cppgc/macros.h"
|
12
|
+
#include "cppgc/platform.h"
|
13
|
+
#include "cppgc/trace-trait.h"
|
14
|
+
#include "cppgc/type-traits.h"
|
15
|
+
|
16
|
+
namespace cppgc {
|
17
|
+
|
18
|
+
class Visitor;
|
19
|
+
|
20
|
+
namespace internal {
|
21
|
+
|
22
|
+
class GarbageCollectedBase {
|
23
|
+
public:
|
24
|
+
// Must use MakeGarbageCollected.
|
25
|
+
void* operator new(size_t) = delete;
|
26
|
+
void* operator new[](size_t) = delete;
|
27
|
+
// The garbage collector is taking care of reclaiming the object. Also,
|
28
|
+
// virtual destructor requires an unambiguous, accessible 'operator delete'.
|
29
|
+
void operator delete(void*) {
|
30
|
+
#ifdef V8_ENABLE_CHECKS
|
31
|
+
internal::Abort();
|
32
|
+
#endif // V8_ENABLE_CHECKS
|
33
|
+
}
|
34
|
+
void operator delete[](void*) = delete;
|
35
|
+
|
36
|
+
protected:
|
37
|
+
GarbageCollectedBase() = default;
|
38
|
+
};
|
39
|
+
|
40
|
+
} // namespace internal
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Base class for managed objects. Only descendent types of GarbageCollected
|
44
|
+
* can be constructed using MakeGarbageCollected. Must be inherited from as
|
45
|
+
* left-most base class.
|
46
|
+
*
|
47
|
+
* Types inheriting from GarbageCollected must provide a method of
|
48
|
+
* signature `void Trace(cppgc::Visitor*) const` that dispatchs all managed
|
49
|
+
* pointers to the visitor and delegates to garbage-collected base classes.
|
50
|
+
* The method must be virtual if the type is not directly a child of
|
51
|
+
* GarbageCollected and marked as final.
|
52
|
+
*
|
53
|
+
* \code
|
54
|
+
* // Example using final class.
|
55
|
+
* class FinalType final : public GarbageCollected<FinalType> {
|
56
|
+
* public:
|
57
|
+
* void Trace(cppgc::Visitor* visitor) const {
|
58
|
+
* // Dispatch using visitor->Trace(...);
|
59
|
+
* }
|
60
|
+
* };
|
61
|
+
*
|
62
|
+
* // Example using non-final base class.
|
63
|
+
* class NonFinalBase : public GarbageCollected<NonFinalBase> {
|
64
|
+
* public:
|
65
|
+
* virtual void Trace(cppgc::Visitor*) const {}
|
66
|
+
* };
|
67
|
+
*
|
68
|
+
* class FinalChild final : public NonFinalBase {
|
69
|
+
* public:
|
70
|
+
* void Trace(cppgc::Visitor* visitor) const final {
|
71
|
+
* // Dispatch using visitor->Trace(...);
|
72
|
+
* NonFinalBase::Trace(visitor);
|
73
|
+
* }
|
74
|
+
* };
|
75
|
+
* \endcode
|
76
|
+
*/
|
77
|
+
template <typename>
|
78
|
+
class GarbageCollected : public internal::GarbageCollectedBase {
|
79
|
+
public:
|
80
|
+
using IsGarbageCollectedTypeMarker = void;
|
81
|
+
|
82
|
+
protected:
|
83
|
+
GarbageCollected() = default;
|
84
|
+
};
|
85
|
+
|
86
|
+
/**
|
87
|
+
* Base class for managed mixin objects. Such objects cannot be constructed
|
88
|
+
* directly but must be mixed into the inheritance hierarchy of a
|
89
|
+
* GarbageCollected object.
|
90
|
+
*
|
91
|
+
* Types inheriting from GarbageCollectedMixin must override a virtual method
|
92
|
+
* of signature `void Trace(cppgc::Visitor*) const` that dispatchs all managed
|
93
|
+
* pointers to the visitor and delegates to base classes.
|
94
|
+
*
|
95
|
+
* \code
|
96
|
+
* class Mixin : public GarbageCollectedMixin {
|
97
|
+
* public:
|
98
|
+
* void Trace(cppgc::Visitor* visitor) const override {
|
99
|
+
* // Dispatch using visitor->Trace(...);
|
100
|
+
* }
|
101
|
+
* };
|
102
|
+
* \endcode
|
103
|
+
*/
|
104
|
+
class GarbageCollectedMixin : public internal::GarbageCollectedBase {
|
105
|
+
public:
|
106
|
+
using IsGarbageCollectedMixinTypeMarker = void;
|
107
|
+
|
108
|
+
// Sentinel used to mark not-fully-constructed mixins.
|
109
|
+
static constexpr void* kNotFullyConstructedObject = nullptr;
|
110
|
+
|
111
|
+
// Provide default implementation that indicate that the vtable is not yet
|
112
|
+
// set up properly. This is used to to get GCInfo objects for mixins so that
|
113
|
+
// these objects can be processed later on.
|
114
|
+
virtual TraceDescriptor GetTraceDescriptor() const {
|
115
|
+
return {kNotFullyConstructedObject, nullptr};
|
116
|
+
}
|
117
|
+
|
118
|
+
/**
|
119
|
+
* This Trace method must be overriden by objects inheriting from
|
120
|
+
* GarbageCollectedMixin.
|
121
|
+
*/
|
122
|
+
virtual void Trace(cppgc::Visitor*) const {}
|
123
|
+
};
|
124
|
+
|
125
|
+
/**
|
126
|
+
* Macro defines all methods and markers needed for handling mixins. Must be
|
127
|
+
* used on the type that is inheriting from GarbageCollected *and*
|
128
|
+
* GarbageCollectedMixin.
|
129
|
+
*
|
130
|
+
* \code
|
131
|
+
* class Mixin : public GarbageCollectedMixin {
|
132
|
+
* public:
|
133
|
+
* void Trace(cppgc::Visitor* visitor) const override {
|
134
|
+
* // Dispatch using visitor->Trace(...);
|
135
|
+
* }
|
136
|
+
* };
|
137
|
+
*
|
138
|
+
* class Foo : public GarbageCollected<Foo>, public Mixin {
|
139
|
+
* USING_GARBAGE_COLLECTED_MIXIN();
|
140
|
+
* public:
|
141
|
+
* void Trace(cppgc::Visitor* visitor) const override {
|
142
|
+
* // Dispatch using visitor->Trace(...);
|
143
|
+
* Mixin::Trace(visitor);
|
144
|
+
* }
|
145
|
+
* };
|
146
|
+
* \endcode
|
147
|
+
*/
|
148
|
+
#define USING_GARBAGE_COLLECTED_MIXIN() \
|
149
|
+
public: \
|
150
|
+
/* Marker is used by clang to check for proper usages of the macro. */ \
|
151
|
+
typedef int HasUsingGarbageCollectedMixinMacro; \
|
152
|
+
\
|
153
|
+
TraceDescriptor GetTraceDescriptor() const override { \
|
154
|
+
static_assert( \
|
155
|
+
internal::IsSubclassOfTemplate< \
|
156
|
+
std::remove_const_t<std::remove_pointer_t<decltype(this)>>, \
|
157
|
+
cppgc::GarbageCollected>::value, \
|
158
|
+
"Only garbage collected objects can have garbage collected mixins"); \
|
159
|
+
return {this, TraceTrait<std::remove_const_t< \
|
160
|
+
std::remove_pointer_t<decltype(this)>>>::Trace}; \
|
161
|
+
} \
|
162
|
+
\
|
163
|
+
private: \
|
164
|
+
friend class internal::__thisIsHereToForceASemicolonAfterThisMacro
|
165
|
+
|
166
|
+
/**
|
167
|
+
* Merge two or more Mixins into one.
|
168
|
+
*
|
169
|
+
* \code
|
170
|
+
* class A : public GarbageCollectedMixin {};
|
171
|
+
* class B : public GarbageCollectedMixin {};
|
172
|
+
* class C : public A, public B {
|
173
|
+
* MERGE_GARBAGE_COLLECTED_MIXINS();
|
174
|
+
* public:
|
175
|
+
* };
|
176
|
+
* \endcode
|
177
|
+
*/
|
178
|
+
#define MERGE_GARBAGE_COLLECTED_MIXINS() \
|
179
|
+
public: \
|
180
|
+
/* When using multiple mixins the methods become */ \
|
181
|
+
/* ambigous. Providing additional implementations */ \
|
182
|
+
/* disambiguate them again. */ \
|
183
|
+
TraceDescriptor GetTraceDescriptor() const override { \
|
184
|
+
return {kNotFullyConstructedObject, nullptr}; \
|
185
|
+
} \
|
186
|
+
\
|
187
|
+
private: \
|
188
|
+
friend class internal::__thisIsHereToForceASemicolonAfterThisMacro
|
189
|
+
|
190
|
+
} // namespace cppgc
|
191
|
+
|
192
|
+
#endif // INCLUDE_CPPGC_GARBAGE_COLLECTED_H_
|
@@ -0,0 +1,50 @@
|
|
1
|
+
// Copyright 2020 the V8 project authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
|
5
|
+
#ifndef INCLUDE_CPPGC_HEAP_H_
|
6
|
+
#define INCLUDE_CPPGC_HEAP_H_
|
7
|
+
|
8
|
+
#include <memory>
|
9
|
+
|
10
|
+
#include "v8config.h" // NOLINT(build/include_directory)
|
11
|
+
|
12
|
+
namespace cppgc {
|
13
|
+
namespace internal {
|
14
|
+
class Heap;
|
15
|
+
} // namespace internal
|
16
|
+
|
17
|
+
class V8_EXPORT Heap {
|
18
|
+
public:
|
19
|
+
// Normal spaces are used to store objects of different size classes:
|
20
|
+
// - kNormal1: < 32 bytes
|
21
|
+
// - kNormal2: < 64 bytes
|
22
|
+
// - kNormal3: < 128 bytes
|
23
|
+
// - kNormal4: >= 128 bytes
|
24
|
+
// Objects of size greater than 2^16 get stored in the large space. Users can
|
25
|
+
// register up to 4 arenas for application specific needs.
|
26
|
+
enum class SpaceType {
|
27
|
+
kNormal1,
|
28
|
+
kNormal2,
|
29
|
+
kNormal3,
|
30
|
+
kNormal4,
|
31
|
+
kLarge,
|
32
|
+
kUserDefined1,
|
33
|
+
kUserDefined2,
|
34
|
+
kUserDefined3,
|
35
|
+
kUserDefined4,
|
36
|
+
};
|
37
|
+
|
38
|
+
static std::unique_ptr<Heap> Create();
|
39
|
+
|
40
|
+
virtual ~Heap() = default;
|
41
|
+
|
42
|
+
private:
|
43
|
+
Heap() = default;
|
44
|
+
|
45
|
+
friend class internal::Heap;
|
46
|
+
};
|
47
|
+
|
48
|
+
} // namespace cppgc
|
49
|
+
|
50
|
+
#endif // INCLUDE_CPPGC_HEAP_H_
|
@@ -0,0 +1,26 @@
|
|
1
|
+
// Copyright 2020 the V8 project authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
|
5
|
+
#ifndef INCLUDE_CPPGC_INTERNAL_ACCESSORS_H_
|
6
|
+
#define INCLUDE_CPPGC_INTERNAL_ACCESSORS_H_
|
7
|
+
|
8
|
+
#include "cppgc/internal/api-constants.h"
|
9
|
+
|
10
|
+
namespace cppgc {
|
11
|
+
|
12
|
+
class Heap;
|
13
|
+
|
14
|
+
namespace internal {
|
15
|
+
|
16
|
+
inline cppgc::Heap* GetHeapFromPayload(const void* payload) {
|
17
|
+
return *reinterpret_cast<cppgc::Heap**>(
|
18
|
+
((reinterpret_cast<uintptr_t>(payload) & api_constants::kPageBaseMask) +
|
19
|
+
api_constants::kGuardPageSize) +
|
20
|
+
api_constants::kHeapOffset);
|
21
|
+
}
|
22
|
+
|
23
|
+
} // namespace internal
|
24
|
+
} // namespace cppgc
|
25
|
+
|
26
|
+
#endif // INCLUDE_CPPGC_INTERNAL_ACCESSORS_H_
|
@@ -0,0 +1,44 @@
|
|
1
|
+
// Copyright 2020 the V8 project authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
|
5
|
+
#ifndef INCLUDE_CPPGC_INTERNAL_API_CONSTANTS_H_
|
6
|
+
#define INCLUDE_CPPGC_INTERNAL_API_CONSTANTS_H_
|
7
|
+
|
8
|
+
#include <stddef.h>
|
9
|
+
#include <stdint.h>
|
10
|
+
|
11
|
+
#include "v8config.h" // NOLINT(build/include_directory)
|
12
|
+
|
13
|
+
namespace cppgc {
|
14
|
+
namespace internal {
|
15
|
+
|
16
|
+
// Embedders should not rely on this code!
|
17
|
+
|
18
|
+
// Internal constants to avoid exposing internal types on the API surface.
|
19
|
+
namespace api_constants {
|
20
|
+
// Offset of the uint16_t bitfield from the payload contaning the
|
21
|
+
// in-construction bit. This is subtracted from the payload pointer to get
|
22
|
+
// to the right bitfield.
|
23
|
+
static constexpr size_t kFullyConstructedBitFieldOffsetFromPayload =
|
24
|
+
2 * sizeof(uint16_t);
|
25
|
+
// Mask for in-construction bit.
|
26
|
+
static constexpr size_t kFullyConstructedBitMask = size_t{1};
|
27
|
+
|
28
|
+
// Page constants used to align pointers to page begin.
|
29
|
+
static constexpr size_t kPageSize = size_t{1} << 17;
|
30
|
+
static constexpr size_t kPageAlignment = kPageSize;
|
31
|
+
static constexpr size_t kPageBaseMask = ~(kPageAlignment - 1);
|
32
|
+
static constexpr size_t kGuardPageSize = 4096;
|
33
|
+
|
34
|
+
// Offset of the Heap backref.
|
35
|
+
static constexpr size_t kHeapOffset = 0;
|
36
|
+
|
37
|
+
static constexpr size_t kLargeObjectSizeThreshold = kPageSize / 2;
|
38
|
+
|
39
|
+
} // namespace api_constants
|
40
|
+
|
41
|
+
} // namespace internal
|
42
|
+
} // namespace cppgc
|
43
|
+
|
44
|
+
#endif // INCLUDE_CPPGC_INTERNAL_API_CONSTANTS_H_
|