From 31b12e32073f458950e96d0d1b44e48508cf67e4 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Fri, 2 Sep 2016 17:11:57 -0700 Subject: Avoid read barrier for image HLoadClass Concurrent copying baker: X86_64 core-optimizing-pic.oat: 28583112 -> 27906824 (2.4% smaller) Around 0.4% of 2.4% is from re-enabling kBootImageLinkTimeAddress, kBootImageLinkTimePcRelative, and kBootImageAddress. N6P boot.oat 32: 73042140 -> 71891956 (1.57% smaller) N6P boot.oat 64: 83831608 -> 82531456 (1.55% smaller) EAAC: 1252 -> 1245 (32 samples) Bug: 29516974 Test: test-art-host CC baker, N6P booting Change-Id: I9a196cf0157058836981c43c93872e9f0c4919aa --- compiler/optimizing/nodes.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/nodes.h') diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 19e499ba8c..149a71d1b9 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -5461,7 +5461,8 @@ class HLoadClass FINAL : public HInstruction { bool is_referrers_class, uint32_t dex_pc, bool needs_access_check, - bool is_in_dex_cache) + bool is_in_dex_cache, + bool is_in_boot_image) : HInstruction(SideEffectsForArchRuntimeCalls(), dex_pc), special_input_(HUserRecord(current_method)), type_index_(type_index), @@ -5475,6 +5476,7 @@ class HLoadClass FINAL : public HInstruction { is_referrers_class ? LoadKind::kReferrersClass : LoadKind::kDexCacheViaMethod); SetPackedFlag(needs_access_check); SetPackedFlag(is_in_dex_cache); + SetPackedFlag(is_in_boot_image); SetPackedFlag(false); } @@ -5565,6 +5567,7 @@ class HLoadClass FINAL : public HInstruction { bool IsReferrersClass() const { return GetLoadKind() == LoadKind::kReferrersClass; } bool NeedsAccessCheck() const { return GetPackedFlag(); } bool IsInDexCache() const { return GetPackedFlag(); } + bool IsInBootImage() const { return GetPackedFlag(); } bool MustGenerateClinitCheck() const { return GetPackedFlag(); } void MarkInDexCache() { @@ -5574,6 +5577,10 @@ class HLoadClass FINAL : public HInstruction { SetSideEffects(SideEffects::None()); } + void MarkInBootImage() { + SetPackedFlag(true); + } + void AddSpecialInput(HInstruction* special_input); using HInstruction::GetInputRecords; // Keep the const version visible. @@ -5591,9 +5598,10 @@ class HLoadClass FINAL : public HInstruction { private: static constexpr size_t kFlagNeedsAccessCheck = kNumberOfGenericPackedBits; static constexpr size_t kFlagIsInDexCache = kFlagNeedsAccessCheck + 1; + static constexpr size_t kFlagIsInBootImage = kFlagIsInDexCache + 1; // Whether this instruction must generate the initialization check. // Used for code generation. - static constexpr size_t kFlagGenerateClInitCheck = kFlagIsInDexCache + 1; + static constexpr size_t kFlagGenerateClInitCheck = kFlagIsInBootImage + 1; static constexpr size_t kFieldLoadKind = kFlagGenerateClInitCheck + 1; static constexpr size_t kFieldLoadKindSize = MinimumBitsToStore(static_cast(LoadKind::kLast)); -- cgit v1.2.3-59-g8ed1b