OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "ia32/lithium-codegen-ia32.h" | 9 #include "ia32/lithium-codegen-ia32.h" |
10 #include "ic.h" | 10 #include "ic.h" |
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1638 } else { | 1638 } else { |
1639 __ ror(ToRegister(left), shift_count); | 1639 __ ror(ToRegister(left), shift_count); |
1640 } | 1640 } |
1641 break; | 1641 break; |
1642 case Token::SAR: | 1642 case Token::SAR: |
1643 if (shift_count != 0) { | 1643 if (shift_count != 0) { |
1644 __ sar(ToRegister(left), shift_count); | 1644 __ sar(ToRegister(left), shift_count); |
1645 } | 1645 } |
1646 break; | 1646 break; |
1647 case Token::SHR: | 1647 case Token::SHR: |
1648 if (shift_count == 0 && instr->can_deopt()) { | 1648 if (shift_count != 0) { |
| 1649 __ shr(ToRegister(left), shift_count); |
| 1650 } else if (instr->can_deopt()) { |
1649 __ test(ToRegister(left), ToRegister(left)); | 1651 __ test(ToRegister(left), ToRegister(left)); |
1650 DeoptimizeIf(sign, instr->environment()); | 1652 DeoptimizeIf(sign, instr->environment()); |
1651 } else { | |
1652 __ shr(ToRegister(left), shift_count); | |
1653 } | 1653 } |
1654 break; | 1654 break; |
1655 case Token::SHL: | 1655 case Token::SHL: |
1656 if (shift_count != 0) { | 1656 if (shift_count != 0) { |
1657 if (instr->hydrogen_value()->representation().IsSmi() && | 1657 if (instr->hydrogen_value()->representation().IsSmi() && |
1658 instr->can_deopt()) { | 1658 instr->can_deopt()) { |
1659 if (shift_count != 1) { | 1659 if (shift_count != 1) { |
1660 __ shl(ToRegister(left), shift_count - 1); | 1660 __ shl(ToRegister(left), shift_count - 1); |
1661 } | 1661 } |
1662 __ SmiTag(ToRegister(left)); | 1662 __ SmiTag(ToRegister(left)); |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2236 default: | 2236 default: |
2237 UNREACHABLE(); | 2237 UNREACHABLE(); |
2238 } | 2238 } |
2239 return cond; | 2239 return cond; |
2240 } | 2240 } |
2241 | 2241 |
2242 | 2242 |
2243 void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) { | 2243 void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) { |
2244 LOperand* left = instr->left(); | 2244 LOperand* left = instr->left(); |
2245 LOperand* right = instr->right(); | 2245 LOperand* right = instr->right(); |
2246 Condition cc = TokenToCondition(instr->op(), instr->is_double()); | 2246 bool is_unsigned = |
| 2247 instr->is_double() || instr->hydrogen()->CheckFlag(HInstruction::kUint32); |
| 2248 Condition cc = TokenToCondition(instr->op(), is_unsigned); |
2247 | 2249 |
2248 if (left->IsConstantOperand() && right->IsConstantOperand()) { | 2250 if (left->IsConstantOperand() && right->IsConstantOperand()) { |
2249 // We can statically evaluate the comparison. | 2251 // We can statically evaluate the comparison. |
2250 double left_val = ToDouble(LConstantOperand::cast(left)); | 2252 double left_val = ToDouble(LConstantOperand::cast(left)); |
2251 double right_val = ToDouble(LConstantOperand::cast(right)); | 2253 double right_val = ToDouble(LConstantOperand::cast(right)); |
2252 int next_block = EvalComparison(instr->op(), left_val, right_val) ? | 2254 int next_block = EvalComparison(instr->op(), left_val, right_val) ? |
2253 instr->TrueDestination(chunk_) : instr->FalseDestination(chunk_); | 2255 instr->TrueDestination(chunk_) : instr->FalseDestination(chunk_); |
2254 EmitGoto(next_block); | 2256 EmitGoto(next_block); |
2255 } else { | 2257 } else { |
2256 if (instr->is_double()) { | 2258 if (instr->is_double()) { |
(...skipping 3431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5688 __ bind(deferred->exit()); | 5690 __ bind(deferred->exit()); |
5689 __ bind(&done); | 5691 __ bind(&done); |
5690 } | 5692 } |
5691 | 5693 |
5692 | 5694 |
5693 #undef __ | 5695 #undef __ |
5694 | 5696 |
5695 } } // namespace v8::internal | 5697 } } // namespace v8::internal |
5696 | 5698 |
5697 #endif // V8_TARGET_ARCH_IA32 | 5699 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |