8000 chore: cherry-pick fbfd2557c2ab from v8 by ppontes · Pull Request #30821 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: cherry-pick fbfd2557c2ab from v8 #30821

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

Merged
merged 2 commits into from
Sep 6, 2021
Merged
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
1 change: 1 addition & 0 deletions patches/v8/.patches
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ cherry-pick-1234770.patch
cherry-pick-1231950.patch
cherry-pick-1228036.patch
cherry-pick-1234764.patch
cherry-pick-fbfd2557c2ab.patch
33 changes: 33 additions & 0 deletions patches/v8/cherry-pick-fbfd2557c2ab.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mythri A <mythria@chromium.org>
Date: Fri, 21 May 2021 11:12:41 +0100
Subject: Return early when initializing feedback cell for AsmWasm functions

AsmWasmFunctions don't allocate / use feedback vectors.

Bug: chromium:1206289
Change-Id: I970d5eaba6603809a844c2fc5753efba411cd719
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2909854
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74708}

diff --git a/src/objects/js-function.cc b/src/objects/js-function.cc
index 35010be838ea1a5a3bebbb8a86d3358092da5199..b17550a29668d3dab082a515c7287b219becd01d 100644
--- a/src/objects/js-function.cc
+++ b/src/objects/js-function.cc
@@ -361,6 +361,14 @@ void JSFunction::InitializeFeedbackCell(
Handle<JSFunction> function, IsCompiledScope* is_compiled_scope,
bool reset_budget_for_feedback_allocation) {
Isolate* const isolate = function->GetIsolate();
+#if V8_ENABLE_WEBASSEMBLY
+ // The following checks ensure that the feedback vectors are compatible with
+ // the feedback metadata. For Asm / Wasm functions we never allocate / use
+ // feedback vectors, so a mismatch between the metadata and feedback vector is
+ // harmless. The checks could fail for functions that has has_asm_wasm_broken
+ // set at runtime (for ex: failed instantiation).
+ if (function->shared().HasAsmWasmData()) return;
+#endif // V8_ENABLE_WEBASSEMBLY

if (function->has_feedback_vector()) {
CHECK_EQ(function->feedback_vector().length(),
0