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

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: Created 9 years, 11 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
« src/ia32/lithium-codegen-ia32.cc ('K') | « src/ia32/lithium-ia32.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 } 1665 }
1645 1666
1646 1667
1647 LInstruction* LChunkBuilder::DoStoreGlobal(HStoreGlobal* instr) { 1668 LInstruction* LChunkBuilder::DoStoreGlobal(HStoreGlobal* instr) {
1648 LStoreGlobal* result = new LStoreGlobal(UseRegisterAtStart(instr->value())); 1669 LStoreGlobal* result = new LStoreGlobal(UseRegisterAtStart(instr->value()));
1649 return instr->check_hole_value() ? AssignEnvironment(result) : result; 1670 return instr->check_hole_value() ? AssignEnvironment(result) : result;
1650 } 1671 }
1651 1672
1652 1673
1653 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { 1674 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) {
1654 return DefineAsRegister(new LLoadContextSlot); 1675 LOperand* context = UseRegisterAtStart(instr->value());
1676 return DefineAsRegister(new LLoadContextSlot(context));
1655 } 1677 }
1656 1678
1657 1679
1680 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) {
1681 HValue* stored_value = instr->value();
1682 bool skip_write_barrier = stored_value->type().IsSmi() ||
Vitaly Repeshko 2011/01/27 14:05:21 Add NeedsWriteBarrier predicate to HStoreContextSl
Kevin Millikin (Chromium) 2011/02/03 08:37:23 Yes, done.
1683 (stored_value->IsConstant() &&
1684 HConstant::cast(stored_value)->InOldSpace());
1685
1686 LOperand* context = skip_write_barrier
1687 ? UseRegisterAtStart(instr->context())
1688 : UseTempRegister(instr->context());
1689 LOperand* value = skip_write_barrier
1690 ? UseRegister(stored_value)
1691 : UseTempRegister(stored_value);
1692 LOperand* temp = skip_write_barrier ? NULL : TempRegister();
1693
1694 return new LStoreContextSlot(context, value, temp);
1695 }
1696
1697
1658 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { 1698 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
1659 ASSERT(instr->representation().IsTagged()); 1699 ASSERT(instr->representation().IsTagged());
1660 LOperand* obj = UseRegisterAtStart(instr->object()); 1700 LOperand* obj = UseRegisterAtStart(instr->object());
1661 return DefineAsRegister(new LLoadNamedField(obj)); 1701 return DefineAsRegister(new LLoadNamedField(obj));
1662 } 1702 }
1663 1703
1664 1704
1665 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { 1705 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
1666 LOperand* object = UseFixed(instr->object(), eax); 1706 LOperand* object = UseFixed(instr->object(), eax);
1667 LLoadNamedGeneric* result = new LLoadNamedGeneric(object); 1707 LLoadNamedGeneric* result = new LLoadNamedGeneric(object);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1742 ? UseTempRegister(instr->object()) 1782 ? UseTempRegister(instr->object())
1743 : UseRegisterAtStart(instr->object()); 1783 : UseRegisterAtStart(instr->object());
1744 1784
1745 LOperand* val = needs_write_barrier 1785 LOperand* val = needs_write_barrier
1746 ? UseTempRegister(instr->value()) 1786 ? UseTempRegister(instr->value())
1747 : UseRegister(instr->value()); 1787 : UseRegister(instr->value());
1748 1788
1749 // We only need a scratch register if we have a write barrier or we 1789 // We only need a scratch register if we have a write barrier or we
1750 // have a store into the properties array (not in-object-property). 1790 // have a store into the properties array (not in-object-property).
1751 LOperand* temp = (!instr->is_in_object() || needs_write_barrier) 1791 LOperand* temp = (!instr->is_in_object() || needs_write_barrier)
1752 ? TempRegister() : NULL; 1792 ? TempRegister()
1793 : NULL;
1753 1794
1754 return new LStoreNamedField(obj, val, temp); 1795 return new LStoreNamedField(obj, val, temp);
1755 } 1796 }
1756 1797
1757 1798
1758 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { 1799 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
1759 LOperand* obj = UseFixed(instr->object(), edx); 1800 LOperand* obj = UseFixed(instr->object(), edx);
1760 LOperand* val = UseFixed(instr->value(), eax); 1801 LOperand* val = UseFixed(instr->value(), eax);
1761 1802
1762 LStoreNamedGeneric* result = new LStoreNamedGeneric(obj, val); 1803 LStoreNamedGeneric* result = new LStoreNamedGeneric(obj, val);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1909 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 1950 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
1910 HEnvironment* outer = current_block_->last_environment()->outer(); 1951 HEnvironment* outer = current_block_->last_environment()->outer();
1911 current_block_->UpdateEnvironment(outer); 1952 current_block_->UpdateEnvironment(outer);
1912 return NULL; 1953 return NULL;
1913 } 1954 }
1914 1955
1915 1956
1916 } } // namespace v8::internal 1957 } } // namespace v8::internal
1917 1958
1918 #endif // V8_TARGET_ARCH_IA32 1959 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/ia32/lithium-codegen-ia32.cc ('K') | « src/ia32/lithium-ia32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698