libv8 8.4.255.0-universal-darwin-15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/ext/libv8/.location.yml +1 -0
  3. data/ext/libv8/location.rb +89 -0
  4. data/ext/libv8/paths.rb +28 -0
  5. data/lib/libv8.rb +9 -0
  6. data/lib/libv8/version.rb +3 -0
  7. data/vendor/v8/include/cppgc/allocation.h +124 -0
  8. data/vendor/v8/include/cppgc/garbage-collected.h +192 -0
  9. data/vendor/v8/include/cppgc/heap.h +50 -0
  10. data/vendor/v8/include/cppgc/internal/accessors.h +26 -0
  11. data/vendor/v8/include/cppgc/internal/api-constants.h +44 -0
  12. data/vendor/v8/include/cppgc/internal/compiler-specific.h +26 -0
  13. data/vendor/v8/include/cppgc/internal/finalizer-trait.h +90 -0
  14. data/vendor/v8/include/cppgc/internal/gc-info.h +43 -0
  15. data/vendor/v8/include/cppgc/internal/logging.h +50 -0
  16. data/vendor/v8/include/cppgc/internal/persistent-node.h +109 -0
  17. data/vendor/v8/include/cppgc/internal/pointer-policies.h +133 -0
  18. data/vendor/v8/include/cppgc/internal/prefinalizer-handler.h +31 -0
  19. data/vendor/v8/include/cppgc/liveness-broker.h +50 -0
  20. data/vendor/v8/include/cppgc/macros.h +26 -0
  21. data/vendor/v8/include/cppgc/member.h +206 -0
  22. data/vendor/v8/include/cppgc/persistent.h +304 -0
  23. data/vendor/v8/include/cppgc/platform.h +31 -0
  24. data/vendor/v8/include/cppgc/prefinalizer.h +54 -0
  25. data/vendor/v8/include/cppgc/source-location.h +59 -0
  26. data/vendor/v8/include/cppgc/trace-trait.h +67 -0
  27. data/vendor/v8/include/cppgc/type-traits.h +109 -0
  28. data/vendor/v8/include/cppgc/visitor.h +137 -0
  29. data/vendor/v8/include/libplatform/libplatform-export.h +29 -0
  30. data/vendor/v8/include/libplatform/libplatform.h +85 -0
  31. data/vendor/v8/include/libplatform/v8-tracing.h +332 -0
  32. data/vendor/v8/include/v8-fast-api-calls.h +412 -0
  33. data/vendor/v8/include/v8-inspector-protocol.h +13 -0
  34. data/vendor/v8/include/v8-inspector.h +327 -0
  35. data/vendor/v8/include/v8-internal.h +389 -0
  36. data/vendor/v8/include/v8-platform.h +577 -0
  37. data/vendor/v8/include/v8-profiler.h +1059 -0
  38. data/vendor/v8/include/v8-util.h +652 -0
  39. data/vendor/v8/include/v8-value-serializer-version.h +24 -0
  40. data/vendor/v8/include/v8-version-string.h +38 -0
  41. data/vendor/v8/include/v8-version.h +20 -0
  42. data/vendor/v8/include/v8-wasm-trap-handler-posix.h +31 -0
  43. data/vendor/v8/include/v8-wasm-trap-handler-win.h +28 -0
  44. data/vendor/v8/include/v8.h +12018 -0
  45. data/vendor/v8/include/v8config.h +465 -0
  46. data/vendor/v8/out.gn/libv8/obj/libv8_libbase.a +0 -0
  47. data/vendor/v8/out.gn/libv8/obj/libv8_libplatform.a +0 -0
  48. data/vendor/v8/out.gn/libv8/obj/libv8_monolith.a +0 -0
  49. data/vendor/v8/out.gn/libv8/obj/third_party/icu/libicui18n.a +0 -0
  50. data/vendor/v8/out.gn/libv8/obj/third_party/icu/libicuuc.a +0 -0
  51. data/vendor/v8/out.gn/libv8/obj/third_party/zlib/google/libcompression_utils_portable.a +0 -0
  52. data/vendor/v8/out.gn/libv8/obj/third_party/zlib/libchrome_zlib.a +0 -0
  53. metadata +138 -0
