OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/instruction-selector-impl.h" | 5 #include "src/compiler/instruction-selector-impl.h" |
6 #include "src/compiler/node-matchers.h" | 6 #include "src/compiler/node-matchers.h" |
7 #include "src/compiler/node-properties-inl.h" | 7 #include "src/compiler/node-properties-inl.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 input != buffer.pushed_nodes.rend(); input++) { | 523 input != buffer.pushed_nodes.rend(); input++) { |
524 // TODO(titzer): handle pushing double parameters. | 524 // TODO(titzer): handle pushing double parameters. |
525 Emit(kIA32Push, NULL, | 525 Emit(kIA32Push, NULL, |
526 g.CanBeImmediate(*input) ? g.UseImmediate(*input) : g.Use(*input)); | 526 g.CanBeImmediate(*input) ? g.UseImmediate(*input) : g.Use(*input)); |
527 } | 527 } |
528 | 528 |
529 // Select the appropriate opcode based on the call type. | 529 // Select the appropriate opcode based on the call type. |
530 InstructionCode opcode; | 530 InstructionCode opcode; |
531 switch (descriptor->kind()) { | 531 switch (descriptor->kind()) { |
532 case CallDescriptor::kCallCodeObject: { | 532 case CallDescriptor::kCallCodeObject: { |
533 opcode = kIA32CallCodeObject; | 533 opcode = kArchCallCodeObject; |
534 break; | 534 break; |
535 } | 535 } |
536 case CallDescriptor::kCallAddress: | 536 case CallDescriptor::kCallAddress: |
537 opcode = kIA32CallAddress; | 537 opcode = kArchCallAddress; |
538 break; | 538 break; |
539 case CallDescriptor::kCallJSFunction: | 539 case CallDescriptor::kCallJSFunction: |
540 opcode = kIA32CallJSFunction; | 540 opcode = kArchCallJSFunction; |
541 break; | 541 break; |
542 default: | 542 default: |
543 UNREACHABLE(); | 543 UNREACHABLE(); |
544 return; | 544 return; |
545 } | 545 } |
546 opcode |= MiscField::encode(descriptor->deoptimization_support()); | 546 opcode |= MiscField::encode(descriptor->deoptimization_support()); |
547 | 547 |
548 // Emit the call instruction. | 548 // Emit the call instruction. |
549 Instruction* call_instr = | 549 Instruction* call_instr = |
550 Emit(opcode, buffer.outputs.size(), &buffer.outputs.front(), | 550 Emit(opcode, buffer.outputs.size(), &buffer.outputs.front(), |
551 buffer.instruction_args.size(), &buffer.instruction_args.front()); | 551 buffer.instruction_args.size(), &buffer.instruction_args.front()); |
552 | 552 |
553 call_instr->MarkAsCall(); | 553 call_instr->MarkAsCall(); |
554 if (deoptimization != NULL) { | 554 if (deoptimization != NULL) { |
555 DCHECK(continuation != NULL); | 555 DCHECK(continuation != NULL); |
556 call_instr->MarkAsControl(); | 556 call_instr->MarkAsControl(); |
557 } | 557 } |
558 | 558 |
559 // Caller clean up of stack for C-style calls. | 559 // Caller clean up of stack for C-style calls. |
560 if (descriptor->kind() == CallDescriptor::kCallAddress && | 560 if (descriptor->kind() == CallDescriptor::kCallAddress && |
561 buffer.pushed_nodes.size() > 0) { | 561 buffer.pushed_nodes.size() > 0) { |
562 DCHECK(deoptimization == NULL && continuation == NULL); | 562 DCHECK(deoptimization == NULL && continuation == NULL); |
563 Emit(kPopStack | MiscField::encode(buffer.pushed_nodes.size()), NULL); | 563 Emit(kArchDrop | MiscField::encode(buffer.pushed_nodes.size()), NULL); |
564 } | 564 } |
565 } | 565 } |
566 | 566 |
567 } // namespace compiler | 567 } // namespace compiler |
568 } // namespace internal | 568 } // namespace internal |
569 } // namespace v8 | 569 } // namespace v8 |
OLD | NEW |