Index: src/arm64/lithium-codegen-arm64.cc |
diff --git a/src/arm64/lithium-codegen-arm64.cc b/src/arm64/lithium-codegen-arm64.cc |
index 3ecd2403ba3b6aa0848006d90439a11b746e0bc3..91a34eb01d9deb8172399f4ef9f9a804f8013b13 100644 |
--- a/src/arm64/lithium-codegen-arm64.cc |
+++ b/src/arm64/lithium-codegen-arm64.cc |
@@ -1255,6 +1255,19 @@ Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const { |
} |
+Operand LCodeGen::ToShiftedRightOperand32( |
+ LOperand* right, LShiftedRightOpInterface* shift_info, |
+ IntegerSignedness signedness) { |
+ if (shift_info->shift() == NO_SHIFT) { |
+ return (signedness == SIGNED_INT32) ? ToOperand32I(right) |
+ : ToOperand32U(right); |
+ } else { |
+ return Operand( |
+ ToRegister32(right), |
+ shift_info->shift(), |
+ ToInteger32(LConstantOperand::cast(shift_info->shift_amount())) & 0x1f); |
ulan
2014/05/02 10:01:18
Could you name the 0x1f constant since it is used
Alexandre Rames
2014/05/02 13:51:44
Abstracted the constant and used a helper.
|
+ } |
+} |
ulan
2014/05/02 10:01:18
Two empty lines after function.
Alexandre Rames
2014/05/02 13:51:44
Done.
|
bool LCodeGen::IsSmi(LConstantOperand* op) const { |
return chunk_->LookupLiteralRepresentation(op).IsSmi(); |
} |
@@ -1451,7 +1464,8 @@ void LCodeGen::DoAddI(LAddI* instr) { |
bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); |
Register result = ToRegister32(instr->result()); |
Register left = ToRegister32(instr->left()); |
- Operand right = ToOperand32I(instr->right()); |
+ Operand right = ToShiftedRightOperand32I(instr->right(), instr); |
+ |
if (can_overflow) { |
__ Adds(result, left, right); |
DeoptimizeIf(vs, instr->environment()); |
@@ -1725,7 +1739,7 @@ void LCodeGen::DoArithmeticT(LArithmeticT* instr) { |
void LCodeGen::DoBitI(LBitI* instr) { |
Register result = ToRegister32(instr->result()); |
Register left = ToRegister32(instr->left()); |
- Operand right = ToOperand32U(instr->right()); |
+ Operand right = ToShiftedRightOperand32U(instr->right(), instr); |
switch (instr->op()) { |
case Token::BIT_AND: __ And(result, left, right); break; |
@@ -5411,7 +5425,8 @@ void LCodeGen::DoSubI(LSubI* instr) { |
bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); |
Register result = ToRegister32(instr->result()); |
Register left = ToRegister32(instr->left()); |
- Operand right = ToOperand32I(instr->right()); |
+ Operand right = ToShiftedRightOperand32I(instr->right(), instr); |
+ |
if (can_overflow) { |
__ Subs(result, left, right); |
DeoptimizeIf(vs, instr->environment()); |