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 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1901 } | 1901 } |
1902 if (from.IsTagged()) { | 1902 if (from.IsTagged()) { |
1903 if (to.IsDouble()) { | 1903 if (to.IsDouble()) { |
1904 info()->MarkAsDeferredCalling(); | 1904 info()->MarkAsDeferredCalling(); |
1905 LOperand* value = UseRegister(instr->value()); | 1905 LOperand* value = UseRegister(instr->value()); |
1906 LNumberUntagD* res = new(zone()) LNumberUntagD(value); | 1906 LNumberUntagD* res = new(zone()) LNumberUntagD(value); |
1907 return AssignEnvironment(DefineAsRegister(res)); | 1907 return AssignEnvironment(DefineAsRegister(res)); |
1908 } else if (to.IsSmi()) { | 1908 } else if (to.IsSmi()) { |
1909 HValue* val = instr->value(); | 1909 HValue* val = instr->value(); |
1910 LOperand* value = UseRegister(val); | 1910 LOperand* value = UseRegister(val); |
| 1911 if (val->type().IsSmi()) { |
| 1912 return DefineSameAsFirst(new(zone()) LDummyUse(value)); |
| 1913 } |
1911 return AssignEnvironment( | 1914 return AssignEnvironment( |
1912 DefineSameAsFirst(new(zone()) LCheckSmiAndReturn(value))); | 1915 DefineSameAsFirst(new(zone()) LCheckSmiAndReturn(value))); |
1913 } else { | 1916 } else { |
1914 ASSERT(to.IsInteger32()); | 1917 ASSERT(to.IsInteger32()); |
1915 LOperand* value = NULL; | 1918 LOperand* value = NULL; |
1916 LInstruction* res = NULL; | 1919 LInstruction* res = NULL; |
1917 if (instr->value()->type().IsSmi()) { | 1920 if (instr->value()->type().IsSmi()) { |
1918 value = UseRegisterAtStart(instr->value()); | 1921 value = UseRegisterAtStart(instr->value()); |
1919 res = DefineAsRegister(new(zone()) LSmiUntag(value, false)); | 1922 res = DefineAsRegister(new(zone()) LSmiUntag(value, false)); |
1920 if (instr->value()->IsLoadKeyed()) { | 1923 if (instr->value()->IsLoadKeyed()) { |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2639 | 2642 |
2640 | 2643 |
2641 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2644 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2642 LOperand* object = UseRegister(instr->object()); | 2645 LOperand* object = UseRegister(instr->object()); |
2643 LOperand* index = UseRegister(instr->index()); | 2646 LOperand* index = UseRegister(instr->index()); |
2644 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2647 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2645 } | 2648 } |
2646 | 2649 |
2647 | 2650 |
2648 } } // namespace v8::internal | 2651 } } // namespace v8::internal |
OLD | NEW |