From 8b8fe87e54c1b93ca1be8344cb3e969653c70e20 Mon Sep 17 00:00:00 2001 From: Benedikt Meurer Date: Wed, 15 May 2019 08:37:20 +0200 Subject: [PATCH] deps: V8: cherry-pick cca9ae3c9a MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: Remove recursion from NeedsCheckHeapObject. We use the predicate NeedsCheckHeapObject in the compiler frontend to determine whether we can skip introducing CheckHeapObject nodes. But this predicate would also walk up the graph in case of Phis, which can result in really long compilation times (on the main thread). In the report in https://github.com/nodejs/node/issues/27667, the compiler frontend alone took around 4-5mins of main thread time for a single function. With this patch the time goes down to 4-5ms. Bug: v8:9250 Refs: nodejs/node#27667 Change-Id: I231eb780ff04f949fa1669714f9af6ebfbcade05 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1612897 Reviewed-by: Jaroslav Sevcik Commit-Queue: Benedikt Meurer Cr-Commit-Position: refs/heads/master@{#61503} Fixes: https://github.com/nodejs/node/issues/27667 Backport-PR-URL: https://github.com/nodejs/node/pull/28005 PR-URL: https://github.com/nodejs/node/pull/27729 Reviewed-By: Michaƫl Zasso Reviewed-By: Colin Ihrig Reviewed-By: Ruben Bridgewater Reviewed-By: Rich Trott Reviewed-By: Michael Dawson Reviewed-By: James M Snell --- common.gypi | 2 +- deps/v8/src/compiler/property-access-builder.cc | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/common.gypi b/common.gypi index 37edf77e4baf2d..317ba1f4435504 100644 --- a/common.gypi +++ b/common.gypi @@ -38,7 +38,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.4', + 'v8_embedder_string': '-node.5', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/compiler/property-access-builder.cc b/deps/v8/src/compiler/property-access-builder.cc index 1c5aa1f2c3cae8..75b3c70f659b13 100644 --- a/deps/v8/src/compiler/property-access-builder.cc +++ b/deps/v8/src/compiler/property-access-builder.cc @@ -119,14 +119,6 @@ bool NeedsCheckHeapObject(Node* receiver) { case IrOpcode::kJSToString: case IrOpcode::kTypeOf: return false; - case IrOpcode::kPhi: { - Node* control = NodeProperties::GetControlInput(receiver); - if (control->opcode() != IrOpcode::kMerge) return true; - for (int i = 0; i < receiver->InputCount() - 1; ++i) { - if (NeedsCheckHeapObject(receiver->InputAt(i))) return true; - } - return false; - } default: return true; }