OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1626 if (from.IsTagged()) { | 1626 if (from.IsTagged()) { |
1627 if (to.IsDouble()) { | 1627 if (to.IsDouble()) { |
1628 LOperand* value = UseRegister(instr->value()); | 1628 LOperand* value = UseRegister(instr->value()); |
1629 LNumberUntagD* res = new LNumberUntagD(value); | 1629 LNumberUntagD* res = new LNumberUntagD(value); |
1630 return AssignEnvironment(DefineAsRegister(res)); | 1630 return AssignEnvironment(DefineAsRegister(res)); |
1631 } else { | 1631 } else { |
1632 ASSERT(to.IsInteger32()); | 1632 ASSERT(to.IsInteger32()); |
1633 LOperand* value = UseRegister(instr->value()); | 1633 LOperand* value = UseRegister(instr->value()); |
1634 bool needs_check = !instr->value()->type().IsSmi(); | 1634 bool needs_check = !instr->value()->type().IsSmi(); |
1635 if (needs_check) { | 1635 if (needs_check) { |
1636 CpuFeatures* cpu_features = Isolate::Current()->cpu_features(); | |
1637 LOperand* xmm_temp = | 1636 LOperand* xmm_temp = |
1638 (instr->CanTruncateToInt32() && cpu_features->IsSupported(SSE3)) | 1637 (instr->CanTruncateToInt32() && CpuFeatures::IsSupported(SSE3)) |
1639 ? NULL | 1638 ? NULL |
1640 : FixedTemp(xmm1); | 1639 : FixedTemp(xmm1); |
1641 LTaggedToI* res = new LTaggedToI(value, xmm_temp); | 1640 LTaggedToI* res = new LTaggedToI(value, xmm_temp); |
1642 return AssignEnvironment(DefineSameAsFirst(res)); | 1641 return AssignEnvironment(DefineSameAsFirst(res)); |
1643 } else { | 1642 } else { |
1644 return DefineSameAsFirst(new LSmiUntag(value, needs_check)); | 1643 return DefineSameAsFirst(new LSmiUntag(value, needs_check)); |
1645 } | 1644 } |
1646 } | 1645 } |
1647 } else if (from.IsDouble()) { | 1646 } else if (from.IsDouble()) { |
1648 if (to.IsTagged()) { | 1647 if (to.IsTagged()) { |
1649 LOperand* value = UseRegister(instr->value()); | 1648 LOperand* value = UseRegister(instr->value()); |
1650 LOperand* temp = TempRegister(); | 1649 LOperand* temp = TempRegister(); |
1651 | 1650 |
1652 // Make sure that temp and result_temp are different registers. | 1651 // Make sure that temp and result_temp are different registers. |
1653 LUnallocated* result_temp = TempRegister(); | 1652 LUnallocated* result_temp = TempRegister(); |
1654 LNumberTagD* result = new LNumberTagD(value, temp); | 1653 LNumberTagD* result = new LNumberTagD(value, temp); |
1655 return AssignPointerMap(Define(result, result_temp)); | 1654 return AssignPointerMap(Define(result, result_temp)); |
1656 } else { | 1655 } else { |
1657 ASSERT(to.IsInteger32()); | 1656 ASSERT(to.IsInteger32()); |
1658 bool needs_temp = instr->CanTruncateToInt32() && | 1657 bool needs_temp = instr->CanTruncateToInt32() && |
1659 !Isolate::Current()->cpu_features()->IsSupported(SSE3); | 1658 !CpuFeatures::IsSupported(SSE3); |
1660 LOperand* value = needs_temp ? | 1659 LOperand* value = needs_temp ? |
1661 UseTempRegister(instr->value()) : UseRegister(instr->value()); | 1660 UseTempRegister(instr->value()) : UseRegister(instr->value()); |
1662 LOperand* temp = needs_temp ? TempRegister() : NULL; | 1661 LOperand* temp = needs_temp ? TempRegister() : NULL; |
1663 return AssignEnvironment(DefineAsRegister(new LDoubleToI(value, temp))); | 1662 return AssignEnvironment(DefineAsRegister(new LDoubleToI(value, temp))); |
1664 } | 1663 } |
1665 } else if (from.IsInteger32()) { | 1664 } else if (from.IsInteger32()) { |
1666 if (to.IsTagged()) { | 1665 if (to.IsTagged()) { |
1667 HValue* val = instr->value(); | 1666 HValue* val = instr->value(); |
1668 LOperand* value = UseRegister(val); | 1667 LOperand* value = UseRegister(val); |
1669 if (val->HasRange() && val->range()->IsInSmiRange()) { | 1668 if (val->HasRange() && val->range()->IsInSmiRange()) { |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2149 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2148 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
2150 HEnvironment* outer = current_block_->last_environment()->outer(); | 2149 HEnvironment* outer = current_block_->last_environment()->outer(); |
2151 current_block_->UpdateEnvironment(outer); | 2150 current_block_->UpdateEnvironment(outer); |
2152 return NULL; | 2151 return NULL; |
2153 } | 2152 } |
2154 | 2153 |
2155 | 2154 |
2156 } } // namespace v8::internal | 2155 } } // namespace v8::internal |
2157 | 2156 |
2158 #endif // V8_TARGET_ARCH_IA32 | 2157 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |