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

Unified Diff: src/compiler/instruction-selector.cc

Issue 530783002: Convert Linkage to use MachineSignature. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Another try at size_t. Staunch the bleeding. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: src/compiler/instruction-selector.cc
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc
index 0e3f341f4f2a1c16d88e4deece82138e7dc4bc27..503cca031f64203fca0b4a5ac17aa2427bcc0c83 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -298,10 +298,12 @@ void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer,
for (size_t i = 0; i < buffer->output_nodes.size(); i++) {
if (buffer->output_nodes[i] != NULL) {
Node* output = buffer->output_nodes[i];
+ MachineType type =
+ buffer->descriptor->GetReturnType(static_cast<int>(i));
LinkageLocation location =
buffer->descriptor->GetReturnLocation(static_cast<int>(i));
- MarkAsRepresentation(location.representation(), output);
- buffer->outputs.push_back(g.DefineAsLocation(output, location));
+ MarkAsRepresentation(type, output);
+ buffer->outputs.push_back(g.DefineAsLocation(output, location, type));
}
}
}
@@ -325,7 +327,8 @@ void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer,
break;
case CallDescriptor::kCallJSFunction:
buffer->instruction_args.push_back(
- g.UseLocation(callee, buffer->descriptor->GetInputLocation(0)));
+ g.UseLocation(callee, buffer->descriptor->GetInputLocation(0),
+ buffer->descriptor->GetInputType(0)));
break;
}
DCHECK_EQ(1, buffer->instruction_args.size());
@@ -343,8 +346,8 @@ void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer,
AddFrameStateInputs(frame_state, &buffer->instruction_args,
buffer->frame_state_descriptor);
}
- DCHECK_EQ(1 + buffer->frame_state_value_count(),
- buffer->instruction_args.size());
+ DCHECK(1 + buffer->frame_state_value_count() ==
+ buffer->instruction_args.size());
int input_count = buffer->input_count();
@@ -360,7 +363,8 @@ void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer,
DCHECK((*iter)->op()->opcode() != IrOpcode::kFrameState);
if (index == 0) continue; // The first argument (callee) is already done.
InstructionOperand* op =
- g.UseLocation(*iter, buffer->descriptor->GetInputLocation(index));
+ g.UseLocation(*iter, buffer->descriptor->GetInputLocation(index),
+ buffer->descriptor->GetInputType(index));
if (UnallocatedOperand::cast(op)->HasFixedSlotPolicy()) {
int stack_index = -UnallocatedOperand::cast(op)->fixed_slot_index() - 1;
if (static_cast<size_t>(stack_index) >= buffer->pushed_nodes.size()) {
@@ -484,9 +488,8 @@ void InstructionSelector::VisitNode(Node* node) {
case IrOpcode::kFinish:
return VisitFinish(node);
case IrOpcode::kParameter: {
- LinkageLocation location =
- linkage()->GetParameterLocation(OpParameter<int>(node));
- MarkAsRepresentation(location.representation(), node);
+ MachineType type = linkage()->GetParameterType(OpParameter<int>(node));
+ MarkAsRepresentation(type, node);
return VisitParameter(node);
}
case IrOpcode::kPhi:
@@ -822,8 +825,10 @@ void InstructionSelector::VisitFinish(Node* node) {
void InstructionSelector::VisitParameter(Node* node) {
OperandGenerator g(this);
- Emit(kArchNop, g.DefineAsLocation(node, linkage()->GetParameterLocation(
- OpParameter<int>(node))));
+ int index = OpParameter<int>(node);
+ Emit(kArchNop,
+ g.DefineAsLocation(node, linkage()->GetParameterLocation(index),
+ linkage()->GetParameterType(index)));
}
@@ -987,7 +992,8 @@ void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch,
void InstructionSelector::VisitReturn(Node* value) {
OperandGenerator g(this);
if (value != NULL) {
- Emit(kArchRet, NULL, g.UseLocation(value, linkage()->GetReturnLocation()));
+ Emit(kArchRet, NULL, g.UseLocation(value, linkage()->GetReturnLocation(),
+ linkage()->GetReturnType()));
} else {
Emit(kArchRet, NULL);
}

Powered by Google App Engine
This is Rietveld 408576698