Index: src/arm/lithium-arm.cc |
=================================================================== |
--- src/arm/lithium-arm.cc (revision 6618) |
+++ src/arm/lithium-arm.cc (working copy) |
@@ -158,6 +158,9 @@ |
case Token::MUL: return "mul-t"; |
case Token::MOD: return "mod-t"; |
case Token::DIV: return "div-t"; |
+ case Token::BIT_AND: return "bit-and-t"; |
+ case Token::BIT_OR: return "bit-or-t"; |
+ case Token::BIT_XOR: return "bit-xor-t"; |
default: |
UNREACHABLE(); |
return NULL; |
@@ -750,13 +753,23 @@ |
LInstruction* LChunkBuilder::DoBit(Token::Value op, |
HBitwiseBinaryOperation* instr) { |
- ASSERT(instr->representation().IsInteger32()); |
- ASSERT(instr->left()->representation().IsInteger32()); |
- ASSERT(instr->right()->representation().IsInteger32()); |
+ if (instr->representation().IsInteger32()) { |
+ ASSERT(instr->left()->representation().IsInteger32()); |
+ ASSERT(instr->right()->representation().IsInteger32()); |
- LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand()); |
- LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand()); |
- return DefineSameAsFirst(new LBitI(op, left, right)); |
+ LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand()); |
+ LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand()); |
+ return DefineSameAsFirst(new LBitI(op, left, right)); |
+ } else { |
+ ASSERT(instr->representation().IsTagged()); |
+ ASSERT(instr->left()->representation().IsTagged()); |
+ ASSERT(instr->right()->representation().IsTagged()); |
+ |
+ LOperand* left = UseFixed(instr->left(), r1); |
+ LOperand* right = UseFixed(instr->right(), r0); |
+ LArithmeticT* result = new LArithmeticT(op, left, right); |
+ return MarkAsCall(DefineFixed(result, r0), instr); |
+ } |
} |