Index: src/x64/lithium-x64.cc |
diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc |
index 25c22cc18f2e48a37f4c097b80932c5329eca8ac..fa7829cdd723188b464c2863e47f5ff05dbc3dd8 100644 |
--- a/src/x64/lithium-x64.cc |
+++ b/src/x64/lithium-x64.cc |
@@ -787,8 +787,8 @@ LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, |
op == Token::SUB); |
HValue* left = instr->left(); |
HValue* right = instr->right(); |
- ASSERT(left->representation().IsSmiOrTagged()); |
- ASSERT(right->representation().IsSmiOrTagged()); |
+ ASSERT(left->representation().IsTagged()); |
+ ASSERT(right->representation().IsTagged()); |
LOperand* left_operand = UseFixed(left, rdx); |
LOperand* right_operand = UseFixed(right, rax); |
LArithmeticT* result = |
@@ -1319,17 +1319,17 @@ LInstruction* LChunkBuilder::DoShl(HShl* instr) { |
LInstruction* LChunkBuilder::DoBitwise(HBitwise* instr) { |
- if (instr->representation().IsInteger32()) { |
- ASSERT(instr->left()->representation().IsInteger32()); |
- ASSERT(instr->right()->representation().IsInteger32()); |
+ if (instr->representation().IsSmiOrInteger32()) { |
+ ASSERT(instr->left()->representation().Equals(instr->representation())); |
+ ASSERT(instr->right()->representation().Equals(instr->representation())); |
LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); |
LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); |
return DefineSameAsFirst(new(zone()) LBitI(left, right)); |
} else { |
- ASSERT(instr->representation().IsSmiOrTagged()); |
- ASSERT(instr->left()->representation().IsSmiOrTagged()); |
- ASSERT(instr->right()->representation().IsSmiOrTagged()); |
+ ASSERT(instr->representation().IsTagged()); |
+ ASSERT(instr->left()->representation().IsTagged()); |
+ ASSERT(instr->right()->representation().IsTagged()); |
LOperand* left = UseFixed(instr->left(), rdx); |
LOperand* right = UseFixed(instr->right(), rax); |
@@ -1352,7 +1352,9 @@ LInstruction* LChunkBuilder::DoBitNot(HBitNot* instr) { |
LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { |
if (instr->representation().IsDouble()) { |
return DoArithmeticD(Token::DIV, instr); |
- } else if (instr->representation().IsInteger32()) { |
+ } else if (instr->representation().IsSmiOrInteger32()) { |
+ ASSERT(instr->left()->representation().Equals(instr->representation())); |
+ ASSERT(instr->right()->representation().Equals(instr->representation())); |
if (instr->HasPowerOf2Divisor()) { |
ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero)); |
LOperand* value = UseRegisterAtStart(instr->left()); |
@@ -1368,7 +1370,7 @@ LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { |
LDivI* result = new(zone()) LDivI(dividend, divisor, temp); |
return AssignEnvironment(DefineFixed(result, rax)); |
} else { |
- ASSERT(instr->representation().IsSmiOrTagged()); |
+ ASSERT(instr->representation().IsTagged()); |
return DoArithmeticT(Token::DIV, instr); |
} |
} |
@@ -1432,9 +1434,9 @@ LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) { |
LInstruction* LChunkBuilder::DoMod(HMod* instr) { |
HValue* left = instr->left(); |
HValue* right = instr->right(); |
- if (instr->representation().IsInteger32()) { |
- ASSERT(left->representation().IsInteger32()); |
- ASSERT(right->representation().IsInteger32()); |
+ if (instr->representation().IsSmiOrInteger32()) { |
+ ASSERT(left->representation().Equals(instr->representation())); |
+ ASSERT(right->representation().Equals(instr->representation())); |
if (instr->HasPowerOf2Divisor()) { |
ASSERT(!right->CanBeZero()); |
LModI* mod = new(zone()) LModI(UseRegisterAtStart(left), |
@@ -1467,7 +1469,7 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) { |
? AssignEnvironment(result) |
: result; |
} |
- } else if (instr->representation().IsSmiOrTagged()) { |
+ } else if (instr->representation().IsTagged()) { |
return DoArithmeticT(Token::MOD, instr); |
} else { |
ASSERT(instr->representation().IsDouble()); |
@@ -1483,9 +1485,9 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) { |
LInstruction* LChunkBuilder::DoMul(HMul* instr) { |
- if (instr->representation().IsInteger32()) { |
- ASSERT(instr->left()->representation().IsInteger32()); |
- ASSERT(instr->right()->representation().IsInteger32()); |
+ if (instr->representation().IsSmiOrInteger32()) { |
+ ASSERT(instr->left()->representation().Equals(instr->representation())); |
+ ASSERT(instr->right()->representation().Equals(instr->representation())); |
LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); |
LOperand* right = UseOrConstant(instr->BetterRightOperand()); |
LMulI* mul = new(zone()) LMulI(left, right); |
@@ -1497,16 +1499,16 @@ LInstruction* LChunkBuilder::DoMul(HMul* instr) { |
} else if (instr->representation().IsDouble()) { |
return DoArithmeticD(Token::MUL, instr); |
} else { |
- ASSERT(instr->representation().IsSmiOrTagged()); |
+ ASSERT(instr->representation().IsTagged()); |
return DoArithmeticT(Token::MUL, instr); |
} |
} |
LInstruction* LChunkBuilder::DoSub(HSub* instr) { |
- if (instr->representation().IsInteger32()) { |
- ASSERT(instr->left()->representation().IsInteger32()); |
- ASSERT(instr->right()->representation().IsInteger32()); |
+ if (instr->representation().IsSmiOrInteger32()) { |
+ ASSERT(instr->left()->representation().Equals(instr->representation())); |
+ ASSERT(instr->right()->representation().Equals(instr->representation())); |
LOperand* left = UseRegisterAtStart(instr->left()); |
LOperand* right = UseOrConstantAtStart(instr->right()); |
LSubI* sub = new(zone()) LSubI(left, right); |
@@ -1518,21 +1520,21 @@ LInstruction* LChunkBuilder::DoSub(HSub* instr) { |
} else if (instr->representation().IsDouble()) { |
return DoArithmeticD(Token::SUB, instr); |
} else { |
- ASSERT(instr->representation().IsSmiOrTagged()); |
+ ASSERT(instr->representation().IsTagged()); |
return DoArithmeticT(Token::SUB, instr); |
} |
} |
LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { |
- if (instr->representation().IsInteger32()) { |
+ if (instr->representation().IsSmiOrInteger32()) { |
// Check to see if it would be advantageous to use an lea instruction rather |
// than an add. This is the case when no overflow check is needed and there |
// are multiple uses of the add's inputs, so using a 3-register add will |
// preserve all input values for later uses. |
bool use_lea = LAddI::UseLea(instr); |
- ASSERT(instr->left()->representation().IsInteger32()); |
- ASSERT(instr->right()->representation().IsInteger32()); |
+ ASSERT(instr->left()->representation().Equals(instr->representation())); |
+ ASSERT(instr->right()->representation().Equals(instr->representation())); |
LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); |
HValue* right_candidate = instr->BetterRightOperand(); |
LOperand* right = use_lea |
@@ -1550,7 +1552,7 @@ LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { |
} else if (instr->representation().IsDouble()) { |
return DoArithmeticD(Token::ADD, instr); |
} else { |
- ASSERT(instr->representation().IsSmiOrTagged()); |
+ ASSERT(instr->representation().IsTagged()); |
return DoArithmeticT(Token::ADD, instr); |
} |
return NULL; |