Skip to content

Commit 3805a69

Browse files
Milad FaV8 LUCI CQ
authored andcommitted
PPC/s390: [wasm][liftoff] Always zero-extend 32 bit offsets
Port 2b77ca2 Original Commit Message: The upper 32 bits of the 64 bit offset register are not guaranteed to be cleared, so a zero-extension is needed. We already do the zero-extension in the case of explicit bounds checking, but this should also be done if the trap handler is enabled. [email protected], [email protected], [email protected], [email protected] BUG= LOG=N Change-Id: Ife3ae4f93b85fe1b2c76fe4b98fa408b5b51ed71 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2929661 Reviewed-by: Junliang Yan <[email protected]> Commit-Queue: Milad Fa <[email protected]> Cr-Commit-Position: refs/heads/master@{#74886}
1 parent e2ebe3b commit 3805a69

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/wasm/baseline/ppc/liftoff-assembler-ppc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
250250
void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
251251
Register offset_reg, uintptr_t offset_imm,
252252
LoadType type, LiftoffRegList pinned,
253-
uint32_t* protected_load_pc, bool is_load_mem) {
253+
uint32_t* protected_load_pc, bool is_load_mem,
254+
bool i64_offset) {
254255
bailout(kUnsupportedArchitecture, "Load");
255256
}
256257

src/wasm/baseline/s390/liftoff-assembler-s390.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,17 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
280280
void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
281281
Register offset_reg, uintptr_t offset_imm,
282282
LoadType type, LiftoffRegList pinned,
283-
uint32_t* protected_load_pc, bool is_load_mem) {
283+
uint32_t* protected_load_pc, bool is_load_mem,
284+
bool i64_offset) {
284285
UseScratchRegisterScope temps(this);
285286
if (!is_int20(offset_imm)) {
286287
mov(ip, Operand(offset_imm));
287288
if (offset_reg != no_reg) {
289+
if (!i64_offset) {
290+
// Clear the upper 32 bits of the 64 bit offset register.
291+
llgfr(r0, offset_reg);
292+
offset_reg = r0;
293+
}
288294
AddS64(ip, offset_reg);
289295
}
290296
offset_reg = ip;

0 commit comments

Comments
 (0)