1 /* 2 * Copyright (C) 2020 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 #ifndef ART_DEXOPTANALYZER_DEXOPTANALYZER_H_ 18 #define ART_DEXOPTANALYZER_DEXOPTANALYZER_H_ 19 20 namespace art { 21 namespace dexoptanalyzer { 22 23 // See OatFileAssistant docs for the meaning of the valid return codes. 24 enum class ReturnCode { 25 kNoDexOptNeeded = 0, 26 kDex2OatFromScratch = 1, 27 kDex2OatForBootImageOat = 2, 28 kDex2OatForFilterOat = 3, 29 kDex2OatForBootImageOdex = 4, 30 kDex2OatForFilterOdex = 5, 31 32 // Success return code when executed with --flatten-class-loader-context. 33 // Success is typically signalled with a zero but we use a non-colliding 34 // code to communicate that the flattening code path was taken. 35 kFlattenClassLoaderContextSuccess = 50, 36 37 kErrorInvalidArguments = 101, 38 kErrorCannotCreateRuntime = 102, 39 kErrorUnknownDexOptNeeded = 103 40 }; 41 42 // Accepted values for the profile analysis results. 43 enum class ProfileAnalysisResult { 44 kOptimize = 1, 45 kDontOptimizeSmallDelta = 2, 46 kDontOptimizeEmptyProfiles = 3, 47 }; 48 49 } // namespace dexoptanalyzer 50 } // namespace art 51 52 #endif // ART_DEXOPTANALYZER_DEXOPTANALYZER_H_ 53