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 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1760 } else { | 1760 } else { |
1761 ASSERT(input_rep.IsTagged()); | 1761 ASSERT(input_rep.IsTagged()); |
1762 // Register allocator doesn't (yet) support allocation of double | 1762 // Register allocator doesn't (yet) support allocation of double |
1763 // temps. Reserve d1 explicitly. | 1763 // temps. Reserve d1 explicitly. |
1764 LClampTToUint8* result = new LClampTToUint8(reg, FixedTemp(d1)); | 1764 LClampTToUint8* result = new LClampTToUint8(reg, FixedTemp(d1)); |
1765 return AssignEnvironment(DefineAsRegister(result)); | 1765 return AssignEnvironment(DefineAsRegister(result)); |
1766 } | 1766 } |
1767 } | 1767 } |
1768 | 1768 |
1769 | 1769 |
| 1770 LInstruction* LChunkBuilder::DoToInt32(HToInt32* instr) { |
| 1771 HValue* value = instr->value(); |
| 1772 Representation input_rep = value->representation(); |
| 1773 LOperand* reg = UseRegister(value); |
| 1774 if (input_rep.IsDouble()) { |
| 1775 LOperand* temp1 = TempRegister(); |
| 1776 LOperand* temp2 = TempRegister(); |
| 1777 LDoubleToI* res = new LDoubleToI(reg, temp1, temp2); |
| 1778 return AssignEnvironment(DefineAsRegister(res)); |
| 1779 } else if (input_rep.IsInteger32()) { |
| 1780 // Canonicalization should already have removed the hydrogen instruction in |
| 1781 // this case, since it is a noop. |
| 1782 UNREACHABLE(); |
| 1783 return NULL; |
| 1784 } else { |
| 1785 ASSERT(input_rep.IsTagged()); |
| 1786 LOperand* temp1 = TempRegister(); |
| 1787 LOperand* temp2 = TempRegister(); |
| 1788 LOperand* temp3 = FixedTemp(d3); |
| 1789 LTaggedToI* res = new LTaggedToI(reg, temp1, temp2, temp3); |
| 1790 return AssigneEnvironment(DefineSameAsFirst(res)); |
| 1791 } |
| 1792 } |
| 1793 |
| 1794 |
1770 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { | 1795 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { |
1771 return new LReturn(UseFixed(instr->value(), r0)); | 1796 return new LReturn(UseFixed(instr->value(), r0)); |
1772 } | 1797 } |
1773 | 1798 |
1774 | 1799 |
1775 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { | 1800 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { |
1776 Representation r = instr->representation(); | 1801 Representation r = instr->representation(); |
1777 if (r.IsInteger32()) { | 1802 if (r.IsInteger32()) { |
1778 return DefineAsRegister(new LConstantI); | 1803 return DefineAsRegister(new LConstantI); |
1779 } else if (r.IsDouble()) { | 1804 } else if (r.IsDouble()) { |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2197 | 2222 |
2198 LInstruction* LChunkBuilder::DoIn(HIn* instr) { | 2223 LInstruction* LChunkBuilder::DoIn(HIn* instr) { |
2199 LOperand* key = UseRegisterAtStart(instr->key()); | 2224 LOperand* key = UseRegisterAtStart(instr->key()); |
2200 LOperand* object = UseRegisterAtStart(instr->object()); | 2225 LOperand* object = UseRegisterAtStart(instr->object()); |
2201 LIn* result = new LIn(key, object); | 2226 LIn* result = new LIn(key, object); |
2202 return MarkAsCall(DefineFixed(result, r0), instr); | 2227 return MarkAsCall(DefineFixed(result, r0), instr); |
2203 } | 2228 } |
2204 | 2229 |
2205 | 2230 |
2206 } } // namespace v8::internal | 2231 } } // namespace v8::internal |
OLD | NEW |