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

Unified Diff: runtime/vm/intermediate_language.h

Issue 62133002: Cleanup of branch code generation (no change in functionality). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased Created 7 years, 1 month 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/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 30039)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -21,7 +21,6 @@
class BufferFormatter;
class CatchBlockEntryInstr;
class ComparisonInstr;
-class ControlInstruction;
class Definition;
class Environment;
class FlowGraph;
@@ -746,9 +745,6 @@
bool IsDefinition() { return (AsDefinition() != NULL); }
virtual Definition* AsDefinition() { return NULL; }
- bool IsControl() { return (AsControl() != NULL); }
- virtual ControlInstruction* AsControl() { return NULL; }
-
virtual intptr_t InputCount() const = 0;
virtual Value* InputAt(intptr_t i) const = 0;
void SetInputAt(intptr_t i, Value* value) {
@@ -787,7 +783,7 @@
void set_next(Instruction* instr) {
ASSERT(!IsGraphEntry());
ASSERT(!IsReturn());
- ASSERT(!IsControl() || (instr == NULL));
+ ASSERT(!IsBranch() || (instr == NULL));
ASSERT(!IsPhi());
ASSERT(instr == NULL || !instr->IsBlockEntry());
// TODO(fschneider): Also add Throw and ReThrow to the list of instructions
@@ -1006,7 +1002,6 @@
friend class LoadIndexedInstr;
friend class StoreIndexedInstr;
friend class StoreInstanceFieldInstr;
- friend class ControlInstruction;
friend class ComparisonInstr;
friend class TargetEntryInstr;
friend class JoinEntryInstr;
@@ -2133,36 +2128,8 @@
};
-class ControlInstruction : public Instruction {
+class BranchInstr : public Instruction {
public:
- ControlInstruction() : true_successor_(NULL), false_successor_(NULL) { }
-
- virtual ControlInstruction* AsControl() { return this; }
-
- TargetEntryInstr* true_successor() const { return true_successor_; }
- TargetEntryInstr* false_successor() const { return false_successor_; }
-
- TargetEntryInstr** true_successor_address() { return &true_successor_; }
- TargetEntryInstr** false_successor_address() { return &false_successor_; }
-
- virtual intptr_t SuccessorCount() const;
- virtual BlockEntryInstr* SuccessorAt(intptr_t index) const;
-
- void EmitBranchOnCondition(FlowGraphCompiler* compiler,
- Condition true_condition);
-
- void EmitBranchOnValue(FlowGraphCompiler* compiler, bool result);
-
- private:
- TargetEntryInstr* true_successor_;
- TargetEntryInstr* false_successor_;
-
- DISALLOW_COPY_AND_ASSIGN(ControlInstruction);
-};
-
-
-class BranchInstr : public ControlInstruction {
- public:
explicit BranchInstr(ComparisonInstr* comparison, bool is_checked = false);
DECLARE_INSTRUCTION(Branch)
@@ -2220,14 +2187,23 @@
virtual bool MayThrow() const;
+ TargetEntryInstr* true_successor() const { return true_successor_; }
+ TargetEntryInstr* false_successor() const { return false_successor_; }
+
+ TargetEntryInstr** true_successor_address() { return &true_successor_; }
+ TargetEntryInstr** false_successor_address() { return &false_successor_; }
+
+ virtual intptr_t SuccessorCount() const;
+ virtual BlockEntryInstr* SuccessorAt(intptr_t index) const;
+
private:
virtual void RawSetInputAt(intptr_t i, Value* value);
+ TargetEntryInstr* true_successor_;
+ TargetEntryInstr* false_successor_;
ComparisonInstr* comparison_;
const bool is_checked_;
-
ConstrainedCompileType* constrained_type_;
-
TargetEntryInstr* constant_target_;
DISALLOW_COPY_AND_ASSIGN(BranchInstr);
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698