From 9820b7c1dc70e75ad405b9e6e63578fa9fe94e94 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 2 Jan 2014 16:40:37 +0000 Subject: Early inlining of simple methods. Inlining "special" methods: empty methods, methods returning constants or their arguments, simple getters and setters. Bug: 8164439 Change-Id: I8c7fa9c14351fbb2470000b378a22974daaef236 --- compiler/driver/compiler_driver-inl.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'compiler/driver/compiler_driver-inl.h') diff --git a/compiler/driver/compiler_driver-inl.h b/compiler/driver/compiler_driver-inl.h index 664f809..d9f2a3a 100644 --- a/compiler/driver/compiler_driver-inl.h +++ b/compiler/driver/compiler_driver-inl.h @@ -289,6 +289,16 @@ inline int CompilerDriver::IsFastInvoke( return stats_flags; } +inline bool CompilerDriver::NeedsClassInitialization(mirror::Class* referrer_class, + mirror::ArtMethod* resolved_method) { + if (!resolved_method->IsStatic()) { + return false; + } + mirror::Class* methods_class = resolved_method->GetDeclaringClass(); + // NOTE: Unlike in IsFastStaticField(), we don't check CanAssumeTypeIsPresentInDexCache() here. + return methods_class != referrer_class && !methods_class->IsInitialized(); +} + } // namespace art #endif // ART_COMPILER_DRIVER_COMPILER_DRIVER_INL_H_ -- cgit v1.1