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

Side by Side Diff: src/compiler/ia32/instruction-selector-ia32.cc

Issue 492203002: Initial support for debugger frame state in Turbofan. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Another attempt to fix Win64 Created 6 years, 4 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 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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 Node* right = node->InputAt(1); 505 Node* right = node->InputAt(1);
506 VisitCompare(this, kSSEFloat64Cmp, g.UseDoubleRegister(left), g.Use(right), 506 VisitCompare(this, kSSEFloat64Cmp, g.UseDoubleRegister(left), g.Use(right),
507 cont); 507 cont);
508 } 508 }
509 509
510 510
511 void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation, 511 void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation,
512 BasicBlock* deoptimization) { 512 BasicBlock* deoptimization) {
513 IA32OperandGenerator g(this); 513 IA32OperandGenerator g(this);
514 CallDescriptor* descriptor = OpParameter<CallDescriptor*>(call); 514 CallDescriptor* descriptor = OpParameter<CallDescriptor*>(call);
515 CallBuffer buffer(zone(), descriptor); 515
516 FrameStateDescriptor* frame_state_descriptor = NULL;
517
518 if (descriptor->NeedsFrameState()) {
519 frame_state_descriptor =
520 GetFrameStateDescriptor(call->InputAt(descriptor->InputCount()));
521 }
522
523 CallBuffer buffer(zone(), descriptor, frame_state_descriptor);
516 524
517 // Compute InstructionOperands for inputs and outputs. 525 // Compute InstructionOperands for inputs and outputs.
518 InitializeCallBuffer(call, &buffer, true, true, continuation, deoptimization); 526 InitializeCallBuffer(call, &buffer, true, true, continuation, deoptimization);
519 527
520 // Push any stack arguments. 528 // Push any stack arguments.
521 for (int i = buffer.pushed_count - 1; i >= 0; --i) { 529 for (NodeVectorRIter input = buffer.pushed_nodes.rbegin();
522 Node* input = buffer.pushed_nodes[i]; 530 input != buffer.pushed_nodes.rend(); input++) {
523 // TODO(titzer): handle pushing double parameters. 531 // TODO(titzer): handle pushing double parameters.
524 Emit(kIA32Push, NULL, 532 Emit(kIA32Push, NULL,
525 g.CanBeImmediate(input) ? g.UseImmediate(input) : g.Use(input)); 533 g.CanBeImmediate(*input) ? g.UseImmediate(*input) : g.Use(*input));
526 } 534 }
527 535
528 // Select the appropriate opcode based on the call type. 536 // Select the appropriate opcode based on the call type.
529 InstructionCode opcode; 537 InstructionCode opcode;
530 switch (descriptor->kind()) { 538 switch (descriptor->kind()) {
531 case CallDescriptor::kCallCodeObject: { 539 case CallDescriptor::kCallCodeObject: {
532 bool lazy_deopt = descriptor->CanLazilyDeoptimize(); 540 opcode = kIA32CallCodeObject;
533 opcode = kIA32CallCodeObject | MiscField::encode(lazy_deopt ? 1 : 0);
534 break; 541 break;
535 } 542 }
536 case CallDescriptor::kCallAddress: 543 case CallDescriptor::kCallAddress:
537 opcode = kIA32CallAddress; 544 opcode = kIA32CallAddress;
538 break; 545 break;
539 case CallDescriptor::kCallJSFunction: 546 case CallDescriptor::kCallJSFunction:
540 opcode = kIA32CallJSFunction; 547 opcode = kIA32CallJSFunction;
541 break; 548 break;
542 default: 549 default:
543 UNREACHABLE(); 550 UNREACHABLE();
544 return; 551 return;
545 } 552 }
553 opcode |= MiscField::encode(descriptor->deoptimization_support());
546 554
547 // Emit the call instruction. 555 // Emit the call instruction.
548 Instruction* call_instr = 556 Instruction* call_instr =
549 Emit(opcode, buffer.output_count, buffer.outputs, 557 Emit(opcode, buffer.outputs.size(), &buffer.outputs.front(),
550 buffer.fixed_and_control_count(), buffer.fixed_and_control_args); 558 buffer.instruction_args.size(), &buffer.instruction_args.front());
551 559
552 call_instr->MarkAsCall(); 560 call_instr->MarkAsCall();
553 if (deoptimization != NULL) { 561 if (deoptimization != NULL) {
554 DCHECK(continuation != NULL); 562 DCHECK(continuation != NULL);
555 call_instr->MarkAsControl(); 563 call_instr->MarkAsControl();
556 } 564 }
557 565
558 // Caller clean up of stack for C-style calls. 566 // Caller clean up of stack for C-style calls.
559 if (descriptor->kind() == CallDescriptor::kCallAddress && 567 if (descriptor->kind() == CallDescriptor::kCallAddress &&
560 buffer.pushed_count > 0) { 568 buffer.pushed_nodes.size() > 0) {
561 DCHECK(deoptimization == NULL && continuation == NULL); 569 DCHECK(deoptimization == NULL && continuation == NULL);
562 Emit(kPopStack | MiscField::encode(buffer.pushed_count), NULL); 570 Emit(kPopStack | MiscField::encode(buffer.pushed_nodes.size()), NULL);
563 } 571 }
564 } 572 }
565 573
566 } // namespace compiler 574 } // namespace compiler
567 } // namespace internal 575 } // namespace internal
568 } // namespace v8 576 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698