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

Unified Diff: runtime/vm/flow_graph_optimizer.h

Issue 12212093: Convert some compiler passes to preserve valid def-use chains. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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: runtime/vm/flow_graph_optimizer.h
diff --git a/runtime/vm/flow_graph_optimizer.h b/runtime/vm/flow_graph_optimizer.h
index b53054e2f45b2f4bef6c74145ba5568059091282..50a0852bae48988b01a6e857a5926530eee62a07 100644
--- a/runtime/vm/flow_graph_optimizer.h
+++ b/runtime/vm/flow_graph_optimizer.h
@@ -47,7 +47,9 @@ class FlowGraphOptimizer : public FlowGraphVisitor {
void InsertBefore(Instruction* next,
Instruction* instr,
Environment* env,
- Definition::UseKind use_kind);
+ Definition::UseKind use_kind) {
+ flow_graph_->InsertBefore(next, instr, env, use_kind);
+ }
private:
// Attempt to build ICData for call using propagated class-ids.
@@ -57,8 +59,8 @@ class FlowGraphOptimizer : public FlowGraphVisitor {
intptr_t PrepareIndexedOp(InstanceCallInstr* call,
intptr_t class_id,
- Value** array,
- Value** index);
+ Definition** array,
+ Definition** index);
bool TryReplaceWithStoreIndexed(InstanceCallInstr* call);
bool TryReplaceWithLoadIndexed(InstanceCallInstr* call);
@@ -79,12 +81,22 @@ class FlowGraphOptimizer : public FlowGraphVisitor {
intptr_t receiver_cid,
intptr_t view_cid);
- void AddCheckClass(InstanceCallInstr* call, Value* value);
+ // Insert a check of 'to_check' determined by 'unary_checks'. If the
+ // check fails it will deoptimize to 'deopt_id' using the deoptimization
+ // environment 'deopt_environment'. The check is inserted immediately
+ // before 'insert_before'.
+ void AddCheckClass(Definition* to_check,
+ const ICData& unary_checks,
+ intptr_t deopt_id,
+ Environment* deopt_environment,
+ Instruction* insert_before);
+
+ // Add a class check for a call's first argument immediately before the
+ // call, using the call's IC data to determine the check, and the call's
+ // deopt ID and deoptimization environment if the check fails.
+ void AddReceiverCheck(InstanceCallInstr* call);
- void InsertAfter(Instruction* prev,
- Instruction* instr,
- Environment* env,
- Definition::UseKind use_kind);
+ void ReplaceCall(Definition* call, Definition* replacement);
void InsertConversionsFor(Definition* def);
@@ -112,6 +124,14 @@ class FlowGraphOptimizer : public FlowGraphVisitor {
void ReplaceWithMathCFunction(InstanceCallInstr* call,
MethodRecognizer::Kind recognized_kind);
+ void HandleRelationalOp(RelationalOpInstr* comp);
+
+ // Visit an equality compare. The current instruction can be the
+ // comparison itself or a branch on the comparison.
+ template <typename T>
+ void HandleEqualityCompare(EqualityCompareInstr* comp,
+ T current_instruction);
+
FlowGraph* flow_graph_;
DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer);

Powered by Google App Engine
This is Rietveld 408576698