@@ -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_
@@ -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_COMPILER_SPECIFIC_H_
6
+ #define INCLUDE_CPPGC_INTERNAL_COMPILER_SPECIFIC_H_
7
+
8
+ namespace cppgc {
9
+
10
+ #if defined(__has_cpp_attribute)
11
+ #define CPPGC_HAS_CPP_ATTRIBUTE(FEATURE) __has_cpp_attribute(FEATURE)
12
+ #else
13
+ #define CPPGC_HAS_CPP_ATTRIBUTE(FEATURE) 0
14
+ #endif
15
+
16
+ // [[no_unique_address]] comes in C++20 but supported in clang with -std >=
17
+ // c++11.
18
+ #if CPPGC_HAS_CPP_ATTRIBUTE(no_unique_address) // NOLINTNEXTLINE
19
+ #define CPPGC_NO_UNIQUE_ADDRESS [[no_unique_address]]
20
+ #else
21
+ #define CPPGC_NO_UNIQUE_ADDRESS
22
+ #endif
23
+
24
+ } // namespace cppgc
25
+
26
+ #endif // INCLUDE_CPPGC_INTERNAL_COMPILER_SPECIFIC_H_
@@ -0,0 +1,90 @@
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_FINALIZER_TRAIT_H_
6
+ #define INCLUDE_CPPGC_INTERNAL_FINALIZER_TRAIT_H_
7
+
8
+ #include <type_traits>
9
+
10
+ #include "cppgc/type-traits.h"
11
+
12
+ namespace cppgc {
13
+ namespace internal {
14
+
15
+ using FinalizationCallback = void (*)(void*);
16
+
17
+ template <typename T, typename = void>
18
+ struct HasFinalizeGarbageCollectedObject : std::false_type {};
19
+
20
+ template <typename T>
21
+ struct HasFinalizeGarbageCollectedObject<
22
+ T, void_t<decltype(std::declval<T>().FinalizeGarbageCollectedObject())>>
23
+ : std::true_type {};
24
+
25
+ // The FinalizerTraitImpl specifies how to finalize objects.
26
+ template <typename T, bool isFinalized>
27
+ struct FinalizerTraitImpl;
28
+
29
+ template <typename T>
30
+ struct FinalizerTraitImpl<T, true> {
31
+ private:
32
+ // Dispatch to custom FinalizeGarbageCollectedObject().
33
+ struct Custom {
34
+ static void Call(void* obj) {
35
+ static_cast<T*>(obj)->FinalizeGarbageCollectedObject();
36
+ }
37
+ };
38
+
39
+ // Dispatch to regular destructor.
40
+ struct Destructor {
41
+ static void Call(void* obj) { static_cast<T*>(obj)->~T(); }
42
+ };
43
+
44
+ using FinalizeImpl =
45
+ std::conditional_t<HasFinalizeGarbageCollectedObject<T>::value, Custom,
46
+ Destructor>;
47
+
48
+ public:
49
+ static void Finalize(void* obj) {
50
+ static_assert(sizeof(T), "T must be fully defined");
51
+ FinalizeImpl::Call(obj);
52
+ }
53
+ };
54
+
55
+ template <typename T>
56
+ struct FinalizerTraitImpl<T, false> {
57
+ static void Finalize(void* obj) {
58
+ static_assert(sizeof(T), "T must be fully defined");
59
+ }
60
+ };
61
+
62
+ // The FinalizerTrait is used to determine if a type requires finalization and
63
+ // what finalization means.
64
+ template <typename T>
65
+ struct FinalizerTrait {
66
+ private:
67
+ // Object has a finalizer if it has
68
+ // - a custom FinalizeGarbageCollectedObject method, or
69
+ // - a destructor.
70
+ static constexpr bool kNonTrivialFinalizer =
71
+ internal::HasFinalizeGarbageCollectedObject<T>::value ||
72
+ !std::is_trivially_destructible<typename std::remove_cv<T>::type>::value;
73
+
74
+ static void Finalize(void* obj) {
75
+ internal::FinalizerTraitImpl<T, kNonTrivialFinalizer>::Finalize(obj);
76
+ }
77
+
78
+ public:
79
+ // The callback used to finalize an object of type T.
80
+ static constexpr FinalizationCallback kCallback =
81
+ kNonTrivialFinalizer ? Finalize : nullptr;
82
+ };
83
+
84
+ template <typename T>
85
+ constexpr FinalizationCallback FinalizerTrait<T>::kCallback;
86
+
87
+ } // namespace internal
88
+ } // namespace cppgc
89
+
90
+ #endif // INCLUDE_CPPGC_INTERNAL_FINALIZER_TRAIT_H_
@@ -0,0 +1,43 @@
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_GC_INFO_H_
6
+ #define INCLUDE_CPPGC_INTERNAL_GC_INFO_H_
7
+
8
+ #include <stdint.h>
9
+
10
+ #include "cppgc/internal/finalizer-trait.h"
11
+ #include "v8config.h" // NOLINT(build/include_directory)
12
+
13
+ namespace cppgc {
14
+ namespace internal {
15
+
16
+ using GCInfoIndex = uint16_t;
17
+
18
+ class V8_EXPORT RegisteredGCInfoIndex final {
19
+ public:
20
+ RegisteredGCInfoIndex(FinalizationCallback finalization_callback,
21
+ bool has_v_table);
22
+ GCInfoIndex GetIndex() const { return index_; }
23
+
24
+ private:
25
+ const GCInfoIndex index_;
26
+ };
27
+
28
+ // Trait determines how the garbage collector treats objects wrt. to traversing,
29
+ // finalization, and naming.
30
+ template <typename T>
31
+ struct GCInfoTrait {
32
+ static GCInfoIndex Index() {
33
+ static_assert(sizeof(T), "T must be fully defined");
34
+ static const RegisteredGCInfoIndex registered_index(
35
+ FinalizerTrait<T>::kCallback, std::is_polymorphic<T>::value);
36
+ return registered_index.GetIndex();
37
+ }
38
+ };
39
+
40
+ } // namespace internal
41
+ } // namespace cppgc
42
+
43
+ #endif // INCLUDE_CPPGC_INTERNAL_GC_INFO_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_INTERNAL_LOGGING_H_
6
+ #define INCLUDE_CPPGC_INTERNAL_LOGGING_H_
7
+
8
+ #include "cppgc/source-location.h"
9
+ #include "v8config.h" // NOLINT(build/include_directory)
10
+
11
+ namespace cppgc {
12
+ namespace internal {
13
+
14
+ void V8_EXPORT DCheckImpl(const char*,
15
+ const SourceLocation& = SourceLocation::Current());
16
+ [[noreturn]] void V8_EXPORT
17
+ FatalImpl(const char*, const SourceLocation& = SourceLocation::Current());
18
+
19
+ // Used to ignore -Wunused-variable.
20
+ template <typename>
21
+ struct EatParams {};
22
+
23
+ #if DEBUG
24
+ #define CPPGC_DCHECK_MSG(condition, message) \
25
+ do { \
26
+ if (V8_UNLIKELY(!(condition))) { \
27
+ ::cppgc::internal::DCheckImpl(message); \
28
+ } \
29
+ } while (false)
30
+ #else
31
+ #define CPPGC_DCHECK_MSG(condition, message) \
32
+ (static_cast<void>(::cppgc::internal::EatParams<decltype( \
33
+ static_cast<void>(condition), message)>{}))
34
+ #endif
35
+
36
+ #define CPPGC_DCHECK(condition) CPPGC_DCHECK_MSG(condition, #condition)
37
+
38
+ #define CPPGC_CHECK_MSG(condition, message) \
39
+ do { \
40
+ if (V8_UNLIKELY(!(condition))) { \
41
+ ::cppgc::internal::FatalImpl(message); \
42
+ } \
43
+ } while (false)
44
+
45
+ #define CPPGC_CHECK(condition) CPPGC_CHECK_MSG(condition, #condition)
46
+
47
+ } // namespace internal
48
+ } // namespace cppgc
49
+
50
+ #endif // INCLUDE_CPPGC_INTERNAL_LOGGING_H_
@@ -0,0 +1,109 @@
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_PERSISTENT_NODE_H_
6
+ #define INCLUDE_CPPGC_INTERNAL_PERSISTENT_NODE_H_
7
+
8
+ #include <array>
9
+ #include <memory>
10
+ #include <vector>
11
+
12
+ #include "cppgc/internal/logging.h"
13
+ #include "cppgc/trace-trait.h"
14
+ #include "v8config.h" // NOLINT(build/include_directory)
15
+
16
+ namespace cppgc {
17
+
18
+ class Visitor;
19
+
20
+ namespace internal {
21
+
22
+ // PersistentNode represesents a variant of two states:
23
+ // 1) traceable node with a back pointer to the Persistent object;
24
+ // 2) freelist entry.
25
+ class PersistentNode final {
26
+ public:
27
+ PersistentNode() = default;
28
+
29
+ PersistentNode(const PersistentNode&) = delete;
30
+ PersistentNode& operator=(const PersistentNode&) = delete;
31
+
32
+ void InitializeAsUsedNode(void* owner, TraceCallback trace) {
33
+ owner_ = owner;
34
+ trace_ = trace;
35
+ }
36
+
37
+ void InitializeAsFreeNode(PersistentNode* next) {
38
+ next_ = next;
39
+ trace_ = nullptr;
40
+ }
41
+
42
+ void UpdateOwner(void* owner) {
43
+ CPPGC_DCHECK(IsUsed());
44
+ owner_ = owner;
45
+ }
46
+
47
+ PersistentNode* FreeListNext() const {
48
+ CPPGC_DCHECK(!IsUsed());
49
+ return next_;
50
+ }
51
+
52
+ void Trace(Visitor* visitor) const {
53
+ CPPGC_DCHECK(IsUsed());
54
+ trace_(visitor, owner_);
55
+ }
56
+
57
+ bool IsUsed() const { return trace_; }
58
+
59
+ private:
60
+ // PersistentNode acts as a designated union:
61
+ // If trace_ != nullptr, owner_ points to the corresponding Persistent handle.
62
+ // Otherwise, next_ points to the next freed PersistentNode.
63
+ union {
64
+ void* owner_ = nullptr;
65
+ PersistentNode* next_;
66
+ };
67
+ TraceCallback trace_ = nullptr;
68
+ };
69
+
70
+ class V8_EXPORT PersistentRegion {
71
+ using PersistentNodeSlots = std::array<PersistentNode, 256u>;
72
+
73
+ public:
74
+ PersistentRegion() = default;
75
+
76
+ PersistentRegion(const PersistentRegion&) = delete;
77
+ PersistentRegion& operator=(const PersistentRegion&) = delete;
78
+
79
+ PersistentNode* AllocateNode(void* owner, TraceCallback trace) {
80
+ if (!free_list_head_) {
81
+ EnsureNodeSlots();
82
+ }
83
+ PersistentNode* node = free_list_head_;
84
+ free_list_head_ = free_list_head_->FreeListNext();
85
+ node->InitializeAsUsedNode(owner, trace);
86
+ return node;
87
+ }
88
+
89
+ void FreeNode(PersistentNode* node) {
90
+ node->InitializeAsFreeNode(free_list_head_);
91
+ free_list_head_ = node;
92
+ }
93
+
94
+ void Trace(Visitor*);
95
+
96
+ size_t NodesInUse() const;
97
+
98
+ private:
99
+ void EnsureNodeSlots();
100
+
101
+ std::vector<std::unique_ptr<PersistentNodeSlots>> nodes_;
102
+ PersistentNode* free_list_head_ = nullptr;
103
+ };
104
+
105
+ } // namespace internal
106
+
107
+ } // namespace cppgc
108
+
109
+ #endif // INCLUDE_CPPGC_INTERNAL_PERSISTENT_NODE_H_