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 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1636 return NULL; | 1636 return NULL; |
1637 } | 1637 } |
1638 | 1638 |
1639 | 1639 |
1640 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) { | 1640 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) { |
1641 LOperand* value = UseFixed(instr->value(), r0); | 1641 LOperand* value = UseFixed(instr->value(), r0); |
1642 return MarkAsCall(new LThrow(value), instr); | 1642 return MarkAsCall(new LThrow(value), instr); |
1643 } | 1643 } |
1644 | 1644 |
1645 | 1645 |
| 1646 LInstruction* LChunkBuilder::DoForceRepresentation(HForceRepresentation* bad) { |
| 1647 // All HForceRepresentation instructions should be eliminated in the |
| 1648 // representation change phase of Hydrogen. |
| 1649 UNREACHABLE(); |
| 1650 return NULL; |
| 1651 } |
| 1652 |
| 1653 |
1646 LInstruction* LChunkBuilder::DoChange(HChange* instr) { | 1654 LInstruction* LChunkBuilder::DoChange(HChange* instr) { |
1647 Representation from = instr->from(); | 1655 Representation from = instr->from(); |
1648 Representation to = instr->to(); | 1656 Representation to = instr->to(); |
1649 if (from.IsTagged()) { | 1657 if (from.IsTagged()) { |
1650 if (to.IsDouble()) { | 1658 if (to.IsDouble()) { |
1651 LOperand* value = UseRegister(instr->value()); | 1659 LOperand* value = UseRegister(instr->value()); |
1652 LNumberUntagD* res = new LNumberUntagD(value); | 1660 LNumberUntagD* res = new LNumberUntagD(value); |
1653 return AssignEnvironment(DefineAsRegister(res)); | 1661 return AssignEnvironment(DefineAsRegister(res)); |
1654 } else { | 1662 } else { |
1655 ASSERT(to.IsInteger32()); | 1663 ASSERT(to.IsInteger32()); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1744 } | 1752 } |
1745 | 1753 |
1746 | 1754 |
1747 LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) { | 1755 LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) { |
1748 LOperand* value = UseRegisterAtStart(instr->value()); | 1756 LOperand* value = UseRegisterAtStart(instr->value()); |
1749 LInstruction* result = new LCheckMap(value); | 1757 LInstruction* result = new LCheckMap(value); |
1750 return AssignEnvironment(result); | 1758 return AssignEnvironment(result); |
1751 } | 1759 } |
1752 | 1760 |
1753 | 1761 |
| 1762 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { |
| 1763 HValue* value = instr->value(); |
| 1764 Representation input_rep = value->representation(); |
| 1765 LOperand* reg = UseRegister(value); |
| 1766 if (input_rep.IsDouble()) { |
| 1767 return DefineAsRegister(new LClampDToUint8(reg, FixedTemp(d1))); |
| 1768 } else if (input_rep.IsInteger32()) { |
| 1769 return DefineAsRegister(new LClampIToUint8(reg)); |
| 1770 } else { |
| 1771 ASSERT(input_rep.IsTagged()); |
| 1772 // Register allocator doesn't (yet) support allocation of double |
| 1773 // temps. Reserve d1 explicitly. |
| 1774 LClampTToUint8* result = new LClampTToUint8(reg, FixedTemp(d1)); |
| 1775 return AssignEnvironment(DefineAsRegister(result)); |
| 1776 } |
| 1777 } |
| 1778 |
| 1779 |
1754 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { | 1780 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { |
1755 return new LReturn(UseFixed(instr->value(), r0)); | 1781 return new LReturn(UseFixed(instr->value(), r0)); |
1756 } | 1782 } |
1757 | 1783 |
1758 | 1784 |
1759 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { | 1785 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { |
1760 Representation r = instr->representation(); | 1786 Representation r = instr->representation(); |
1761 if (r.IsInteger32()) { | 1787 if (r.IsInteger32()) { |
1762 return DefineAsRegister(new LConstantI); | 1788 return DefineAsRegister(new LConstantI); |
1763 } else if (r.IsDouble()) { | 1789 } else if (r.IsDouble()) { |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2180 | 2206 |
2181 LInstruction* LChunkBuilder::DoIn(HIn* instr) { | 2207 LInstruction* LChunkBuilder::DoIn(HIn* instr) { |
2182 LOperand* key = UseRegisterAtStart(instr->key()); | 2208 LOperand* key = UseRegisterAtStart(instr->key()); |
2183 LOperand* object = UseRegisterAtStart(instr->object()); | 2209 LOperand* object = UseRegisterAtStart(instr->object()); |
2184 LIn* result = new LIn(key, object); | 2210 LIn* result = new LIn(key, object); |
2185 return MarkAsCall(DefineFixed(result, r0), instr); | 2211 return MarkAsCall(DefineFixed(result, r0), instr); |
2186 } | 2212 } |
2187 | 2213 |
2188 | 2214 |
2189 } } // namespace v8::internal | 2215 } } // namespace v8::internal |
OLD | NEW |