summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/Android.bp1
-rw-r--r--compiler/common_compiler_test.cc5
-rw-r--r--compiler/common_compiler_test.h2
-rw-r--r--compiler/dex/verification_results.cc76
-rw-r--r--compiler/dex/verification_results.h61
-rw-r--r--compiler/driver/compiler_options.cc7
-rw-r--r--compiler/driver/compiler_options.h6
-rw-r--r--compiler/libart-compiler.map1
8 files changed, 0 insertions, 159 deletions
diff --git a/compiler/Android.bp b/compiler/Android.bp
index 172af5ef01..5055554843 100644
--- a/compiler/Android.bp
+++ b/compiler/Android.bp
@@ -36,7 +36,6 @@ art_cc_defaults {
"compiled_method.cc",
"debug/elf_debug_writer.cc",
"dex/inline_method_analyser.cc",
- "dex/verification_results.cc",
"driver/compiled_method_storage.cc",
"driver/compiler_options.cc",
"driver/dex_compilation_unit.cc",
diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc
index a63d21d4ca..7d7b70bb6d 100644
--- a/compiler/common_compiler_test.cc
+++ b/compiler/common_compiler_test.cc
@@ -30,7 +30,6 @@
#include "class_linker.h"
#include "compiled_method-inl.h"
#include "dex/descriptors_names.h"
-#include "dex/verification_results.h"
#include "driver/compiled_method_storage.h"
#include "driver/compiler_options.h"
#include "jni/java_vm_ext.h"
@@ -207,7 +206,6 @@ void CommonCompilerTestImpl::OverrideInstructionSetFeatures(InstructionSet instr
void CommonCompilerTestImpl::SetUpRuntimeOptionsImpl() {
compiler_options_.reset(new CompilerOptions);
- verification_results_.reset(new VerificationResults());
ApplyInstructionSet();
}
@@ -221,7 +219,6 @@ void CommonCompilerTestImpl::SetCompilerKind(Compiler::Kind compiler_kind) {
void CommonCompilerTestImpl::TearDown() {
code_and_metadata_.clear();
- verification_results_.reset();
compiler_options_.reset();
}
@@ -241,7 +238,6 @@ void CommonCompilerTestImpl::CompileMethod(ArtMethod* method) {
Handle<mirror::DexCache> dex_cache =
hs.NewHandle(GetClassLinker()->FindDexCache(self, dex_file));
Handle<mirror::ClassLoader> class_loader = hs.NewHandle(method->GetClassLoader());
- compiler_options_->verification_results_ = verification_results_.get();
if (method->IsNative()) {
compiled_method = compiler->JniCompile(method->GetAccessFlags(),
method->GetDexMethodIndex(),
@@ -257,7 +253,6 @@ void CommonCompilerTestImpl::CompileMethod(ArtMethod* method) {
dex_file,
dex_cache);
}
- compiler_options_->verification_results_ = nullptr;
}
CHECK(method != nullptr);
{
diff --git a/compiler/common_compiler_test.h b/compiler/common_compiler_test.h
index cc021b829e..cc74f8f6b4 100644
--- a/compiler/common_compiler_test.h
+++ b/compiler/common_compiler_test.h
@@ -38,7 +38,6 @@ class CompilerOptions;
class CumulativeLogger;
class DexFile;
class TimingLogger;
-class VerificationResults;
template<class T> class Handle;
@@ -88,7 +87,6 @@ class CommonCompilerTestImpl {
= InstructionSetFeatures::FromCppDefines();
std::unique_ptr<CompilerOptions> compiler_options_;
- std::unique_ptr<VerificationResults> verification_results_;
protected:
virtual ClassLinker* GetClassLinker() = 0;
diff --git a/compiler/dex/verification_results.cc b/compiler/dex/verification_results.cc
deleted file mode 100644
index bc0329a74e..0000000000
--- a/compiler/dex/verification_results.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "verification_results.h"
-
-#include <android-base/logging.h>
-
-#include "base/mutex-inl.h"
-#include "base/stl_util.h"
-#include "dex/class_accessor-inl.h"
-#include "runtime.h"
-#include "thread-current-inl.h"
-#include "thread.h"
-
-namespace art {
-
-VerificationResults::VerificationResults()
- : uncompilable_methods_lock_("compiler uncompilable methods lock"),
- rejected_classes_lock_("compiler rejected classes lock") {}
-
-// Non-inline version of the destructor, as it does some implicit work not worth
-// inlining.
-VerificationResults::~VerificationResults() {}
-
-void VerificationResults::AddRejectedClass(ClassReference ref) {
- {
- WriterMutexLock mu(Thread::Current(), rejected_classes_lock_);
- rejected_classes_.insert(ref);
- }
- DCHECK(IsClassRejected(ref));
-}
-
-bool VerificationResults::IsClassRejected(ClassReference ref) const {
- ReaderMutexLock mu(Thread::Current(), rejected_classes_lock_);
- return rejected_classes_.find(ref) != rejected_classes_.end();
-}
-
-void VerificationResults::AddUncompilableMethod(MethodReference ref) {
- {
- WriterMutexLock mu(Thread::Current(), uncompilable_methods_lock_);
- uncompilable_methods_.insert(ref);
- }
- DCHECK(IsUncompilableMethod(ref));
-}
-
-void VerificationResults::AddUncompilableClass(ClassReference ref) {
- const DexFile& dex_file = *ref.dex_file;
- const dex::ClassDef& class_def = dex_file.GetClassDef(ref.ClassDefIdx());
- WriterMutexLock mu(Thread::Current(), uncompilable_methods_lock_);
- ClassAccessor accessor(dex_file, class_def);
- for (const ClassAccessor::Method& method : accessor.GetMethods()) {
- MethodReference method_ref(&dex_file, method.GetIndex());
- uncompilable_methods_.insert(method_ref);
- }
-}
-
-bool VerificationResults::IsUncompilableMethod(MethodReference ref) const {
- ReaderMutexLock mu(Thread::Current(), uncompilable_methods_lock_);
- return uncompilable_methods_.find(ref) != uncompilable_methods_.end();
-}
-
-
-} // namespace art
diff --git a/compiler/dex/verification_results.h b/compiler/dex/verification_results.h
deleted file mode 100644
index 7c5595efef..0000000000
--- a/compiler/dex/verification_results.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ART_COMPILER_DEX_VERIFICATION_RESULTS_H_
-#define ART_COMPILER_DEX_VERIFICATION_RESULTS_H_
-
-#include <set>
-
-#include "base/macros.h"
-#include "base/mutex.h"
-#include "dex/class_reference.h"
-#include "dex/method_reference.h"
-
-namespace art {
-
-namespace verifier {
-class VerifierDepsTest;
-} // namespace verifier
-
-// Used by CompilerCallbacks to track verification information from the Runtime.
-class VerificationResults {
- public:
- VerificationResults();
- ~VerificationResults();
-
- void AddRejectedClass(ClassReference ref) REQUIRES(!rejected_classes_lock_);
- bool IsClassRejected(ClassReference ref) const REQUIRES(!rejected_classes_lock_);
-
- void AddUncompilableClass(ClassReference ref) REQUIRES(!uncompilable_methods_lock_);
- void AddUncompilableMethod(MethodReference ref) REQUIRES(!uncompilable_methods_lock_);
- bool IsUncompilableMethod(MethodReference ref) const REQUIRES(!uncompilable_methods_lock_);
-
- private:
- // TODO: External locking during CompilerDriver::PreCompile(), no locking during compilation.
- mutable ReaderWriterMutex uncompilable_methods_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
- std::set<MethodReference> uncompilable_methods_ GUARDED_BY(uncompilable_methods_lock_);
-
- // Rejected classes.
- // TODO: External locking during CompilerDriver::PreCompile(), no locking during compilation.
- mutable ReaderWriterMutex rejected_classes_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
- std::set<ClassReference> rejected_classes_ GUARDED_BY(rejected_classes_lock_);
-
- friend class verifier::VerifierDepsTest;
-};
-
-} // namespace art
-
-#endif // ART_COMPILER_DEX_VERIFICATION_RESULTS_H_
diff --git a/compiler/driver/compiler_options.cc b/compiler/driver/compiler_options.cc
index a531bc91ff..8c2c8f30f9 100644
--- a/compiler/driver/compiler_options.cc
+++ b/compiler/driver/compiler_options.cc
@@ -31,7 +31,6 @@
#include "cmdline_parser.h"
#include "compiler_options_map-inl.h"
#include "dex/dex_file-inl.h"
-#include "dex/verification_results.h"
#include "runtime.h"
#include "scoped_thread_state_change-inl.h"
#include "simple_compiler_options_map.h"
@@ -49,7 +48,6 @@ CompilerOptions::CompilerOptions()
no_inline_from_(),
dex_files_for_oat_file_(),
image_classes_(),
- verification_results_(nullptr),
compiler_type_(CompilerType::kAotCompiler),
image_type_(ImageType::kNone),
multi_image_(false),
@@ -156,11 +154,6 @@ bool CompilerOptions::IsPreloadedClass(const char* pretty_descriptor) const {
return preloaded_classes_.find(std::string_view(pretty_descriptor)) != preloaded_classes_.end();
}
-const VerificationResults* CompilerOptions::GetVerificationResults() const {
- DCHECK(Runtime::Current()->IsAotCompiler());
- return verification_results_;
-}
-
bool CompilerOptions::ShouldCompileWithClinitCheck(ArtMethod* method) const {
if (method != nullptr &&
Runtime::Current()->IsAotCompiler() &&
diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h
index 20f54bdecd..1afa2c5d34 100644
--- a/compiler/driver/compiler_options.h
+++ b/compiler/driver/compiler_options.h
@@ -49,7 +49,6 @@ class DexFile;
enum class InstructionSet;
class InstructionSetFeatures;
class ProfileCompilationInfo;
-class VerificationResults;
// Enum for CheckProfileMethodsCompiled. Outside CompilerOptions so it can be forward-declared.
enum class ProfileMethodsCheck : uint8_t {
@@ -305,8 +304,6 @@ class CompilerOptions final {
// classes. `pretty_descriptor` should be the result of calling `PrettyDescriptor`.
bool IsPreloadedClass(const char* pretty_descriptor) const;
- const VerificationResults* GetVerificationResults() const;
-
bool ParseCompilerOptions(const std::vector<std::string>& options,
bool ignore_unrecognized,
std::string* error_msg);
@@ -423,9 +420,6 @@ class CompilerOptions final {
// boot image extension compilation.
HashSet<std::string> preloaded_classes_;
- // Results of AOT verification.
- const VerificationResults* verification_results_;
-
CompilerType compiler_type_;
ImageType image_type_;
bool multi_image_;
diff --git a/compiler/libart-compiler.map b/compiler/libart-compiler.map
index 7e7841f995..b2ddd9eede 100644
--- a/compiler/libart-compiler.map
+++ b/compiler/libart-compiler.map
@@ -25,7 +25,6 @@ ART_COMPILER {
art::CompilerOptions::*;
art::CreateTrampoline*;
art::IntrinsicObjects::*;
- art::VerificationResults::*;
art::debug::MakeMiniDebugInfo*;
art::linker::operator*art::linker::LinkerPatch::Type*;
art::operator*art::Whence*;