diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/dex/quick_compiler_callbacks.cc | 10 | ||||
| -rw-r--r-- | compiler/dex/quick_compiler_callbacks.h | 2 | ||||
| -rw-r--r-- | compiler/driver/compiler_driver.cc | 6 | ||||
| -rw-r--r-- | compiler/driver/compiler_driver.h | 2 | ||||
| -rw-r--r-- | compiler/driver/compiler_driver_test.cc | 8 |
5 files changed, 8 insertions, 20 deletions
diff --git a/compiler/dex/quick_compiler_callbacks.cc b/compiler/dex/quick_compiler_callbacks.cc index c7e9f4fc07..23511e55fc 100644 --- a/compiler/dex/quick_compiler_callbacks.cc +++ b/compiler/dex/quick_compiler_callbacks.cc @@ -34,17 +34,21 @@ void QuickCompilerCallbacks::ClassRejected(ClassReference ref) { } } -bool QuickCompilerCallbacks::CanAssumeVerified(ClassReference ref) { +ClassStatus QuickCompilerCallbacks::GetPreviousClassState(ClassReference ref) { // If we don't have class unloading enabled in the compiler, we will never see class that were // previously verified. Return false to avoid overhead from the lookup in the compiler driver. if (!does_class_unloading_) { - return false; + return ClassStatus::kStatusNotReady; } DCHECK(compiler_driver_ != nullptr); // In the case of the quicken filter: avoiding verification of quickened instructions, which the // verifier doesn't currently support. // In the case of the verify filter, avoiding verifiying twice. - return compiler_driver_->CanAssumeVerified(ref); + ClassStatus status; + if (!compiler_driver_->GetCompiledClass(ref, &status)) { + return ClassStatus::kStatusNotReady; + } + return status; } } // namespace art diff --git a/compiler/dex/quick_compiler_callbacks.h b/compiler/dex/quick_compiler_callbacks.h index 578aff45e5..45456f2a1c 100644 --- a/compiler/dex/quick_compiler_callbacks.h +++ b/compiler/dex/quick_compiler_callbacks.h @@ -54,7 +54,7 @@ class QuickCompilerCallbacks FINAL : public CompilerCallbacks { verification_results_ = verification_results; } - bool CanAssumeVerified(ClassReference ref) OVERRIDE; + ClassStatus GetPreviousClassState(ClassReference ref) OVERRIDE; void SetDoesClassUnloading(bool does_class_unloading, CompilerDriver* compiler_driver) OVERRIDE { diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index ee36a92c17..18b54eefba 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -3053,10 +3053,4 @@ void CompilerDriver::SetDexFilesForOatFile(const std::vector<const DexFile*>& de } } -bool CompilerDriver::CanAssumeVerified(ClassReference ref) const { - mirror::Class::Status existing = mirror::Class::kStatusNotReady; - compiled_classes_.Get(DexFileReference(ref.first, ref.second), &existing); - return existing >= mirror::Class::kStatusVerified; -} - } // namespace art diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index 11808c1be4..d08d9d7940 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -379,8 +379,6 @@ class CompilerDriver { return profile_compilation_info_; } - bool CanAssumeVerified(ClassReference ref) const; - // Is `boot_image_filename` the name of a core image (small boot // image used for ART testing only)? static bool IsCoreImageFilename(const std::string& boot_image_filename) { diff --git a/compiler/driver/compiler_driver_test.cc b/compiler/driver/compiler_driver_test.cc index 392d57c0f2..278358b250 100644 --- a/compiler/driver/compiler_driver_test.cc +++ b/compiler/driver/compiler_driver_test.cc @@ -369,8 +369,6 @@ TEST_F(CompilerDriverVerifyTest, VerifyCompilation) { // Test that a class of status kStatusRetryVerificationAtRuntime is indeed recorded that way in the // driver. -// Test that checks that classes can be assumed as verified if unloading mode is enabled and -// the class status is at least verified. TEST_F(CompilerDriverVerifyTest, RetryVerifcationStatusCheckVerified) { Thread* const self = Thread::Current(); jobject class_loader; @@ -401,12 +399,6 @@ TEST_F(CompilerDriverVerifyTest, RetryVerifcationStatusCheckVerified) { mirror::Class::Status status = {}; ASSERT_TRUE(compiler_driver_->GetCompiledClass(ref, &status)); EXPECT_EQ(status, expected_status); - - // Check that we can assume verified if we are a status that is at least verified. - if (status >= mirror::Class::kStatusVerified) { - // Check that the class can be assumed as verified in the compiler driver. - EXPECT_TRUE(callbacks_->CanAssumeVerified(ref)) << status; - } } } |