Commit 719f9db3 authored by Junliang Yan's avatar Junliang Yan Committed by V8 LUCI CQ

s390x: [baseline] implement Jump pt.2

Change-Id: I508b75e9023cc5cff8018aa0c07ce6ca10bf1bbb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3313443Reviewed-by: 's avatarVictor Gomes <victorgomes@chromium.org>
Reviewed-by: 's avatarMilad Farazmand <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#78229}
parent a66c7a38
......@@ -134,6 +134,20 @@ inline bool IsSignedCondition(Condition cond) {
}
}
#define __ assm->masm()->
// s390x helper
void JumpIfHelper(BaselineAssembler* assm, Condition cc, Register lhs,
Register rhs, Label* target) {
if (IsSignedCondition(cc)) {
__ CmpS64(lhs, rhs);
} else {
__ CmpU64(lhs, rhs);
}
__ b(AsMasmCondition(cc), target);
}
#undef __
#define __ masm_->
MemOperand BaselineAssembler::RegisterFrameOperand(
......@@ -199,50 +213,79 @@ void BaselineAssembler::TailCallBuiltin(Builtin builtin) {
void BaselineAssembler::TestAndBranch(Register value, int mask, Condition cc,
Label* target, Label::Distance) {
UNIMPLEMENTED();
__ AndP(r0, value, Operand(mask));
__ b(AsMasmCondition(cc), target);
}
void BaselineAssembler::JumpIf(Condition cc, Register lhs, const Operand& rhs,
Label* target, Label::Distance) {
UNIMPLEMENTED();
if (IsSignedCondition(cc)) {
__ CmpS64(lhs, rhs);
} else {
__ CmpU64(lhs, rhs);
}
__ b(AsMasmCondition(cc), target);
}
void BaselineAssembler::JumpIfObjectType(Condition cc, Register object,
InstanceType instance_type,
Register map, Label* target,
Label::Distance) {
UNIMPLEMENTED();
ScratchRegisterScope temps(this);
Register type = temps.AcquireScratch();
__ LoadMap(map, object);
__ LoadU16(type, FieldMemOperand(map, Map::kInstanceTypeOffset));
JumpIf(cc, type, Operand(instance_type), target);
}
void BaselineAssembler::JumpIfInstanceType(Condition cc, Register map,
InstanceType instance_type,
Label* target, Label::Distance) {
UNIMPLEMENTED();
ScratchRegisterScope temps(this);
Register type = temps.AcquireScratch();
if (FLAG_debug_code) {
__ AssertNotSmi(map);
__ CompareObjectType(map, type, type, MAP_TYPE);
__ Assert(eq, AbortReason::kUnexpectedValue);
}
__ LoadU16(type, FieldMemOperand(map, Map::kInstanceTypeOffset));
JumpIf(cc, type, Operand(instance_type), target);
}
void BaselineAssembler::JumpIfPointer(Condition cc, Register value,
MemOperand operand, Label* target,
Label::Distance) {
UNIMPLEMENTED();
ScratchRegisterScope temps(this);
Register tmp = temps.AcquireScratch();
__ LoadU64(tmp, operand);
JumpIfHelper(this, cc, value, tmp, target);
}
void BaselineAssembler::JumpIfSmi(Condition cc, Register value, Smi smi,
Label* target, Label::Distance) {
UNIMPLEMENTED();
__ AssertSmi(value);
__ LoadSmiLiteral(r0, smi);
JumpIfHelper(this, cc, value, r0, target);
}
void BaselineAssembler::JumpIfSmi(Condition cc, Register lhs, Register rhs,
Label* target, Label::Distance) {
UNIMPLEMENTED();
__ AssertSmi(lhs);
__ AssertSmi(rhs);
JumpIfHelper(this, cc, lhs, rhs, target);
}
void BaselineAssembler::JumpIfTagged(Condition cc, Register value,
MemOperand operand, Label* target,
Label::Distance) {
UNIMPLEMENTED();
__ LoadU64(r0, operand);
JumpIfHelper(this, cc, value, r0, target);
}
void BaselineAssembler::JumpIfTagged(Condition cc, MemOperand operand,
Register value, Label* target,
Label::Distance) {
UNIMPLEMENTED();
__ LoadU64(r0, operand);
JumpIfHelper(this, cc, r0, value, target);
}
void BaselineAssembler::JumpIfByte(Condition cc, Register value, int32_t byte,
Label* target, Label::Distance) {
UNIMPLEMENTED();
JumpIf(cc, value, Operand(byte), target);
}
void BaselineAssembler::Move(interpreter::Register output, Register source) {
......
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