Commit 7cb9c47b authored by Junliang Yan's avatar Junliang Yan Committed by V8 LUCI CQ

ppc64: [baseline] add StoreTagged functions

drive-by: Add code comment macros
Change-Id: I1bded0f0e49f9e590cb7a8a5d86e26e8d9d5eea6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3585530Reviewed-by: 's avatarMilad Farazmand <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#79969}
parent 8081a5ff
...@@ -170,36 +170,44 @@ void BaselineAssembler::JumpTarget() { ...@@ -170,36 +170,44 @@ void BaselineAssembler::JumpTarget() {
} }
void BaselineAssembler::Jump(Label* target, Label::Distance distance) { void BaselineAssembler::Jump(Label* target, Label::Distance distance) {
ASM_CODE_COMMENT(masm_);
__ b(target); __ b(target);
} }
void BaselineAssembler::JumpIfRoot(Register value, RootIndex index, void BaselineAssembler::JumpIfRoot(Register value, RootIndex index,
Label* target, Label::Distance) { Label* target, Label::Distance) {
ASM_CODE_COMMENT(masm_);
__ JumpIfRoot(value, index, target); __ JumpIfRoot(value, index, target);
} }
void BaselineAssembler::JumpIfNotRoot(Register value, RootIndex index, void BaselineAssembler::JumpIfNotRoot(Register value, RootIndex index,
Label* target, Label::Distance) { Label* target, Label::Distance) {
ASM_CODE_COMMENT(masm_);
__ JumpIfNotRoot(value, index, target); __ JumpIfNotRoot(value, index, target);
} }
void BaselineAssembler::JumpIfSmi(Register value, Label* target, void BaselineAssembler::JumpIfSmi(Register value, Label* target,
Label::Distance) { Label::Distance) {
ASM_CODE_COMMENT(masm_);
__ JumpIfSmi(value, target); __ JumpIfSmi(value, target);
} }
void BaselineAssembler::JumpIfImmediate(Condition cc, Register left, int right, void BaselineAssembler::JumpIfImmediate(Condition cc, Register left, int right,
Label* target, Label* target,
Label::Distance distance) { Label::Distance distance) {
ASM_CODE_COMMENT(masm_);
JumpIf(cc, left, Operand(right), target, distance); JumpIf(cc, left, Operand(right), target, distance);
} }
void BaselineAssembler::JumpIfNotSmi(Register value, Label* target, void BaselineAssembler::JumpIfNotSmi(Register value, Label* target,
Label::Distance) { Label::Distance) {
ASM_CODE_COMMENT(masm_);
__ JumpIfNotSmi(value, target); __ JumpIfNotSmi(value, target);
} }
void BaselineAssembler::CallBuiltin(Builtin builtin) { void BaselineAssembler::CallBuiltin(Builtin builtin) {
ASM_CODE_COMMENT_STRING(masm_,
__ CommentForOffHeapTrampoline("call", builtin));
if (masm()->options().short_builtin_calls) { if (masm()->options().short_builtin_calls) {
// Generate pc-relative call. // Generate pc-relative call.
__ CallBuiltin(builtin, al); __ CallBuiltin(builtin, al);
...@@ -227,12 +235,14 @@ void BaselineAssembler::TailCallBuiltin(Builtin builtin) { ...@@ -227,12 +235,14 @@ void BaselineAssembler::TailCallBuiltin(Builtin builtin) {
void BaselineAssembler::TestAndBranch(Register value, int mask, Condition cc, void BaselineAssembler::TestAndBranch(Register value, int mask, Condition cc,
Label* target, Label::Distance) { Label* target, Label::Distance) {
ASM_CODE_COMMENT(masm_);
__ AndU64(r0, value, Operand(mask), ip, SetRC); __ AndU64(r0, value, Operand(mask), ip, SetRC);
__ b(AsMasmCondition(cc), target); __ b(AsMasmCondition(cc), target);
} }
void BaselineAssembler::JumpIf(Condition cc, Register lhs, const Operand& rhs, void BaselineAssembler::JumpIf(Condition cc, Register lhs, const Operand& rhs,
Label* target, Label::Distance) { Label* target, Label::Distance) {
ASM_CODE_COMMENT(masm_);
if (IsSignedCondition(cc)) { if (IsSignedCondition(cc)) {
__ CmpS64(lhs, rhs, r0); __ CmpS64(lhs, rhs, r0);
} else { } else {
...@@ -240,10 +250,12 @@ void BaselineAssembler::JumpIf(Condition cc, Register lhs, const Operand& rhs, ...@@ -240,10 +250,12 @@ void BaselineAssembler::JumpIf(Condition cc, Register lhs, const Operand& rhs,
} }
__ b(AsMasmCondition(cc), target); __ b(AsMasmCondition(cc), target);
} }
void BaselineAssembler::JumpIfObjectType(Condition cc, Register object, void BaselineAssembler::JumpIfObjectType(Condition cc, Register object,
InstanceType instance_type, InstanceType instance_type,
Register map, Label* target, Register map, Label* target,
Label::Distance) { Label::Distance) {
ASM_CODE_COMMENT(masm_);
ScratchRegisterScope temps(this); ScratchRegisterScope temps(this);
Register type = temps.AcquireScratch(); Register type = temps.AcquireScratch();
__ LoadMap(map, object); __ LoadMap(map, object);
...@@ -254,6 +266,7 @@ void BaselineAssembler::JumpIfObjectType(Condition cc, Register object, ...@@ -254,6 +266,7 @@ void BaselineAssembler::JumpIfObjectType(Condition cc, Register object,
void BaselineAssembler::JumpIfInstanceType(Condition cc, Register map, void BaselineAssembler::JumpIfInstanceType(Condition cc, Register map,
InstanceType instance_type, InstanceType instance_type,
Label* target, Label::Distance) { Label* target, Label::Distance) {
ASM_CODE_COMMENT(masm_);
ScratchRegisterScope temps(this); ScratchRegisterScope temps(this);
Register type = temps.AcquireScratch(); Register type = temps.AcquireScratch();
if (FLAG_debug_code) { if (FLAG_debug_code) {
...@@ -268,6 +281,7 @@ void BaselineAssembler::JumpIfInstanceType(Condition cc, Register map, ...@@ -268,6 +281,7 @@ void BaselineAssembler::JumpIfInstanceType(Condition cc, Register map,
void BaselineAssembler::JumpIfPointer(Condition cc, Register value, void BaselineAssembler::JumpIfPointer(Condition cc, Register value,
MemOperand operand, Label* target, MemOperand operand, Label* target,
Label::Distance) { Label::Distance) {
ASM_CODE_COMMENT(masm_);
ScratchRegisterScope temps(this); ScratchRegisterScope temps(this);
Register tmp = temps.AcquireScratch(); Register tmp = temps.AcquireScratch();
__ LoadU64(tmp, operand); __ LoadU64(tmp, operand);
...@@ -276,6 +290,7 @@ void BaselineAssembler::JumpIfPointer(Condition cc, Register value, ...@@ -276,6 +290,7 @@ void BaselineAssembler::JumpIfPointer(Condition cc, Register value,
void BaselineAssembler::JumpIfSmi(Condition cc, Register value, Smi smi, void BaselineAssembler::JumpIfSmi(Condition cc, Register value, Smi smi,
Label* target, Label::Distance) { Label* target, Label::Distance) {
ASM_CODE_COMMENT(masm_);
__ AssertSmi(value); __ AssertSmi(value);
__ LoadSmiLiteral(r0, smi); __ LoadSmiLiteral(r0, smi);
JumpIfHelper(masm_, cc, value, r0, target); JumpIfHelper(masm_, cc, value, r0, target);
...@@ -283,6 +298,7 @@ void BaselineAssembler::JumpIfSmi(Condition cc, Register value, Smi smi, ...@@ -283,6 +298,7 @@ void BaselineAssembler::JumpIfSmi(Condition cc, Register value, Smi smi,
void BaselineAssembler::JumpIfSmi(Condition cc, Register lhs, Register rhs, void BaselineAssembler::JumpIfSmi(Condition cc, Register lhs, Register rhs,
Label* target, Label::Distance) { Label* target, Label::Distance) {
ASM_CODE_COMMENT(masm_);
__ AssertSmi(lhs); __ AssertSmi(lhs);
__ AssertSmi(rhs); __ AssertSmi(rhs);
JumpIfHelper(masm_, cc, lhs, rhs, target); JumpIfHelper(masm_, cc, lhs, rhs, target);
...@@ -291,6 +307,7 @@ void BaselineAssembler::JumpIfSmi(Condition cc, Register lhs, Register rhs, ...@@ -291,6 +307,7 @@ void BaselineAssembler::JumpIfSmi(Condition cc, Register lhs, Register rhs,
void BaselineAssembler::JumpIfTagged(Condition cc, Register value, void BaselineAssembler::JumpIfTagged(Condition cc, Register value,
MemOperand operand, Label* target, MemOperand operand, Label* target,
Label::Distance) { Label::Distance) {
ASM_CODE_COMMENT(masm_);
__ LoadU64(r0, operand); __ LoadU64(r0, operand);
JumpIfHelper(masm_, cc, value, r0, target); JumpIfHelper(masm_, cc, value, r0, target);
} }
...@@ -298,44 +315,54 @@ void BaselineAssembler::JumpIfTagged(Condition cc, Register value, ...@@ -298,44 +315,54 @@ void BaselineAssembler::JumpIfTagged(Condition cc, Register value,
void BaselineAssembler::JumpIfTagged(Condition cc, MemOperand operand, void BaselineAssembler::JumpIfTagged(Condition cc, MemOperand operand,
Register value, Label* target, Register value, Label* target,
Label::Distance) { Label::Distance) {
ASM_CODE_COMMENT(masm_);
__ LoadU64(r0, operand); __ LoadU64(r0, operand);
JumpIfHelper(masm_, cc, r0, value, target); JumpIfHelper(masm_, cc, r0, value, target);
} }
void BaselineAssembler::JumpIfByte(Condition cc, Register value, int32_t byte, void BaselineAssembler::JumpIfByte(Condition cc, Register value, int32_t byte,
Label* target, Label::Distance) { Label* target, Label::Distance) {
ASM_CODE_COMMENT(masm_);
JumpIf(cc, value, Operand(byte), target); JumpIf(cc, value, Operand(byte), target);
} }
void BaselineAssembler::Move(interpreter::Register output, Register source) { void BaselineAssembler::Move(interpreter::Register output, Register source) {
ASM_CODE_COMMENT(masm_);
Move(RegisterFrameOperand(output), source); Move(RegisterFrameOperand(output), source);
} }
void BaselineAssembler::Move(Register output, TaggedIndex value) { void BaselineAssembler::Move(Register output, TaggedIndex value) {
ASM_CODE_COMMENT(masm_);
__ mov(output, Operand(value.ptr())); __ mov(output, Operand(value.ptr()));
} }
void BaselineAssembler::Move(MemOperand output, Register source) { void BaselineAssembler::Move(MemOperand output, Register source) {
ASM_CODE_COMMENT(masm_);
__ StoreU64(source, output); __ StoreU64(source, output);
} }
void BaselineAssembler::Move(Register output, ExternalReference reference) { void BaselineAssembler::Move(Register output, ExternalReference reference) {
ASM_CODE_COMMENT(masm_);
__ Move(output, reference); __ Move(output, reference);
} }
void BaselineAssembler::Move(Register output, Handle<HeapObject> value) { void BaselineAssembler::Move(Register output, Handle<HeapObject> value) {
ASM_CODE_COMMENT(masm_);
__ Move(output, value); __ Move(output, value);
} }
void BaselineAssembler::Move(Register output, int32_t value) { void BaselineAssembler::Move(Register output, int32_t value) {
ASM_CODE_COMMENT(masm_);
__ mov(output, Operand(value)); __ mov(output, Operand(value));
} }
void BaselineAssembler::MoveMaybeSmi(Register output, Register source) { void BaselineAssembler::MoveMaybeSmi(Register output, Register source) {
ASM_CODE_COMMENT(masm_);
__ mr(output, source); __ mr(output, source);
} }
void BaselineAssembler::MoveSmi(Register output, Register source) { void BaselineAssembler::MoveSmi(Register output, Register source) {
ASM_CODE_COMMENT(masm_);
__ mr(output, source); __ mr(output, source);
} }
...@@ -451,43 +478,58 @@ void BaselineAssembler::Pop(T... registers) { ...@@ -451,43 +478,58 @@ void BaselineAssembler::Pop(T... registers) {
void BaselineAssembler::LoadTaggedPointerField(Register output, Register source, void BaselineAssembler::LoadTaggedPointerField(Register output, Register source,
int offset) { int offset) {
ASM_CODE_COMMENT(masm_);
__ LoadTaggedPointerField(output, FieldMemOperand(source, offset), r0); __ LoadTaggedPointerField(output, FieldMemOperand(source, offset), r0);
} }
void BaselineAssembler::LoadTaggedSignedField(Register output, Register source, void BaselineAssembler::LoadTaggedSignedField(Register output, Register source,
int offset) { int offset) {
ASM_CODE_COMMENT(masm_);
__ LoadTaggedSignedField(output, FieldMemOperand(source, offset), r0); __ LoadTaggedSignedField(output, FieldMemOperand(source, offset), r0);
} }
void BaselineAssembler::LoadTaggedAnyField(Register output, Register source, void BaselineAssembler::LoadTaggedAnyField(Register output, Register source,
int offset) { int offset) {
ASM_CODE_COMMENT(masm_);
__ LoadAnyTaggedField(output, FieldMemOperand(source, offset), r0); __ LoadAnyTaggedField(output, FieldMemOperand(source, offset), r0);
} }
void BaselineAssembler::LoadWord16FieldZeroExtend(Register output, void BaselineAssembler::LoadWord16FieldZeroExtend(Register output,
Register source, int offset) { Register source, int offset) {
ASM_CODE_COMMENT(masm_);
__ LoadU16(output, FieldMemOperand(source, offset), r0); __ LoadU16(output, FieldMemOperand(source, offset), r0);
} }
void BaselineAssembler::LoadWord8Field(Register output, Register source, void BaselineAssembler::LoadWord8Field(Register output, Register source,
int offset) { int offset) {
ASM_CODE_COMMENT(masm_);
__ LoadU8(output, FieldMemOperand(source, offset), r0); __ LoadU8(output, FieldMemOperand(source, offset), r0);
} }
void BaselineAssembler::StoreTaggedSignedField(Register target, int offset, void BaselineAssembler::StoreTaggedSignedField(Register target, int offset,
Smi value) { Smi value) {
UNIMPLEMENTED(); ASM_CODE_COMMENT(masm_);
ScratchRegisterScope temps(this);
Register tmp = temps.AcquireScratch();
__ LoadSmiLiteral(tmp, value);
__ StoreTaggedField(tmp, FieldMemOperand(target, offset), r0);
} }
void BaselineAssembler::StoreTaggedFieldWithWriteBarrier(Register target, void BaselineAssembler::StoreTaggedFieldWithWriteBarrier(Register target,
int offset, int offset,
Register value) { Register value) {
UNIMPLEMENTED(); ASM_CODE_COMMENT(masm_);
Register scratch = WriteBarrierDescriptor::SlotAddressRegister();
DCHECK(!AreAliased(target, value, scratch));
__ StoreTaggedField(value, FieldMemOperand(target, offset), r0);
__ RecordWriteField(target, offset, value, scratch, kLRHasNotBeenSaved,
SaveFPRegsMode::kIgnore);
} }
void BaselineAssembler::StoreTaggedFieldNoWriteBarrier(Register target, void BaselineAssembler::StoreTaggedFieldNoWriteBarrier(Register target,
int offset, int offset,
Register value) { Register value) {
UNIMPLEMENTED(); ASM_CODE_COMMENT(masm_);
__ StoreTaggedField(value, FieldMemOperand(target, offset), r0);
} }
void BaselineAssembler::AddToInterruptBudgetAndJumpIfNotExceeded( void BaselineAssembler::AddToInterruptBudgetAndJumpIfNotExceeded(
......
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