Rename ReverseCondition to CommuteCondition, a more standard term.
R=dcarney@chromium.org, dcarney BUG= Review URL: https://codereview.chromium.org/313083006 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21677 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
bd857a7d10
commit
3c501d3a4b
@ -89,8 +89,8 @@ inline Condition NegateCondition(Condition cond) {
|
||||
}
|
||||
|
||||
|
||||
// Corresponds to transposing the operands of a comparison.
|
||||
inline Condition ReverseCondition(Condition cond) {
|
||||
// Commute a condition such that a cond b == b cond' b.
|
||||
inline Condition CommuteCondition(Condition cond) {
|
||||
switch (cond) {
|
||||
case lo:
|
||||
return hi;
|
||||
|
@ -2404,8 +2404,8 @@ void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) {
|
||||
} else {
|
||||
__ cmp(ToRegister(right), Operand(value));
|
||||
}
|
||||
// We transposed the operands. Reverse the condition.
|
||||
cond = ReverseCondition(cond);
|
||||
// We commuted the operands, so commute the condition.
|
||||
cond = CommuteCondition(cond);
|
||||
} else {
|
||||
__ cmp(ToRegister(left), ToRegister(right));
|
||||
}
|
||||
@ -4148,7 +4148,7 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
|
||||
Operand index = ToOperand(instr->index());
|
||||
Register length = ToRegister(instr->length());
|
||||
__ cmp(length, index);
|
||||
cc = ReverseCondition(cc);
|
||||
cc = CommuteCondition(cc);
|
||||
} else {
|
||||
Register index = ToRegister(instr->index());
|
||||
Operand length = ToOperand(instr->length());
|
||||
|
@ -265,8 +265,8 @@ inline Condition NegateCondition(Condition cond) {
|
||||
return static_cast<Condition>(cond ^ 1);
|
||||
}
|
||||
|
||||
// Corresponds to transposing the operands of a comparison.
|
||||
inline Condition ReverseCondition(Condition cond) {
|
||||
// Commute a condition such that a cond b == b cond' b.
|
||||
inline Condition CommuteCondition(Condition cond) {
|
||||
switch (cond) {
|
||||
case lo:
|
||||
return hi;
|
||||
|
@ -1848,7 +1848,7 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck *instr) {
|
||||
Operand index = ToOperand32I(instr->index());
|
||||
Register length = ToRegister32(instr->length());
|
||||
__ Cmp(length, index);
|
||||
cond = ReverseCondition(cond);
|
||||
cond = CommuteCondition(cond);
|
||||
} else {
|
||||
Register index = ToRegister32(instr->index());
|
||||
Operand length = ToOperand32I(instr->length());
|
||||
@ -2486,10 +2486,10 @@ void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) {
|
||||
__ Fcmp(ToDoubleRegister(left),
|
||||
ToDouble(LConstantOperand::cast(right)));
|
||||
} else if (left->IsConstantOperand()) {
|
||||
// Transpose the operands and reverse the condition.
|
||||
// Commute the operands and the condition.
|
||||
__ Fcmp(ToDoubleRegister(right),
|
||||
ToDouble(LConstantOperand::cast(left)));
|
||||
cond = ReverseCondition(cond);
|
||||
cond = CommuteCondition(cond);
|
||||
} else {
|
||||
__ Fcmp(ToDoubleRegister(left), ToDoubleRegister(right));
|
||||
}
|
||||
@ -2506,9 +2506,9 @@ void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) {
|
||||
ToRegister32(left),
|
||||
ToOperand32I(right));
|
||||
} else {
|
||||
// Transpose the operands and reverse the condition.
|
||||
// Commute the operands and the condition.
|
||||
EmitCompareAndBranch(instr,
|
||||
ReverseCondition(cond),
|
||||
CommuteCondition(cond),
|
||||
ToRegister32(right),
|
||||
ToOperand32I(left));
|
||||
}
|
||||
@ -2521,10 +2521,10 @@ void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) {
|
||||
ToRegister(left),
|
||||
Operand(Smi::FromInt(value)));
|
||||
} else if (left->IsConstantOperand()) {
|
||||
// Transpose the operands and reverse the condition.
|
||||
// Commute the operands and the condition.
|
||||
int32_t value = ToInteger32(LConstantOperand::cast(left));
|
||||
EmitCompareAndBranch(instr,
|
||||
ReverseCondition(cond),
|
||||
CommuteCondition(cond),
|
||||
ToRegister(right),
|
||||
Operand(Smi::FromInt(value)));
|
||||
} else {
|
||||
|
@ -246,8 +246,8 @@ inline Condition NegateCondition(Condition cc) {
|
||||
}
|
||||
|
||||
|
||||
// Corresponds to transposing the operands of a comparison.
|
||||
inline Condition ReverseCondition(Condition cc) {
|
||||
// Commute a condition such that a cond b == b cond' b.
|
||||
inline Condition CommuteCondition(Condition cc) {
|
||||
switch (cc) {
|
||||
case below:
|
||||
return above;
|
||||
|
@ -2270,8 +2270,8 @@ void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) {
|
||||
} else if (left->IsConstantOperand()) {
|
||||
__ cmp(ToOperand(right),
|
||||
ToImmediate(left, instr->hydrogen()->representation()));
|
||||
// We transposed the operands. Reverse the condition.
|
||||
cc = ReverseCondition(cc);
|
||||
// We commuted the operands, so commute the condition.
|
||||
cc = CommuteCondition(cc);
|
||||
} else {
|
||||
__ cmp(ToRegister(left), ToOperand(right));
|
||||
}
|
||||
@ -4064,7 +4064,7 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
|
||||
__ cmp(ToOperand(instr->length()),
|
||||
ToImmediate(LConstantOperand::cast(instr->index()),
|
||||
instr->hydrogen()->length()->representation()));
|
||||
cc = ReverseCondition(cc);
|
||||
cc = CommuteCondition(cc);
|
||||
} else if (instr->length()->IsConstantOperand()) {
|
||||
__ cmp(ToOperand(instr->index()),
|
||||
ToImmediate(LConstantOperand::cast(instr->length()),
|
||||
|
@ -504,7 +504,8 @@ inline Condition NegateCondition(Condition cc) {
|
||||
}
|
||||
|
||||
|
||||
inline Condition ReverseCondition(Condition cc) {
|
||||
// Commute a condition such that a cond b == b cond' b.
|
||||
inline Condition CommuteCondition(Condition cc) {
|
||||
switch (cc) {
|
||||
case Uless:
|
||||
return Ugreater;
|
||||
|
@ -2324,8 +2324,8 @@ void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) {
|
||||
cmp_left = ToRegister(right);
|
||||
cmp_right = Operand(value);
|
||||
}
|
||||
// We transposed the operands. Reverse the condition.
|
||||
cond = ReverseCondition(cond);
|
||||
// We commuted the operands, so commute the condition.
|
||||
cond = CommuteCondition(cond);
|
||||
} else {
|
||||
cmp_left = ToRegister(left);
|
||||
cmp_right = Operand(ToRegister(right));
|
||||
@ -4142,7 +4142,7 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
|
||||
if (instr->index()->IsConstantOperand()) {
|
||||
operand = ToOperand(instr->index());
|
||||
reg = ToRegister(instr->length());
|
||||
cc = ReverseCondition(cc);
|
||||
cc = CommuteCondition(cc);
|
||||
} else {
|
||||
reg = ToRegister(instr->index());
|
||||
operand = ToOperand(instr->length());
|
||||
|
@ -326,8 +326,8 @@ inline Condition NegateCondition(Condition cc) {
|
||||
}
|
||||
|
||||
|
||||
// Corresponds to transposing the operands of a comparison.
|
||||
inline Condition ReverseCondition(Condition cc) {
|
||||
// Commute a condition such that a cond b == b cond' b.
|
||||
inline Condition CommuteCondition(Condition cc) {
|
||||
switch (cc) {
|
||||
case below:
|
||||
return above;
|
||||
|
@ -2276,8 +2276,8 @@ void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) {
|
||||
} else {
|
||||
__ cmpl(ToOperand(right), Immediate(value));
|
||||
}
|
||||
// We transposed the operands. Reverse the condition.
|
||||
cc = ReverseCondition(cc);
|
||||
// We commuted the operands, so commute the condition.
|
||||
cc = CommuteCondition(cc);
|
||||
} else if (instr->hydrogen_value()->representation().IsSmi()) {
|
||||
if (right->IsRegister()) {
|
||||
__ cmpp(ToRegister(left), ToRegister(right));
|
||||
@ -4118,7 +4118,7 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
|
||||
} else {
|
||||
__ cmpl(index, Immediate(length));
|
||||
}
|
||||
cc = ReverseCondition(cc);
|
||||
cc = CommuteCondition(cc);
|
||||
} else if (instr->index()->IsConstantOperand()) {
|
||||
int32_t index = ToInteger32(LConstantOperand::cast(instr->index()));
|
||||
if (instr->length()->IsRegister()) {
|
||||
|
@ -238,8 +238,8 @@ inline Condition NegateCondition(Condition cc) {
|
||||
}
|
||||
|
||||
|
||||
// Corresponds to transposing the operands of a comparison.
|
||||
inline Condition ReverseCondition(Condition cc) {
|
||||
// Commute a condition such that a cond b == b cond' b.
|
||||
inline Condition CommuteCondition(Condition cc) {
|
||||
switch (cc) {
|
||||
case below:
|
||||
return above;
|
||||
|
@ -2404,8 +2404,8 @@ void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) {
|
||||
} else if (left->IsConstantOperand()) {
|
||||
__ cmp(ToOperand(right),
|
||||
ToImmediate(left, instr->hydrogen()->representation()));
|
||||
// We transposed the operands. Reverse the condition.
|
||||
cc = ReverseCondition(cc);
|
||||
// We commuted the operands, so commute the condition.
|
||||
cc = CommuteCondition(cc);
|
||||
} else {
|
||||
__ cmp(ToRegister(left), ToOperand(right));
|
||||
}
|
||||
@ -3974,7 +3974,7 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
|
||||
__ cmp(ToOperand(instr->length()),
|
||||
ToImmediate(LConstantOperand::cast(instr->index()),
|
||||
instr->hydrogen()->length()->representation()));
|
||||
cc = ReverseCondition(cc);
|
||||
cc = CommuteCondition(cc);
|
||||
} else if (instr->length()->IsConstantOperand()) {
|
||||
__ cmp(ToOperand(instr->index()),
|
||||
ToImmediate(LConstantOperand::cast(instr->length()),
|
||||
|
Loading…
Reference in New Issue
Block a user