Vladimir Marko | 815d5e5 | 2019-03-04 10:18:31 +0000 | [diff] [blame] | 1 | /* |
Vladimir Marko | 327497e | 2019-03-04 12:53:20 +0000 | [diff] [blame] | 2 | * Copyright (C) 2019 The Android Open Source Project |
Vladimir Marko | 815d5e5 | 2019-03-04 10:18:31 +0000 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Vladimir Marko | 327497e | 2019-03-04 12:53:20 +0000 | [diff] [blame] | 17 | #ifndef ART_DEX2OAT_COMMON_COMPILER_DRIVER_TEST_H_ |
| 18 | #define ART_DEX2OAT_COMMON_COMPILER_DRIVER_TEST_H_ |
Vladimir Marko | 815d5e5 | 2019-03-04 10:18:31 +0000 | [diff] [blame] | 19 | |
| 20 | #include <vector> |
| 21 | |
| 22 | #include <jni.h> |
| 23 | |
| 24 | #include "common_compiler_test.h" |
| 25 | #include "base/hash_set.h" |
| 26 | #include "base/mem_map.h" |
| 27 | |
| 28 | namespace art { |
| 29 | |
| 30 | class CompilerDriver; |
| 31 | class DexFile; |
| 32 | class ProfileCompilationInfo; |
| 33 | class TimingLogger; |
Vladimir Marko | d46716b | 2022-09-27 14:47:22 +0200 | [diff] [blame] | 34 | class VerificationResults; |
Vladimir Marko | 815d5e5 | 2019-03-04 10:18:31 +0000 | [diff] [blame] | 35 | |
| 36 | class CommonCompilerDriverTest : public CommonCompilerTest { |
| 37 | public: |
| 38 | CommonCompilerDriverTest(); |
| 39 | ~CommonCompilerDriverTest(); |
| 40 | |
| 41 | void CompileAll(jobject class_loader, |
| 42 | const std::vector<const DexFile*>& dex_files, |
| 43 | TimingLogger* timings) REQUIRES(!Locks::mutator_lock_); |
| 44 | |
| 45 | void SetDexFilesForOatFile(const std::vector<const DexFile*>& dex_files); |
| 46 | |
| 47 | void ReserveImageSpace(); |
| 48 | |
| 49 | void UnreserveImageSpace(); |
| 50 | |
| 51 | void CreateCompilerDriver(); |
| 52 | |
| 53 | protected: |
| 54 | void SetUpRuntimeOptions(RuntimeOptions* options) override; |
| 55 | |
| 56 | void SetUp() override; |
| 57 | void TearDown() override; |
| 58 | |
| 59 | // Get the set of image classes given to the compiler-driver in SetUp. |
| 60 | virtual std::unique_ptr<HashSet<std::string>> GetImageClasses(); |
| 61 | |
| 62 | virtual ProfileCompilationInfo* GetProfileCompilationInfo(); |
| 63 | |
| 64 | size_t number_of_threads_ = 2u; |
| 65 | |
Vladimir Marko | d46716b | 2022-09-27 14:47:22 +0200 | [diff] [blame] | 66 | std::unique_ptr<VerificationResults> verification_results_; |
Vladimir Marko | 815d5e5 | 2019-03-04 10:18:31 +0000 | [diff] [blame] | 67 | std::unique_ptr<CompilerDriver> compiler_driver_; |
| 68 | |
| 69 | private: |
| 70 | MemMap image_reservation_; |
| 71 | void* inaccessible_page_; |
| 72 | }; |
| 73 | |
| 74 | } // namespace art |
| 75 | |
Vladimir Marko | 327497e | 2019-03-04 12:53:20 +0000 | [diff] [blame] | 76 | #endif // ART_DEX2OAT_COMMON_COMPILER_DRIVER_TEST_H_ |