15eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe/* 25eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe * Copyright (C) 2015 The Android Open Source Project 35eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe * 45eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe * Licensed under the Apache License, Version 2.0 (the "License"); 55eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe * you may not use this file except in compliance with the License. 65eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe * You may obtain a copy of the License at 75eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe * 85eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe * http://www.apache.org/licenses/LICENSE-2.0 95eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe * 105eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe * Unless required by applicable law or agreed to in writing, software 115eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe * distributed under the License is distributed on an "AS IS" BASIS, 125eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 135eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe * See the License for the specific language governing permissions and 145eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe * limitations under the License. 155eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe */ 165eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe 175eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe#ifndef ART_COMPILER_DEX_DEX_TO_DEX_COMPILER_H_ 185eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe#define ART_COMPILER_DEX_DEX_TO_DEX_COMPILER_H_ 195eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe 205eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe#include "jni.h" 215eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe 225eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe#include "dex_file.h" 235eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe#include "invoke_type.h" 245eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe 255eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampenamespace art { 265eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe 275eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampeclass CompiledMethod; 285eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampeclass CompilerDriver; 295eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe 305eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampenamespace optimizer { 315eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe 325eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampeenum class DexToDexCompilationLevel { 335eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe kDontDexToDexCompile, // Only meaning wrt image time interpretation. 345eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe kRequired, // Dex-to-dex compilation required for correctness. 355eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe kOptimize // Perform required transformation and peep-hole optimizations. 365eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe}; 375eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampestd::ostream& operator<<(std::ostream& os, const DexToDexCompilationLevel& rhs); 385eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe 395eb0d38dabda4d17a315c557f07f457308d28fa7Andreas GampeCompiledMethod* ArtCompileDEX(CompilerDriver* driver, 405eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe const DexFile::CodeItem* code_item, 415eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe uint32_t access_flags, 425eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe InvokeType invoke_type, 435eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe uint16_t class_def_idx, 445eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe uint32_t method_idx, 455eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe jobject class_loader, 465eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe const DexFile& dex_file, 475eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe DexToDexCompilationLevel dex_to_dex_compilation_level); 485eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe 495eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe} // namespace optimizer 505eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe 515eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe} // namespace art 525eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe 535eb0d38dabda4d17a315c557f07f457308d28fa7Andreas Gampe#endif // ART_COMPILER_DEX_DEX_TO_DEX_COMPILER_H_ 54