| 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 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1743 // Register allocator doesn't (yet) support allocation of double | 1743 // Register allocator doesn't (yet) support allocation of double |
| 1744 // temps. Reserve xmm1 explicitly. | 1744 // temps. Reserve xmm1 explicitly. |
| 1745 LClampTToUint8* result = new(zone()) LClampTToUint8(reg, | 1745 LClampTToUint8* result = new(zone()) LClampTToUint8(reg, |
| 1746 TempRegister(), | 1746 TempRegister(), |
| 1747 FixedTemp(xmm1)); | 1747 FixedTemp(xmm1)); |
| 1748 return AssignEnvironment(DefineSameAsFirst(result)); | 1748 return AssignEnvironment(DefineSameAsFirst(result)); |
| 1749 } | 1749 } |
| 1750 } | 1750 } |
| 1751 | 1751 |
| 1752 | 1752 |
| 1753 LInstruction* LChunkBuilder::DoToInt32(HToInt32* instr) { | |
| 1754 HValue* value = instr->value(); | |
| 1755 Representation input_rep = value->representation(); | |
| 1756 LOperand* reg = UseRegister(value); | |
| 1757 if (input_rep.IsDouble()) { | |
| 1758 return AssignEnvironment(DefineAsRegister(new(zone()) LDoubleToI(reg))); | |
| 1759 } else if (input_rep.IsInteger32()) { | |
| 1760 // Canonicalization should already have removed the hydrogen instruction in | |
| 1761 // this case, since it is a noop. | |
| 1762 UNREACHABLE(); | |
| 1763 return NULL; | |
| 1764 } else { | |
| 1765 ASSERT(input_rep.IsTagged()); | |
| 1766 LOperand* reg = UseRegister(value); | |
| 1767 // Register allocator doesn't (yet) support allocation of double | |
| 1768 // temps. Reserve xmm1 explicitly. | |
| 1769 LOperand* xmm_temp = | |
| 1770 CpuFeatures::IsSupported(SSE3) | |
| 1771 ? NULL | |
| 1772 : FixedTemp(xmm1); | |
| 1773 return AssignEnvironment( | |
| 1774 DefineSameAsFirst(new(zone()) LTaggedToI(reg, xmm_temp))); | |
| 1775 } | |
| 1776 } | |
| 1777 | |
| 1778 | |
| 1779 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { | 1753 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { |
| 1780 return new(zone()) LReturn(UseFixed(instr->value(), rax)); | 1754 return new(zone()) LReturn(UseFixed(instr->value(), rax)); |
| 1781 } | 1755 } |
| 1782 | 1756 |
| 1783 | 1757 |
| 1784 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { | 1758 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { |
| 1785 Representation r = instr->representation(); | 1759 Representation r = instr->representation(); |
| 1786 if (r.IsInteger32()) { | 1760 if (r.IsInteger32()) { |
| 1787 return DefineAsRegister(new(zone()) LConstantI); | 1761 return DefineAsRegister(new(zone()) LConstantI); |
| 1788 } else if (r.IsDouble()) { | 1762 } else if (r.IsDouble()) { |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2327 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2301 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2328 LOperand* object = UseRegister(instr->object()); | 2302 LOperand* object = UseRegister(instr->object()); |
| 2329 LOperand* index = UseTempRegister(instr->index()); | 2303 LOperand* index = UseTempRegister(instr->index()); |
| 2330 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2304 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2331 } | 2305 } |
| 2332 | 2306 |
| 2333 | 2307 |
| 2334 } } // namespace v8::internal | 2308 } } // namespace v8::internal |
| 2335 | 2309 |
| 2336 #endif // V8_TARGET_ARCH_X64 | 2310 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |