From 1545ccc4852255870b5c4676203fc7c2f2fa393f Mon Sep 17 00:00:00 2001 From: Mingyao Yang Date: Tue, 8 Aug 2017 15:24:26 -0700 Subject: scheduler should not schedule volatile field accesses. Unresolved field accesses are not scheduled either since it's not know whether they are volatile or not, and they are already expensive anyway. Test: 706-checker-scheduler Change-Id: Ie736542590a2459ee9b597e090fbedd4b527782a --- compiler/optimizing/scheduler.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'compiler/optimizing/scheduler.cc') diff --git a/compiler/optimizing/scheduler.cc b/compiler/optimizing/scheduler.cc index 5ad011d8f9..d66f2a2864 100644 --- a/compiler/optimizing/scheduler.cc +++ b/compiler/optimizing/scheduler.cc @@ -724,8 +724,8 @@ bool HScheduler::IsSchedulable(const HInstruction* instruction) const { instruction->IsClassTableGet() || instruction->IsCurrentMethod() || instruction->IsDivZeroCheck() || - instruction->IsInstanceFieldGet() || - instruction->IsInstanceFieldSet() || + (instruction->IsInstanceFieldGet() && !instruction->AsInstanceFieldGet()->IsVolatile()) || + (instruction->IsInstanceFieldSet() && !instruction->AsInstanceFieldSet()->IsVolatile()) || instruction->IsInstanceOf() || instruction->IsInvokeInterface() || instruction->IsInvokeStaticOrDirect() || @@ -741,14 +741,10 @@ bool HScheduler::IsSchedulable(const HInstruction* instruction) const { instruction->IsReturn() || instruction->IsReturnVoid() || instruction->IsSelect() || - instruction->IsStaticFieldGet() || - instruction->IsStaticFieldSet() || + (instruction->IsStaticFieldGet() && !instruction->AsStaticFieldGet()->IsVolatile()) || + (instruction->IsStaticFieldSet() && !instruction->AsStaticFieldSet()->IsVolatile()) || instruction->IsSuspendCheck() || - instruction->IsTypeConversion() || - instruction->IsUnresolvedInstanceFieldGet() || - instruction->IsUnresolvedInstanceFieldSet() || - instruction->IsUnresolvedStaticFieldGet() || - instruction->IsUnresolvedStaticFieldSet(); + instruction->IsTypeConversion(); } bool HScheduler::IsSchedulable(const HBasicBlock* block) const { -- cgit v1.2.3-59-g8ed1b