diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-04-29 16:46:27 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2015-04-30 11:20:21 +0100 |
commit | 781733632637db98d79dfffad72bf063be3259be (patch) | |
tree | a4ea455e89adb9db77e25525a81737f3b0ab0c58 /compiler/optimizing/nodes.h | |
parent | 36ad3f1c3c08a49680a8f5d34bba43199ab9dd5b (diff) | |
download | art-781733632637db98d79dfffad72bf063be3259be.zip art-781733632637db98d79dfffad72bf063be3259be.tar.gz art-781733632637db98d79dfffad72bf063be3259be.tar.bz2 |
GVN final fields even with side effects.
Two accesses of a final field can be GVN'ed even if there are
side effects between them.
Change-Id: I04495ae83c7858f4216b083ad1c29851954320ad
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 3fe23e1..51c68e9 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -2993,8 +2993,10 @@ class HInstanceFieldGet : public HExpression<1> { HInstanceFieldGet(HInstruction* value, Primitive::Type field_type, MemberOffset field_offset, + bool is_final, bool is_volatile) - : HExpression(field_type, SideEffects::DependsOnSomething()), + : HExpression(field_type, + is_final ? SideEffects::None() : SideEffects::DependsOnSomething()), field_info_(field_offset, field_type, is_volatile) { SetRawInputAt(0, value); } @@ -3404,8 +3406,10 @@ class HStaticFieldGet : public HExpression<1> { HStaticFieldGet(HInstruction* cls, Primitive::Type field_type, MemberOffset field_offset, + bool is_final, bool is_volatile) - : HExpression(field_type, SideEffects::DependsOnSomething()), + : HExpression(field_type, + is_final ? SideEffects::None() : SideEffects::DependsOnSomething()), field_info_(field_offset, field_type, is_volatile) { SetRawInputAt(0, cls); } |