summaryrefslogtreecommitdiff
path: root/compiler/optimizing/builder.cc
diff options
context:
space:
mode:
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
commit781733632637db98d79dfffad72bf063be3259be (patch)
treea4ea455e89adb9db77e25525a81737f3b0ab0c58 /compiler/optimizing/builder.cc
parent36ad3f1c3c08a49680a8f5d34bba43199ab9dd5b (diff)
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/builder.cc')
-rw-r--r--compiler/optimizing/builder.cc19
1 files changed, 13 insertions, 6 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc
index 0f44af07b8..c04fe4ec76 100644
--- a/compiler/optimizing/builder.cc
+++ b/compiler/optimizing/builder.cc
@@ -816,6 +816,7 @@ bool HGraphBuilder::BuildInstanceFieldAccess(const Instruction& instruction,
current_block_->GetLastInstruction(),
field_type,
resolved_field->GetOffset(),
+ resolved_field->IsFinal(),
resolved_field->IsVolatile()));
UpdateLocal(source_or_dest_reg, current_block_->GetLastInstruction());
@@ -917,13 +918,19 @@ bool HGraphBuilder::BuildStaticFieldAccess(const Instruction& instruction,
temps.Add(cls);
HInstruction* value = LoadLocal(source_or_dest_reg, field_type);
DCHECK_EQ(value->GetType(), field_type);
- current_block_->AddInstruction(
- new (arena_) HStaticFieldSet(cls, value, field_type, resolved_field->GetOffset(),
- resolved_field->IsVolatile()));
+ current_block_->AddInstruction(new (arena_) HStaticFieldSet(
+ cls,
+ value,
+ field_type,
+ resolved_field->GetOffset(),
+ resolved_field->IsVolatile()));
} else {
- current_block_->AddInstruction(
- new (arena_) HStaticFieldGet(cls, field_type, resolved_field->GetOffset(),
- resolved_field->IsVolatile()));
+ current_block_->AddInstruction(new (arena_) HStaticFieldGet(
+ cls,
+ field_type,
+ resolved_field->GetOffset(),
+ resolved_field->IsFinal(),
+ resolved_field->IsVolatile()));
UpdateLocal(source_or_dest_reg, current_block_->GetLastInstruction());
}
return true;