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

Side by Side Diff: src/arm/lithium-arm.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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 } 251 }
252 252
253 253
254 void LUnaryMathOperation::PrintDataTo(StringStream* stream) { 254 void LUnaryMathOperation::PrintDataTo(StringStream* stream) {
255 stream->Add("/%s ", hydrogen()->OpName()); 255 stream->Add("/%s ", hydrogen()->OpName());
256 InputAt(0)->PrintTo(stream); 256 InputAt(0)->PrintTo(stream);
257 } 257 }
258 258
259 259
260 void LLoadContextSlot::PrintDataTo(StringStream* stream) { 260 void LLoadContextSlot::PrintDataTo(StringStream* stream) {
261 stream->Add("(%d, %d)", context_chain_length(), slot_index()); 261 InputAt(0)->PrintTo(stream);
262 stream->Add("[%d]", slot_index());
262 } 263 }
263 264
264 265
266 void LStoreContextSlot::PrintDataTo(StringStream* stream) {
267 InputAt(0)->PrintTo(stream);
268 stream->Add("[%d] <- ", slot_index());
269 InputAt(1)->PrintTo(stream);
270 }
271
272
265 void LCallKeyed::PrintDataTo(StringStream* stream) { 273 void LCallKeyed::PrintDataTo(StringStream* stream) {
266 stream->Add("[r2] #%d / ", arity()); 274 stream->Add("[r2] #%d / ", arity());
267 } 275 }
268 276
269 277
270 void LCallNamed::PrintDataTo(StringStream* stream) { 278 void LCallNamed::PrintDataTo(StringStream* stream) {
271 SmartPointer<char> name_string = name()->ToCString(); 279 SmartPointer<char> name_string = name()->ToCString();
272 stream->Add("%s #%d / ", *name_string, arity()); 280 stream->Add("%s #%d / ", *name_string, arity());
273 } 281 }
274 282
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 } 1106 }
1099 1107
1100 1108
1101 LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) { 1109 LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) {
1102 ++argument_count_; 1110 ++argument_count_;
1103 LOperand* argument = Use(instr->argument()); 1111 LOperand* argument = Use(instr->argument());
1104 return new LPushArgument(argument); 1112 return new LPushArgument(argument);
1105 } 1113 }
1106 1114
1107 1115
1116 LInstruction* LChunkBuilder::DoContext(HContext* instr) {
1117 return DefineAsRegister(new LContext);
1118 }
1119
1120
1121 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) {
1122 LOperand* context = UseRegisterAtStart(instr->value());
1123 return DefineAsRegister(new LOuterContext(context));
1124 }
1125
1126
1108 LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) { 1127 LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) {
1109 return DefineAsRegister(new LGlobalObject); 1128 LOperand* context = UseRegisterAtStart(instr->value());
1129 return DefineAsRegister(new LGlobalObject(context));
1110 } 1130 }
1111 1131
1112 1132
1113 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) { 1133 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) {
1114 return DefineAsRegister(new LGlobalReceiver); 1134 LOperand* global_object = UseRegisterAtStart(instr->value());
1135 return DefineAsRegister(new LGlobalReceiver(global_object));
1115 } 1136 }
1116 1137
1117 1138
1118 LInstruction* LChunkBuilder::DoCallConstantFunction( 1139 LInstruction* LChunkBuilder::DoCallConstantFunction(
1119 HCallConstantFunction* instr) { 1140 HCallConstantFunction* instr) {
1120 argument_count_ -= instr->argument_count(); 1141 argument_count_ -= instr->argument_count();
1121 return MarkAsCall(DefineFixed(new LCallConstantFunction, r0), instr); 1142 return MarkAsCall(DefineFixed(new LCallConstantFunction, r0), instr);
1122 } 1143 }
1123 1144
1124 1145
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 LOperand* value = UseRegister(instr->value()); 1635 LOperand* value = UseRegister(instr->value());
1615 return AssignEnvironment(new LStoreGlobal(value, temp)); 1636 return AssignEnvironment(new LStoreGlobal(value, temp));
1616 } else { 1637 } else {
1617 LOperand* value = UseRegisterAtStart(instr->value()); 1638 LOperand* value = UseRegisterAtStart(instr->value());
1618 return new LStoreGlobal(value, NULL); 1639 return new LStoreGlobal(value, NULL);
1619 } 1640 }
1620 } 1641 }
1621 1642
1622 1643
1623 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { 1644 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) {
1624 return DefineAsRegister(new LLoadContextSlot); 1645 LOperand* context = UseRegisterAtStart(instr->value());
1646 return DefineAsRegister(new LLoadContextSlot(context));
1625 } 1647 }
1626 1648
1627 1649
1650 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) {
1651 LOperand* context;
1652 LOperand* value;
1653 if (instr->NeedsWriteBarrier()) {
1654 context = UseTempRegister(instr->context());
1655 value = UseTempRegister(instr->value());
1656 } else {
1657 context = UseRegisterAtStart(instr->context());
1658 value = UseRegister(instr->value());
1659 }
1660 return new LStoreContextSlot(context, value);
1661 }
1662
1663
1628 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { 1664 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
1629 return DefineAsRegister( 1665 return DefineAsRegister(
1630 new LLoadNamedField(UseRegisterAtStart(instr->object()))); 1666 new LLoadNamedField(UseRegisterAtStart(instr->object())));
1631 } 1667 }
1632 1668
1633 1669
1634 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { 1670 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
1635 LOperand* object = UseFixed(instr->object(), r0); 1671 LOperand* object = UseFixed(instr->object(), r0);
1636 LInstruction* result = DefineFixed(new LLoadNamedGeneric(object), r0); 1672 LInstruction* result = DefineFixed(new LLoadNamedGeneric(object), r0);
1637 return MarkAsCall(result, instr); 1673 return MarkAsCall(result, instr);
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1873 1909
1874 1910
1875 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 1911 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
1876 HEnvironment* outer = current_block_->last_environment()->outer(); 1912 HEnvironment* outer = current_block_->last_environment()->outer();
1877 current_block_->UpdateEnvironment(outer); 1913 current_block_->UpdateEnvironment(outer);
1878 return NULL; 1914 return NULL;
1879 } 1915 }
1880 1916
1881 1917
1882 } } // namespace v8::internal 1918 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.cc » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698