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 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1809 LOperand* reg = UseFixed(value, eax); | 1809 LOperand* reg = UseFixed(value, eax); |
1810 // Register allocator doesn't (yet) support allocation of double | 1810 // Register allocator doesn't (yet) support allocation of double |
1811 // temps. Reserve xmm1 explicitly. | 1811 // temps. Reserve xmm1 explicitly. |
1812 LOperand* temp = FixedTemp(xmm1); | 1812 LOperand* temp = FixedTemp(xmm1); |
1813 LClampTToUint8* result = new(zone()) LClampTToUint8(reg, temp); | 1813 LClampTToUint8* result = new(zone()) LClampTToUint8(reg, temp); |
1814 return AssignEnvironment(DefineFixed(result, eax)); | 1814 return AssignEnvironment(DefineFixed(result, eax)); |
1815 } | 1815 } |
1816 } | 1816 } |
1817 | 1817 |
1818 | 1818 |
1819 LInstruction* LChunkBuilder::DoToInt32(HToInt32* instr) { | |
1820 HValue* value = instr->value(); | |
1821 Representation input_rep = value->representation(); | |
1822 | |
1823 LInstruction* result; | |
1824 if (input_rep.IsDouble()) { | |
1825 LOperand* reg = UseRegister(value); | |
1826 LOperand* temp_reg = | |
1827 CpuFeatures::IsSupported(SSE3) ? NULL : TempRegister(); | |
1828 result = DefineAsRegister(new(zone()) LDoubleToI(reg, temp_reg)); | |
1829 } else if (input_rep.IsInteger32()) { | |
1830 // Canonicalization should already have removed the hydrogen instruction in | |
1831 // this case, since it is a noop. | |
1832 UNREACHABLE(); | |
1833 return NULL; | |
1834 } else { | |
1835 ASSERT(input_rep.IsTagged()); | |
1836 LOperand* reg = UseRegister(value); | |
1837 // Register allocator doesn't (yet) support allocation of double | |
1838 // temps. Reserve xmm1 explicitly. | |
1839 LOperand* xmm_temp = | |
1840 CpuFeatures::IsSupported(SSE3) ? NULL : FixedTemp(xmm1); | |
1841 result = DefineSameAsFirst(new(zone()) LTaggedToI(reg, xmm_temp)); | |
1842 } | |
1843 return AssignEnvironment(result); | |
1844 } | |
1845 | |
1846 | |
1847 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { | 1819 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { |
1848 return new(zone()) LReturn(UseFixed(instr->value(), eax)); | 1820 return new(zone()) LReturn(UseFixed(instr->value(), eax)); |
1849 } | 1821 } |
1850 | 1822 |
1851 | 1823 |
1852 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { | 1824 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { |
1853 Representation r = instr->representation(); | 1825 Representation r = instr->representation(); |
1854 if (r.IsInteger32()) { | 1826 if (r.IsInteger32()) { |
1855 return DefineAsRegister(new(zone()) LConstantI); | 1827 return DefineAsRegister(new(zone()) LConstantI); |
1856 } else if (r.IsDouble()) { | 1828 } else if (r.IsDouble()) { |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2443 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2415 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2444 LOperand* object = UseRegister(instr->object()); | 2416 LOperand* object = UseRegister(instr->object()); |
2445 LOperand* index = UseTempRegister(instr->index()); | 2417 LOperand* index = UseTempRegister(instr->index()); |
2446 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2418 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2447 } | 2419 } |
2448 | 2420 |
2449 | 2421 |
2450 } } // namespace v8::internal | 2422 } } // namespace v8::internal |
2451 | 2423 |
2452 #endif // V8_TARGET_ARCH_IA32 | 2424 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |