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

Unified Diff: vm/intermediate_language.h

Issue 10830275: Optimize expressions of the form (expr === true) when expr has boolean type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: addressed comments Created 8 years, 4 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 | « vm/il_printer.cc ('k') | vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/intermediate_language.h
===================================================================
--- vm/intermediate_language.h (revision 10497)
+++ vm/intermediate_language.h (working copy)
@@ -112,6 +112,7 @@
class BranchInstr;
class BufferFormatter;
class ComparisonComp;
+class Definition;
class Instruction;
class PushArgumentInstr;
class Value;
@@ -147,6 +148,10 @@
// Returns true, if this computation can deoptimize.
virtual bool CanDeoptimize() const = 0;
+ // Optimize this computation. Returns a replacement for the instruction
+ // that wraps this computation or NULL if nothing to replace.
+ virtual Definition* TryReplace(BindInstr* instr) { return NULL; }
+
// Compile time type of the computation, which typically depends on the
// compile time types (and possibly propagated types) of its inputs.
virtual RawAbstractType* CompileType() const = 0;
@@ -354,6 +359,8 @@
UseVal* next_use_;
UseVal* previous_use_;
+ friend class Definition;
+
DISALLOW_COPY_AND_ASSIGN(UseVal);
};
@@ -646,6 +653,8 @@
virtual bool CanDeoptimize() const { return false; }
+ virtual Definition* TryReplace(BindInstr* instr);
+
private:
DISALLOW_COPY_AND_ASSIGN(StrictCompareComp);
};
@@ -2374,6 +2383,8 @@
use_list_ = head;
}
+ void ReplaceUsesWith(Definition* other);
+
private:
intptr_t temp_index_;
intptr_t ssa_temp_index_;
« no previous file with comments | « vm/il_printer.cc ('k') | vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698