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 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1882 // representation change phase of Hydrogen. | 1882 // representation change phase of Hydrogen. |
1883 UNREACHABLE(); | 1883 UNREACHABLE(); |
1884 return NULL; | 1884 return NULL; |
1885 } | 1885 } |
1886 | 1886 |
1887 | 1887 |
1888 LInstruction* LChunkBuilder::DoChange(HChange* instr) { | 1888 LInstruction* LChunkBuilder::DoChange(HChange* instr) { |
1889 Representation from = instr->from(); | 1889 Representation from = instr->from(); |
1890 Representation to = instr->to(); | 1890 Representation to = instr->to(); |
1891 if (from.IsSmi()) { | 1891 if (from.IsSmi()) { |
1892 if (to.IsTagged()) { | 1892 if (to.IsSmiOrTagged()) { |
1893 LOperand* value = UseRegister(instr->value()); | 1893 LOperand* value = UseRegister(instr->value()); |
1894 return DefineSameAsFirst(new(zone()) LDummyUse(value)); | 1894 return DefineSameAsFirst(new(zone()) LDummyUse(value)); |
1895 } | 1895 } |
| 1896 if (to.IsInteger32()) { |
| 1897 LOperand* value = UseRegister(instr->value()); |
| 1898 return DefineSameAsFirst(new(zone()) LSmiUntag(value, false)); |
| 1899 } |
1896 from = Representation::Tagged(); | 1900 from = Representation::Tagged(); |
1897 } | 1901 } |
1898 if (from.IsTagged()) { | 1902 if (from.IsTagged()) { |
1899 if (to.IsDouble()) { | 1903 if (to.IsDouble()) { |
1900 info()->MarkAsDeferredCalling(); | 1904 info()->MarkAsDeferredCalling(); |
1901 LOperand* value = UseRegister(instr->value()); | 1905 LOperand* value = UseRegister(instr->value()); |
1902 LNumberUntagD* res = new(zone()) LNumberUntagD(value); | 1906 LNumberUntagD* res = new(zone()) LNumberUntagD(value); |
1903 return AssignEnvironment(DefineAsRegister(res)); | 1907 return AssignEnvironment(DefineAsRegister(res)); |
1904 } else if (to.IsSmi()) { | 1908 } else if (to.IsSmi()) { |
1905 HValue* val = instr->value(); | 1909 HValue* val = instr->value(); |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2592 | 2596 |
2593 | 2597 |
2594 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2598 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2595 LOperand* object = UseRegister(instr->object()); | 2599 LOperand* object = UseRegister(instr->object()); |
2596 LOperand* index = UseRegister(instr->index()); | 2600 LOperand* index = UseRegister(instr->index()); |
2597 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2601 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2598 } | 2602 } |
2599 | 2603 |
2600 | 2604 |
2601 } } // namespace v8::internal | 2605 } } // namespace v8::internal |
OLD | NEW |