Commit 132d7bd4 authored by LiuYu's avatar LiuYu Committed by Commit Bot

[mips][wasm-gc] Liftoff support part 2

Port: 5e18ab50

Bug: v8:7748
Change-Id: I1ac349cf80b6689971bd6c686c6795daf85c5637
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2594536
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#71815}
parent 53b9ee37
......@@ -4803,7 +4803,7 @@ void TurboAssembler::Abort(AbortReason reason) {
}
}
void MacroAssembler::LoadMap(Register destination, Register object) {
void TurboAssembler::LoadMap(Register destination, Register object) {
Lw(destination, FieldMemOperand(object, HeapObject::kMapOffset));
}
......
......@@ -780,6 +780,8 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
void LoadRoot(Register destination, RootIndex index, Condition cond,
Register src1, const Operand& src2);
void LoadMap(Register destination, Register object);
// If the value is a NaN, canonicalize the value else, do nothing.
void FPUCanonicalizeNaN(const DoubleRegister dst, const DoubleRegister src);
......@@ -990,8 +992,6 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
bool do_return = NO_EMIT_RETURN,
bool argument_count_is_length = false);
void LoadMap(Register destination, Register object);
// Make sure the stack is aligned. Only emits code in debug mode.
void AssertStackIsAligned();
......
......@@ -5214,7 +5214,7 @@ void TurboAssembler::Abort(AbortReason reason) {
}
}
void MacroAssembler::LoadMap(Register destination, Register object) {
void TurboAssembler::LoadMap(Register destination, Register object) {
Ld(destination, FieldMemOperand(object, HeapObject::kMapOffset));
}
......
......@@ -741,6 +741,8 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
void LoadRoot(Register destination, RootIndex index, Condition cond,
Register src1, const Operand& src2);
void LoadMap(Register destination, Register object);
// If the value is a NaN, canonicalize the value else, do nothing.
void FPUCanonicalizeNaN(const DoubleRegister dst, const DoubleRegister src);
......@@ -1032,8 +1034,6 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
bool do_return = NO_EMIT_RETURN,
bool argument_count_is_length = false);
void LoadMap(Register destination, Register object);
// Make sure the stack is aligned. Only emits code in debug mode.
void AssertStackIsAligned();
......
......@@ -851,6 +851,7 @@ I32_BINOP(xor, xor_)
// clang-format off
I32_BINOP_I(add, Addu)
I32_BINOP_I(sub, Subu)
I32_BINOP_I(and, And)
I32_BINOP_I(or, Or)
I32_BINOP_I(xor, Xor)
......@@ -1467,6 +1468,13 @@ void LiftoffAssembler::emit_cond_jump(LiftoffCondition liftoff_cond,
}
}
void LiftoffAssembler::emit_i32_cond_jumpi(LiftoffCondition liftoff_cond,
Label* label, Register lhs,
int32_t imm) {
Condition cond = liftoff::ToCondition(liftoff_cond);
TurboAssembler::Branch(label, cond, lhs, Operand(imm));
}
void LiftoffAssembler::emit_i32_eqz(Register dst, Register src) {
sltiu(dst, src, 1);
}
......@@ -1653,6 +1661,15 @@ bool LiftoffAssembler::emit_select(LiftoffRegister dst, Register condition,
return false;
}
void LiftoffAssembler::emit_smi_check(Register obj, Label* target,
SmiCheckMode mode) {
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
And(scratch, obj, Operand(kSmiTagMask));
Condition condition = mode == kJumpOnSmi ? eq : ne;
Branch(target, condition, scratch, Operand(zero_reg));
}
void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr,
Register offset_reg, uintptr_t offset_imm,
LoadType type,
......
......@@ -829,6 +829,7 @@ I32_BINOP(xor, xor_)
// clang-format off
I32_BINOP_I(add, Addu)
I32_BINOP_I(sub, Subu)
I32_BINOP_I(and, And)
I32_BINOP_I(or, Or)
I32_BINOP_I(xor, Xor)
......@@ -1344,6 +1345,13 @@ void LiftoffAssembler::emit_cond_jump(LiftoffCondition liftoff_cond,
}
}
void LiftoffAssembler::emit_i32_cond_jumpi(LiftoffCondition liftoff_cond,
Label* label, Register lhs,
int32_t imm) {
Condition cond = liftoff::ToCondition(liftoff_cond);
TurboAssembler::Branch(label, cond, lhs, Operand(imm));
}
void LiftoffAssembler::emit_i32_eqz(Register dst, Register src) {
sltiu(dst, src, 1);
}
......@@ -1512,6 +1520,15 @@ bool LiftoffAssembler::emit_select(LiftoffRegister dst, Register condition,
return false;
}
void LiftoffAssembler::emit_smi_check(Register obj, Label* target,
SmiCheckMode mode) {
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
And(scratch, obj, Operand(kSmiTagMask));
Condition condition = mode == kJumpOnSmi ? eq : ne;
Branch(target, condition, scratch, Operand(zero_reg));
}
void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr,
Register offset_reg, uintptr_t offset_imm,
LoadType type,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment