Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: crypto: use cppgc to manage Hash #51017

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.13',
'v8_embedder_string': '-node.14',

##### V8 defaults for Node.js #####

Expand Down
1 change: 1 addition & 0 deletions deps/v8/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ filegroup(
"include/cppgc/default-platform.h",
"include/cppgc/ephemeron-pair.h",
"include/cppgc/explicit-management.h",
"include/cppgc/external.h",
"include/cppgc/garbage-collected.h",
"include/cppgc/heap.h",
"include/cppgc/heap-consistency.h",
Expand Down
1 change: 1 addition & 0 deletions deps/v8/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -6920,6 +6920,7 @@ v8_header_set("cppgc_headers") {
"include/cppgc/default-platform.h",
"include/cppgc/ephemeron-pair.h",
"include/cppgc/explicit-management.h",
"include/cppgc/external.h",
"include/cppgc/garbage-collected.h",
"include/cppgc/heap-consistency.h",
"include/cppgc/heap-handle.h",
Expand Down
23 changes: 23 additions & 0 deletions deps/v8/include/cppgc/external.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright 2024 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 INCLUDE_CPPGC_EXTERNAL_H_
#define INCLUDE_CPPGC_EXTERNAL_H_

#include <cstddef>

namespace cppgc {

class Visitor;

class External {
public:
virtual void Trace(cppgc::Visitor*) const {}
virtual const char* GetHumanReadableName() const = 0;
virtual size_t GetSize() const = 0;
};

} // namespace cppgc

#endif // INCLUDE_CPPGC_EXTERNAL_H_
8 changes: 8 additions & 0 deletions deps/v8/include/cppgc/visitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

namespace cppgc {

class External;

namespace internal {
template <typename T, typename WeaknessPolicy, typename LocationPolicy,
typename CheckingPolicy>
Expand Down Expand Up @@ -306,6 +308,11 @@ class V8_EXPORT Visitor {
callback_data);
}

/**
* Trace method for members with externally-managed memory.
*/
void TraceExternal(const External* external) { VisitExternal(external); }

/**
* Registers a slot containing a reference to an object allocated on a
* compactable space. Such references maybe be arbitrarily moved by the GC.
Expand Down Expand Up @@ -359,6 +366,7 @@ class V8_EXPORT Visitor {
virtual void VisitWeakContainer(const void* self, TraceDescriptor strong_desc,
TraceDescriptor weak_desc,
WeakCallback callback, const void* data) {}
virtual void VisitExternal(const External* external) {}
virtual void HandleMovableReference(const void**) {}

virtual void VisitMultipleUncompressedMember(
Expand Down
Loading