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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10830339: Propagate class ids using existing type propagation framework. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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 | « runtime/vm/il_printer.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 10825)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -156,6 +156,9 @@
// 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;
+ // TODO(srdjan): Make this abstract so that it gets correctly implemented
+ // in all computations.
+ virtual intptr_t ResultCid() const { return kDynamicCid; }
// Mutate assigned_vars to add the local variable index for all
// frame-allocated locals assigned to by the computation.
@@ -368,6 +371,8 @@
virtual void RemoveFromUseList();
virtual void RemoveInputUses() { RemoveFromUseList(); }
+ virtual intptr_t ResultCid() const;
+
private:
void AddToUseList();
Definition* definition_;
@@ -380,7 +385,7 @@
};
-class ConstantVal: public Value {
+class ConstantVal : public Value {
public:
explicit ConstantVal(const Object& value)
: value_(value) {
@@ -402,6 +407,8 @@
virtual void RemoveFromUseList() { }
+ virtual intptr_t ResultCid() const;
+
private:
const Object& value_;
@@ -499,6 +506,8 @@
virtual bool CanDeoptimize() const { return false; }
+ virtual intptr_t ResultCid() const { return kBoolCid; }
+
private:
const intptr_t token_pos_;
const intptr_t try_index_;
@@ -693,6 +702,8 @@
virtual Definition* TryReplace(BindInstr* instr);
+ virtual intptr_t ResultCid() const { return kBoolCid; }
+
private:
DISALLOW_COPY_AND_ASSIGN(StrictCompareComp);
};
@@ -725,6 +736,8 @@
virtual bool CanDeoptimize() const { return true; }
+ virtual intptr_t ResultCid() const { return kBoolCid; }
+
private:
const intptr_t token_pos_;
const intptr_t try_index_;
@@ -765,6 +778,8 @@
virtual bool CanDeoptimize() const { return true; }
+ virtual intptr_t ResultCid() const { return kBoolCid; }
+
private:
const intptr_t token_pos_;
const intptr_t try_index_;
@@ -2375,6 +2390,7 @@
: temp_index_(-1),
ssa_temp_index_(-1),
propagated_type_(AbstractType::Handle()),
+ propagated_cid_(kIllegalCid),
use_list_(NULL) { }
virtual bool IsDefinition() const { return true; }
@@ -2413,6 +2429,14 @@
return changed;
}
+ bool has_propagated_cid() const { return propagated_cid_ != kIllegalCid; }
+ intptr_t propagated_cid() const { return propagated_cid_; }
+ // May compute and set propagated cid.
+ virtual intptr_t GetPropagatedCid() = 0;
+
+ // Returns true if the propagated cid has changed.
+ bool SetPropagatedCid(intptr_t cid);
+
UseVal* use_list() { return use_list_; }
void set_use_list(UseVal* head) {
ASSERT(head == NULL || head->previous_use() == NULL);
@@ -2427,6 +2451,7 @@
// TODO(regis): GrowableArray<const AbstractType*> propagated_types_;
// For now:
AbstractType& propagated_type_;
+ intptr_t propagated_cid_;
UseVal* use_list_;
DISALLOW_COPY_AND_ASSIGN(Definition);
@@ -2469,6 +2494,7 @@
bool is_used() const { return is_used_; }
virtual RawAbstractType* CompileType() const;
+ virtual intptr_t GetPropagatedCid();
virtual void RecordAssignedVars(BitVector* assigned_vars,
intptr_t fixed_parameter_count);
@@ -2499,6 +2525,7 @@
}
virtual RawAbstractType* CompileType() const;
+ virtual intptr_t GetPropagatedCid() { return propagated_cid(); }
virtual intptr_t ArgumentCount() const { return 0; }
@@ -2544,6 +2571,8 @@
// Compile type of the passed-in parameter.
virtual RawAbstractType* CompileType() const;
+ // No known propagated cid for parameters.
+ virtual intptr_t GetPropagatedCid() { return propagated_cid(); }
virtual intptr_t ArgumentCount() const { return 0; }
@@ -2586,6 +2615,7 @@
virtual intptr_t ArgumentCount() const { return 0; }
virtual RawAbstractType* CompileType() const;
+ virtual intptr_t GetPropagatedCid() { return propagated_cid(); }
Value* value() const { return value_; }
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698