blob: 1ff88e5b61655315694a901378c2b20b6b46f8db [file] [log] [blame]
Vladimir Marko815d5e52019-03-04 10:18:31 +00001/*
Vladimir Marko327497e2019-03-04 12:53:20 +00002 * Copyright (C) 2019 The Android Open Source Project
Vladimir Marko815d5e52019-03-04 10:18:31 +00003 *
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 Marko327497e2019-03-04 12:53:20 +000017#ifndef ART_DEX2OAT_COMMON_COMPILER_DRIVER_TEST_H_
18#define ART_DEX2OAT_COMMON_COMPILER_DRIVER_TEST_H_
Vladimir Marko815d5e52019-03-04 10:18:31 +000019
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
28namespace art {
29
30class CompilerDriver;
31class DexFile;
32class ProfileCompilationInfo;
33class TimingLogger;
34
35class CommonCompilerDriverTest : public CommonCompilerTest {
36 public:
37 CommonCompilerDriverTest();
38 ~CommonCompilerDriverTest();
39
40 void CompileAll(jobject class_loader,
41 const std::vector<const DexFile*>& dex_files,
42 TimingLogger* timings) REQUIRES(!Locks::mutator_lock_);
43
44 void SetDexFilesForOatFile(const std::vector<const DexFile*>& dex_files);
45
46 void ReserveImageSpace();
47
48 void UnreserveImageSpace();
49
50 void CreateCompilerDriver();
51
52 protected:
53 void SetUpRuntimeOptions(RuntimeOptions* options) override;
54
55 void SetUp() override;
56 void TearDown() override;
57
58 // Get the set of image classes given to the compiler-driver in SetUp.
59 virtual std::unique_ptr<HashSet<std::string>> GetImageClasses();
60
61 virtual ProfileCompilationInfo* GetProfileCompilationInfo();
62
63 size_t number_of_threads_ = 2u;
64
65 std::unique_ptr<CompilerDriver> compiler_driver_;
66
67 private:
68 MemMap image_reservation_;
69 void* inaccessible_page_;
70};
71
72} // namespace art
73
Vladimir Marko327497e2019-03-04 12:53:20 +000074#endif // ART_DEX2OAT_COMMON_COMPILER_DRIVER_TEST_H_