blob: 226e6b79528ef63bcb2c8dca617d750fb2f758b4 [file] [log] [blame]
Mathieu Chartier5bdab122015-01-26 18:30:19 -08001/*
2 * Copyright (C) 2015 The Android Open Source Project
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
17#include "compiler_options.h"
18
19#include "dex/pass_manager.h"
20
21namespace art {
22
23CompilerOptions::CompilerOptions()
24 : compiler_filter_(kDefaultCompilerFilter),
25 huge_method_threshold_(kDefaultHugeMethodThreshold),
26 large_method_threshold_(kDefaultLargeMethodThreshold),
27 small_method_threshold_(kDefaultSmallMethodThreshold),
28 tiny_method_threshold_(kDefaultTinyMethodThreshold),
29 num_dex_methods_threshold_(kDefaultNumDexMethodsThreshold),
Mathieu Chartier5bdab122015-01-26 18:30:19 -080030 include_patch_information_(kDefaultIncludePatchInformation),
31 top_k_profile_threshold_(kDefaultTopKProfileThreshold),
Andreas Gampe7b2f09e2015-03-02 14:07:33 -080032 debuggable_(false),
David Srbecky8363c772015-05-28 16:12:43 +010033 generate_debug_info_(kDefaultGenerateDebugInfo),
Mathieu Chartier5bdab122015-01-26 18:30:19 -080034 implicit_null_checks_(true),
35 implicit_so_checks_(true),
36 implicit_suspend_checks_(false),
37 compile_pic_(false),
38 verbose_methods_(nullptr),
39 pass_manager_options_(new PassManagerOptions),
Andreas Gampe6cf49e52015-03-05 13:08:45 -080040 abort_on_hard_verifier_failure_(false),
Mathieu Chartier5bdab122015-01-26 18:30:19 -080041 init_failure_output_(nullptr) {
42}
43
Vladimir Markob163bb72015-03-31 21:49:49 +010044CompilerOptions::~CompilerOptions() {
45 // The destructor looks empty but it destroys a PassManagerOptions object. We keep it here
46 // because we don't want to include the PassManagerOptions definition from the header file.
47}
48
Mathieu Chartier5bdab122015-01-26 18:30:19 -080049CompilerOptions::CompilerOptions(CompilerFilter compiler_filter,
50 size_t huge_method_threshold,
51 size_t large_method_threshold,
52 size_t small_method_threshold,
53 size_t tiny_method_threshold,
54 size_t num_dex_methods_threshold,
Mathieu Chartier5bdab122015-01-26 18:30:19 -080055 bool include_patch_information,
56 double top_k_profile_threshold,
Andreas Gampe7b2f09e2015-03-02 14:07:33 -080057 bool debuggable,
David Srbecky8363c772015-05-28 16:12:43 +010058 bool generate_debug_info,
Mathieu Chartier5bdab122015-01-26 18:30:19 -080059 bool implicit_null_checks,
60 bool implicit_so_checks,
61 bool implicit_suspend_checks,
62 bool compile_pic,
63 const std::vector<std::string>* verbose_methods,
64 PassManagerOptions* pass_manager_options,
Andreas Gampe6cf49e52015-03-05 13:08:45 -080065 std::ostream* init_failure_output,
66 bool abort_on_hard_verifier_failure
Mathieu Chartier5bdab122015-01-26 18:30:19 -080067 ) : // NOLINT(whitespace/parens)
68 compiler_filter_(compiler_filter),
69 huge_method_threshold_(huge_method_threshold),
70 large_method_threshold_(large_method_threshold),
71 small_method_threshold_(small_method_threshold),
72 tiny_method_threshold_(tiny_method_threshold),
73 num_dex_methods_threshold_(num_dex_methods_threshold),
Mathieu Chartier5bdab122015-01-26 18:30:19 -080074 include_patch_information_(include_patch_information),
75 top_k_profile_threshold_(top_k_profile_threshold),
Andreas Gampe7b2f09e2015-03-02 14:07:33 -080076 debuggable_(debuggable),
David Srbecky8363c772015-05-28 16:12:43 +010077 generate_debug_info_(generate_debug_info),
Mathieu Chartier5bdab122015-01-26 18:30:19 -080078 implicit_null_checks_(implicit_null_checks),
79 implicit_so_checks_(implicit_so_checks),
80 implicit_suspend_checks_(implicit_suspend_checks),
81 compile_pic_(compile_pic),
82 verbose_methods_(verbose_methods),
83 pass_manager_options_(pass_manager_options),
Andreas Gampe6cf49e52015-03-05 13:08:45 -080084 abort_on_hard_verifier_failure_(abort_on_hard_verifier_failure),
Mathieu Chartier5bdab122015-01-26 18:30:19 -080085 init_failure_output_(init_failure_output) {
86}
87
88} // namespace art