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

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

Issue 104663004: Preview of a first step towards unification of hydrogen calls (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merge fix Created 6 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
« no previous file with comments | « src/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 270
271 271
272 void LInnerAllocatedObject::PrintDataTo(StringStream* stream) { 272 void LInnerAllocatedObject::PrintDataTo(StringStream* stream) {
273 stream->Add(" = "); 273 stream->Add(" = ");
274 base_object()->PrintTo(stream); 274 base_object()->PrintTo(stream);
275 stream->Add(" + "); 275 stream->Add(" + ");
276 offset()->PrintTo(stream); 276 offset()->PrintTo(stream);
277 } 277 }
278 278
279 279
280 void LCallConstantFunction::PrintDataTo(StringStream* stream) { 280 void LCallJSFunction::PrintDataTo(StringStream* stream) {
281 stream->Add("= ");
282 function()->PrintTo(stream);
281 stream->Add("#%d / ", arity()); 283 stream->Add("#%d / ", arity());
282 } 284 }
283 285
286
287 void LCallWithDescriptor::PrintDataTo(StringStream* stream) {
288 for (int i = 0; i < InputCount(); i++) {
289 InputAt(i)->PrintTo(stream);
290 stream->Add(" ");
291 }
292 stream->Add("#%d / ", arity());
293 }
294
284 295
285 void LLoadContextSlot::PrintDataTo(StringStream* stream) { 296 void LLoadContextSlot::PrintDataTo(StringStream* stream) {
286 context()->PrintTo(stream); 297 context()->PrintTo(stream);
287 stream->Add("[%d]", slot_index()); 298 stream->Add("[%d]", slot_index());
288 } 299 }
289 300
290 301
291 void LStoreContextSlot::PrintDataTo(StringStream* stream) { 302 void LStoreContextSlot::PrintDataTo(StringStream* stream) {
292 context()->PrintTo(stream); 303 context()->PrintTo(stream);
293 stream->Add("[%d] <- ", slot_index()); 304 stream->Add("[%d] <- ", slot_index());
294 value()->PrintTo(stream); 305 value()->PrintTo(stream);
295 } 306 }
296 307
297 308
298 void LInvokeFunction::PrintDataTo(StringStream* stream) { 309 void LInvokeFunction::PrintDataTo(StringStream* stream) {
299 stream->Add("= "); 310 stream->Add("= ");
300 function()->PrintTo(stream); 311 function()->PrintTo(stream);
301 stream->Add(" #%d / ", arity()); 312 stream->Add(" #%d / ", arity());
302 } 313 }
303 314
304 315
305 void LCallKeyed::PrintDataTo(StringStream* stream) {
306 stream->Add("[r2] #%d / ", arity());
307 }
308
309
310 void LCallNamed::PrintDataTo(StringStream* stream) {
311 SmartArrayPointer<char> name_string = name()->ToCString();
312 stream->Add("%s #%d / ", name_string.get(), arity());
313 }
314
315
316 void LCallKnownGlobal::PrintDataTo(StringStream* stream) {
317 stream->Add("#%d / ", arity());
318 }
319
320
321 void LCallNew::PrintDataTo(StringStream* stream) { 316 void LCallNew::PrintDataTo(StringStream* stream) {
322 stream->Add("= "); 317 stream->Add("= ");
323 constructor()->PrintTo(stream); 318 constructor()->PrintTo(stream);
324 stream->Add(" #%d / ", arity()); 319 stream->Add(" #%d / ", arity());
325 } 320 }
326 321
327 322
328 void LCallNewArray::PrintDataTo(StringStream* stream) { 323 void LCallNewArray::PrintDataTo(StringStream* stream) {
329 stream->Add("= "); 324 stream->Add("= ");
330 constructor()->PrintTo(stream); 325 constructor()->PrintTo(stream);
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 LOperand* LChunkBuilder::Use(HValue* value, LUnallocated* operand) { 545 LOperand* LChunkBuilder::Use(HValue* value, LUnallocated* operand) {
551 if (value->EmitAtUses()) { 546 if (value->EmitAtUses()) {
552 HInstruction* instr = HInstruction::cast(value); 547 HInstruction* instr = HInstruction::cast(value);
553 VisitInstruction(instr); 548 VisitInstruction(instr);
554 } 549 }
555 operand->set_virtual_register(value->id()); 550 operand->set_virtual_register(value->id());
556 return operand; 551 return operand;
557 } 552 }
558 553
559 554
560 template<int I, int T> 555 LInstruction* LChunkBuilder::Define(LTemplateResultInstruction<1>* instr,
561 LInstruction* LChunkBuilder::Define(LTemplateInstruction<1, I, T>* instr,
562 LUnallocated* result) { 556 LUnallocated* result) {
563 result->set_virtual_register(current_instruction_->id()); 557 result->set_virtual_register(current_instruction_->id());
564 instr->set_result(result); 558 instr->set_result(result);
565 return instr; 559 return instr;
566 } 560 }
567 561
568 562
569 template<int I, int T>
570 LInstruction* LChunkBuilder::DefineAsRegister( 563 LInstruction* LChunkBuilder::DefineAsRegister(
571 LTemplateInstruction<1, I, T>* instr) { 564 LTemplateResultInstruction<1>* instr) {
572 return Define(instr, 565 return Define(instr,
573 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER)); 566 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER));
574 } 567 }
575 568
576 569
577 template<int I, int T>
578 LInstruction* LChunkBuilder::DefineAsSpilled( 570 LInstruction* LChunkBuilder::DefineAsSpilled(
579 LTemplateInstruction<1, I, T>* instr, int index) { 571 LTemplateResultInstruction<1>* instr, int index) {
580 return Define(instr, 572 return Define(instr,
581 new(zone()) LUnallocated(LUnallocated::FIXED_SLOT, index)); 573 new(zone()) LUnallocated(LUnallocated::FIXED_SLOT, index));
582 } 574 }
583 575
584 576
585 template<int I, int T>
586 LInstruction* LChunkBuilder::DefineSameAsFirst( 577 LInstruction* LChunkBuilder::DefineSameAsFirst(
587 LTemplateInstruction<1, I, T>* instr) { 578 LTemplateResultInstruction<1>* instr) {
588 return Define(instr, 579 return Define(instr,
589 new(zone()) LUnallocated(LUnallocated::SAME_AS_FIRST_INPUT)); 580 new(zone()) LUnallocated(LUnallocated::SAME_AS_FIRST_INPUT));
590 } 581 }
591 582
592 583
593 template<int I, int T>
594 LInstruction* LChunkBuilder::DefineFixed( 584 LInstruction* LChunkBuilder::DefineFixed(
595 LTemplateInstruction<1, I, T>* instr, Register reg) { 585 LTemplateResultInstruction<1>* instr, Register reg) {
596 return Define(instr, ToUnallocated(reg)); 586 return Define(instr, ToUnallocated(reg));
597 } 587 }
598 588
599 589
600 template<int I, int T>
601 LInstruction* LChunkBuilder::DefineFixedDouble( 590 LInstruction* LChunkBuilder::DefineFixedDouble(
602 LTemplateInstruction<1, I, T>* instr, DoubleRegister reg) { 591 LTemplateResultInstruction<1>* instr, DoubleRegister reg) {
603 return Define(instr, ToUnallocated(reg)); 592 return Define(instr, ToUnallocated(reg));
604 } 593 }
605 594
606 595
607 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) { 596 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) {
608 HEnvironment* hydrogen_env = current_block_->last_environment(); 597 HEnvironment* hydrogen_env = current_block_->last_environment();
609 int argument_index_accumulator = 0; 598 int argument_index_accumulator = 0;
610 ZoneList<HValue*> objects_to_materialize(0, zone()); 599 ZoneList<HValue*> objects_to_materialize(0, zone());
611 instr->set_environment(CreateEnvironment(hydrogen_env, 600 instr->set_environment(CreateEnvironment(hydrogen_env,
612 &argument_index_accumulator, 601 &argument_index_accumulator,
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 return DefineAsRegister(new(zone()) LGlobalObject(context)); 1059 return DefineAsRegister(new(zone()) LGlobalObject(context));
1071 } 1060 }
1072 1061
1073 1062
1074 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) { 1063 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) {
1075 LOperand* global_object = UseRegisterAtStart(instr->value()); 1064 LOperand* global_object = UseRegisterAtStart(instr->value());
1076 return DefineAsRegister(new(zone()) LGlobalReceiver(global_object)); 1065 return DefineAsRegister(new(zone()) LGlobalReceiver(global_object));
1077 } 1066 }
1078 1067
1079 1068
1080 LInstruction* LChunkBuilder::DoCallConstantFunction( 1069 LInstruction* LChunkBuilder::DoCallJSFunction(
1081 HCallConstantFunction* instr) { 1070 HCallJSFunction* instr) {
1082 return MarkAsCall(DefineFixed(new(zone()) LCallConstantFunction, r0), instr); 1071 LOperand* function = UseFixed(instr->function(), r1);
1072
1073 LCallJSFunction* result = new(zone()) LCallJSFunction(function);
1074
1075 return MarkAsCall(DefineFixed(result, r0), instr);
1083 } 1076 }
1084 1077
1085 1078
1079 LInstruction* LChunkBuilder::DoCallWithDescriptor(
1080 HCallWithDescriptor* instr) {
1081 const CallInterfaceDescriptor* descriptor = instr->descriptor();
1082
1083 LOperand* target = UseRegisterOrConstantAtStart(instr->target());
1084 ZoneList<LOperand*> ops(instr->OperandCount(), zone());
1085 ops.Add(target, zone());
1086 for (int i = 1; i < instr->OperandCount(); i++) {
1087 LOperand* op = UseFixed(instr->OperandAt(i),
1088 descriptor->GetParameterRegister(i - 1));
1089 ops.Add(op, zone());
1090 }
1091
1092 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor(
1093 descriptor, ops, zone());
1094 return MarkAsCall(DefineFixed(result, r0), instr);
1095 }
1096
1097
1086 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { 1098 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) {
1087 LOperand* context = UseFixed(instr->context(), cp); 1099 LOperand* context = UseFixed(instr->context(), cp);
1088 LOperand* function = UseFixed(instr->function(), r1); 1100 LOperand* function = UseFixed(instr->function(), r1);
1089 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); 1101 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function);
1090 return MarkAsCall(DefineFixed(result, r0), instr, CANNOT_DEOPTIMIZE_EAGERLY); 1102 return MarkAsCall(DefineFixed(result, r0), instr, CANNOT_DEOPTIMIZE_EAGERLY);
1091 } 1103 }
1092 1104
1093 1105
1094 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { 1106 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
1095 switch (instr->op()) { 1107 switch (instr->op()) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 } 1172 }
1161 1173
1162 1174
1163 LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) { 1175 LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) {
1164 LOperand* input = UseRegisterAtStart(instr->value()); 1176 LOperand* input = UseRegisterAtStart(instr->value());
1165 LMathPowHalf* result = new(zone()) LMathPowHalf(input); 1177 LMathPowHalf* result = new(zone()) LMathPowHalf(input);
1166 return DefineAsRegister(result); 1178 return DefineAsRegister(result);
1167 } 1179 }
1168 1180
1169 1181
1170 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) {
1171 ASSERT(instr->key()->representation().IsTagged());
1172 LOperand* context = UseFixed(instr->context(), cp);
1173 LOperand* key = UseFixed(instr->key(), r2);
1174 return MarkAsCall(
1175 DefineFixed(new(zone()) LCallKeyed(context, key), r0), instr);
1176 }
1177
1178
1179 LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) {
1180 LOperand* context = UseFixed(instr->context(), cp);
1181 return MarkAsCall(DefineFixed(new(zone()) LCallNamed(context), r0), instr);
1182 }
1183
1184
1185 LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) {
1186 return MarkAsCall(DefineFixed(new(zone()) LCallKnownGlobal, r0), instr);
1187 }
1188
1189
1190 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) { 1182 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) {
1191 LOperand* context = UseFixed(instr->context(), cp); 1183 LOperand* context = UseFixed(instr->context(), cp);
1192 LOperand* constructor = UseFixed(instr->constructor(), r1); 1184 LOperand* constructor = UseFixed(instr->constructor(), r1);
1193 LCallNew* result = new(zone()) LCallNew(context, constructor); 1185 LCallNew* result = new(zone()) LCallNew(context, constructor);
1194 return MarkAsCall(DefineFixed(result, r0), instr); 1186 return MarkAsCall(DefineFixed(result, r0), instr);
1195 } 1187 }
1196 1188
1197 1189
1198 LInstruction* LChunkBuilder::DoCallNewArray(HCallNewArray* instr) { 1190 LInstruction* LChunkBuilder::DoCallNewArray(HCallNewArray* instr) {
1199 LOperand* context = UseFixed(instr->context(), cp); 1191 LOperand* context = UseFixed(instr->context(), cp);
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after
2551 } 2543 }
2552 2544
2553 2545
2554 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2546 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2555 LOperand* object = UseRegister(instr->object()); 2547 LOperand* object = UseRegister(instr->object());
2556 LOperand* index = UseRegister(instr->index()); 2548 LOperand* index = UseRegister(instr->index());
2557 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2549 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2558 } 2550 }
2559 2551
2560 } } // namespace v8::internal 2552 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698