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

Unified Diff: runtime/vm/intrinsifier.cc

Issue 2772143002: Reland "VM: Handle null-comparisons in the flow graph type propagation" (Closed)
Patch Set: address comments Created 3 years, 9 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 | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier.cc
diff --git a/runtime/vm/intrinsifier.cc b/runtime/vm/intrinsifier.cc
index 9c6d9eef36ee37b4b50dd56d17d2dfc69e98fcc3..3b915134ac574dd327aff43230438ae834bf1b46 100644
--- a/runtime/vm/intrinsifier.cc
+++ b/runtime/vm/intrinsifier.cc
@@ -285,7 +285,14 @@ static intptr_t CidForRepresentation(Representation rep) {
class BlockBuilder : public ValueObject {
public:
BlockBuilder(FlowGraph* flow_graph, TargetEntryInstr* entry)
- : flow_graph_(flow_graph), entry_(entry), current_(entry) {}
+ : flow_graph_(flow_graph),
+ entry_(entry),
+ current_(entry),
+ empty_env_(new Environment(0,
+ 0,
+ Thread::kNoDeoptId,
+ flow_graph->parsed_function(),
+ NULL)) {}
Definition* AddToInitialDefinitions(Definition* def) {
def->set_ssa_temp_index(flow_graph_->alloc_ssa_temp_index());
@@ -295,11 +302,17 @@ class BlockBuilder : public ValueObject {
Definition* AddDefinition(Definition* def) {
def->set_ssa_temp_index(flow_graph_->alloc_ssa_temp_index());
- current_ = current_->AppendInstruction(def);
+ AddInstruction(def);
return def;
}
Instruction* AddInstruction(Instruction* instr) {
+ if (instr->ComputeCanDeoptimize()) {
+ // Since we use the presence of an environment to determine if an
+ // instructions can deoptimize, we need an empty enviroment for
+ // instructions that "deoptimize" to the intrinsic fall-through code.
+ instr->SetEnvironment(empty_env_);
+ }
current_ = current_->AppendInstruction(instr);
return instr;
}
@@ -360,6 +373,7 @@ class BlockBuilder : public ValueObject {
FlowGraph* flow_graph_;
BlockEntryInstr* entry_;
Instruction* current_;
+ Environment* empty_env_;
};
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698