Commit a925b6b8 authored by palfia@homejinni.com's avatar palfia@homejinni.com

MIPS: Refactoring and cleanup of control instructions.

Port r15513 (6f50861)

BUG=

Review URL: https://codereview.chromium.org/18359004
Patch from Balazs Kilvady <kilvadyb@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15527 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5eb8ddf4
...@@ -2202,7 +2202,7 @@ Condition LCodeGen::TokenToCondition(Token::Value op, bool is_unsigned) { ...@@ -2202,7 +2202,7 @@ Condition LCodeGen::TokenToCondition(Token::Value op, bool is_unsigned) {
} }
void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) { void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) {
LOperand* left = instr->left(); LOperand* left = instr->left();
LOperand* right = instr->right(); LOperand* right = instr->right();
Condition cond = TokenToCondition(instr->op(), false); Condition cond = TokenToCondition(instr->op(), false);
......
...@@ -187,7 +187,7 @@ LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) { ...@@ -187,7 +187,7 @@ LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) {
} }
void LCmpIDAndBranch::PrintDataTo(StringStream* stream) { void LCompareNumericAndBranch::PrintDataTo(StringStream* stream) {
stream->Add("if "); stream->Add("if ");
left()->PrintTo(stream); left()->PrintTo(stream);
stream->Add(" %s ", Token::String(op())); stream->Add(" %s ", Token::String(op()));
...@@ -1606,8 +1606,8 @@ LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { ...@@ -1606,8 +1606,8 @@ LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
} }
LInstruction* LChunkBuilder::DoCompareIDAndBranch( LInstruction* LChunkBuilder::DoCompareNumericAndBranch(
HCompareIDAndBranch* instr) { HCompareNumericAndBranch* instr) {
Representation r = instr->representation(); Representation r = instr->representation();
if (r.IsSmiOrInteger32()) { if (r.IsSmiOrInteger32()) {
ASSERT(instr->left()->representation().IsSmiOrInteger32()); ASSERT(instr->left()->representation().IsSmiOrInteger32());
...@@ -1615,14 +1615,14 @@ LInstruction* LChunkBuilder::DoCompareIDAndBranch( ...@@ -1615,14 +1615,14 @@ LInstruction* LChunkBuilder::DoCompareIDAndBranch(
instr->right()->representation())); instr->right()->representation()));
LOperand* left = UseRegisterOrConstantAtStart(instr->left()); LOperand* left = UseRegisterOrConstantAtStart(instr->left());
LOperand* right = UseRegisterOrConstantAtStart(instr->right()); LOperand* right = UseRegisterOrConstantAtStart(instr->right());
return new(zone()) LCmpIDAndBranch(left, right); return new(zone()) LCompareNumericAndBranch(left, right);
} else { } else {
ASSERT(r.IsDouble()); ASSERT(r.IsDouble());
ASSERT(instr->left()->representation().IsDouble()); ASSERT(instr->left()->representation().IsDouble());
ASSERT(instr->right()->representation().IsDouble()); ASSERT(instr->right()->representation().IsDouble());
LOperand* left = UseRegisterAtStart(instr->left()); LOperand* left = UseRegisterAtStart(instr->left());
LOperand* right = UseRegisterAtStart(instr->right()); LOperand* right = UseRegisterAtStart(instr->right());
return new(zone()) LCmpIDAndBranch(left, right); return new(zone()) LCompareNumericAndBranch(left, right);
} }
} }
......
...@@ -81,7 +81,7 @@ class LCodeGen; ...@@ -81,7 +81,7 @@ class LCodeGen;
V(ClampTToUint8) \ V(ClampTToUint8) \
V(ClassOfTestAndBranch) \ V(ClassOfTestAndBranch) \
V(CmpConstantEqAndBranch) \ V(CmpConstantEqAndBranch) \
V(CmpIDAndBranch) \ V(CompareNumericAndBranch) \
V(CmpObjectEqAndBranch) \ V(CmpObjectEqAndBranch) \
V(CmpMapAndBranch) \ V(CmpMapAndBranch) \
V(CmpT) \ V(CmpT) \
...@@ -712,9 +712,9 @@ class LDebugBreak: public LTemplateInstruction<0, 0, 0> { ...@@ -712,9 +712,9 @@ class LDebugBreak: public LTemplateInstruction<0, 0, 0> {
}; };
class LCmpIDAndBranch: public LControlInstruction<2, 0> { class LCompareNumericAndBranch: public LControlInstruction<2, 0> {
public: public:
LCmpIDAndBranch(LOperand* left, LOperand* right) { LCompareNumericAndBranch(LOperand* left, LOperand* right) {
inputs_[0] = left; inputs_[0] = left;
inputs_[1] = right; inputs_[1] = right;
} }
...@@ -722,8 +722,9 @@ class LCmpIDAndBranch: public LControlInstruction<2, 0> { ...@@ -722,8 +722,9 @@ class LCmpIDAndBranch: public LControlInstruction<2, 0> {
LOperand* left() { return inputs_[0]; } LOperand* left() { return inputs_[0]; }
LOperand* right() { return inputs_[1]; } LOperand* right() { return inputs_[1]; }
DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch") DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch,
DECLARE_HYDROGEN_ACCESSOR(CompareIDAndBranch) "compare-numeric-and-branch")
DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch)
Token::Value op() const { return hydrogen()->token(); } Token::Value op() const { return hydrogen()->token(); }
bool is_double() const { bool is_double() const {
......
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