Package com.oracle.truffle.api.profiles
Class InlinedLongValueProfile
java.lang.Object
com.oracle.truffle.api.profiles.InlinedProfile
com.oracle.truffle.api.profiles.InlinedLongValueProfile
Specialized value profile to capture certain properties of
long
runtime values.
Value profiles require a runtime check in their initialized state to verify their profiled
assumption. Value profiles are limited to capture monomorphic profiles only. This means that if
two or more values are profiled within a single profile then the profile has no effect. If the
value assumption is invalidated in compiled code then it is invalidated.
Usage example:
abstract class LongProfileNode extends Node { abstract long execute(long input); @Specialization long doDefault(byte input, @Cached InlinedLongValueProfile profile) { long profiledValue = profile.profile(this, input); // compiler may now see profiledValue as a partial evaluation constant return profiledValue; } }
- Since:
- 23.0
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final int
protected static final int
protected static final int
protected final InlineSupport.StateField
protected static final int
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
Disables this profile by setting it to its generic state.static InlinedLongValueProfile
Returns the uncached version of the profile.static InlinedLongValueProfile
inline
(InlineSupport.InlineTarget target) Returns an inlined version of the profile.long
final void
Resets this profile to its uninitialized state.Prints a string representation of this inlined profile given a target node.Methods inherited from class com.oracle.truffle.api.profiles.InlinedProfile
toString
-
Field Details
-
UNINITIALIZED
protected static final int UNINITIALIZED- See Also:
-
SPECIALIZED
protected static final int SPECIALIZED- See Also:
-
GENERIC
protected static final int GENERIC- See Also:
-
REQUIRED_STATE_BITS
protected static final int REQUIRED_STATE_BITS- See Also:
-
state
-
-
Method Details
-
profile
- Since:
- 23.0
-
toString
Prints a string representation of this inlined profile given a target node.- Specified by:
toString
in classInlinedProfile
- Since:
- 23.0
-
inline
Returns an inlined version of the profile. This version is automatically used by Truffle DSL node inlining.- Since:
- 23.0
-
getUncached
Returns the uncached version of the profile. The uncached version of a profile does not perform any profiling.- Since:
- 23.0
-
disable
Description copied from class:InlinedProfile
Disables this profile by setting it to its generic state. After disabling it is guaranteed to neverdeoptimize
on any invocation of a profile method.This method must not be called on compiled code paths. Note that disabling the profile will not invalidate existing compiled code that uses this profile.
- Specified by:
disable
in classInlinedProfile
-
reset
Description copied from class:InlinedProfile
Resets this profile to its uninitialized state. Has no effect if this profile is already in its uninitialized state or a disabled version of this profile is used.This method must not be called on compiled code paths. Note that disabling the profile will not invalidate existing compiled code that uses this profile.
- Specified by:
reset
in classInlinedProfile
-