Class InlinedIntValueProfile
java.lang.Object
com.oracle.truffle.api.profiles.InlinedProfile
com.oracle.truffle.api.profiles.InlinedIntValueProfile
Specialized value profile to capture certain properties of
int 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 IntProfileNode extends Node {
abstract int execute(int input);
@Specialization
int doDefault(int input, @Cached InlinedIntValueProfile profile) {
int profiledValue = profile.profile(this, input);
// compiler may now see profiledValue as a partial evaluation constant
return profiledValue;
}
}
- Since:
- 23.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final intprotected final InlineSupport.StateFieldprotected static final int -
Method Summary
Modifier and TypeMethodDescriptionfinal voidDisables this profile by setting it to its generic state.static InlinedIntValueProfileReturns the uncached version of the profile.static InlinedIntValueProfileinline(InlineSupport.InlineTarget target) Returns an inlined version of the profile.intfinal voidResets 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:
toStringin 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:InlinedProfileDisables this profile by setting it to its generic state. After disabling it is guaranteed to neverdeoptimizeon 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:
disablein classInlinedProfile
-
reset
Description copied from class:InlinedProfileResets 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:
resetin classInlinedProfile
-