Skip to content

Commit 05530e8

Browse files
committed
deps: V8: cherry-pick e527ba4bf8af
Original commit message: Merged: [interpreter] Store accumulator to callee after optional chain checks Revision: df98901c19ce17ca995ee6750379b0f004210d68 BUG=chromium:1171954 NOTRY=true NOPRESUBMIT=true NOTREECHECKS=true R=​[email protected] (cherry picked from commit f309db52c2ccab8c9a04fcd236e89deb077061f9) Change-Id: If09e1503ca07b47a112362495ec0bb9d502118c9 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2674008 Reviewed-by: Ross McIlroy <[email protected]> Cr-Original-Commit-Position: refs/branch-heads/8.9@{#33} Cr-Original-Branched-From: 16b9bbbd581c25391981aa03180b76aa60463a3e-refs/heads/8.9.255@{#1} Cr-Original-Branched-From: d16a2a688498bd1c3e6a49edb25d8c4ca56232dc-refs/heads/master@{#72039} Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2706110 Reviewed-by: Mythri Alle <[email protected]> Commit-Queue: Achuith Bhandarkar <[email protected]> Cr-Commit-Position: refs/branch-heads/8.6@{#62} Cr-Branched-From: a64aed2333abf49e494d2a5ce24bbd14fff19f60-refs/heads/8.6.395@{#1} Cr-Branched-From: a626bc036236c9bf92ac7b87dc40c9e538b087e3-refs/heads/master@{#69472} Refs: v8/v8@e527ba4 PR-URL: #38275 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Shelley Vohr <[email protected]>
1 parent fdb4a0c commit 05530e8

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.43',
39+
'v8_embedder_string': '-node.44',
4040

4141
##### V8 defaults for Node.js #####
4242

deps/v8/src/interpreter/bytecode-generator.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -4891,8 +4891,9 @@ void BytecodeGenerator::VisitCall(Call* expr) {
48914891
Property* property = chain->expression()->AsProperty();
48924892
BuildOptionalChain([&]() {
48934893
VisitAndPushIntoRegisterList(property->obj(), &args);
4894-
VisitPropertyLoadForRegister(args.last_register(), property, callee);
4894+
VisitPropertyLoad(args.last_register(), property);
48954895
});
4896+
builder()->StoreAccumulatorInRegister(callee);
48964897
break;
48974898
}
48984899
case Call::SUPER_CALL:

deps/v8/test/mjsunit/regress/regress-crbug-1038178.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function opt(){
1515
(((function(){})())?.v)()
1616
}
1717
%PrepareFunctionForOptimization(opt)
18-
assertThrows(opt());
19-
assertThrows(opt());
18+
assertThrows(() => opt());
19+
assertThrows(() => opt());
2020
%OptimizeFunctionOnNextCall(opt)
21-
assertThrows(opt());
21+
assertThrows(() => opt());
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2021 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// Flags: --always-opt
6+
7+
// This causes the register used by the call in the later try-catch block to be
8+
// used by the ToName conversion for null which causes a DCHECK fail when
9+
// compiling. If register allocation changes, this test may no longer reproduce
10+
// the crash but it is not easy write a proper test because it is linked to
11+
// register allocation. This test should always work, so shouldn't cause any
12+
// flakes.
13+
try {
14+
var { [null]: __v_12, } = {};
15+
} catch (e) {}
16+
17+
try {
18+
assertEquals((__v_40?.o?.m)().p);
19+
} catch (e) {}

0 commit comments

Comments
 (0)