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

Unified Diff: runtime/vm/flow_graph.h

Issue 14935005: Implement a variation of scalar replacement for non-escaping allocations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comments Created 7 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 | « runtime/vm/deopt_instructions.cc ('k') | runtime/vm/flow_graph.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph.h
diff --git a/runtime/vm/flow_graph.h b/runtime/vm/flow_graph.h
index d071b3688294c0dc0284351744ae427004559f31..ec85594358b9856c6e8981a7eaa983280a271d74 100644
--- a/runtime/vm/flow_graph.h
+++ b/runtime/vm/flow_graph.h
@@ -150,6 +150,23 @@ class FlowGraph : public ZoneAllocated {
// Remove the redefinition instructions inserted to inhibit code motion.
void RemoveRedefinitions();
+ // Copy deoptimization target from one instruction to another if we still
+ // have to keep deoptimization environment at gotos for LICM purposes.
+ void CopyDeoptTarget(Instruction* to, Instruction* from) {
+ if (is_licm_allowed()) {
+ to->InheritDeoptTarget(from);
+ }
+ }
+
+ // Returns true if every Goto in the graph is expected to have a
+ // deoptimization environment and can be used as deoptimization target
+ // for hoisted instructions.
+ bool is_licm_allowed() const { return licm_allowed_; }
+
+ // Stop preserving environments on Goto instructions. LICM is not allowed
+ // after this point.
+ void disallow_licm() { licm_allowed_ = false; }
+
private:
friend class IfConverter;
friend class BranchSimplifier;
@@ -205,6 +222,7 @@ class FlowGraph : public ZoneAllocated {
ConstantInstr* constant_null_;
BlockEffects* block_effects_;
+ bool licm_allowed_;
};
« no previous file with comments | « runtime/vm/deopt_instructions.cc ('k') | runtime/vm/flow_graph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698