| 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 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1756 return NULL; | 1756 return NULL; |
| 1757 } | 1757 } |
| 1758 | 1758 |
| 1759 | 1759 |
| 1760 LInstruction* LChunkBuilder::DoChange(HChange* instr) { | 1760 LInstruction* LChunkBuilder::DoChange(HChange* instr) { |
| 1761 Representation from = instr->from(); | 1761 Representation from = instr->from(); |
| 1762 Representation to = instr->to(); | 1762 Representation to = instr->to(); |
| 1763 if (from.IsSmi()) { | 1763 if (from.IsSmi()) { |
| 1764 if (to.IsTagged()) { | 1764 if (to.IsTagged()) { |
| 1765 LOperand* value = UseRegister(instr->value()); | 1765 LOperand* value = UseRegister(instr->value()); |
| 1766 // For now, always deopt on hole. |
| 1767 if (instr->value()->IsLoadKeyed() && |
| 1768 HLoadKeyed::cast(instr->value())->UsesMustHandleHole()) { |
| 1769 return AssignEnvironment( |
| 1770 DefineSameAsFirst(new(zone()) LCheckSmiAndReturn(value))); |
| 1771 } |
| 1766 return DefineSameAsFirst(new(zone()) LDummyUse(value)); | 1772 return DefineSameAsFirst(new(zone()) LDummyUse(value)); |
| 1767 } | 1773 } |
| 1768 from = Representation::Tagged(); | 1774 from = Representation::Tagged(); |
| 1769 } | 1775 } |
| 1770 if (from.IsTagged()) { | 1776 if (from.IsTagged()) { |
| 1771 if (to.IsDouble()) { | 1777 if (to.IsDouble()) { |
| 1772 info()->MarkAsDeferredCalling(); | 1778 info()->MarkAsDeferredCalling(); |
| 1773 LOperand* value = UseRegister(instr->value()); | 1779 LOperand* value = UseRegister(instr->value()); |
| 1774 LNumberUntagD* res = new(zone()) LNumberUntagD(value); | 1780 LNumberUntagD* res = new(zone()) LNumberUntagD(value); |
| 1775 return AssignEnvironment(DefineAsRegister(res)); | 1781 return AssignEnvironment(DefineAsRegister(res)); |
| 1776 } else if (to.IsSmi()) { | 1782 } else if (to.IsSmi()) { |
| 1777 HValue* val = instr->value(); | 1783 HValue* val = instr->value(); |
| 1778 LOperand* value = UseRegisterAtStart(val); | 1784 LOperand* value = UseRegister(val); |
| 1779 return AssignEnvironment( | 1785 return AssignEnvironment( |
| 1780 DefineSameAsFirst(new(zone()) LCheckSmi(value))); | 1786 DefineSameAsFirst(new(zone()) LCheckSmiAndReturn(value))); |
| 1781 } else { | 1787 } else { |
| 1782 ASSERT(to.IsInteger32()); | 1788 ASSERT(to.IsInteger32()); |
| 1783 LOperand* value = NULL; | 1789 LOperand* value = NULL; |
| 1784 LInstruction* res = NULL; | 1790 LInstruction* res = NULL; |
| 1785 if (instr->value()->type().IsSmi()) { | 1791 if (instr->value()->type().IsSmi()) { |
| 1786 value = UseRegisterAtStart(instr->value()); | 1792 value = UseRegisterAtStart(instr->value()); |
| 1787 res = DefineAsRegister(new(zone()) LSmiUntag(value, false)); | 1793 res = DefineAsRegister(new(zone()) LSmiUntag(value, false)); |
| 1788 if (instr->value()->IsLoadKeyed()) { | 1794 if (instr->value()->IsLoadKeyed()) { |
| 1789 HLoadKeyed* load_keyed = HLoadKeyed::cast(instr->value()); | 1795 HLoadKeyed* load_keyed = HLoadKeyed::cast(instr->value()); |
| 1790 if (load_keyed->UsesMustHandleHole() && | 1796 if (load_keyed->UsesMustHandleHole() && |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2515 | 2521 |
| 2516 | 2522 |
| 2517 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2523 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2518 LOperand* object = UseRegister(instr->object()); | 2524 LOperand* object = UseRegister(instr->object()); |
| 2519 LOperand* index = UseRegister(instr->index()); | 2525 LOperand* index = UseRegister(instr->index()); |
| 2520 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2526 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
| 2521 } | 2527 } |
| 2522 | 2528 |
| 2523 | 2529 |
| 2524 } } // namespace v8::internal | 2530 } } // namespace v8::internal |
| OLD | NEW |