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

Unified Diff: runtime/vm/intermediate_language.h

Issue 189543013: Add alias identity information to array allocations. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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') | tests/language/vm/load_to_load_forwarding_vm_test.dart » ('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 33493)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -1706,6 +1706,16 @@
};
+// 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 AliasIdentity {
+ kIdentityUnknown,
+ kIdentityAliased,
+ kIdentityNotAliased
+};
+
+
// Abstract super-class of all instructions that define a value (Bind, Phi).
class Definition : public Instruction {
public:
@@ -1843,6 +1853,16 @@
temp_index_ = reinterpret_cast<intptr_t>(other);
}
+ virtual AliasIdentity Identity() const {
+ // Only implemented for allocation instructions.
+ UNREACHABLE();
+ return kIdentityUnknown;
+ }
+
+ virtual void SetIdentity(AliasIdentity identity) {
+ UNREACHABLE();
+ }
+
protected:
friend class RangeAnalysis;
friend class Value;
@@ -3265,7 +3285,8 @@
arguments_(arguments),
result_cid_(kDynamicCid),
is_known_list_constructor_(false),
- is_native_list_factory_(false) {
+ is_native_list_factory_(false),
+ identity_(kIdentityUnknown) {
ASSERT(function.IsZoneHandle());
ASSERT(argument_names.IsZoneHandle() || argument_names.InVMHeap());
}
@@ -3311,6 +3332,9 @@
virtual bool MayThrow() const { return true; }
+ virtual AliasIdentity Identity() const { return identity_; }
+ virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
+
private:
const ICData* ic_data_;
const intptr_t token_pos_;
@@ -3323,6 +3347,8 @@
bool is_known_list_constructor_;
bool is_native_list_factory_;
+ AliasIdentity identity_;
+
DISALLOW_COPY_AND_ASSIGN(StaticCallInstr);
};
@@ -4037,7 +4063,7 @@
: token_pos_(token_pos),
cls_(cls),
arguments_(arguments),
- identity_(kUnknown),
+ identity_(kIdentityUnknown),
closure_function_(Function::ZoneHandle()) {
// Either no arguments or one type-argument and one instantiator.
ASSERT(arguments->is_empty() || (arguments->length() == 1));
@@ -4067,23 +4093,14 @@
virtual bool MayThrow() const { return false; }
- // 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
- };
+ virtual AliasIdentity Identity() const { return identity_; }
+ virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
- Identity identity() const { return identity_; }
- void set_identity(Identity identity) { identity_ = identity; }
-
private:
const intptr_t token_pos_;
const Class& cls_;
ZoneGrowableArray<PushArgumentInstr*>* const arguments_;
- Identity identity_;
+ AliasIdentity identity_;
Function& closure_function_;
DISALLOW_COPY_AND_ASSIGN(AllocateObjectInstr);
@@ -4164,7 +4181,7 @@
CreateArrayInstr(intptr_t token_pos,
Value* element_type,
Value* num_elements)
- : token_pos_(token_pos) {
+ : token_pos_(token_pos), identity_(kIdentityUnknown) {
SetInputAt(kElementTypePos, element_type);
SetInputAt(kLengthPos, num_elements);
}
@@ -4190,8 +4207,12 @@
virtual bool MayThrow() const { return false; }
+ virtual AliasIdentity Identity() const { return identity_; }
+ virtual void SetIdentity(AliasIdentity identity) { identity_ = identity; }
+
private:
const intptr_t token_pos_;
+ AliasIdentity identity_;
DISALLOW_COPY_AND_ASSIGN(CreateArrayInstr);
};
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | tests/language/vm/load_to_load_forwarding_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698