blob: 824194c7bd45707118a6bd7468776f7280913e60 [file] [log] [blame]
Ian Rogerse63db272014-07-15 15:36:11 -07001/*
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
22namespace art {
23
24class VerificationResults;
25class DexFileToMethodInlinerMap;
26
27class QuickCompilerCallbacks FINAL : public CompilerCallbacks {
28 public:
29 QuickCompilerCallbacks(VerificationResults* verification_results,
Andreas Gampe81c6f8d2015-03-25 17:19:53 -070030 DexFileToMethodInlinerMap* method_inliner_map,
Andreas Gampe4585f872015-03-27 23:45:15 -070031 CompilerCallbacks::CallbackMode mode)
David Brazdilca3c8c32016-09-06 14:04:48 +010032 : CompilerCallbacks(mode),
33 verification_results_(verification_results),
34 method_inliner_map_(method_inliner_map),
35 verifier_deps_(nullptr) {
Ian Rogerse63db272014-07-15 15:36:11 -070036 CHECK(verification_results != nullptr);
37 CHECK(method_inliner_map != nullptr);
38 }
39
40 ~QuickCompilerCallbacks() { }
41
Andreas Gampe53e32d12015-12-09 21:03:23 -080042 void MethodVerified(verifier::MethodVerifier* verifier)
Andreas Gampebdf7f1c2016-08-30 16:38:47 -070043 REQUIRES_SHARED(Locks::mutator_lock_) OVERRIDE;
Ian Rogerse63db272014-07-15 15:36:11 -070044
45 void ClassRejected(ClassReference ref) OVERRIDE;
46
Alex Lighta59dd802014-07-02 16:28:08 -070047 // We are running in an environment where we can call patchoat safely so we should.
48 bool IsRelocationPossible() OVERRIDE {
49 return true;
50 }
51
David Brazdilca3c8c32016-09-06 14:04:48 +010052 verifier::VerifierDeps* GetVerifierDeps() const OVERRIDE {
53 return verifier_deps_;
54 }
55
56 void SetVerifierDeps(verifier::VerifierDeps* deps) {
57 verifier_deps_ = deps;
58 }
59
Ian Rogerse63db272014-07-15 15:36:11 -070060 private:
61 VerificationResults* const verification_results_;
62 DexFileToMethodInlinerMap* const method_inliner_map_;
David Brazdilca3c8c32016-09-06 14:04:48 +010063 verifier::VerifierDeps* verifier_deps_;
Ian Rogerse63db272014-07-15 15:36:11 -070064};
65
66} // namespace art
67
68#endif // ART_COMPILER_DEX_QUICK_COMPILER_CALLBACKS_H_