Skip to content

Commit

Permalink
deps: V8: cherry-pick 79a9d2eb3477
Browse files Browse the repository at this point in the history
Original commit message:

    Fix destructor for EmbedderStateScope

    EmbedderState is forward declared in public header for
    EmbedderStateScope. Default std::unique_ptr's destructor needs a fully
    defined class. Defining default destructor in implementation file fixes
    this.

    Bug: chromium:1263871
    Change-Id: I8ccc58f56a758927dc5d7a39387188185e7d3827
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3338697
    Auto-Submit: Corentin Pescheloche <cpescheloche@fb.com>
    Reviewed-by: Camillo Bruni <cbruni@chromium.org>
    Commit-Queue: Camillo Bruni <cbruni@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#78363}

Refs: v8/v8@79a9d2e

PR-URL: #41610
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
targos committed Feb 2, 2022
1 parent ae5edcf commit 48708be
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
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.10',
'v8_embedder_string': '-node.11',

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

Expand Down
2 changes: 2 additions & 0 deletions deps/v8/include/v8-embedder-state-scope.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class V8_EXPORT EmbedderStateScope {
EmbedderStateScope(Isolate* isolate, Local<v8::Context> context,
EmbedderStateTag tag);

~EmbedderStateScope();

private:
// Declaring operator new and delete as deleted is not spec compliant.
// Therefore declare them private instead to disable dynamic alloc
Expand Down
5 changes: 5 additions & 0 deletions deps/v8/src/api/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10361,6 +10361,11 @@ EmbedderStateScope::EmbedderStateScope(Isolate* isolate,
EmbedderStateTag tag)
: embedder_state_(new internal::EmbedderState(isolate, context, tag)) {}

// std::unique_ptr's destructor is not compatible with Forward declared
// EmbedderState class.
// Default destructor must be defined in implementation file.
EmbedderStateScope::~EmbedderStateScope() = default;

void TracedReferenceBase::CheckValue() const {
#ifdef V8_HOST_ARCH_64_BIT
if (!val_) return;
Expand Down

0 comments on commit 48708be

Please sign in to comment.