OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1776 LTaggedToI* res = new(zone()) LTaggedToI(value, xmm_temp); | 1776 LTaggedToI* res = new(zone()) LTaggedToI(value, xmm_temp); |
1777 return AssignEnvironment(DefineSameAsFirst(res)); | 1777 return AssignEnvironment(DefineSameAsFirst(res)); |
1778 } | 1778 } |
1779 } | 1779 } |
1780 } else if (from.IsDouble()) { | 1780 } else if (from.IsDouble()) { |
1781 if (to.IsTagged()) { | 1781 if (to.IsTagged()) { |
1782 info()->MarkAsDeferredCalling(); | 1782 info()->MarkAsDeferredCalling(); |
1783 LOperand* value = CpuFeatures::IsSupported(SSE2) | 1783 LOperand* value = CpuFeatures::IsSupported(SSE2) |
1784 ? UseRegisterAtStart(instr->value()) | 1784 ? UseRegisterAtStart(instr->value()) |
1785 : UseAtStart(instr->value()); | 1785 : UseAtStart(instr->value()); |
1786 LOperand* temp = TempRegister(); | 1786 LOperand* temp = FLAG_inline_new ? TempRegister() : NULL; |
1787 | 1787 |
1788 // Make sure that temp and result_temp are different registers. | 1788 // Make sure that temp and result_temp are different registers. |
1789 LUnallocated* result_temp = TempRegister(); | 1789 LUnallocated* result_temp = TempRegister(); |
1790 LNumberTagD* result = new(zone()) LNumberTagD(value, temp); | 1790 LNumberTagD* result = new(zone()) LNumberTagD(value, temp); |
1791 return AssignPointerMap(Define(result, result_temp)); | 1791 return AssignPointerMap(Define(result, result_temp)); |
1792 } else { | 1792 } else { |
1793 ASSERT(to.IsInteger32()); | 1793 ASSERT(to.IsInteger32()); |
1794 bool truncating = instr->CanTruncateToInt32(); | 1794 bool truncating = instr->CanTruncateToInt32(); |
1795 bool needs_temp = truncating && !CpuFeatures::IsSupported(SSE3); | 1795 bool needs_temp = truncating && !CpuFeatures::IsSupported(SSE3); |
1796 LOperand* value = needs_temp ? | 1796 LOperand* value = needs_temp ? |
1797 UseTempRegister(instr->value()) : UseRegister(instr->value()); | 1797 UseTempRegister(instr->value()) : UseRegister(instr->value()); |
1798 LOperand* temp = needs_temp ? TempRegister() : NULL; | 1798 LOperand* temp = needs_temp ? TempRegister() : NULL; |
1799 return AssignEnvironment( | 1799 return AssignEnvironment( |
1800 DefineAsRegister(new(zone()) LDoubleToI(value, temp))); | 1800 DefineAsRegister(new(zone()) LDoubleToI(value, temp))); |
1801 } | 1801 } |
1802 } else if (from.IsInteger32()) { | 1802 } else if (from.IsInteger32()) { |
1803 info()->MarkAsDeferredCalling(); | 1803 info()->MarkAsDeferredCalling(); |
1804 if (to.IsTagged()) { | 1804 if (to.IsTagged()) { |
1805 HValue* val = instr->value(); | 1805 HValue* val = instr->value(); |
1806 LOperand* value = UseRegister(val); | 1806 LOperand* value = UseRegister(val); |
1807 if (val->HasRange() && val->range()->IsInSmiRange()) { | 1807 if (val->HasRange() && val->range()->IsInSmiRange()) { |
1808 return DefineSameAsFirst(new(zone()) LSmiTag(value)); | 1808 return DefineSameAsFirst(new(zone()) LSmiTag(value)); |
1809 } else if (val->CheckFlag(HInstruction::kUint32)) { | 1809 } else if (val->CheckFlag(HInstruction::kUint32)) { |
1810 LOperand* temp = FixedTemp(xmm1); | 1810 LNumberTagU* result = new(zone()) LNumberTagU(value); |
1811 LNumberTagU* result = new(zone()) LNumberTagU(value, temp); | |
1812 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); | 1811 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); |
1813 } else { | 1812 } else { |
1814 LNumberTagI* result = new(zone()) LNumberTagI(value); | 1813 LNumberTagI* result = new(zone()) LNumberTagI(value); |
1815 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); | 1814 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); |
1816 } | 1815 } |
1817 } else { | 1816 } else { |
1818 ASSERT(to.IsDouble()); | 1817 ASSERT(to.IsDouble()); |
1819 if (instr->value()->CheckFlag(HInstruction::kUint32)) { | 1818 if (instr->value()->CheckFlag(HInstruction::kUint32)) { |
1820 LOperand* temp = FixedTemp(xmm1); | 1819 LOperand* temp = FixedTemp(xmm1); |
1821 return DefineAsRegister( | 1820 return DefineAsRegister( |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2512 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2511 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2513 LOperand* object = UseRegister(instr->object()); | 2512 LOperand* object = UseRegister(instr->object()); |
2514 LOperand* index = UseTempRegister(instr->index()); | 2513 LOperand* index = UseTempRegister(instr->index()); |
2515 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2514 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2516 } | 2515 } |
2517 | 2516 |
2518 | 2517 |
2519 } } // namespace v8::internal | 2518 } } // namespace v8::internal |
2520 | 2519 |
2521 #endif // V8_TARGET_ARCH_IA32 | 2520 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |