diff options
author | 2016-09-06 14:04:48 +0100 | |
---|---|---|
committer | 2016-09-16 10:08:18 +0100 | |
commit | ca3c8c33501bf199d6fd0a5db30a27d8e010cb23 (patch) | |
tree | 12a6c3a4266bd17c6b9fe7066fd0b25cb8d9b2d6 /compiler/dex/verified_method.cc | |
parent | 0764877e21f1230e718923d5b84b048cd4346afa (diff) |
Collect verifier dependencies
MethodVerifier tests whether a DEX method is valid w.r.t. the classes
in class path. Since the APK does not change across OTA updates, it
is not necessary to analyze the bytecode again with MethodVerifier,
as long as its dependencies on the class path (which may have changed)
are satisfied.
This patch introduces VerifierDeps, a class path dependency collector,
and adds hooks into MethodVerifier where classes/methods/fields are
resolved and where assignability of types is tested.
Test: m test-art-host-gtest-verifier_deps_test
Bug: 30937355
Change-Id: Iee0b321d772a5c7d1cb471aaa6e13918310b7e2f
Diffstat (limited to 'compiler/dex/verified_method.cc')
-rw-r--r-- | compiler/dex/verified_method.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/dex/verified_method.cc b/compiler/dex/verified_method.cc index 4bcd59ac90..e19fb7b300 100644 --- a/compiler/dex/verified_method.cc +++ b/compiler/dex/verified_method.cc @@ -231,7 +231,7 @@ void VerifiedMethod::GenerateSafeCastSet(verifier::MethodVerifier* method_verifi inst->VRegA_21c())); const verifier::RegType& cast_type = method_verifier->ResolveCheckedClass(inst->VRegB_21c()); - is_safe_cast = cast_type.IsStrictlyAssignableFrom(reg_type); + is_safe_cast = cast_type.IsStrictlyAssignableFrom(reg_type, method_verifier); } else { const verifier::RegType& array_type(line->GetRegisterType(method_verifier, inst->VRegB_23x())); @@ -243,7 +243,7 @@ void VerifiedMethod::GenerateSafeCastSet(verifier::MethodVerifier* method_verifi inst->VRegA_23x())); const verifier::RegType& component_type = method_verifier->GetRegTypeCache() ->GetComponentType(array_type, method_verifier->GetClassLoader()); - is_safe_cast = component_type.IsStrictlyAssignableFrom(value_type); + is_safe_cast = component_type.IsStrictlyAssignableFrom(value_type, method_verifier); } } if (is_safe_cast) { |