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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10828018: Add support for fixed parameters in the register allocator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 24e88e81c297a945878f16e8c84306a5e6e4c29f..f9cb9496e8275b19a499edcdfabfaa5e2356f04e 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -108,6 +108,7 @@ FOR_EACH_COMPUTATION(FORWARD_DECLARATION)
#undef FORWARD_DECLARATION
// Forward declarations.
+class AssignedVarsCollector;
Kevin Millikin (Google) 2012/07/26 09:29:08 Huh?
Vyacheslav Egorov (Google) 2012/07/26 11:33:53 Artifacts :-). Removed.
class BindInstr;
class BranchInstr;
class BufferFormatter;
@@ -146,7 +147,8 @@ class Computation : public ZoneAllocated {
// Mutate assigned_vars to add the local variable index for all
// frame-allocated locals assigned to by the computation.
- virtual void RecordAssignedVars(BitVector* assigned_vars);
+ virtual void RecordAssignedVars(BitVector* assigned_vars,
+ intptr_t fixed_param_count);
virtual const char* DebugName() const = 0;
@@ -772,7 +774,8 @@ class StoreLocalComp : public TemplateComputation<1> {
Value* value() const { return inputs_[0]; }
intptr_t context_level() const { return context_level_; }
- virtual void RecordAssignedVars(BitVector* assigned_vars);
+ virtual void RecordAssignedVars(BitVector* assigned_vars,
+ intptr_t fixed_param_count);
virtual void PrintOperandsTo(BufferFormatter* f) const;
@@ -1794,14 +1797,16 @@ class Instruction : public ZoneAllocated {
GrowableArray<BlockEntryInstr*>* postorder,
GrowableArray<intptr_t>* parent,
GrowableArray<BitVector*>* assigned_vars,
- intptr_t variable_count) {
+ intptr_t variable_count,
+ intptr_t fixed_param_count) {
// Never called for instructions except block entries and branches.
UNREACHABLE();
}
// 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);
+ virtual void RecordAssignedVars(BitVector* assigned_vars,
+ intptr_t fixed_param_count);
// Printing support.
virtual void PrintTo(BufferFormatter* f) const = 0;
@@ -1918,7 +1923,8 @@ class BlockEntryInstr : public Instruction {
GrowableArray<BlockEntryInstr*>* postorder,
GrowableArray<intptr_t>* parent,
GrowableArray<BitVector*>* assigned_vars,
- intptr_t variable_count);
+ intptr_t variable_count,
+ intptr_t fixed_param_count);
protected:
BlockEntryInstr()
@@ -2000,7 +2006,8 @@ class GraphEntryInstr : public BlockEntryInstr {
: BlockEntryInstr(),
normal_entry_(normal_entry),
catch_entries_(),
- start_env_(NULL) { }
+ start_env_(NULL),
+ spill_slot_count_(0) { }
DECLARE_INSTRUCTION(GraphEntry)
@@ -2020,7 +2027,8 @@ class GraphEntryInstr : public BlockEntryInstr {
GrowableArray<BlockEntryInstr*>* postorder,
GrowableArray<intptr_t>* parent,
GrowableArray<BitVector*>* assigned_vars,
- intptr_t variable_count);
+ intptr_t variable_count,
+ intptr_t fixed_param_count);
void AddCatchEntry(TargetEntryInstr* entry) { catch_entries_.Add(entry); }
@@ -2029,10 +2037,16 @@ class GraphEntryInstr : public BlockEntryInstr {
Environment* start_env() const { return start_env_; }
void set_start_env(Environment* env) { start_env_ = env; }
+ intptr_t spill_slot_count() const { return spill_slot_count_; }
+ void set_spill_slot_count(intptr_t count) {
srdjan 2012/07/26 00:33:56 ASSERT(count >= 0)
Vyacheslav Egorov (Google) 2012/07/26 11:33:53 Done.
+ spill_slot_count_ = count;
+ }
+
private:
TargetEntryInstr* normal_entry_;
GrowableArray<TargetEntryInstr*> catch_entries_;
Environment* start_env_;
+ intptr_t spill_slot_count_;
DISALLOW_COPY_AND_ASSIGN(GraphEntryInstr);
};
@@ -2175,7 +2189,8 @@ class BindInstr : public Definition {
return computation()->StaticType();
}
- virtual void RecordAssignedVars(BitVector* assigned_vars);
+ virtual void RecordAssignedVars(BitVector* assigned_vars,
+ intptr_t fixed_param_count);
virtual LocationSummary* locs() {
return computation()->locs();
@@ -2385,7 +2400,8 @@ class BranchInstr : public InstructionWithInputs {
GrowableArray<BlockEntryInstr*>* postorder,
GrowableArray<intptr_t>* parent,
GrowableArray<BitVector*>* assigned_vars,
- intptr_t variable_count);
+ intptr_t variable_count,
+ intptr_t fixed_param_count);
virtual LocationSummary* MakeLocationSummary() const;
@@ -2500,8 +2516,11 @@ class Environment : public ZoneAllocated {
// TODO(vegorov): it's absolutely crucial that locations_ backing store
// is preallocated and never reallocated. We use pointers into it
// during register allocation.
- explicit Environment(const GrowableArray<Value*>& values)
- : values_(values.length()), locations_(values.length()) {
+ explicit Environment(const GrowableArray<Value*>& values,
+ intptr_t fixed_param_count)
+ : values_(values.length()),
+ locations_(values.length()),
+ fixed_param_count_(fixed_param_count) {
values_.AddArray(values);
}
@@ -2521,11 +2540,17 @@ class Environment : public ZoneAllocated {
return & locations_[ix];
}
+ intptr_t fixed_param_count() const {
+ return fixed_param_count_;
+ }
+
void PrintTo(BufferFormatter* f) const;
private:
GrowableArray<Value*> values_;
GrowableArray<Location> locations_;
+ const intptr_t fixed_param_count_;
+
DISALLOW_COPY_AND_ASSIGN(Environment);
};

Powered by Google App Engine
This is Rietveld 408576698