summaryrefslogtreecommitdiff
path: root/deps/v8/src/heap/cppgc-js/wrappable-info.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/heap/cppgc-js/wrappable-info.h')
-rw-r--r--deps/v8/src/heap/cppgc-js/wrappable-info.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/deps/v8/src/heap/cppgc-js/wrappable-info.h b/deps/v8/src/heap/cppgc-js/wrappable-info.h
new file mode 100644
index 0000000000..7a11daa10a
--- /dev/null
+++ b/deps/v8/src/heap/cppgc-js/wrappable-info.h
@@ -0,0 +1,34 @@
+// Copyright 2023 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_HEAP_CPPGC_JS_WRAPPABLE_INFO_H_
+#define V8_HEAP_CPPGC_JS_WRAPPABLE_INFO_H_
+
+#include "include/v8-cppgc.h"
+#include "src/base/optional.h"
+#include "src/objects/embedder-data-slot.h"
+#include "src/objects/js-objects.h"
+
+namespace v8::internal {
+
+class Isolate;
+
+struct WrappableInfo final {
+ public:
+ static V8_INLINE base::Optional<WrappableInfo> From(Isolate*, JSObject,
+ const WrapperDescriptor&);
+ static V8_INLINE base::Optional<WrappableInfo> From(
+ Isolate*, const EmbedderDataSlot& type_slot,
+ const EmbedderDataSlot& instance_slot, const WrapperDescriptor&);
+
+ constexpr WrappableInfo(void* type, void* instance)
+ : type(type), instance(instance) {}
+
+ void* type = nullptr;
+ void* instance = nullptr;
+};
+
+} // namespace v8::internal
+
+#endif // V8_HEAP_CPPGC_JS_WRAPPABLE_INFO_H_