summaryrefslogtreecommitdiff
path: root/runtime/verifier/method_verifier.h
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2018-08-24 15:22:43 -0700
committer Andreas Gampe <agampe@google.com> 2018-08-24 15:22:43 -0700
commit6cc23acba91d26d7afd6bc681004ac5865a8a163 (patch)
treed5b6850d7ce511658a33ca417764eac92cafe2d1 /runtime/verifier/method_verifier.h
parente9dce6a280057315a8a58ed46190c9a893c90fba (diff)
ART: Add API level to verifier
Pass API level to verifier. In preparation for API-level dependent checks. Bug: 111969862 Test: m test-art-host Change-Id: I700ef52e28436a7fda8b9d9ef29841110ed6d3bb
Diffstat (limited to 'runtime/verifier/method_verifier.h')
-rw-r--r--runtime/verifier/method_verifier.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/runtime/verifier/method_verifier.h b/runtime/verifier/method_verifier.h
index 9890af9d95..eef22807ec 100644
--- a/runtime/verifier/method_verifier.h
+++ b/runtime/verifier/method_verifier.h
@@ -100,6 +100,7 @@ class MethodVerifier {
CompilerCallbacks* callbacks,
bool allow_soft_failures,
HardFailLogMode log_level,
+ uint32_t api_level,
std::string* error)
REQUIRES_SHARED(Locks::mutator_lock_);
static FailureKind VerifyClass(Thread* self,
@@ -110,6 +111,7 @@ class MethodVerifier {
CompilerCallbacks* callbacks,
bool allow_soft_failures,
HardFailLogMode log_level,
+ uint32_t api_level,
std::string* error)
REQUIRES_SHARED(Locks::mutator_lock_);
@@ -121,7 +123,8 @@ class MethodVerifier {
Handle<mirror::ClassLoader> class_loader,
const DexFile::ClassDef& class_def,
const DexFile::CodeItem* code_item, ArtMethod* method,
- uint32_t method_access_flags)
+ uint32_t method_access_flags,
+ uint32_t api_level)
REQUIRES_SHARED(Locks::mutator_lock_);
uint8_t EncodePcToReferenceMapData() const;
@@ -163,8 +166,10 @@ class MethodVerifier {
// Fills 'monitor_enter_dex_pcs' with the dex pcs of the monitor-enter instructions corresponding
// to the locks held at 'dex_pc' in method 'm'.
// Note: this is the only situation where the verifier will visit quickened instructions.
- static void FindLocksAtDexPc(ArtMethod* m, uint32_t dex_pc,
- std::vector<DexLockInfo>* monitor_enter_dex_pcs)
+ static void FindLocksAtDexPc(ArtMethod* m,
+ uint32_t dex_pc,
+ std::vector<DexLockInfo>* monitor_enter_dex_pcs,
+ uint32_t api_level)
REQUIRES_SHARED(Locks::mutator_lock_);
static void Init() REQUIRES_SHARED(Locks::mutator_lock_);
@@ -242,7 +247,8 @@ class MethodVerifier {
bool allow_soft_failures,
bool need_precise_constants,
bool verify_to_dump,
- bool allow_thread_suspension)
+ bool allow_thread_suspension,
+ uint32_t api_level)
REQUIRES_SHARED(Locks::mutator_lock_);
void UninstantiableError(const char* descriptor);
@@ -299,6 +305,7 @@ class MethodVerifier {
bool allow_soft_failures,
HardFailLogMode log_level,
bool need_precise_constants,
+ uint32_t api_level,
std::string* hard_failure_msg)
REQUIRES_SHARED(Locks::mutator_lock_);
@@ -790,6 +797,10 @@ class MethodVerifier {
// Link, for the method verifier root linked list.
MethodVerifier* link_;
+ // API level, for dependent checks. Note: we do not use '0' for unset here, to simplify checks.
+ // Instead, unset level should correspond to max().
+ const uint32_t api_level_;
+
friend class art::Thread;
friend class VerifierDepsTest;