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

Unified Diff: runtime/vm/intermediate_language.h

Issue 14872002: Improve load forwarding: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address Srdjan's comments Created 7 years, 8 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
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index a09b2c6abe3624c07ec1263620b6168558386f2f..dc33a3fe836bd2128b8eed52bae58c77f2c4faf9 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -3425,7 +3425,8 @@ class AllocateObjectInstr : public TemplateDefinition<0> {
ZoneGrowableArray<PushArgumentInstr*>* arguments)
: ast_node_(*node),
arguments_(arguments),
- cid_(Class::Handle(node->constructor().Owner()).id()) {
+ cid_(Class::Handle(node->constructor().Owner()).id()),
+ identity_(kUnknown) {
// Either no arguments or one type-argument and one instantiator.
ASSERT(arguments->is_empty() || (arguments->length() == 2));
}
@@ -3447,10 +3448,23 @@ class AllocateObjectInstr : public TemplateDefinition<0> {
virtual EffectSet Effects() const { return EffectSet::None(); }
+ // If the result of the allocation is not stored into any field, passed
+ // as an argument or used in a phi then it can't alias with any other
+ // SSA value.
+ enum Identity {
+ kUnknown,
+ kAliased,
+ kNotAliased
+ };
+
+ Identity identity() const { return identity_; }
+ void set_identity(Identity identity) { identity_ = identity; }
+
private:
const ConstructorCallNode& ast_node_;
ZoneGrowableArray<PushArgumentInstr*>* const arguments_;
const intptr_t cid_;
+ Identity identity_;
DISALLOW_COPY_AND_ASSIGN(AllocateObjectInstr);
};
@@ -3592,7 +3606,7 @@ class LoadUntaggedInstr : public TemplateDefinition<1> {
class LoadFieldInstr : public TemplateDefinition<1> {
public:
- LoadFieldInstr(Value* value,
+ LoadFieldInstr(Value* instance,
intptr_t offset_in_bytes,
const AbstractType& type,
bool immutable = false)
@@ -3604,10 +3618,10 @@ class LoadFieldInstr : public TemplateDefinition<1> {
field_name_(NULL),
field_(NULL) {
ASSERT(type.IsZoneHandle()); // May be null if field is not an instance.
- SetInputAt(0, value);
+ SetInputAt(0, instance);
}
- Value* value() const { return inputs_[0]; }
+ Value* instance() const { return inputs_[0]; }
intptr_t offset_in_bytes() const { return offset_in_bytes_; }
const AbstractType& type() const { return type_; }
void set_result_cid(intptr_t value) { result_cid_ = value; }
@@ -3616,8 +3630,8 @@ class LoadFieldInstr : public TemplateDefinition<1> {
void set_field_name(const char* name) { field_name_ = name; }
const char* field_name() const { return field_name_; }
- Field* field() const { return field_; }
- void set_field(Field* field) { field_ = field; }
+ const Field* field() const { return field_; }
+ void set_field(const Field* field) { field_ = field; }
void set_recognized_kind(MethodRecognizer::Kind kind) {
recognized_kind_ = kind;
@@ -3658,7 +3672,7 @@ class LoadFieldInstr : public TemplateDefinition<1> {
MethodRecognizer::Kind recognized_kind_;
const char* field_name_;
- Field* field_;
+ const Field* field_;
DISALLOW_COPY_AND_ASSIGN(LoadFieldInstr);
};
@@ -3956,6 +3970,8 @@ class BoxDoubleInstr : public TemplateDefinition<1> {
virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ Definition* Canonicalize(FlowGraphOptimizer* optimizer);
+
private:
DISALLOW_COPY_AND_ASSIGN(BoxDoubleInstr);
};
@@ -4071,6 +4087,8 @@ class UnboxDoubleInstr : public TemplateDefinition<1> {
virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ Definition* Canonicalize(FlowGraphOptimizer* optimizer);
+
private:
DISALLOW_COPY_AND_ASSIGN(UnboxDoubleInstr);
};
« 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