• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 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 "aot_class_linker.h"
18 
19 #include "class_reference.h"
20 #include "compiler_callbacks.h"
21 #include "handle_scope-inl.h"
22 #include "mirror/class-inl.h"
23 #include "runtime.h"
24 #include "verifier/verifier_enums.h"
25 
26 namespace art {
27 
AotClassLinker(InternTable * intern_table)28 AotClassLinker::AotClassLinker(InternTable *intern_table) : ClassLinker(intern_table) {}
29 
~AotClassLinker()30 AotClassLinker::~AotClassLinker() {}
31 
PerformClassVerification(Thread * self,Handle<mirror::Class> klass,verifier::HardFailLogMode log_level,std::string * error_msg)32 verifier::FailureKind AotClassLinker::PerformClassVerification(Thread* self,
33                                                                Handle<mirror::Class> klass,
34                                                                verifier::HardFailLogMode log_level,
35                                                                std::string* error_msg) {
36   Runtime* const runtime = Runtime::Current();
37   CompilerCallbacks* callbacks = runtime->GetCompilerCallbacks();
38   if (callbacks->CanAssumeVerified(ClassReference(&klass->GetDexFile(),
39                                                   klass->GetDexClassDefIndex()))) {
40     return verifier::FailureKind::kNoFailure;
41   }
42   return ClassLinker::PerformClassVerification(self, klass, log_level, error_msg);
43 }
44 
45 }  // namespace art
46