Skip to content

Commit fdb4a0c

Browse files
committed
deps: V8: cherry-pick 5c6c99a8dc72
Original commit message: Merged: [liftoff][arm] Release temp registers after use The {ParallelRegisterMove} at the end of {AtomicLoad} might need a temporary scratch register for spilling values to the stack. Make sure that one is available by giving up the scratch register used for the address of the atomic access. TBR=​[email protected] (cherry picked from commit 63166010061d2af4fef6a713d448ebf074a9d2cb) (cherry picked from commit 953f7a9dcb1425616e3be67fdfe6ef8d820f0daa) Bug: chromium:1153442 Change-Id: Ie312b37857e226058581b300b5adb1f14476c155 No-Try: true No-Presubmit: true No-Tree-Checks: true Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2584959 Reviewed-by: Clemens Backes <[email protected]> Commit-Queue: Clemens Backes <[email protected]> Cr-Original-Commit-Position: refs/branch-heads/8.7@{#60} Cr-Original-Branched-From: 0d81cd72688512abcbe1601015baee390c484a6a-refs/heads/8.7.220@{#1} Cr-Original-Branched-From: 942c2ef85caef00fcf02517d049f05e9a3d4b440-refs/heads/master@{#70196} Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2656263 Reviewed-by: Victor-Gabriel Savu <[email protected]> Commit-Queue: Artem Sumaneev <[email protected]> Cr-Commit-Position: refs/branch-heads/8.6@{#58} Cr-Branched-From: a64aed2333abf49e494d2a5ce24bbd14fff19f60-refs/heads/8.6.395@{#1} Cr-Branched-From: a626bc036236c9bf92ac7b87dc40c9e538b087e3-refs/heads/master@{#69472} Refs: v8/v8@5c6c99a PR-URL: #38275 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Shelley Vohr <[email protected]>
1 parent 42552a7 commit fdb4a0c

File tree

3 files changed

+69
-8
lines changed

3 files changed

+69
-8
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.42',
39+
'v8_embedder_string': '-node.43',
4040

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

deps/v8/src/wasm/baseline/arm/liftoff-assembler-arm.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -880,11 +880,13 @@ void LiftoffAssembler::AtomicLoad(LiftoffRegister dst, Register src_addr,
880880
if (cache_state()->is_used(LiftoffRegister(dst_high))) {
881881
SpillRegister(LiftoffRegister(dst_high));
882882
}
883-
UseScratchRegisterScope temps(this);
884-
Register actual_addr = liftoff::CalculateActualAddress(
885-
this, &temps, src_addr, offset_reg, offset_imm);
886-
ldrexd(dst_low, dst_high, actual_addr);
887-
dmb(ISH);
883+
{
884+
UseScratchRegisterScope temps(this);
885+
Register actual_addr = liftoff::CalculateActualAddress(
886+
this, &temps, src_addr, offset_reg, offset_imm);
887+
ldrexd(dst_low, dst_high, actual_addr);
888+
dmb(ISH);
889+
}
888890

889891
LiftoffAssembler::ParallelRegisterMoveTuple reg_moves[]{
890892
{dst, LiftoffRegister::ForPair(dst_low, dst_high), kWasmI64}};
@@ -1196,12 +1198,10 @@ void LiftoffAssembler::Move(DoubleRegister dst, DoubleRegister src,
11961198
}
11971199

11981200
void LiftoffAssembler::Spill(int offset, LiftoffRegister reg, ValueType type) {
1199-
#ifdef DEBUG
12001201
// The {str} instruction needs a temp register when the immediate in the
12011202
// provided MemOperand does not fit into 12 bits. This happens for large stack
12021203
// frames. This DCHECK checks that the temp register is available when needed.
12031204
DCHECK(UseScratchRegisterScope{this}.CanAcquire());
1204-
#endif
12051205
DCHECK_LT(0, offset);
12061206
RecordUsedSpillOffset(offset);
12071207
MemOperand dst(fp, -offset);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// Copyright 2020 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: --experimental-wasm-threads
6+
7+
load('test/mjsunit/wasm/wasm-module-builder.js');
8+
9+
const builder = new WasmModuleBuilder();
10+
builder.addMemory(1, 1, false, true);
11+
builder.addGlobal(kWasmI32, 1);
12+
builder.addGlobal(kWasmI32, 1);
13+
builder.addType(makeSig([kWasmI32, kWasmI64, kWasmI32], []));
14+
// Generate function 1 (out of 1).
15+
builder.addFunction(undefined, 0 /* sig */)
16+
.addLocals(kWasmI32, 10)
17+
.addBodyWithEnd([
18+
// signature: v_ili
19+
// body:
20+
kExprI32Const, 0x00, // i32.const
21+
kExprLocalSet, 0x04, // local.set
22+
kExprI32Const, 0x01, // i32.const
23+
kExprLocalSet, 0x05, // local.set
24+
kExprBlock, kWasmStmt, // block @11
25+
kExprBr, 0x00, // br depth=0
26+
kExprEnd, // end @15
27+
kExprGlobalGet, 0x01, // global.get
28+
kExprLocalSet, 0x03, // local.set
29+
kExprLocalGet, 0x03, // local.get
30+
kExprI32Const, 0x01, // i32.const
31+
kExprI32Sub, // i32.sub
32+
kExprLocalSet, 0x06, // local.set
33+
kExprI64Const, 0x01, // i64.const
34+
kExprLocalSet, 0x01, // local.set
35+
kExprI32Const, 0x00, // i32.const
36+
kExprI32Eqz, // i32.eqz
37+
kExprLocalSet, 0x07, // local.set
38+
kExprBlock, kWasmStmt, // block @36
39+
kExprBr, 0x00, // br depth=0
40+
kExprEnd, // end @40
41+
kExprGlobalGet, 0x01, // global.get
42+
kExprLocalSet, 0x08, // local.set
43+
kExprI32Const, 0x01, // i32.const
44+
kExprI32Const, 0x01, // i32.const
45+
kExprI32Sub, // i32.sub
46+
kExprLocalSet, 0x09, // local.set
47+
kExprLocalGet, 0x00, // local.get
48+
kExprLocalSet, 0x0a, // local.set
49+
kExprGlobalGet, 0x00, // global.get
50+
kExprLocalSet, 0x0b, // local.set
51+
kExprI32Const, 0x00, // i32.const
52+
kExprI32Const, 0x0f, // i32.const
53+
kExprI32And, // i32.and
54+
kExprLocalSet, 0x0c, // local.set
55+
kExprI32Const, 0x00, // i32.const
56+
kAtomicPrefix, kExprI64AtomicLoad, 0x03, 0x04, // i64.atomic.load64
57+
kExprDrop, // drop
58+
kExprUnreachable, // unreachable
59+
kExprEnd, // end @75
60+
]);
61+
builder.toModule();

0 commit comments

Comments
 (0)