Ian Rogers | e63db27 | 2014-07-15 15:36:11 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 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_COMPILER_DEX_QUICK_COMPILER_CALLBACKS_H_ |
| 18 | #define ART_COMPILER_DEX_QUICK_COMPILER_CALLBACKS_H_ |
| 19 | |
| 20 | #include "compiler_callbacks.h" |
| 21 | |
| 22 | namespace art { |
| 23 | |
| 24 | class VerificationResults; |
| 25 | class DexFileToMethodInlinerMap; |
| 26 | |
| 27 | class QuickCompilerCallbacks FINAL : public CompilerCallbacks { |
| 28 | public: |
| 29 | QuickCompilerCallbacks(VerificationResults* verification_results, |
Andreas Gampe | 81c6f8d | 2015-03-25 17:19:53 -0700 | [diff] [blame] | 30 | DexFileToMethodInlinerMap* method_inliner_map, |
Andreas Gampe | 4585f87 | 2015-03-27 23:45:15 -0700 | [diff] [blame] | 31 | CompilerCallbacks::CallbackMode mode) |
| 32 | : CompilerCallbacks(mode), verification_results_(verification_results), |
Ian Rogers | e63db27 | 2014-07-15 15:36:11 -0700 | [diff] [blame] | 33 | method_inliner_map_(method_inliner_map) { |
| 34 | CHECK(verification_results != nullptr); |
| 35 | CHECK(method_inliner_map != nullptr); |
| 36 | } |
| 37 | |
| 38 | ~QuickCompilerCallbacks() { } |
| 39 | |
Andreas Gampe | 53e32d1 | 2015-12-09 21:03:23 -0800 | [diff] [blame] | 40 | void MethodVerified(verifier::MethodVerifier* verifier) |
Mathieu Chartier | 9044347 | 2015-07-16 20:32:27 -0700 | [diff] [blame] | 41 | SHARED_REQUIRES(Locks::mutator_lock_) OVERRIDE; |
Ian Rogers | e63db27 | 2014-07-15 15:36:11 -0700 | [diff] [blame] | 42 | |
| 43 | void ClassRejected(ClassReference ref) OVERRIDE; |
| 44 | |
Alex Light | a59dd80 | 2014-07-02 16:28:08 -0700 | [diff] [blame] | 45 | // We are running in an environment where we can call patchoat safely so we should. |
| 46 | bool IsRelocationPossible() OVERRIDE { |
| 47 | return true; |
| 48 | } |
| 49 | |
Ian Rogers | e63db27 | 2014-07-15 15:36:11 -0700 | [diff] [blame] | 50 | private: |
| 51 | VerificationResults* const verification_results_; |
| 52 | DexFileToMethodInlinerMap* const method_inliner_map_; |
| 53 | }; |
| 54 | |
| 55 | } // namespace art |
| 56 | |
| 57 | #endif // ART_COMPILER_DEX_QUICK_COMPILER_CALLBACKS_H_ |