diff options
author | Sebastien Hertz <shertz@google.com> | 2013-07-24 16:14:19 +0200 |
---|---|---|
committer | Sebastien Hertz <shertz@google.com> | 2013-07-26 10:24:55 +0200 |
commit | 4d4adb1dae07bb7421e863732ab789413a3b43f0 (patch) | |
tree | a0c7861c64f193065264478af397929be473184c /runtime/runtime.cc | |
parent | 56eb9bc9da8d3863fef02891c2f4f2e4d996204d (diff) | |
download | art-4d4adb1dae07bb7421e863732ab789413a3b43f0.zip art-4d4adb1dae07bb7421e863732ab789413a3b43f0.tar.gz art-4d4adb1dae07bb7421e863732ab789413a3b43f0.tar.bz2 |
Prevent verifier from creating unused compilation data.
The verifier used to create data which may be unused like GC map. This is the
case for non-compiled method (which are interpreted). This CL aims to optimize
this.
Here are the changes:
- Move compilation selection to MethodVerifier::IsCandidateForCompilation.
- Compiler and verifier use this method to know if a method must be compiled.
- Only create compilation data while compiling using Runtime::IsCompiler.
- Do not create internal structures concerning GC map, ... in Runtime::Init and
Runtime::Shutdown when we are not compiling.
- Checks we are compiling when accessing these structures.
- Add missing destruction of MethodVerifier::safecast_map_lock_ and
MethodVerifier::safecast_map_ in Runtime::Shutdown.
- Call Runtime::Shutdown just before Runtime instance is destroyed to avoid a
crash.
- Add missing "GUARDED_BY" macro for MethodVerifier::rejected_classes_ field.
- Add "has_check_casts" to avoid the safecast pass if there is no check-cast
instruction.
- Add "has_virtual_or_interface_invokes" to avoid the devirtualization pass if
there is no invoke-virtual/range nor invoke-interface/range instructions.
Bug: 9987437
Change-Id: I418ee99f63e4203409cf5b7d2c2295b22fcf24c1
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r-- | runtime/runtime.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index cf6e537..48ee127 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -134,10 +134,10 @@ Runtime::~Runtime() { delete java_vm_; Thread::Shutdown(); QuasiAtomic::Shutdown(); + verifier::MethodVerifier::Shutdown(); // TODO: acquire a static mutex on Runtime to avoid racing. CHECK(instance_ == NULL || instance_ == this); instance_ = NULL; - verifier::MethodVerifier::Shutdown(); } struct AbortState { |