diff options
author | Vladimir Marko <vmarko@google.com> | 2020-05-19 14:42:02 +0100 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2020-05-20 08:41:09 +0000 |
commit | 695348f4b0541f4373b46eac5830cdd87f71c076 (patch) | |
tree | f2f6019f0c394f99aaaf9f2f7deec16bf6116b0f /compiler/driver/compiler_options.h | |
parent | 1f5300a211202442a07607830c6550773ca50b50 (diff) |
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
Diffstat (limited to 'compiler/driver/compiler_options.h')
-rw-r--r-- | compiler/driver/compiler_options.h | 21 |
1 files changed, 21 insertions, 0 deletions
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_; |