diff options
| author | 2016-12-06 10:11:57 +0000 | |
|---|---|---|
| committer | 2016-12-06 10:11:57 +0000 | |
| commit | 3a9cc4b5e5dd3e5ebe1e40b3e3696f7d618edb61 (patch) | |
| tree | e3c0f8a424ada628dfc55f3c3666a97eb48fb056 /compiler/dex | |
| parent | 735af486815608076a2fd7980fa8b16e4734185d (diff) | |
| parent | 2eace9c1323060ee4f42d67cba9c1fd068c6a2b3 (diff) | |
Merge "Create empty VerifiedMethod after vdex verification."
am: 2eace9c132
Change-Id: I234895ba7cbff5b760275a2e2ba4581b47aba4e8
Diffstat (limited to 'compiler/dex')
| -rw-r--r-- | compiler/dex/verification_results.cc | 11 | ||||
| -rw-r--r-- | compiler/dex/verification_results.h | 3 | ||||
| -rw-r--r-- | compiler/dex/verified_method.h | 4 |
3 files changed, 16 insertions, 2 deletions
diff --git a/compiler/dex/verification_results.cc b/compiler/dex/verification_results.cc index 669d8cd991..9d39bf2c7a 100644 --- a/compiler/dex/verification_results.cc +++ b/compiler/dex/verification_results.cc @@ -103,6 +103,17 @@ const VerifiedMethod* VerificationResults::GetVerifiedMethod(MethodReference ref return (it != verified_methods_.end()) ? it->second : nullptr; } +void VerificationResults::CreateVerifiedMethodFor(MethodReference ref) { + // This method should only be called for classes verified at compile time, + // which have no verifier error, nor has methods that we know will throw + // at runtime. + AtomicMap::InsertResult result = atomic_verified_methods_.Insert( + ref, + /*expected*/ nullptr, + new VerifiedMethod(/* encountered_error_types */ 0, /* has_runtime_throw */ false)); + DCHECK_EQ(result, AtomicMap::kInsertResultSuccess); +} + void VerificationResults::AddRejectedClass(ClassReference ref) { { WriterMutexLock mu(Thread::Current(), rejected_classes_lock_); diff --git a/compiler/dex/verification_results.h b/compiler/dex/verification_results.h index ea38f4d537..ab735c1315 100644 --- a/compiler/dex/verification_results.h +++ b/compiler/dex/verification_results.h @@ -47,6 +47,9 @@ class VerificationResults { REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!verified_methods_lock_); + void CreateVerifiedMethodFor(MethodReference ref) + REQUIRES(!verified_methods_lock_); + const VerifiedMethod* GetVerifiedMethod(MethodReference ref) REQUIRES(!verified_methods_lock_); diff --git a/compiler/dex/verified_method.h b/compiler/dex/verified_method.h index 04331e5aff..ce53417185 100644 --- a/compiler/dex/verified_method.h +++ b/compiler/dex/verified_method.h @@ -32,6 +32,8 @@ class MethodVerifier; class VerifiedMethod { public: + VerifiedMethod(uint32_t encountered_error_types, bool has_runtime_throw); + // Cast elision set type. // Since we're adding the dex PCs to the set in increasing order, a sorted vector // is better for performance (not just memory usage), especially for large sets. @@ -80,8 +82,6 @@ class VerifiedMethod { } private: - VerifiedMethod(uint32_t encountered_error_types, bool has_runtime_throw); - /* * Generate the GC map for a method that has just been verified (i.e. we're doing this as part of * verification). For type-precise determination we have all the data we need, so we just need to |