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

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

Issue 809333002: [turbofan] Implement OSR for outer loops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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 a91b7db12689f665e9884601dbbe36a5c61f3487..840b75a5588208a45dd0cec090801ca395497189 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -457,6 +457,7 @@ void InstructionSelector::VisitBlock(BasicBlock* block) {
// up".
size_t current_node_end = instructions_.size();
VisitNode(node);
+ // TODO(turbofan): only reverse if > 1 instruction emitted.
std::reverse(instructions_.begin() + current_node_end, instructions_.end());
}
@@ -536,6 +537,8 @@ MachineType InstructionSelector::GetMachineType(Node* node) {
return kMachAnyTagged;
case IrOpcode::kParameter:
return linkage()->GetParameterType(OpParameter<int>(node));
+ case IrOpcode::kOsrValue:
+ return kMachAnyTagged;
case IrOpcode::kPhi:
return OpParameter<MachineType>(node);
case IrOpcode::kProjection:
@@ -674,6 +677,8 @@ void InstructionSelector::VisitNode(Node* node) {
MarkAsRepresentation(type, node);
return VisitParameter(node);
}
+ case IrOpcode::kOsrValue:
+ return VisitOsrValue(node);
case IrOpcode::kPhi: {
MachineType type = OpParameter<MachineType>(node);
MarkAsRepresentation(type, node);
@@ -958,6 +963,14 @@ void InstructionSelector::VisitParameter(Node* node) {
}
+void InstructionSelector::VisitOsrValue(Node* node) {
+ OperandGenerator g(this);
+ int index = OpParameter<int>(node);
+ Emit(kArchNop, g.DefineAsLocation(node, linkage()->GetOsrValueLocation(index),
+ kMachAnyTagged));
+}
+
+
void InstructionSelector::VisitPhi(Node* node) {
const int input_count = node->op()->ValueInputCount();
PhiInstruction* phi = new (instruction_zone())

Powered by Google App Engine
This is Rietveld 408576698