[wasm] Use int type for small offsets
The uint32_t type can easily be confused with the memory offsets that are currently 32 bit and will become 64 bit with the memory64 proposal. Since the offsets into the instance are always small anyway, the type of the integer does not really matter, and we should stick to the default 'int'. R=manoskouk@chromium.org Bug: v8:10949 Change-Id: I742334483bbc80c4cc03f40f046b5d2d3b17d1d8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2489691 Commit-Queue: Clemens Backes <clemensb@chromium.org> Reviewed-by: Manos Koukoutos <manoskouk@chromium.org> Cr-Commit-Position: refs/heads/master@{#70712}
This commit is contained in:
parent
6f73c6c816
commit
ba5646046b
@ -532,16 +532,14 @@ void LiftoffAssembler::LoadConstant(LiftoffRegister reg, WasmValue value,
|
||||
}
|
||||
}
|
||||
|
||||
void LiftoffAssembler::LoadFromInstance(Register dst, uint32_t offset,
|
||||
int size) {
|
||||
DCHECK_LE(offset, kMaxInt);
|
||||
void LiftoffAssembler::LoadFromInstance(Register dst, int offset, int size) {
|
||||
DCHECK_LE(0, offset);
|
||||
DCHECK_EQ(4, size);
|
||||
ldr(dst, liftoff::GetInstanceOperand());
|
||||
ldr(dst, MemOperand(dst, offset));
|
||||
}
|
||||
|
||||
void LiftoffAssembler::LoadTaggedPointerFromInstance(Register dst,
|
||||
uint32_t offset) {
|
||||
void LiftoffAssembler::LoadTaggedPointerFromInstance(Register dst, int offset) {
|
||||
LoadFromInstance(dst, offset, kTaggedSize);
|
||||
}
|
||||
|
||||
|
@ -313,9 +313,8 @@ void LiftoffAssembler::LoadConstant(LiftoffRegister reg, WasmValue value,
|
||||
}
|
||||
}
|
||||
|
||||
void LiftoffAssembler::LoadFromInstance(Register dst, uint32_t offset,
|
||||
int size) {
|
||||
DCHECK_LE(offset, kMaxInt);
|
||||
void LiftoffAssembler::LoadFromInstance(Register dst, int offset, int size) {
|
||||
DCHECK_LE(0, offset);
|
||||
Ldr(dst, liftoff::GetInstanceOperand());
|
||||
DCHECK(size == 4 || size == 8);
|
||||
if (size == 4) {
|
||||
@ -325,9 +324,8 @@ void LiftoffAssembler::LoadFromInstance(Register dst, uint32_t offset,
|
||||
}
|
||||
}
|
||||
|
||||
void LiftoffAssembler::LoadTaggedPointerFromInstance(Register dst,
|
||||
uint32_t offset) {
|
||||
DCHECK_LE(offset, kMaxInt);
|
||||
void LiftoffAssembler::LoadTaggedPointerFromInstance(Register dst, int offset) {
|
||||
DCHECK_LE(0, offset);
|
||||
Ldr(dst, liftoff::GetInstanceOperand());
|
||||
LoadTaggedPointerField(dst, MemOperand(dst, offset));
|
||||
}
|
||||
|
@ -261,16 +261,14 @@ void LiftoffAssembler::LoadConstant(LiftoffRegister reg, WasmValue value,
|
||||
}
|
||||
}
|
||||
|
||||
void LiftoffAssembler::LoadFromInstance(Register dst, uint32_t offset,
|
||||
int size) {
|
||||
DCHECK_LE(offset, kMaxInt);
|
||||
void LiftoffAssembler::LoadFromInstance(Register dst, int offset, int size) {
|
||||
DCHECK_LE(0, offset);
|
||||
mov(dst, liftoff::GetInstanceOperand());
|
||||
DCHECK_EQ(4, size);
|
||||
mov(dst, Operand(dst, offset));
|
||||
}
|
||||
|
||||
void LiftoffAssembler::LoadTaggedPointerFromInstance(Register dst,
|
||||
uint32_t offset) {
|
||||
void LiftoffAssembler::LoadTaggedPointerFromInstance(Register dst, int offset) {
|
||||
LoadFromInstance(dst, offset, kTaggedSize);
|
||||
}
|
||||
|
||||
|
@ -478,8 +478,8 @@ class LiftoffAssembler : public TurboAssembler {
|
||||
|
||||
inline void LoadConstant(LiftoffRegister, WasmValue,
|
||||
RelocInfo::Mode rmode = RelocInfo::NONE);
|
||||
inline void LoadFromInstance(Register dst, uint32_t offset, int size);
|
||||
inline void LoadTaggedPointerFromInstance(Register dst, uint32_t offset);
|
||||
inline void LoadFromInstance(Register dst, int offset, int size);
|
||||
inline void LoadTaggedPointerFromInstance(Register dst, int offset);
|
||||
inline void SpillInstance(Register instance);
|
||||
inline void FillInstanceInto(Register dst);
|
||||
inline void LoadTaggedPointer(Register dst, Register src_addr,
|
||||
|
@ -236,11 +236,10 @@ void LiftoffAssembler::LoadConstant(LiftoffRegister reg, WasmValue value,
|
||||
}
|
||||
}
|
||||
|
||||
void LiftoffAssembler::LoadFromInstance(Register dst, uint32_t offset,
|
||||
int size) {
|
||||
DCHECK_LE(offset, kMaxInt);
|
||||
movq(dst, liftoff::GetInstanceOperand());
|
||||
void LiftoffAssembler::LoadFromInstance(Register dst, int offset, int size) {
|
||||
DCHECK_LE(0, offset);
|
||||
DCHECK(size == 4 || size == 8);
|
||||
movq(dst, liftoff::GetInstanceOperand());
|
||||
if (size == 4) {
|
||||
movl(dst, Operand(dst, offset));
|
||||
} else {
|
||||
@ -248,9 +247,8 @@ void LiftoffAssembler::LoadFromInstance(Register dst, uint32_t offset,
|
||||
}
|
||||
}
|
||||
|
||||
void LiftoffAssembler::LoadTaggedPointerFromInstance(Register dst,
|
||||
uint32_t offset) {
|
||||
DCHECK_LE(offset, kMaxInt);
|
||||
void LiftoffAssembler::LoadTaggedPointerFromInstance(Register dst, int offset) {
|
||||
DCHECK_LE(0, offset);
|
||||
movq(dst, liftoff::GetInstanceOperand());
|
||||
LoadTaggedPointerField(dst, Operand(dst, offset));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user