From 8f2eb25ca40136a36a5d7002c8ca5a05723e334e Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 6 Nov 2020 13:39:54 +0000 Subject: Remove NeedsDexCache logic from the compiler. The compiled code and runtime stubs don't need to have direct access to the dex cache anymore. Test: test.py Change-Id: Id3aab9b10445ba2599e1a9ffd8e36506a745bfec --- compiler/optimizing/nodes.h | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'compiler/optimizing/nodes.h') diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 9200689f27..ad56d31667 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -2468,10 +2468,6 @@ class HInstruction : public ArenaObject { return NeedsEnvironment() || IsCurrentMethod(); } - // Returns whether the code generation of the instruction will require to have access - // to the dex cache of the current method's declaring class via the current method. - virtual bool NeedsDexCacheOfDeclaringClass() const { return false; } - // Does this instruction have any use in an environment before // control flow hits 'other'? bool HasAnyEnvironmentUseBefore(HInstruction* other); @@ -4355,9 +4351,9 @@ class HNewInstance final : public HExpression<1> { QuickEntrypointEnum entrypoint_; }; -enum IntrinsicNeedsEnvironmentOrCache { - kNoEnvironmentOrCache, // Intrinsic does not require an environment or dex cache. - kNeedsEnvironmentOrCache // Intrinsic requires an environment or requires a dex cache. +enum IntrinsicNeedsEnvironment { + kNoEnvironment, // Intrinsic does not require an environment. + kNeedsEnvironment // Intrinsic requires an environment. }; enum IntrinsicSideEffects { @@ -4446,7 +4442,7 @@ class HInvoke : public HVariableInputSizeInstruction { } void SetIntrinsic(Intrinsics intrinsic, - IntrinsicNeedsEnvironmentOrCache needs_env_or_cache, + IntrinsicNeedsEnvironment needs_env, IntrinsicSideEffects side_effects, IntrinsicExceptions exceptions); @@ -4740,7 +4736,6 @@ class HInvokeStaticOrDirect final : public HInvoke { MethodLoadKind GetMethodLoadKind() const { return dispatch_info_.method_load_kind; } CodePtrLocation GetCodePtrLocation() const { return dispatch_info_.code_ptr_location; } bool IsRecursive() const { return GetMethodLoadKind() == MethodLoadKind::kRecursive; } - bool NeedsDexCacheOfDeclaringClass() const override; bool IsStringInit() const { return GetMethodLoadKind() == MethodLoadKind::kStringInit; } bool HasMethodAddress() const { return GetMethodLoadKind() == MethodLoadKind::kJitDirectAddress; } bool HasPcRelativeMethodLoadKind() const { @@ -4972,11 +4967,6 @@ class HInvokeInterface final : public HInvoke { return (obj == InputAt(0)) && !IsIntrinsic(); } - bool NeedsDexCacheOfDeclaringClass() const override { - // The assembly stub currently needs it. - return true; - } - size_t GetSpecialInputIndex() const { return GetNumberOfArguments(); } @@ -6535,10 +6525,6 @@ class HLoadClass final : public HInstruction { dex::TypeIndex GetTypeIndex() const { return type_index_; } const DexFile& GetDexFile() const { return dex_file_; } - bool NeedsDexCacheOfDeclaringClass() const override { - return GetLoadKind() == LoadKind::kRuntimeCall; - } - static SideEffects SideEffectsForArchRuntimeCalls() { return SideEffects::CanTriggerGC(); } @@ -6745,10 +6731,6 @@ class HLoadString final : public HInstruction { return true; } - bool NeedsDexCacheOfDeclaringClass() const override { - return GetLoadKind() == LoadKind::kRuntimeCall; - } - bool CanBeNull() const override { return false; } bool CanThrow() const override { return NeedsEnvironment(); } -- cgit v1.2.3-59-g8ed1b