From 695348f4b0541f4373b46eac5830cdd87f71c076 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 19 May 2020 14:42:02 +0100 Subject: Add compiler type to CompilerOptions. Let CompilerOptions hold the information whether it is AOT or JIT compilation, or Zygote JIT for shared code. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --jit Test: aosp_taimen-userdebug boots. Change-Id: Id9200572406f8e43d99b8b61ef0e3edf43b52fff --- compiler/driver/compiler_options.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'compiler/driver/compiler_options.h') diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h index 6cdb821e6e..77237078f8 100644 --- a/compiler/driver/compiler_options.h +++ b/compiler/driver/compiler_options.h @@ -69,6 +69,13 @@ class CompilerOptions final { static const size_t kDefaultInlineMaxCodeUnits = 32; static constexpr size_t kUnsetInlineMaxCodeUnits = -1; + enum class CompilerType : uint8_t { + kAotCompiler, // AOT compiler. + kJitCompiler, // Normal JIT compiler. + kSharedCodeJitCompiler, // Zygote JIT producing code in the shared region area, putting + // restrictions on, for example, how literals are being generated. + }; + enum class ImageType : uint8_t { kNone, // JIT or AOT app compilation producing only an oat file but no image. kBootImage, // Creating boot image. @@ -191,6 +198,19 @@ class CompilerOptions final { return implicit_so_checks_; } + bool IsAotCompiler() const { + return compiler_type_ == CompilerType::kAotCompiler; + } + + bool IsJitCompiler() const { + return compiler_type_ == CompilerType::kJitCompiler || + compiler_type_ == CompilerType::kSharedCodeJitCompiler; + } + + bool IsJitCompilerForSharedCode() const { + return compiler_type_ == CompilerType::kSharedCodeJitCompiler; + } + bool GetImplicitSuspendChecks() const { return implicit_suspend_checks_; } @@ -394,6 +414,7 @@ class CompilerOptions final { // Results of AOT verification. const VerificationResults* verification_results_; + CompilerType compiler_type_; ImageType image_type_; bool compile_art_test_; bool baseline_; -- cgit v1.2.3-59-g8ed1b