• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Export Word
    • Attachments
    • Page Information

    Loading...
  1. Dashboard
  2. HotSpot
  3. Main
  4. Compiler
  5. PerformanceTechniques
  6. MethodData
  7. TypeProfile

TypeProfile

  • Created by John Rose, last modified on May 25, 2013

A type profile is information which summarizes the type of some value at some profile point in the program being executed by the JVM.  The summary is designed to allow the optimizing compiler to guess at future types at the same point in the program.  In many cases, these profiles are necessary for attaining best code quality.

A profile point is a specific instance of a bytecode.  Not all bytecodes perform profiling.

The type recorded at a profile point is the concrete class of an object operand to the bytecode.  (I.e., it is the _klass object header field, of type Klass*.)

There is also an indication if nulls have been seen at the profile point.

Here are the bytecodes with their profiled operands:

Profile Point BytecodeType Profiled Operand
invokevirtual, invokeinterfacereceiver
checkcast, instanceoftested object
aastoreelement value

Primitive values are not currently profiled, but see bug 8015418.  Non-receiver arguments and return values are not currently profiled, but see bug 6919064.

Type profile structure

For background on profiles, see MethodData.

Within a MethodData block, each original instance of a type-profiled bytecode instruction (invokevirtual, checkcast, etc.) gets a ReceiverTypeData record. Each record has a few rows (TypeProfileWidth, default 2), each of which contains a count and an exact object type. The record also has an overall count, which may differ from the sum of the individual counts.

Failure modes

Type profiles have two failure modes: First, a method might be compiled before its profile exists and is "mature", so that no stable conclusions can be drawn about operands in that method. Second, a method might be used from many different contexts with independent operand types (as with ArrayList.contains), so that the profile becomes "polluted" by many independent types. A polluted profile contains the first few (2) encountered types with low counts, and a high total count that signals that the ReceiverTypeData structure was too small.

Polluted profiles stem from the fact that a method (containing generically reusable code) has only one profile structure, but the method is reused from a variety of contexts, providing a variety of operand types.  Polluted profiles are discussed here.

 

Overview
Content Tools
ThemeBuilder
  • No labels

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.21
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 168, "requestCorrelationId": "11f85654d03307f7"}