Mathieu Chartier | 5bdab12 | 2015-01-26 18:30:19 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 21 | namespace art { |
| 22 | |
| 23 | CompilerOptions::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), |
Calin Juravle | ec74835 | 2015-07-29 13:52:12 +0100 | [diff] [blame] | 30 | inline_depth_limit_(kDefaultInlineDepthLimit), |
| 31 | inline_max_code_units_(kDefaultInlineMaxCodeUnits), |
Mathieu Chartier | 5bdab12 | 2015-01-26 18:30:19 -0800 | [diff] [blame] | 32 | include_patch_information_(kDefaultIncludePatchInformation), |
| 33 | top_k_profile_threshold_(kDefaultTopKProfileThreshold), |
Andreas Gampe | 7b2f09e | 2015-03-02 14:07:33 -0800 | [diff] [blame] | 34 | debuggable_(false), |
David Srbecky | 8363c77 | 2015-05-28 16:12:43 +0100 | [diff] [blame] | 35 | generate_debug_info_(kDefaultGenerateDebugInfo), |
Mathieu Chartier | 5bdab12 | 2015-01-26 18:30:19 -0800 | [diff] [blame] | 36 | implicit_null_checks_(true), |
| 37 | implicit_so_checks_(true), |
| 38 | implicit_suspend_checks_(false), |
| 39 | compile_pic_(false), |
| 40 | verbose_methods_(nullptr), |
| 41 | pass_manager_options_(new PassManagerOptions), |
Andreas Gampe | 6cf49e5 | 2015-03-05 13:08:45 -0800 | [diff] [blame] | 42 | abort_on_hard_verifier_failure_(false), |
Mathieu Chartier | 5bdab12 | 2015-01-26 18:30:19 -0800 | [diff] [blame] | 43 | init_failure_output_(nullptr) { |
| 44 | } |
| 45 | |
Vladimir Marko | b163bb7 | 2015-03-31 21:49:49 +0100 | [diff] [blame] | 46 | CompilerOptions::~CompilerOptions() { |
| 47 | // The destructor looks empty but it destroys a PassManagerOptions object. We keep it here |
| 48 | // because we don't want to include the PassManagerOptions definition from the header file. |
| 49 | } |
| 50 | |
Mathieu Chartier | 5bdab12 | 2015-01-26 18:30:19 -0800 | [diff] [blame] | 51 | CompilerOptions::CompilerOptions(CompilerFilter compiler_filter, |
| 52 | size_t huge_method_threshold, |
| 53 | size_t large_method_threshold, |
| 54 | size_t small_method_threshold, |
| 55 | size_t tiny_method_threshold, |
| 56 | size_t num_dex_methods_threshold, |
Calin Juravle | ec74835 | 2015-07-29 13:52:12 +0100 | [diff] [blame] | 57 | size_t inline_depth_limit, |
| 58 | size_t inline_max_code_units, |
Mathieu Chartier | 5bdab12 | 2015-01-26 18:30:19 -0800 | [diff] [blame] | 59 | bool include_patch_information, |
| 60 | double top_k_profile_threshold, |
Andreas Gampe | 7b2f09e | 2015-03-02 14:07:33 -0800 | [diff] [blame] | 61 | bool debuggable, |
David Srbecky | 8363c77 | 2015-05-28 16:12:43 +0100 | [diff] [blame] | 62 | bool generate_debug_info, |
Mathieu Chartier | 5bdab12 | 2015-01-26 18:30:19 -0800 | [diff] [blame] | 63 | bool implicit_null_checks, |
| 64 | bool implicit_so_checks, |
| 65 | bool implicit_suspend_checks, |
| 66 | bool compile_pic, |
| 67 | const std::vector<std::string>* verbose_methods, |
| 68 | PassManagerOptions* pass_manager_options, |
Andreas Gampe | 6cf49e5 | 2015-03-05 13:08:45 -0800 | [diff] [blame] | 69 | std::ostream* init_failure_output, |
| 70 | bool abort_on_hard_verifier_failure |
Mathieu Chartier | 5bdab12 | 2015-01-26 18:30:19 -0800 | [diff] [blame] | 71 | ) : // NOLINT(whitespace/parens) |
| 72 | compiler_filter_(compiler_filter), |
| 73 | huge_method_threshold_(huge_method_threshold), |
| 74 | large_method_threshold_(large_method_threshold), |
| 75 | small_method_threshold_(small_method_threshold), |
| 76 | tiny_method_threshold_(tiny_method_threshold), |
| 77 | num_dex_methods_threshold_(num_dex_methods_threshold), |
Calin Juravle | ec74835 | 2015-07-29 13:52:12 +0100 | [diff] [blame] | 78 | inline_depth_limit_(inline_depth_limit), |
| 79 | inline_max_code_units_(inline_max_code_units), |
Mathieu Chartier | 5bdab12 | 2015-01-26 18:30:19 -0800 | [diff] [blame] | 80 | include_patch_information_(include_patch_information), |
| 81 | top_k_profile_threshold_(top_k_profile_threshold), |
Andreas Gampe | 7b2f09e | 2015-03-02 14:07:33 -0800 | [diff] [blame] | 82 | debuggable_(debuggable), |
David Srbecky | 8363c77 | 2015-05-28 16:12:43 +0100 | [diff] [blame] | 83 | generate_debug_info_(generate_debug_info), |
Mathieu Chartier | 5bdab12 | 2015-01-26 18:30:19 -0800 | [diff] [blame] | 84 | implicit_null_checks_(implicit_null_checks), |
| 85 | implicit_so_checks_(implicit_so_checks), |
| 86 | implicit_suspend_checks_(implicit_suspend_checks), |
| 87 | compile_pic_(compile_pic), |
| 88 | verbose_methods_(verbose_methods), |
| 89 | pass_manager_options_(pass_manager_options), |
Andreas Gampe | 6cf49e5 | 2015-03-05 13:08:45 -0800 | [diff] [blame] | 90 | abort_on_hard_verifier_failure_(abort_on_hard_verifier_failure), |
Mathieu Chartier | 5bdab12 | 2015-01-26 18:30:19 -0800 | [diff] [blame] | 91 | init_failure_output_(init_failure_output) { |
| 92 | } |
| 93 | |
| 94 | } // namespace art |