blob: 5cf234ddb548b76aa1d523f59055a87692a973c8 [file] [log] [blame]
Vladimir Marko2b5eaa22013-12-13 13:59:30 +00001/*
2 * Copyright (C) 2013 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_RUNTIME_VERIFIER_METHOD_VERIFIER_INL_H_
18#define ART_RUNTIME_VERIFIER_METHOD_VERIFIER_INL_H_
19
20#include "base/logging.h"
21#include "method_verifier.h"
22#include "mirror/class_loader.h"
23#include "mirror/dex_cache.h"
24
25namespace art {
26namespace verifier {
27
28const DexFile::CodeItem* MethodVerifier::CodeItem() const {
29 return code_item_;
30}
31
32RegisterLine* MethodVerifier::GetRegLine(uint32_t dex_pc) {
33 return reg_table_.GetLine(dex_pc);
34}
35
36const InstructionFlags& MethodVerifier::GetInstructionFlags(size_t index) const {
37 return insn_flags_[index];
38}
39
40mirror::ClassLoader* MethodVerifier::GetClassLoader() {
41 return class_loader_->get();
42}
43
44mirror::DexCache* MethodVerifier::GetDexCache() {
45 return dex_cache_->get();
46}
47
48MethodReference MethodVerifier::GetMethodReference() const {
49 return MethodReference(dex_file_, dex_method_idx_);
50}
51
52uint32_t MethodVerifier::GetAccessFlags() const {
53 return method_access_flags_;
54}
55
56bool MethodVerifier::HasCheckCasts() const {
57 return has_check_casts_;
58}
59
60bool MethodVerifier::HasVirtualOrInterfaceInvokes() const {
61 return has_virtual_or_interface_invokes_;
62}
63
64bool MethodVerifier::HasFailures() const {
65 return !failure_messages_.empty();
66}
67
68const RegType& MethodVerifier::ResolveCheckedClass(uint32_t class_idx) {
69 DCHECK(!HasFailures());
70 const RegType& result = ResolveClassAndCheckAccess(class_idx);
71 DCHECK(!HasFailures());
72 return result;
73}
74
75} // namespace verifier
76} // namespace art
77
78#endif // ART_RUNTIME_VERIFIER_METHOD_VERIFIER_INL_H_