summaryrefslogtreecommitdiffstats
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-04-24 16:48:11 -0700
committerMathieu Chartier <mathieuc@google.com>2014-05-01 17:46:45 -0700
commit8668c3cbdcf9471bd97e0da68a240051f2973074 (patch)
tree3ee580f1d0bf7af89b4c21f73526b01a92ddc28d /compiler/driver/compiler_driver.cc
parent9a16f222cdf40e68b084316b6e768c14d4b9e020 (diff)
downloadart-8668c3cbdcf9471bd97e0da68a240051f2973074.zip
art-8668c3cbdcf9471bd97e0da68a240051f2973074.tar.gz
art-8668c3cbdcf9471bd97e0da68a240051f2973074.tar.bz2
Add finalizer references from the entrypoints.
We now have an invariant where we never allocate finalizable objects with the Initialized or Resolved entrypoints. This speeds up allocation by only doing the check in the slow path. Before: MemAllocTest: 3625, 3707, 3641 EvaluateAndApplyChanges: 3448, 3421, 3413 After: MemAllocTest: 3164, 3109, 3135 EvaluateAndApplyChanges: 3272, 3299, 3353 Bug: 14078487 Change-Id: I2b0534af3e7c75ea5e5257cf3647744f7abfb74e
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 0ad30be..bde0fae 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -905,13 +905,14 @@ bool CompilerDriver::CanAccessInstantiableTypeWithoutChecks(uint32_t referrer_id
bool CompilerDriver::CanEmbedTypeInCode(const DexFile& dex_file, uint32_t type_idx,
bool* is_type_initialized, bool* use_direct_type_ptr,
- uintptr_t* direct_type_ptr) {
+ uintptr_t* direct_type_ptr, bool* out_is_finalizable) {
ScopedObjectAccess soa(Thread::Current());
mirror::DexCache* dex_cache = Runtime::Current()->GetClassLinker()->FindDexCache(dex_file);
mirror::Class* resolved_class = dex_cache->GetResolvedType(type_idx);
if (resolved_class == nullptr) {
return false;
}
+ *out_is_finalizable = resolved_class->IsFinalizable();
const bool compiling_boot = Runtime::Current()->GetHeap()->IsCompilingBoot();
if (compiling_boot) {
// boot -> boot class pointers.