Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: src/ia32/lithium-ia32.cc

Issue 6390003: Introduce a hydrogen value for contexts, support context slot assignment. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Sorted Lithium instructions names. Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 } 261 }
262 262
263 263
264 void LUnaryMathOperation::PrintDataTo(StringStream* stream) { 264 void LUnaryMathOperation::PrintDataTo(StringStream* stream) {
265 stream->Add("/%s ", hydrogen()->OpName()); 265 stream->Add("/%s ", hydrogen()->OpName());
266 InputAt(0)->PrintTo(stream); 266 InputAt(0)->PrintTo(stream);
267 } 267 }
268 268
269 269
270 void LLoadContextSlot::PrintDataTo(StringStream* stream) { 270 void LLoadContextSlot::PrintDataTo(StringStream* stream) {
271 stream->Add("(%d, %d)", context_chain_length(), slot_index()); 271 InputAt(0)->PrintTo(stream);
272 stream->Add("[%d]", slot_index());
272 } 273 }
273 274
274 275
276 void LStoreContextSlot::PrintDataTo(StringStream* stream) {
277 InputAt(0)->PrintTo(stream);
278 stream->Add("[%d] <- ", slot_index());
279 InputAt(1)->PrintTo(stream);
280 }
281
282
275 void LCallKeyed::PrintDataTo(StringStream* stream) { 283 void LCallKeyed::PrintDataTo(StringStream* stream) {
276 stream->Add("[ecx] #%d / ", arity()); 284 stream->Add("[ecx] #%d / ", arity());
277 } 285 }
278 286
279 287
280 void LCallNamed::PrintDataTo(StringStream* stream) { 288 void LCallNamed::PrintDataTo(StringStream* stream) {
281 SmartPointer<char> name_string = name()->ToCString(); 289 SmartPointer<char> name_string = name()->ToCString();
282 stream->Add("%s #%d / ", *name_string, arity()); 290 stream->Add("%s #%d / ", *name_string, arity());
283 } 291 }
284 292
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 } 1141 }
1134 1142
1135 1143
1136 LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) { 1144 LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) {
1137 ++argument_count_; 1145 ++argument_count_;
1138 LOperand* argument = UseOrConstant(instr->argument()); 1146 LOperand* argument = UseOrConstant(instr->argument());
1139 return new LPushArgument(argument); 1147 return new LPushArgument(argument);
1140 } 1148 }
1141 1149
1142 1150
1151 LInstruction* LChunkBuilder::DoContext(HContext* instr) {
1152 return DefineAsRegister(new LContext);
1153 }
1154
1155
1156 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) {
1157 LOperand* context = UseRegisterAtStart(instr->value());
1158 return DefineAsRegister(new LOuterContext(context));
1159 }
1160
1161
1143 LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) { 1162 LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) {
1144 return DefineAsRegister(new LGlobalObject); 1163 LOperand* context = UseRegisterAtStart(instr->value());
1164 return DefineAsRegister(new LGlobalObject(context));
1145 } 1165 }
1146 1166
1147 1167
1148 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) { 1168 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) {
1149 return DefineAsRegister(new LGlobalReceiver); 1169 LOperand* global_object = UseRegisterAtStart(instr->value());
1170 return DefineAsRegister(new LGlobalReceiver(global_object));
1150 } 1171 }
1151 1172
1152 1173
1153 LInstruction* LChunkBuilder::DoCallConstantFunction( 1174 LInstruction* LChunkBuilder::DoCallConstantFunction(
1154 HCallConstantFunction* instr) { 1175 HCallConstantFunction* instr) {
1155 argument_count_ -= instr->argument_count(); 1176 argument_count_ -= instr->argument_count();
1156 return MarkAsCall(DefineFixed(new LCallConstantFunction, eax), instr); 1177 return MarkAsCall(DefineFixed(new LCallConstantFunction, eax), instr);
1157 } 1178 }
1158 1179
1159 1180
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 } 1672 }
1652 1673
1653 1674
1654 LInstruction* LChunkBuilder::DoStoreGlobal(HStoreGlobal* instr) { 1675 LInstruction* LChunkBuilder::DoStoreGlobal(HStoreGlobal* instr) {
1655 LStoreGlobal* result = new LStoreGlobal(UseRegisterAtStart(instr->value())); 1676 LStoreGlobal* result = new LStoreGlobal(UseRegisterAtStart(instr->value()));
1656 return instr->check_hole_value() ? AssignEnvironment(result) : result; 1677 return instr->check_hole_value() ? AssignEnvironment(result) : result;
1657 } 1678 }
1658 1679
1659 1680
1660 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { 1681 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) {
1661 return DefineAsRegister(new LLoadContextSlot); 1682 LOperand* context = UseRegisterAtStart(instr->value());
1683 return DefineAsRegister(new LLoadContextSlot(context));
1662 } 1684 }
1663 1685
1664 1686
1687 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) {
1688 LOperand* context;
1689 LOperand* value;
1690 LOperand* temp;
1691 if (instr->NeedsWriteBarrier()) {
1692 context = UseTempRegister(instr->context());
1693 value = UseTempRegister(instr->value());
1694 temp = TempRegister();
1695 } else {
1696 context = UseRegisterAtStart(instr->context());
fschneider 2011/02/03 13:08:02 UseTempRegister if it is overwritten.
Kevin Millikin (Chromium) 2011/02/04 11:49:09 Thanks, very good catch.
1697 value = UseRegister(instr->value());
1698 temp = NULL;
1699 }
1700 return new LStoreContextSlot(context, value, temp);
1701 }
1702
1703
1665 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { 1704 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
1666 ASSERT(instr->representation().IsTagged()); 1705 ASSERT(instr->representation().IsTagged());
1667 LOperand* obj = UseRegisterAtStart(instr->object()); 1706 LOperand* obj = UseRegisterAtStart(instr->object());
1668 return DefineAsRegister(new LLoadNamedField(obj)); 1707 return DefineAsRegister(new LLoadNamedField(obj));
1669 } 1708 }
1670 1709
1671 1710
1672 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { 1711 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
1673 LOperand* object = UseFixed(instr->object(), eax); 1712 LOperand* object = UseFixed(instr->object(), eax);
1674 LLoadNamedGeneric* result = new LLoadNamedGeneric(object); 1713 LLoadNamedGeneric* result = new LLoadNamedGeneric(object);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1749 ? UseTempRegister(instr->object()) 1788 ? UseTempRegister(instr->object())
1750 : UseRegisterAtStart(instr->object()); 1789 : UseRegisterAtStart(instr->object());
1751 1790
1752 LOperand* val = needs_write_barrier 1791 LOperand* val = needs_write_barrier
1753 ? UseTempRegister(instr->value()) 1792 ? UseTempRegister(instr->value())
1754 : UseRegister(instr->value()); 1793 : UseRegister(instr->value());
1755 1794
1756 // We only need a scratch register if we have a write barrier or we 1795 // We only need a scratch register if we have a write barrier or we
1757 // have a store into the properties array (not in-object-property). 1796 // have a store into the properties array (not in-object-property).
1758 LOperand* temp = (!instr->is_in_object() || needs_write_barrier) 1797 LOperand* temp = (!instr->is_in_object() || needs_write_barrier)
1759 ? TempRegister() : NULL; 1798 ? TempRegister()
1799 : NULL;
1760 1800
1761 return new LStoreNamedField(obj, val, temp); 1801 return new LStoreNamedField(obj, val, temp);
1762 } 1802 }
1763 1803
1764 1804
1765 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { 1805 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
1766 LOperand* obj = UseFixed(instr->object(), edx); 1806 LOperand* obj = UseFixed(instr->object(), edx);
1767 LOperand* val = UseFixed(instr->value(), eax); 1807 LOperand* val = UseFixed(instr->value(), eax);
1768 1808
1769 LStoreNamedGeneric* result = new LStoreNamedGeneric(obj, val); 1809 LStoreNamedGeneric* result = new LStoreNamedGeneric(obj, val);
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1917 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 1957 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
1918 HEnvironment* outer = current_block_->last_environment()->outer(); 1958 HEnvironment* outer = current_block_->last_environment()->outer();
1919 current_block_->UpdateEnvironment(outer); 1959 current_block_->UpdateEnvironment(outer);
1920 return NULL; 1960 return NULL;
1921 } 1961 }
1922 1962
1923 1963
1924 } } // namespace v8::internal 1964 } } // namespace v8::internal
1925 1965
1926 #endif // V8_TARGET_ARCH_IA32 1966 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/hydrogen.cc ('K') | « src/ia32/lithium-ia32.h ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698