| 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 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1180 receiver, | 1180 receiver, |
| 1181 length, | 1181 length, |
| 1182 elements, | 1182 elements, |
| 1183 temp); | 1183 temp); |
| 1184 return MarkAsCall(DefineFixed(result, eax), instr, CAN_DEOPTIMIZE_EAGERLY); | 1184 return MarkAsCall(DefineFixed(result, eax), instr, CAN_DEOPTIMIZE_EAGERLY); |
| 1185 } | 1185 } |
| 1186 | 1186 |
| 1187 | 1187 |
| 1188 LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) { | 1188 LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) { |
| 1189 ++argument_count_; | 1189 ++argument_count_; |
| 1190 LOperand* argument = UseAny(instr->argument()); | 1190 LOperand* argument = UseOrConstant(instr->argument()); |
| 1191 return new LPushArgument(argument); | 1191 return new LPushArgument(argument); |
| 1192 } | 1192 } |
| 1193 | 1193 |
| 1194 | 1194 |
| 1195 LInstruction* LChunkBuilder::DoContext(HContext* instr) { | 1195 LInstruction* LChunkBuilder::DoContext(HContext* instr) { |
| 1196 return DefineAsRegister(new LContext); | 1196 return DefineAsRegister(new LContext); |
| 1197 } | 1197 } |
| 1198 | 1198 |
| 1199 | 1199 |
| 1200 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) { | 1200 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) { |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1626 if (from.IsTagged()) { | 1626 if (from.IsTagged()) { |
| 1627 if (to.IsDouble()) { | 1627 if (to.IsDouble()) { |
| 1628 LOperand* value = UseRegister(instr->value()); | 1628 LOperand* value = UseRegister(instr->value()); |
| 1629 LNumberUntagD* res = new LNumberUntagD(value); | 1629 LNumberUntagD* res = new LNumberUntagD(value); |
| 1630 return AssignEnvironment(DefineAsRegister(res)); | 1630 return AssignEnvironment(DefineAsRegister(res)); |
| 1631 } else { | 1631 } else { |
| 1632 ASSERT(to.IsInteger32()); | 1632 ASSERT(to.IsInteger32()); |
| 1633 LOperand* value = UseRegister(instr->value()); | 1633 LOperand* value = UseRegister(instr->value()); |
| 1634 bool needs_check = !instr->value()->type().IsSmi(); | 1634 bool needs_check = !instr->value()->type().IsSmi(); |
| 1635 if (needs_check) { | 1635 if (needs_check) { |
| 1636 CpuFeatures* cpu_features = Isolate::Current()->cpu_features(); |
| 1636 LOperand* xmm_temp = | 1637 LOperand* xmm_temp = |
| 1637 (instr->CanTruncateToInt32() && CpuFeatures::IsSupported(SSE3)) | 1638 (instr->CanTruncateToInt32() && cpu_features->IsSupported(SSE3)) |
| 1638 ? NULL | 1639 ? NULL |
| 1639 : FixedTemp(xmm1); | 1640 : FixedTemp(xmm1); |
| 1640 LTaggedToI* res = new LTaggedToI(value, xmm_temp); | 1641 LTaggedToI* res = new LTaggedToI(value, xmm_temp); |
| 1641 return AssignEnvironment(DefineSameAsFirst(res)); | 1642 return AssignEnvironment(DefineSameAsFirst(res)); |
| 1642 } else { | 1643 } else { |
| 1643 return DefineSameAsFirst(new LSmiUntag(value, needs_check)); | 1644 return DefineSameAsFirst(new LSmiUntag(value, needs_check)); |
| 1644 } | 1645 } |
| 1645 } | 1646 } |
| 1646 } else if (from.IsDouble()) { | 1647 } else if (from.IsDouble()) { |
| 1647 if (to.IsTagged()) { | 1648 if (to.IsTagged()) { |
| 1648 LOperand* value = UseRegister(instr->value()); | 1649 LOperand* value = UseRegister(instr->value()); |
| 1649 LOperand* temp = TempRegister(); | 1650 LOperand* temp = TempRegister(); |
| 1650 | 1651 |
| 1651 // Make sure that temp and result_temp are different registers. | 1652 // Make sure that temp and result_temp are different registers. |
| 1652 LUnallocated* result_temp = TempRegister(); | 1653 LUnallocated* result_temp = TempRegister(); |
| 1653 LNumberTagD* result = new LNumberTagD(value, temp); | 1654 LNumberTagD* result = new LNumberTagD(value, temp); |
| 1654 return AssignPointerMap(Define(result, result_temp)); | 1655 return AssignPointerMap(Define(result, result_temp)); |
| 1655 } else { | 1656 } else { |
| 1656 ASSERT(to.IsInteger32()); | 1657 ASSERT(to.IsInteger32()); |
| 1657 bool needs_temp = instr->CanTruncateToInt32() && | 1658 bool needs_temp = instr->CanTruncateToInt32() && |
| 1658 !CpuFeatures::IsSupported(SSE3); | 1659 !Isolate::Current()->cpu_features()->IsSupported(SSE3); |
| 1659 LOperand* value = needs_temp ? | 1660 LOperand* value = needs_temp ? |
| 1660 UseTempRegister(instr->value()) : UseRegister(instr->value()); | 1661 UseTempRegister(instr->value()) : UseRegister(instr->value()); |
| 1661 LOperand* temp = needs_temp ? TempRegister() : NULL; | 1662 LOperand* temp = needs_temp ? TempRegister() : NULL; |
| 1662 return AssignEnvironment(DefineAsRegister(new LDoubleToI(value, temp))); | 1663 return AssignEnvironment(DefineAsRegister(new LDoubleToI(value, temp))); |
| 1663 } | 1664 } |
| 1664 } else if (from.IsInteger32()) { | 1665 } else if (from.IsInteger32()) { |
| 1665 if (to.IsTagged()) { | 1666 if (to.IsTagged()) { |
| 1666 HValue* val = instr->value(); | 1667 HValue* val = instr->value(); |
| 1667 LOperand* value = UseRegister(val); | 1668 LOperand* value = UseRegister(val); |
| 1668 if (val->HasRange() && val->range()->IsInSmiRange()) { | 1669 if (val->HasRange() && val->range()->IsInSmiRange()) { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1738 return DefineAsRegister(new LConstantD(temp)); | 1739 return DefineAsRegister(new LConstantD(temp)); |
| 1739 } else if (r.IsTagged()) { | 1740 } else if (r.IsTagged()) { |
| 1740 return DefineAsRegister(new LConstantT); | 1741 return DefineAsRegister(new LConstantT); |
| 1741 } else { | 1742 } else { |
| 1742 UNREACHABLE(); | 1743 UNREACHABLE(); |
| 1743 return NULL; | 1744 return NULL; |
| 1744 } | 1745 } |
| 1745 } | 1746 } |
| 1746 | 1747 |
| 1747 | 1748 |
| 1748 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { | 1749 LInstruction* LChunkBuilder::DoLoadGlobal(HLoadGlobal* instr) { |
| 1749 LLoadGlobalCell* result = new LLoadGlobalCell; | 1750 LLoadGlobal* result = new LLoadGlobal; |
| 1750 return instr->check_hole_value() | 1751 return instr->check_hole_value() |
| 1751 ? AssignEnvironment(DefineAsRegister(result)) | 1752 ? AssignEnvironment(DefineAsRegister(result)) |
| 1752 : DefineAsRegister(result); | 1753 : DefineAsRegister(result); |
| 1753 } | 1754 } |
| 1754 | 1755 |
| 1755 | 1756 |
| 1756 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { | 1757 LInstruction* LChunkBuilder::DoStoreGlobal(HStoreGlobal* instr) { |
| 1757 LOperand* context = UseFixed(instr->context(), esi); | 1758 LStoreGlobal* result = new LStoreGlobal(UseRegisterAtStart(instr->value())); |
| 1758 LOperand* global_object = UseFixed(instr->global_object(), eax); | |
| 1759 LLoadGlobalGeneric* result = new LLoadGlobalGeneric(context, global_object); | |
| 1760 return MarkAsCall(DefineFixed(result, eax), instr); | |
| 1761 } | |
| 1762 | |
| 1763 | |
| 1764 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { | |
| 1765 LStoreGlobalCell* result = | |
| 1766 new LStoreGlobalCell(UseRegisterAtStart(instr->value())); | |
| 1767 return instr->check_hole_value() ? AssignEnvironment(result) : result; | 1759 return instr->check_hole_value() ? AssignEnvironment(result) : result; |
| 1768 } | 1760 } |
| 1769 | 1761 |
| 1770 | 1762 |
| 1771 LInstruction* LChunkBuilder::DoStoreGlobalGeneric(HStoreGlobalGeneric* instr) { | |
| 1772 LOperand* context = UseFixed(instr->context(), esi); | |
| 1773 LOperand* global_object = UseFixed(instr->global_object(), edx); | |
| 1774 LOperand* value = UseFixed(instr->value(), eax); | |
| 1775 LStoreGlobalGeneric* result = | |
| 1776 new LStoreGlobalGeneric(context, global_object, value); | |
| 1777 return MarkAsCall(result, instr); | |
| 1778 } | |
| 1779 | |
| 1780 | |
| 1781 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { | 1763 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
| 1782 LOperand* context = UseRegisterAtStart(instr->value()); | 1764 LOperand* context = UseRegisterAtStart(instr->value()); |
| 1783 return DefineAsRegister(new LLoadContextSlot(context)); | 1765 return DefineAsRegister(new LLoadContextSlot(context)); |
| 1784 } | 1766 } |
| 1785 | 1767 |
| 1786 | 1768 |
| 1787 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { | 1769 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { |
| 1788 LOperand* context; | 1770 LOperand* context; |
| 1789 LOperand* value; | 1771 LOperand* value; |
| 1790 LOperand* temp; | 1772 LOperand* temp; |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2167 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2149 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
| 2168 HEnvironment* outer = current_block_->last_environment()->outer(); | 2150 HEnvironment* outer = current_block_->last_environment()->outer(); |
| 2169 current_block_->UpdateEnvironment(outer); | 2151 current_block_->UpdateEnvironment(outer); |
| 2170 return NULL; | 2152 return NULL; |
| 2171 } | 2153 } |
| 2172 | 2154 |
| 2173 | 2155 |
| 2174 } } // namespace v8::internal | 2156 } } // namespace v8::internal |
| 2175 | 2157 |
| 2176 #endif // V8_TARGET_ARCH_IA32 | 2158 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |