// Structure to store the classes seen at runtime for a specific instruction. // Once the classes_ array is full, we consider the INVOKE to be megamorphic. class InlineCache { public: // This is hard coded in the assembly stub art_quick_update_inline_cache. static constexpr uint8_t kIndividualCacheSize = 5;
// Encode the list of `dex_pcs` to fit into an uint32_t. static uint32_t EncodeDexPc(ArtMethod* method, const std::vector<uint32_t>& dex_pcs,
uint32_t inline_max_code_units)
REQUIRES_SHARED(Locks::mutator_lock_);
// Return the maximum inlining depth that we support to encode a list of dex // pcs. static uint32_t MaxDexPcEncodingDepth(ArtMethod* method,
uint32_t inline_max_code_units)
REQUIRES_SHARED(Locks::mutator_lock_);
/** *Profilinginfoforamethod,createdandfilledbytheinterpreteroncethe *methodiswarm,andusedbythecompilertodriveoptimizations.
*/ class ProfilingInfo { public: // Create a ProfilingInfo for 'method'.
EXPORT static ProfilingInfo* Create(Thread* self,
ArtMethod* method, const std::vector<uint32_t>& inline_cache_entries)
REQUIRES_SHARED(Locks::mutator_lock_);
// Add information from an executed INVOKE instruction to the profile. void AddInvokeInfo(uint32_t dex_pc, mirror::Class* cls) // Method should not be interruptible, as it manipulates the ProfilingInfo // which can be concurrently collected.
REQUIRES(Roles::uninterruptible_)
REQUIRES_SHARED(Locks::mutator_lock_);
// Increments the number of times this method is currently being inlined. // Returns whether it was successful, that is it could increment without // overflowing. bool IncrementInlineUse() { if (current_inline_uses_ == std::numeric_limits<uint16_t>::max()) { returnfalse;
}
current_inline_uses_++; returntrue;
}
// Hotness count for methods compiled with the JIT baseline compiler. Once // a threshold is hit (currentily the maximum value of uint16_t), we will // JIT compile optimized the method.
uint16_t baseline_hotness_count_;
// Method this profiling info is for. // Not 'const' as JVMTI introduces obsolete methods that we implement by creating new ArtMethods. // See JitCodeCache::MoveObsoleteMethod.
ArtMethod* method_;
// Number of invokes we are profiling in the ArtMethod. const uint32_t number_of_inline_caches_;
// Number of branches we are profiling in the ArtMethod. const uint32_t number_of_branch_caches_;
// When the compiler inlines the method associated to this ProfilingInfo, // it updates this counter so that the GC does not try to clear the inline caches.
uint16_t current_inline_uses_;
// Memory following the object: // - Dynamically allocated array of `InlineCache` of size `number_of_inline_caches_`. // - Dynamically allocated array of `BranchCache of size `number_of_branch_caches_`. friendclass jit::JitCodeCache;
DISALLOW_COPY_AND_ASSIGN(ProfilingInfo);
};
class ScopedProfilingInfoUse : public ValueObject { public:
ScopedProfilingInfoUse(jit::Jit* jit, ArtMethod* method, Thread* self);
~ScopedProfilingInfoUse();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.