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 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1794 // representation change phase of Hydrogen. | 1794 // representation change phase of Hydrogen. |
1795 UNREACHABLE(); | 1795 UNREACHABLE(); |
1796 return NULL; | 1796 return NULL; |
1797 } | 1797 } |
1798 | 1798 |
1799 | 1799 |
1800 LInstruction* LChunkBuilder::DoChange(HChange* instr) { | 1800 LInstruction* LChunkBuilder::DoChange(HChange* instr) { |
1801 Representation from = instr->from(); | 1801 Representation from = instr->from(); |
1802 Representation to = instr->to(); | 1802 Representation to = instr->to(); |
1803 if (from.IsSmi()) { | 1803 if (from.IsSmi()) { |
1804 if (to.IsTagged()) { | 1804 if (to.IsSmiOrTagged()) { |
1805 LOperand* value = UseRegister(instr->value()); | 1805 LOperand* value = UseRegister(instr->value()); |
1806 return DefineSameAsFirst(new(zone()) LDummyUse(value)); | 1806 return DefineSameAsFirst(new(zone()) LDummyUse(value)); |
1807 } | 1807 } |
| 1808 if (to.IsInteger32()) { |
| 1809 LOperand* value = UseRegister(instr->value()); |
| 1810 return DefineSameAsFirst(new(zone()) LSmiUntag(value, false)); |
| 1811 } |
1808 from = Representation::Tagged(); | 1812 from = Representation::Tagged(); |
1809 } | 1813 } |
1810 // Only mark conversions that might need to allocate as calling rather than | 1814 // Only mark conversions that might need to allocate as calling rather than |
1811 // all changes. This makes simple, non-allocating conversion not have to force | 1815 // all changes. This makes simple, non-allocating conversion not have to force |
1812 // building a stack frame. | 1816 // building a stack frame. |
1813 if (from.IsTagged()) { | 1817 if (from.IsTagged()) { |
1814 if (to.IsDouble()) { | 1818 if (to.IsDouble()) { |
1815 info()->MarkAsDeferredCalling(); | 1819 info()->MarkAsDeferredCalling(); |
1816 LOperand* value = UseRegister(instr->value()); | 1820 LOperand* value = UseRegister(instr->value()); |
1817 LNumberUntagD* res = new(zone()) LNumberUntagD(value); | 1821 LNumberUntagD* res = new(zone()) LNumberUntagD(value); |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2525 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2529 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2526 LOperand* object = UseRegister(instr->object()); | 2530 LOperand* object = UseRegister(instr->object()); |
2527 LOperand* index = UseTempRegister(instr->index()); | 2531 LOperand* index = UseTempRegister(instr->index()); |
2528 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2532 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2529 } | 2533 } |
2530 | 2534 |
2531 | 2535 |
2532 } } // namespace v8::internal | 2536 } } // namespace v8::internal |
2533 | 2537 |
2534 #endif // V8_TARGET_ARCH_X64 | 2538 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |