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

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

Issue 2916143003: handle WASM trap in the instruction scheduler. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « src/compiler/instruction-scheduler.h ('k') | src/compiler/x64/instruction-scheduler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-scheduler.cc
diff --git a/src/compiler/instruction-scheduler.cc b/src/compiler/instruction-scheduler.cc
index 83d163775dc41d91cd925a5516f5e95df471f754..e311abb2a279b844379d82e86c9c6646b4fbcd0a 100644
--- a/src/compiler/instruction-scheduler.cc
+++ b/src/compiler/instruction-scheduler.cc
@@ -77,7 +77,6 @@ void InstructionScheduler::ScheduleGraphNode::AddSuccessor(
node->unscheduled_predecessors_count_++;
}
-
InstructionScheduler::InstructionScheduler(Zone* zone,
InstructionSequence* sequence)
: zone_(zone),
@@ -86,16 +85,15 @@ InstructionScheduler::InstructionScheduler(Zone* zone,
last_side_effect_instr_(nullptr),
pending_loads_(zone),
last_live_in_reg_marker_(nullptr),
- last_deopt_(nullptr),
+ last_deopt_or_trap_(nullptr),
operands_map_(zone) {}
-
void InstructionScheduler::StartBlock(RpoNumber rpo) {
DCHECK(graph_.empty());
DCHECK(last_side_effect_instr_ == nullptr);
DCHECK(pending_loads_.empty());
DCHECK(last_live_in_reg_marker_ == nullptr);
- DCHECK(last_deopt_ == nullptr);
+ DCHECK(last_deopt_or_trap_ == nullptr);
DCHECK(operands_map_.empty());
sequence()->StartBlock(rpo);
}
@@ -112,7 +110,7 @@ void InstructionScheduler::EndBlock(RpoNumber rpo) {
last_side_effect_instr_ = nullptr;
pending_loads_.clear();
last_live_in_reg_marker_ = nullptr;
- last_deopt_ = nullptr;
+ last_deopt_or_trap_ = nullptr;
operands_map_.clear();
}
@@ -137,9 +135,9 @@ void InstructionScheduler::AddInstruction(Instruction* instr) {
}
// Make sure that instructions are not scheduled before the last
- // deoptimization point when they depend on it.
- if ((last_deopt_ != nullptr) && DependsOnDeoptimization(instr)) {
- last_deopt_->AddSuccessor(new_node);
+ // deoptimization or trap point when they depend on it.
+ if ((last_deopt_or_trap_ != nullptr) && DependsOnDeoptOrTrap(instr)) {
+ last_deopt_or_trap_->AddSuccessor(new_node);
}
// Instructions with side effects and memory operations can't be
@@ -160,13 +158,13 @@ void InstructionScheduler::AddInstruction(Instruction* instr) {
last_side_effect_instr_->AddSuccessor(new_node);
}
pending_loads_.push_back(new_node);
- } else if (instr->IsDeoptimizeCall()) {
- // Ensure that deopts are not reordered with respect to side-effect
- // instructions.
+ } else if (instr->IsDeoptimizeCall() || instr->IsTrap()) {
+ // Ensure that deopts or traps are not reordered with respect to
+ // side-effect instructions.
if (last_side_effect_instr_ != nullptr) {
last_side_effect_instr_->AddSuccessor(new_node);
}
- last_deopt_ = new_node;
+ last_deopt_or_trap_ = new_node;
}
// Look for operand dependencies.
« no previous file with comments | « src/compiler/instruction-scheduler.h ('k') | src/compiler/x64/instruction-scheduler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698