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

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

Issue 132623005: A64: Synchronize with r18642. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 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
« no previous file with comments | « src/x64/lithium-x64.h ('k') | src/x64/macro-assembler-x64.h » ('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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 273
274 274
275 void LInnerAllocatedObject::PrintDataTo(StringStream* stream) { 275 void LInnerAllocatedObject::PrintDataTo(StringStream* stream) {
276 stream->Add(" = "); 276 stream->Add(" = ");
277 base_object()->PrintTo(stream); 277 base_object()->PrintTo(stream);
278 stream->Add(" + "); 278 stream->Add(" + ");
279 offset()->PrintTo(stream); 279 offset()->PrintTo(stream);
280 } 280 }
281 281
282 282
283 void LCallConstantFunction::PrintDataTo(StringStream* stream) { 283 void LCallJSFunction::PrintDataTo(StringStream* stream) {
284 stream->Add("= ");
285 function()->PrintTo(stream);
284 stream->Add("#%d / ", arity()); 286 stream->Add("#%d / ", arity());
285 } 287 }
286 288
289
290 void LCallWithDescriptor::PrintDataTo(StringStream* stream) {
291 for (int i = 0; i < InputCount(); i++) {
292 InputAt(i)->PrintTo(stream);
293 stream->Add(" ");
294 }
295 stream->Add("#%d / ", arity());
296 }
297
287 298
288 void LLoadContextSlot::PrintDataTo(StringStream* stream) { 299 void LLoadContextSlot::PrintDataTo(StringStream* stream) {
289 context()->PrintTo(stream); 300 context()->PrintTo(stream);
290 stream->Add("[%d]", slot_index()); 301 stream->Add("[%d]", slot_index());
291 } 302 }
292 303
293 304
294 void LStoreContextSlot::PrintDataTo(StringStream* stream) { 305 void LStoreContextSlot::PrintDataTo(StringStream* stream) {
295 context()->PrintTo(stream); 306 context()->PrintTo(stream);
296 stream->Add("[%d] <- ", slot_index()); 307 stream->Add("[%d] <- ", slot_index());
297 value()->PrintTo(stream); 308 value()->PrintTo(stream);
298 } 309 }
299 310
300 311
301 void LInvokeFunction::PrintDataTo(StringStream* stream) { 312 void LInvokeFunction::PrintDataTo(StringStream* stream) {
302 stream->Add("= "); 313 stream->Add("= ");
303 function()->PrintTo(stream); 314 function()->PrintTo(stream);
304 stream->Add(" #%d / ", arity()); 315 stream->Add(" #%d / ", arity());
305 } 316 }
306 317
307 318
308 void LCallKeyed::PrintDataTo(StringStream* stream) {
309 stream->Add("[rcx] #%d / ", arity());
310 }
311
312
313 void LCallNamed::PrintDataTo(StringStream* stream) {
314 SmartArrayPointer<char> name_string = name()->ToCString();
315 stream->Add("%s #%d / ", name_string.get(), arity());
316 }
317
318
319 void LCallGlobal::PrintDataTo(StringStream* stream) {
320 SmartArrayPointer<char> name_string = name()->ToCString();
321 stream->Add("%s #%d / ", name_string.get(), arity());
322 }
323
324
325 void LCallKnownGlobal::PrintDataTo(StringStream* stream) {
326 stream->Add("#%d / ", arity());
327 }
328
329
330 void LCallNew::PrintDataTo(StringStream* stream) { 319 void LCallNew::PrintDataTo(StringStream* stream) {
331 stream->Add("= "); 320 stream->Add("= ");
332 constructor()->PrintTo(stream); 321 constructor()->PrintTo(stream);
333 stream->Add(" #%d / ", arity()); 322 stream->Add(" #%d / ", arity());
334 } 323 }
335 324
336 325
337 void LCallNewArray::PrintDataTo(StringStream* stream) { 326 void LCallNewArray::PrintDataTo(StringStream* stream) {
338 stream->Add("= "); 327 stream->Add("= ");
339 constructor()->PrintTo(stream); 328 constructor()->PrintTo(stream);
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 LOperand* LChunkBuilder::Use(HValue* value, LUnallocated* operand) { 558 LOperand* LChunkBuilder::Use(HValue* value, LUnallocated* operand) {
570 if (value->EmitAtUses()) { 559 if (value->EmitAtUses()) {
571 HInstruction* instr = HInstruction::cast(value); 560 HInstruction* instr = HInstruction::cast(value);
572 VisitInstruction(instr); 561 VisitInstruction(instr);
573 } 562 }
574 operand->set_virtual_register(value->id()); 563 operand->set_virtual_register(value->id());
575 return operand; 564 return operand;
576 } 565 }
577 566
578 567
579 template<int I, int T> 568 LInstruction* LChunkBuilder::Define(LTemplateResultInstruction<1>* instr,
580 LInstruction* LChunkBuilder::Define(LTemplateInstruction<1, I, T>* instr,
581 LUnallocated* result) { 569 LUnallocated* result) {
582 result->set_virtual_register(current_instruction_->id()); 570 result->set_virtual_register(current_instruction_->id());
583 instr->set_result(result); 571 instr->set_result(result);
584 return instr; 572 return instr;
585 } 573 }
586 574
587 575
588 template<int I, int T>
589 LInstruction* LChunkBuilder::DefineAsRegister( 576 LInstruction* LChunkBuilder::DefineAsRegister(
590 LTemplateInstruction<1, I, T>* instr) { 577 LTemplateResultInstruction<1>* instr) {
591 return Define(instr, 578 return Define(instr,
592 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER)); 579 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER));
593 } 580 }
594 581
595 582
596 template<int I, int T>
597 LInstruction* LChunkBuilder::DefineAsSpilled( 583 LInstruction* LChunkBuilder::DefineAsSpilled(
598 LTemplateInstruction<1, I, T>* instr, 584 LTemplateResultInstruction<1>* instr,
599 int index) { 585 int index) {
600 return Define(instr, 586 return Define(instr,
601 new(zone()) LUnallocated(LUnallocated::FIXED_SLOT, index)); 587 new(zone()) LUnallocated(LUnallocated::FIXED_SLOT, index));
602 } 588 }
603 589
604 590
605 template<int I, int T>
606 LInstruction* LChunkBuilder::DefineSameAsFirst( 591 LInstruction* LChunkBuilder::DefineSameAsFirst(
607 LTemplateInstruction<1, I, T>* instr) { 592 LTemplateResultInstruction<1>* instr) {
608 return Define(instr, 593 return Define(instr,
609 new(zone()) LUnallocated(LUnallocated::SAME_AS_FIRST_INPUT)); 594 new(zone()) LUnallocated(LUnallocated::SAME_AS_FIRST_INPUT));
610 } 595 }
611 596
612 597
613 template<int I, int T> 598 LInstruction* LChunkBuilder::DefineFixed(LTemplateResultInstruction<1>* instr,
614 LInstruction* LChunkBuilder::DefineFixed(LTemplateInstruction<1, I, T>* instr,
615 Register reg) { 599 Register reg) {
616 return Define(instr, ToUnallocated(reg)); 600 return Define(instr, ToUnallocated(reg));
617 } 601 }
618 602
619 603
620 template<int I, int T>
621 LInstruction* LChunkBuilder::DefineFixedDouble( 604 LInstruction* LChunkBuilder::DefineFixedDouble(
622 LTemplateInstruction<1, I, T>* instr, 605 LTemplateResultInstruction<1>* instr,
623 XMMRegister reg) { 606 XMMRegister reg) {
624 return Define(instr, ToUnallocated(reg)); 607 return Define(instr, ToUnallocated(reg));
625 } 608 }
626 609
627 610
628 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) { 611 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) {
629 HEnvironment* hydrogen_env = current_block_->last_environment(); 612 HEnvironment* hydrogen_env = current_block_->last_environment();
630 int argument_index_accumulator = 0; 613 int argument_index_accumulator = 0;
631 ZoneList<HValue*> objects_to_materialize(0, zone()); 614 ZoneList<HValue*> objects_to_materialize(0, zone());
632 instr->set_environment(CreateEnvironment(hydrogen_env, 615 instr->set_environment(CreateEnvironment(hydrogen_env,
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 return DefineAsRegister(new(zone()) LGlobalObject(context)); 1066 return DefineAsRegister(new(zone()) LGlobalObject(context));
1084 } 1067 }
1085 1068
1086 1069
1087 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) { 1070 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) {
1088 LOperand* global_object = UseRegisterAtStart(instr->value()); 1071 LOperand* global_object = UseRegisterAtStart(instr->value());
1089 return DefineAsRegister(new(zone()) LGlobalReceiver(global_object)); 1072 return DefineAsRegister(new(zone()) LGlobalReceiver(global_object));
1090 } 1073 }
1091 1074
1092 1075
1093 LInstruction* LChunkBuilder::DoCallConstantFunction( 1076 LInstruction* LChunkBuilder::DoCallJSFunction(
1094 HCallConstantFunction* instr) { 1077 HCallJSFunction* instr) {
1095 return MarkAsCall(DefineFixed(new(zone()) LCallConstantFunction, rax), instr); 1078 LOperand* function = UseFixed(instr->function(), rdi);
1079
1080 LCallJSFunction* result = new(zone()) LCallJSFunction(function);
1081
1082 return MarkAsCall(DefineFixed(result, rax), instr);
1096 } 1083 }
1097 1084
1098 1085
1086 LInstruction* LChunkBuilder::DoCallWithDescriptor(
1087 HCallWithDescriptor* instr) {
1088 const CallInterfaceDescriptor* descriptor = instr->descriptor();
1089
1090 LOperand* target = UseRegisterOrConstantAtStart(instr->target());
1091 ZoneList<LOperand*> ops(instr->OperandCount(), zone());
1092 ops.Add(target, zone());
1093 for (int i = 1; i < instr->OperandCount(); i++) {
1094 LOperand* op = UseFixed(instr->OperandAt(i),
1095 descriptor->GetParameterRegister(i - 1));
1096 ops.Add(op, zone());
1097 }
1098
1099 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor(
1100 descriptor, ops, zone());
1101 return MarkAsCall(DefineFixed(result, rax), instr);
1102 }
1103
1104
1099 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { 1105 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) {
1100 LOperand* context = UseFixed(instr->context(), rsi); 1106 LOperand* context = UseFixed(instr->context(), rsi);
1101 LOperand* function = UseFixed(instr->function(), rdi); 1107 LOperand* function = UseFixed(instr->function(), rdi);
1102 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function); 1108 LInvokeFunction* result = new(zone()) LInvokeFunction(context, function);
1103 return MarkAsCall(DefineFixed(result, rax), instr, CANNOT_DEOPTIMIZE_EAGERLY); 1109 return MarkAsCall(DefineFixed(result, rax), instr, CANNOT_DEOPTIMIZE_EAGERLY);
1104 } 1110 }
1105 1111
1106 1112
1107 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { 1113 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
1108 switch (instr->op()) { 1114 switch (instr->op()) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 } 1174 }
1169 1175
1170 1176
1171 LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) { 1177 LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) {
1172 LOperand* input = UseRegisterAtStart(instr->value()); 1178 LOperand* input = UseRegisterAtStart(instr->value());
1173 LMathPowHalf* result = new(zone()) LMathPowHalf(input); 1179 LMathPowHalf* result = new(zone()) LMathPowHalf(input);
1174 return DefineSameAsFirst(result); 1180 return DefineSameAsFirst(result);
1175 } 1181 }
1176 1182
1177 1183
1178 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) {
1179 ASSERT(instr->key()->representation().IsTagged());
1180 LOperand* context = UseFixed(instr->context(), rsi);
1181 LOperand* key = UseFixed(instr->key(), rcx);
1182 LCallKeyed* result = new(zone()) LCallKeyed(context, key);
1183 return MarkAsCall(DefineFixed(result, rax), instr);
1184 }
1185
1186
1187 LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) {
1188 LOperand* context = UseFixed(instr->context(), rsi);
1189 LCallNamed* result = new(zone()) LCallNamed(context);
1190 return MarkAsCall(DefineFixed(result, rax), instr);
1191 }
1192
1193
1194 LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) {
1195 LOperand* context = UseFixed(instr->context(), rsi);
1196 LCallGlobal* result = new(zone()) LCallGlobal(context);
1197 return MarkAsCall(DefineFixed(result, rax), instr);
1198 }
1199
1200
1201 LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) {
1202 return MarkAsCall(DefineFixed(new(zone()) LCallKnownGlobal, rax), instr);
1203 }
1204
1205
1206 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) { 1184 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) {
1207 LOperand* context = UseFixed(instr->context(), rsi); 1185 LOperand* context = UseFixed(instr->context(), rsi);
1208 LOperand* constructor = UseFixed(instr->constructor(), rdi); 1186 LOperand* constructor = UseFixed(instr->constructor(), rdi);
1209 LCallNew* result = new(zone()) LCallNew(context, constructor); 1187 LCallNew* result = new(zone()) LCallNew(context, constructor);
1210 return MarkAsCall(DefineFixed(result, rax), instr); 1188 return MarkAsCall(DefineFixed(result, rax), instr);
1211 } 1189 }
1212 1190
1213 1191
1214 LInstruction* LChunkBuilder::DoCallNewArray(HCallNewArray* instr) { 1192 LInstruction* LChunkBuilder::DoCallNewArray(HCallNewArray* instr) {
1215 LOperand* context = UseFixed(instr->context(), rsi); 1193 LOperand* context = UseFixed(instr->context(), rsi);
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after
2524 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2502 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2525 LOperand* object = UseRegister(instr->object()); 2503 LOperand* object = UseRegister(instr->object());
2526 LOperand* index = UseTempRegister(instr->index()); 2504 LOperand* index = UseTempRegister(instr->index());
2527 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2505 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2528 } 2506 }
2529 2507
2530 2508
2531 } } // namespace v8::internal 2509 } } // namespace v8::internal
2532 2510
2533 #endif // V8_TARGET_ARCH_X64 2511 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698