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

Unified Diff: runtime/vm/intermediate_language.h

Issue 12638040: Compute local variable liveness before translation to SSA. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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/flow_graph_optimizer.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
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 6105fc3538f7ee06f73c73edc74f7ab6154a9978..3758c35e73b85cb44e5f71bb07b6165083d57f7c 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -619,11 +619,6 @@ class Instruction : public ZoneAllocated {
void Goto(JoinEntryInstr* entry);
- // Mutate assigned_vars to add the local variable index for all
- // frame-allocated locals assigned to by the instruction.
- virtual void RecordAssignedVars(BitVector* assigned_vars,
- intptr_t fixed_parameter_count);
-
virtual const char* DebugName() const = 0;
// Printing support.
@@ -969,7 +964,6 @@ class BlockEntryInstr : public Instruction {
GrowableArray<BlockEntryInstr*>* preorder,
GrowableArray<BlockEntryInstr*>* postorder,
GrowableArray<intptr_t>* parent,
- GrowableArray<BitVector*>* assigned_vars,
intptr_t variable_count,
intptr_t fixed_parameter_count);
@@ -1390,9 +1384,6 @@ class Definition : public Instruction {
// NULL iterator.
void ReplaceWith(Definition* other, ForwardInstructionIterator* iterator);
- virtual void RecordAssignedVars(BitVector* assigned_vars,
- intptr_t fixed_parameter_count);
-
// Printing support. These functions are sometimes overridden for custom
// formatting. Otherwise, it prints in the format "opcode(op1, op2, op3)".
virtual void PrintTo(BufferFormatter* f) const;
@@ -2709,7 +2700,8 @@ class StaticCallInstr : public TemplateDefinition<0> {
class LoadLocalInstr : public TemplateDefinition<0> {
public:
- explicit LoadLocalInstr(const LocalVariable& local) : local_(local) { }
+ explicit LoadLocalInstr(const LocalVariable& local)
+ : local_(local), is_last_(false) { }
DECLARE_INSTRUCTION(LoadLocal)
virtual CompileType ComputeType() const;
@@ -2725,8 +2717,12 @@ class LoadLocalInstr : public TemplateDefinition<0> {
return false;
}
+ void mark_last() { is_last_ = true; }
+ bool is_last() const { return is_last_; }
+
private:
const LocalVariable& local_;
+ bool is_last_;
DISALLOW_COPY_AND_ASSIGN(LoadLocalInstr);
};
@@ -2734,7 +2730,8 @@ class LoadLocalInstr : public TemplateDefinition<0> {
class StoreLocalInstr : public TemplateDefinition<1> {
public:
- StoreLocalInstr(const LocalVariable& local, Value* value) : local_(local) {
+ StoreLocalInstr(const LocalVariable& local, Value* value)
+ : local_(local), is_dead_(false), is_last_(false) {
SetInputAt(0, value);
}
@@ -2744,9 +2741,6 @@ class StoreLocalInstr : public TemplateDefinition<1> {
const LocalVariable& local() const { return local_; }
Value* value() const { return inputs_[0]; }
- virtual void RecordAssignedVars(BitVector* assigned_vars,
- intptr_t fixed_parameter_count);
-
virtual void PrintOperandsTo(BufferFormatter* f) const;
virtual bool CanDeoptimize() const { return false; }
@@ -2756,8 +2750,16 @@ class StoreLocalInstr : public TemplateDefinition<1> {
return false;
}
+ void mark_dead() { is_dead_ = true; }
+ bool is_dead() const { return is_dead_; }
+
+ void mark_last() { is_last_ = true; }
+ bool is_last() const { return is_last_; }
+
private:
const LocalVariable& local_;
+ bool is_dead_;
+ bool is_last_;
DISALLOW_COPY_AND_ASSIGN(StoreLocalInstr);
};
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698