Skip to content

Commit

Permalink
deps: V8: cherry-pick cca9ae3c9a
Browse files Browse the repository at this point in the history
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 #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: #27667
    Change-Id: I231eb780ff04f949fa1669714f9af6ebfbcade05
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1612897
    Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#61503}

Fixes: #27667

Backport-PR-URL: #28005
PR-URL: #27729
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
bmeurer authored and targos committed Jun 4, 2019
1 parent 55e9944 commit 8b8fe87
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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 #####

Expand Down
8 changes: 0 additions & 8 deletions deps/v8/src/compiler/property-access-builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8b8fe87

Please sign in to comment.