diff options
author | 2023-07-13 13:43:12 +0000 | |
---|---|---|
committer | 2023-07-14 08:45:01 +0000 | |
commit | 028fb48ae2bddeef20b91e4a1582ce58df724741 (patch) | |
tree | 412a498c59cea952598261fa1f76c0b429655c51 | |
parent | 53472ff9f59c6e6d1494fe767b9137794b8d5f0f (diff) |
Clean up ART intrinsics.
Change `intrinsics_list.h` to a normal include file instead
of the weird include-use-and-undef pattern. Prefix macros
defined in that file with `ART_`.
And also remove blank lines at end of some files and address
some comments on merged changes.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 283082089
Change-Id: I9c462f973c0c4bb53eff39fbe191014f6321d7c5
24 files changed, 47 insertions, 88 deletions
diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc index 7605eb19cc..7af0465ff0 100644 --- a/compiler/optimizing/code_generator_arm64.cc +++ b/compiler/optimizing/code_generator_arm64.cc @@ -35,6 +35,7 @@ #include "interpreter/mterp/nterp.h" #include "intrinsics.h" #include "intrinsics_arm64.h" +#include "intrinsics_list.h" #include "intrinsics_utils.h" #include "linker/linker_patch.h" #include "lock_word.h" @@ -955,15 +956,13 @@ struct IsUnimplemented { UNIMPLEMENTED_INTRINSIC_LIST_ARM64(TRUE_OVERRIDE) #undef TRUE_OVERRIDE -#include "intrinsics_list.h" static constexpr bool kIsIntrinsicUnimplemented[] = { false, // kNone #define IS_UNIMPLEMENTED(Intrinsic, ...) \ IsUnimplemented<Intrinsics::k##Intrinsic>().is_unimplemented, - INTRINSICS_LIST(IS_UNIMPLEMENTED) + ART_INTRINSICS_LIST(IS_UNIMPLEMENTED) #undef IS_UNIMPLEMENTED }; -#undef INTRINSICS_LIST } // namespace detail diff --git a/compiler/optimizing/code_generator_arm_vixl.cc b/compiler/optimizing/code_generator_arm_vixl.cc index faf5608f5d..f18d571253 100644 --- a/compiler/optimizing/code_generator_arm_vixl.cc +++ b/compiler/optimizing/code_generator_arm_vixl.cc @@ -33,6 +33,7 @@ #include "interpreter/mterp/nterp.h" #include "intrinsics.h" #include "intrinsics_arm_vixl.h" +#include "intrinsics_list.h" #include "intrinsics_utils.h" #include "linker/linker_patch.h" #include "mirror/array-inl.h" @@ -1924,15 +1925,13 @@ struct IsUnimplemented { UNIMPLEMENTED_INTRINSIC_LIST_ARM(TRUE_OVERRIDE) #undef TRUE_OVERRIDE -#include "intrinsics_list.h" static constexpr bool kIsIntrinsicUnimplemented[] = { false, // kNone #define IS_UNIMPLEMENTED(Intrinsic, ...) \ IsUnimplemented<Intrinsics::k##Intrinsic>().is_unimplemented, - INTRINSICS_LIST(IS_UNIMPLEMENTED) + ART_INTRINSICS_LIST(IS_UNIMPLEMENTED) #undef IS_UNIMPLEMENTED }; -#undef INTRINSICS_LIST } // namespace detail diff --git a/compiler/optimizing/code_generator_riscv64.cc b/compiler/optimizing/code_generator_riscv64.cc index 7a99adcd21..50acde2949 100644 --- a/compiler/optimizing/code_generator_riscv64.cc +++ b/compiler/optimizing/code_generator_riscv64.cc @@ -96,7 +96,7 @@ Location InvokeDexCallingConventionVisitorRISCV64::GetNextLocation(DataType::Typ LOG(FATAL) << "Unexpected parameter type " << type; } - // Note: Unlike the RISCV-V C/C++ calling convention, managed ABI does not use + // Note: Unlike the RISC-V C/C++ calling convention, managed ABI does not use // GPRs to pass FP args when we run out of FPRs. if (DataType::IsFloatingPointType(type) && float_index_ < calling_convention.GetNumberOfFpuRegisters()) { @@ -2406,8 +2406,6 @@ void InstructionCodeGeneratorRISCV64::VisitVecPredNot(HVecPredNot* instruction) LOG(FATAL) << "Unimplemented"; } -#undef __ - namespace detail { // Mark which intrinsics we don't have handcrafted code for. @@ -2428,14 +2426,12 @@ static constexpr bool kIsIntrinsicUnimplemented[] = { false, // kNone #define IS_UNIMPLEMENTED(Intrinsic, ...) \ IsUnimplemented<Intrinsics::k##Intrinsic>().is_unimplemented, - INTRINSICS_LIST(IS_UNIMPLEMENTED) + ART_INTRINSICS_LIST(IS_UNIMPLEMENTED) #undef IS_UNIMPLEMENTED }; } // namespace detail -#define __ down_cast<Riscv64Assembler*>(GetAssembler())-> // NOLINT - CodeGeneratorRISCV64::CodeGeneratorRISCV64(HGraph* graph, const CompilerOptions& compiler_options, OptimizingCompilerStats* stats) @@ -2480,7 +2476,6 @@ void CodeGeneratorRISCV64::MaybeIncrementHotness(bool is_frame_entry) { DCHECK(info != nullptr); DCHECK(!HasEmptyFrame()); uint64_t address = reinterpret_cast64<uint64_t>(info); - Riscv64Label done; ScratchRegisterScope srs(GetAssembler()); XRegister tmp = srs.AllocateXRegister(); __ LoadConst64(tmp, address); diff --git a/compiler/optimizing/code_generator_riscv64.h b/compiler/optimizing/code_generator_riscv64.h index e024ebdd24..1c87cdf608 100644 --- a/compiler/optimizing/code_generator_riscv64.h +++ b/compiler/optimizing/code_generator_riscv64.h @@ -22,6 +22,7 @@ #include "base/macros.h" #include "code_generator.h" #include "driver/compiler_options.h" +#include "intrinsics_list.h" #include "optimizing/locations.h" #include "utils/riscv64/assembler_riscv64.h" @@ -47,7 +48,7 @@ static constexpr FRegister kRuntimeParameterFpuRegisters[] = { static constexpr size_t kRuntimeParameterFpuRegistersLength = arraysize(kRuntimeParameterFpuRegisters); -#define UNIMPLEMENTED_INTRINSIC_LIST_RISCV64(V) INTRINSICS_LIST(V) +#define UNIMPLEMENTED_INTRINSIC_LIST_RISCV64(V) ART_INTRINSICS_LIST(V) // Method register on invoke. static const XRegister kArtMethodRegister = A0; diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc index 940f24640c..190361a5ce 100644 --- a/compiler/optimizing/code_generator_x86.cc +++ b/compiler/optimizing/code_generator_x86.cc @@ -27,6 +27,7 @@ #include "heap_poisoning.h" #include "interpreter/mterp/nterp.h" #include "intrinsics.h" +#include "intrinsics_list.h" #include "intrinsics_utils.h" #include "intrinsics_x86.h" #include "jit/profiling_info.h" @@ -1124,15 +1125,13 @@ struct IsUnimplemented { UNIMPLEMENTED_INTRINSIC_LIST_X86(TRUE_OVERRIDE) #undef TRUE_OVERRIDE -#include "intrinsics_list.h" static constexpr bool kIsIntrinsicUnimplemented[] = { false, // kNone #define IS_UNIMPLEMENTED(Intrinsic, ...) \ IsUnimplemented<Intrinsics::k##Intrinsic>().is_unimplemented, - INTRINSICS_LIST(IS_UNIMPLEMENTED) + ART_INTRINSICS_LIST(IS_UNIMPLEMENTED) #undef IS_UNIMPLEMENTED }; -#undef INTRINSICS_LIST } // namespace detail diff --git a/compiler/optimizing/code_generator_x86_64.cc b/compiler/optimizing/code_generator_x86_64.cc index f944a85f42..394a186c1b 100644 --- a/compiler/optimizing/code_generator_x86_64.cc +++ b/compiler/optimizing/code_generator_x86_64.cc @@ -27,6 +27,7 @@ #include "heap_poisoning.h" #include "interpreter/mterp/nterp.h" #include "intrinsics.h" +#include "intrinsics_list.h" #include "intrinsics_utils.h" #include "intrinsics_x86_64.h" #include "jit/profiling_info.h" @@ -1512,15 +1513,13 @@ struct IsUnimplemented { UNIMPLEMENTED_INTRINSIC_LIST_X86_64(TRUE_OVERRIDE) #undef TRUE_OVERRIDE -#include "intrinsics_list.h" static constexpr bool kIsIntrinsicUnimplemented[] = { false, // kNone #define IS_UNIMPLEMENTED(Intrinsic, ...) \ IsUnimplemented<Intrinsics::k##Intrinsic>().is_unimplemented, - INTRINSICS_LIST(IS_UNIMPLEMENTED) + ART_INTRINSICS_LIST(IS_UNIMPLEMENTED) #undef IS_UNIMPLEMENTED }; -#undef INTRINSICS_LIST } // namespace detail diff --git a/compiler/optimizing/intrinsics.cc b/compiler/optimizing/intrinsics.cc index 774deec438..8357e57c1f 100644 --- a/compiler/optimizing/intrinsics.cc +++ b/compiler/optimizing/intrinsics.cc @@ -27,6 +27,7 @@ #include "gc/space/image_space.h" #include "image-inl.h" #include "intrinsic_objects.h" +#include "intrinsics_list.h" #include "nodes.h" #include "obj_ptr-inl.h" #include "scoped_thread_state_change-inl.h" @@ -43,10 +44,7 @@ std::ostream& operator<<(std::ostream& os, const Intrinsics& intrinsic) { case Intrinsics::k ## Name: \ os << # Name; \ break; -#include "intrinsics_list.h" - INTRINSICS_LIST(OPTIMIZING_INTRINSICS) -#undef STATIC_INTRINSICS_LIST -#undef VIRTUAL_INTRINSICS_LIST + ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS) #undef OPTIMIZING_INTRINSICS } return os; diff --git a/compiler/optimizing/intrinsics.h b/compiler/optimizing/intrinsics.h index 8cb7f6ac4f..b6c7e1b997 100644 --- a/compiler/optimizing/intrinsics.h +++ b/compiler/optimizing/intrinsics.h @@ -19,6 +19,7 @@ #include "base/macros.h" #include "code_generator.h" +#include "intrinsics_list.h" #include "nodes.h" #include "optimization.h" #include "parallel_move_resolver.h" @@ -48,9 +49,7 @@ class IntrinsicVisitor : public ValueObject { case Intrinsics::k ## Name: \ Visit ## Name(invoke); \ return; -#include "intrinsics_list.h" - INTRINSICS_LIST(OPTIMIZING_INTRINSICS) -#undef INTRINSICS_LIST + ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS) #undef OPTIMIZING_INTRINSICS // Do not put a default case. That way the compiler will complain if we missed a case. @@ -61,9 +60,7 @@ class IntrinsicVisitor : public ValueObject { #define OPTIMIZING_INTRINSICS(Name, ...) \ virtual void Visit##Name([[maybe_unused]] HInvoke* invoke) {} -#include "intrinsics_list.h" - INTRINSICS_LIST(OPTIMIZING_INTRINSICS) -#undef INTRINSICS_LIST + ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS) #undef OPTIMIZING_INTRINSICS static void MoveArguments(HInvoke* invoke, diff --git a/compiler/optimizing/intrinsics_arm64.h b/compiler/optimizing/intrinsics_arm64.h index a0ccf87f7b..b20cea65f4 100644 --- a/compiler/optimizing/intrinsics_arm64.h +++ b/compiler/optimizing/intrinsics_arm64.h @@ -19,6 +19,7 @@ #include "base/macros.h" #include "intrinsics.h" +#include "intrinsics_list.h" namespace vixl { namespace aarch64 { @@ -47,9 +48,7 @@ class IntrinsicLocationsBuilderARM64 final : public IntrinsicVisitor { #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \ void Visit ## Name(HInvoke* invoke) override; -#include "intrinsics_list.h" - INTRINSICS_LIST(OPTIMIZING_INTRINSICS) -#undef INTRINSICS_LIST + ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS) #undef OPTIMIZING_INTRINSICS // Check whether an invoke is an intrinsic, and if so, create a location summary. Returns whether @@ -72,9 +71,7 @@ class IntrinsicCodeGeneratorARM64 final : public IntrinsicVisitor { #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \ void Visit ## Name(HInvoke* invoke) override; -#include "intrinsics_list.h" - INTRINSICS_LIST(OPTIMIZING_INTRINSICS) -#undef INTRINSICS_LIST + ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS) #undef OPTIMIZING_INTRINSICS private: diff --git a/compiler/optimizing/intrinsics_arm_vixl.h b/compiler/optimizing/intrinsics_arm_vixl.h index 54475bcc7e..f517d21c9d 100644 --- a/compiler/optimizing/intrinsics_arm_vixl.h +++ b/compiler/optimizing/intrinsics_arm_vixl.h @@ -19,6 +19,7 @@ #include "base/macros.h" #include "intrinsics.h" +#include "intrinsics_list.h" #include "utils/arm/assembler_arm_vixl.h" namespace art HIDDEN { @@ -36,9 +37,7 @@ class IntrinsicLocationsBuilderARMVIXL final : public IntrinsicVisitor { #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \ void Visit ## Name(HInvoke* invoke) override; -#include "intrinsics_list.h" - INTRINSICS_LIST(OPTIMIZING_INTRINSICS) -#undef INTRINSICS_LIST + ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS) #undef OPTIMIZING_INTRINSICS // Check whether an invoke is an intrinsic, and if so, create a location summary. Returns whether @@ -63,9 +62,7 @@ class IntrinsicCodeGeneratorARMVIXL final : public IntrinsicVisitor { #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \ void Visit ## Name(HInvoke* invoke) override; -#include "intrinsics_list.h" - INTRINSICS_LIST(OPTIMIZING_INTRINSICS) -#undef INTRINSICS_LIST + ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS) #undef OPTIMIZING_INTRINSICS private: diff --git a/compiler/optimizing/intrinsics_x86.h b/compiler/optimizing/intrinsics_x86.h index 77c236d244..fc2f0e3fbd 100644 --- a/compiler/optimizing/intrinsics_x86.h +++ b/compiler/optimizing/intrinsics_x86.h @@ -19,6 +19,7 @@ #include "base/macros.h" #include "intrinsics.h" +#include "intrinsics_list.h" namespace art HIDDEN { @@ -39,9 +40,7 @@ class IntrinsicLocationsBuilderX86 final : public IntrinsicVisitor { #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \ void Visit ## Name(HInvoke* invoke) override; -#include "intrinsics_list.h" - INTRINSICS_LIST(OPTIMIZING_INTRINSICS) -#undef INTRINSICS_LIST + ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS) #undef OPTIMIZING_INTRINSICS // Check whether an invoke is an intrinsic, and if so, create a location summary. Returns whether @@ -64,9 +63,7 @@ class IntrinsicCodeGeneratorX86 final : public IntrinsicVisitor { #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \ void Visit ## Name(HInvoke* invoke) override; -#include "intrinsics_list.h" - INTRINSICS_LIST(OPTIMIZING_INTRINSICS) -#undef INTRINSICS_LIST + ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS) #undef OPTIMIZING_INTRINSICS private: diff --git a/compiler/optimizing/intrinsics_x86_64.h b/compiler/optimizing/intrinsics_x86_64.h index 59fe815a94..d0ee6f622d 100644 --- a/compiler/optimizing/intrinsics_x86_64.h +++ b/compiler/optimizing/intrinsics_x86_64.h @@ -19,6 +19,7 @@ #include "base/macros.h" #include "intrinsics.h" +#include "intrinsics_list.h" namespace art HIDDEN { @@ -39,9 +40,7 @@ class IntrinsicLocationsBuilderX86_64 final : public IntrinsicVisitor { #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \ void Visit ## Name(HInvoke* invoke) override; -#include "intrinsics_list.h" - INTRINSICS_LIST(OPTIMIZING_INTRINSICS) -#undef INTRINSICS_LIST + ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS) #undef OPTIMIZING_INTRINSICS // Check whether an invoke is an intrinsic, and if so, create a location summary. Returns whether @@ -64,9 +63,7 @@ class IntrinsicCodeGeneratorX86_64 final : public IntrinsicVisitor { #define OPTIMIZING_INTRINSICS(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \ void Visit ## Name(HInvoke* invoke) override; -#include "intrinsics_list.h" - INTRINSICS_LIST(OPTIMIZING_INTRINSICS) -#undef INTRINSICS_LIST + ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS) #undef OPTIMIZING_INTRINSICS private: diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index 9caa766858..0d78771bf4 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -36,6 +36,7 @@ #include "code_generator.h" #include "common_dominator.h" #include "intrinsics.h" +#include "intrinsics_list.h" #include "mirror/class-inl.h" #include "scoped_thread_state_change-inl.h" #include "ssa_builder.h" @@ -3523,9 +3524,7 @@ std::ostream& operator<<(std::ostream& os, TypeCheckKind rhs) { static_assert( \ static_cast<uint32_t>(Intrinsics::k ## Name) <= (kAccIntrinsicBits >> CTZ(kAccIntrinsicBits)), \ "Instrinsics enumeration space overflow."); -#include "intrinsics_list.h" - INTRINSICS_LIST(CHECK_INTRINSICS_ENUM_VALUES) -#undef INTRINSICS_LIST + ART_INTRINSICS_LIST(CHECK_INTRINSICS_ENUM_VALUES) #undef CHECK_INTRINSICS_ENUM_VALUES // Function that returns whether an intrinsic needs an environment or not. @@ -3536,9 +3535,7 @@ static inline IntrinsicNeedsEnvironment NeedsEnvironmentIntrinsic(Intrinsics i) #define OPTIMIZING_INTRINSICS(Name, InvokeType, NeedsEnv, SideEffects, Exceptions, ...) \ case Intrinsics::k ## Name: \ return NeedsEnv; -#include "intrinsics_list.h" - INTRINSICS_LIST(OPTIMIZING_INTRINSICS) -#undef INTRINSICS_LIST + ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS) #undef OPTIMIZING_INTRINSICS } return kNeedsEnvironment; @@ -3552,9 +3549,7 @@ static inline IntrinsicSideEffects GetSideEffectsIntrinsic(Intrinsics i) { #define OPTIMIZING_INTRINSICS(Name, InvokeType, NeedsEnv, SideEffects, Exceptions, ...) \ case Intrinsics::k ## Name: \ return SideEffects; -#include "intrinsics_list.h" - INTRINSICS_LIST(OPTIMIZING_INTRINSICS) -#undef INTRINSICS_LIST + ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS) #undef OPTIMIZING_INTRINSICS } return kAllSideEffects; @@ -3568,9 +3563,7 @@ static inline IntrinsicExceptions GetExceptionsIntrinsic(Intrinsics i) { #define OPTIMIZING_INTRINSICS(Name, InvokeType, NeedsEnv, SideEffects, Exceptions, ...) \ case Intrinsics::k ## Name: \ return Exceptions; -#include "intrinsics_list.h" - INTRINSICS_LIST(OPTIMIZING_INTRINSICS) -#undef INTRINSICS_LIST + ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS) #undef OPTIMIZING_INTRINSICS } return kCanThrow; diff --git a/dex2oat/driver/compiler_driver.cc b/dex2oat/driver/compiler_driver.cc index a963fcfe92..24a861125c 100644 --- a/dex2oat/driver/compiler_driver.cc +++ b/dex2oat/driver/compiler_driver.cc @@ -1016,7 +1016,7 @@ static void VerifyClassesContainingIntrinsicsAreImageClasses(HashSet<std::string #define CHECK_INTRINSIC_OWNER_CLASS(_, __, ___, ____, _____, ClassName, ______, _______) \ CHECK(image_classes->find(std::string_view(ClassName)) != image_classes->end()); - INTRINSICS_LIST(CHECK_INTRINSIC_OWNER_CLASS) + ART_INTRINSICS_LIST(CHECK_INTRINSIC_OWNER_CLASS) #undef CHECK_INTRINSIC_OWNER_CLASS } diff --git a/runtime/arch/arm/jni_frame_arm.h b/runtime/arch/arm/jni_frame_arm.h index 8c56af18d1..1987bc3dde 100644 --- a/runtime/arch/arm/jni_frame_arm.h +++ b/runtime/arch/arm/jni_frame_arm.h @@ -85,4 +85,3 @@ inline size_t GetCriticalNativeDirectCallFrameSize(const char* shorty, uint32_t } // namespace art #endif // ART_RUNTIME_ARCH_ARM_JNI_FRAME_ARM_H_ - diff --git a/runtime/arch/arm64/jni_frame_arm64.h b/runtime/arch/arm64/jni_frame_arm64.h index 9f691d06f2..eff20f4b55 100644 --- a/runtime/arch/arm64/jni_frame_arm64.h +++ b/runtime/arch/arm64/jni_frame_arm64.h @@ -92,4 +92,3 @@ inline size_t GetCriticalNativeDirectCallFrameSize(const char* shorty, uint32_t } // namespace art #endif // ART_RUNTIME_ARCH_ARM64_JNI_FRAME_ARM64_H_ - diff --git a/runtime/arch/riscv64/jni_frame_riscv64.h b/runtime/arch/riscv64/jni_frame_riscv64.h index 0228d67543..8a7efb2049 100644 --- a/runtime/arch/riscv64/jni_frame_riscv64.h +++ b/runtime/arch/riscv64/jni_frame_riscv64.h @@ -95,4 +95,3 @@ inline size_t GetCriticalNativeDirectCallFrameSize(const char* shorty, uint32_t } // namespace art #endif // ART_RUNTIME_ARCH_RISCV64_JNI_FRAME_RISCV64_H_ - diff --git a/runtime/arch/x86/jni_frame_x86.h b/runtime/arch/x86/jni_frame_x86.h index 15ccff843c..50114e751d 100644 --- a/runtime/arch/x86/jni_frame_x86.h +++ b/runtime/arch/x86/jni_frame_x86.h @@ -81,4 +81,3 @@ inline size_t GetCriticalNativeDirectCallFrameSize(const char* shorty, uint32_t } // namespace art #endif // ART_RUNTIME_ARCH_X86_JNI_FRAME_X86_H_ - diff --git a/runtime/arch/x86_64/jni_frame_x86_64.h b/runtime/arch/x86_64/jni_frame_x86_64.h index 959e266dd4..a14d43914a 100644 --- a/runtime/arch/x86_64/jni_frame_x86_64.h +++ b/runtime/arch/x86_64/jni_frame_x86_64.h @@ -98,4 +98,3 @@ inline size_t GetCriticalNativeDirectCallFrameSize(const char* shorty, uint32_t } // namespace art #endif // ART_RUNTIME_ARCH_X86_64_JNI_FRAME_X86_64_H_ - diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc index ac9980f6d3..491f05fffd 100644 --- a/runtime/interpreter/interpreter_common.cc +++ b/runtime/interpreter/interpreter_common.cc @@ -26,6 +26,7 @@ #include "entrypoints/runtime_asm_entrypoints.h" #include "handle.h" #include "intrinsics_enum.h" +#include "intrinsics_list.h" #include "jit/jit.h" #include "jvalue-inl.h" #include "method_handles-inl.h" @@ -555,10 +556,7 @@ bool DoInvokePolymorphic(Thread* self, #define CASE_SIGNATURE_POLYMORPHIC_INTRINSIC(Name, ...) \ case Intrinsics::k##Name: \ return Do ## Name(self, shadow_frame, inst, inst_data, result); -#include "intrinsics_list.h" - SIGNATURE_POLYMORPHIC_INTRINSICS_LIST(CASE_SIGNATURE_POLYMORPHIC_INTRINSIC) -#undef INTRINSICS_LIST -#undef SIGNATURE_POLYMORPHIC_INTRINSICS_LIST + ART_SIGNATURE_POLYMORPHIC_INTRINSICS_LIST(CASE_SIGNATURE_POLYMORPHIC_INTRINSIC) #undef CASE_SIGNATURE_POLYMORPHIC_INTRINSIC default: LOG(FATAL) << "Unreachable: " << invoke_method->GetIntrinsic(); diff --git a/runtime/interpreter/interpreter_common.h b/runtime/interpreter/interpreter_common.h index b8d6817904..667a5990a9 100644 --- a/runtime/interpreter/interpreter_common.h +++ b/runtime/interpreter/interpreter_common.h @@ -47,6 +47,7 @@ #include "handle_scope-inl.h" #include "interpreter_cache-inl.h" #include "interpreter_switch_impl.h" +#include "intrinsics_list.h" #include "jit/jit-inl.h" #include "mirror/call_site.h" #include "mirror/class-inl.h" @@ -235,9 +236,7 @@ bool Do ## Name(Thread* self, \ const Instruction* inst, \ uint16_t inst_data, \ JValue* result) REQUIRES_SHARED(Locks::mutator_lock_); -#include "intrinsics_list.h" -INTRINSICS_LIST(DECLARE_SIGNATURE_POLYMORPHIC_HANDLER) -#undef INTRINSICS_LIST +ART_INTRINSICS_LIST(DECLARE_SIGNATURE_POLYMORPHIC_HANDLER) #undef DECLARE_SIGNATURE_POLYMORPHIC_HANDLER // Performs a invoke-polymorphic or invoke-polymorphic-range. diff --git a/runtime/intrinsics_enum.h b/runtime/intrinsics_enum.h index d46d0cc00f..0d228dab59 100644 --- a/runtime/intrinsics_enum.h +++ b/runtime/intrinsics_enum.h @@ -17,15 +17,15 @@ #ifndef ART_RUNTIME_INTRINSICS_ENUM_H_ #define ART_RUNTIME_INTRINSICS_ENUM_H_ +#include "intrinsics_list.h" + namespace art { enum class Intrinsics { #define OPTIMIZING_INTRINSICS(Name, ...) \ k ## Name, -#include "intrinsics_list.h" kNone, - INTRINSICS_LIST(OPTIMIZING_INTRINSICS) -#undef INTRINSICS_LIST + ART_INTRINSICS_LIST(OPTIMIZING_INTRINSICS) #undef OPTIMIZING_INTRINSICS }; std::ostream& operator<<(std::ostream& os, const Intrinsics& intrinsic); diff --git a/runtime/intrinsics_list.h b/runtime/intrinsics_list.h index 256cd2e5fe..5450a3b3f7 100644 --- a/runtime/intrinsics_list.h +++ b/runtime/intrinsics_list.h @@ -48,7 +48,7 @@ // of finer grain side effects representation. // Intrinsics for methods with signature polymorphic behaviours. -#define SIGNATURE_POLYMORPHIC_INTRINSICS_LIST(V) \ +#define ART_SIGNATURE_POLYMORPHIC_INTRINSICS_LIST(V) \ V(MethodHandleInvokeExact, kPolymorphic, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljava/lang/invoke/MethodHandle;", "invokeExact", "([Ljava/lang/Object;)Ljava/lang/Object;") \ V(MethodHandleInvoke, kPolymorphic, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljava/lang/invoke/MethodHandle;", "invoke", "([Ljava/lang/Object;)Ljava/lang/Object;") \ V(VarHandleCompareAndExchange, kPolymorphic, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljava/lang/invoke/VarHandle;", "compareAndExchange", "([Ljava/lang/Object;)Ljava/lang/Object;") \ @@ -84,7 +84,7 @@ V(VarHandleWeakCompareAndSetRelease, kPolymorphic, kNeedsEnvironment, kAllSideEffects, kCanThrow, "Ljava/lang/invoke/VarHandle;", "weakCompareAndSetRelease", "([Ljava/lang/Object;)Z") // The complete list of intrinsics. -#define INTRINSICS_LIST(V) \ +#define ART_INTRINSICS_LIST(V) \ V(DoubleDoubleToRawLongBits, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Double;", "doubleToRawLongBits", "(D)J") \ V(DoubleDoubleToLongBits, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Double;", "doubleToLongBits", "(D)J") \ V(DoubleIsInfinite, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/lang/Double;", "isInfinite", "(D)Z") \ @@ -286,7 +286,6 @@ V(CRC32Update, kStatic, kNeedsEnvironment, kNoSideEffects, kNoThrow, "Ljava/util/zip/CRC32;", "update", "(II)I") \ V(CRC32UpdateBytes, kStatic, kNeedsEnvironment, kReadSideEffects, kCanThrow, "Ljava/util/zip/CRC32;", "updateBytes", "(I[BII)I") \ V(CRC32UpdateByteBuffer, kStatic, kNeedsEnvironment, kReadSideEffects, kNoThrow, "Ljava/util/zip/CRC32;", "updateByteBuffer", "(IJII)I") \ - SIGNATURE_POLYMORPHIC_INTRINSICS_LIST(V) + ART_SIGNATURE_POLYMORPHIC_INTRINSICS_LIST(V) #endif // ART_RUNTIME_INTRINSICS_LIST_H_ -#undef ART_RUNTIME_INTRINSICS_LIST_H_ // #define is only for lint. diff --git a/runtime/runtime_intrinsics.cc b/runtime/runtime_intrinsics.cc index fb60cfe393..0f4fce1d68 100644 --- a/runtime/runtime_intrinsics.cc +++ b/runtime/runtime_intrinsics.cc @@ -99,7 +99,7 @@ bool AreAllIntrinsicsInitialized() REQUIRES_SHARED(Locks::mutator_lock_) { ClassName, \ MethodName, \ Signature) && - bool result = INTRINSICS_LIST(IS_INTRINSIC_INITIALIZED) true; + bool result = ART_INTRINSICS_LIST(IS_INTRINSIC_INITIALIZED) true; #undef IS_INTRINSIC_INITIALIZED return result; } @@ -117,7 +117,7 @@ void InitializeIntrinsics() { ClassName, \ MethodName, \ Signature) || - INTRINSICS_LIST(INITIALIZE_INTRINSIC) true; + ART_INTRINSICS_LIST(INITIALIZE_INTRINSIC) true; #undef INITIALIZE_INTRINSIC DCHECK(AreAllIntrinsicsInitialized()); } |