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

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

Issue 492203002: Initial support for debugger frame state in Turbofan. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Relax a CHECK to DCHECK 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 side-by-side diff with in-line comments
Download patch
Index: src/compiler/x64/instruction-selector-x64.cc
diff --git a/src/compiler/x64/instruction-selector-x64.cc b/src/compiler/x64/instruction-selector-x64.cc
index bb4c03bd7e96c65bca7336d070b095e759fbcccb..fca82b44da37ad36ad02017124653398c305e701 100644
--- a/src/compiler/x64/instruction-selector-x64.cc
+++ b/src/compiler/x64/instruction-selector-x64.cc
@@ -676,7 +676,14 @@ void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation,
BasicBlock* deoptimization) {
X64OperandGenerator g(this);
CallDescriptor* descriptor = OpParameter<CallDescriptor*>(call);
- CallBuffer buffer(zone(), descriptor); // TODO(turbofan): temp zone here?
+
+ FrameStateDescriptor* frame_state_descriptor = NULL;
+ if (descriptor->NeedsFrameState()) {
+ frame_state_descriptor =
+ GetFrameStateDescriptor(call->InputAt(descriptor->InputCount()));
+ }
+
+ CallBuffer buffer(zone(), descriptor, frame_state_descriptor);
// Compute InstructionOperands for inputs and outputs.
InitializeCallBuffer(call, &buffer, true, true, continuation, deoptimization);
@@ -684,7 +691,7 @@ void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation,
// TODO(dcarney): stack alignment for c calls.
// TODO(dcarney): shadow space on window for c calls.
// Push any stack arguments.
- for (int i = buffer.pushed_count - 1; i >= 0; --i) {
+ for (int i = buffer.pushed_nodes.size() - 1; i >= 0; --i) {
Node* input = buffer.pushed_nodes[i];
// TODO(titzer): handle pushing double parameters.
if (g.CanBeImmediate(input)) {
@@ -698,8 +705,7 @@ void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation,
InstructionCode opcode;
switch (descriptor->kind()) {
case CallDescriptor::kCallCodeObject: {
- bool lazy_deopt = descriptor->CanLazilyDeoptimize();
- opcode = kX64CallCodeObject | MiscField::encode(lazy_deopt ? 1 : 0);
+ opcode = kX64CallCodeObject;
break;
}
case CallDescriptor::kCallAddress:
@@ -712,11 +718,12 @@ void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation,
UNREACHABLE();
return;
}
+ opcode |= MiscField::encode(descriptor->deoptimization_support());
// Emit the call instruction.
Instruction* call_instr =
- Emit(opcode, buffer.output_count, buffer.outputs,
- buffer.fixed_and_control_count(), buffer.fixed_and_control_args);
+ Emit(opcode, buffer.outputs.size(), &buffer.outputs.front(),
+ buffer.instruction_args.size(), &buffer.instruction_args.front());
call_instr->MarkAsCall();
if (deoptimization != NULL) {
@@ -726,9 +733,9 @@ void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation,
// Caller clean up of stack for C-style calls.
if (descriptor->kind() == CallDescriptor::kCallAddress &&
- buffer.pushed_count > 0) {
+ !buffer.pushed_nodes.empty()) {
DCHECK(deoptimization == NULL && continuation == NULL);
- Emit(kPopStack | MiscField::encode(buffer.pushed_count), NULL);
+ Emit(kPopStack | MiscField::encode(buffer.pushed_nodes.size()), NULL);
}
}

Powered by Google App Engine
This is Rietveld 408576698