Skip to content

Commit bccab95

Browse files
committed
[GR-44400] Introduce ADOPTED as the new ProfileSource.
PullRequest: graal/13942
2 parents 5bf9391 + cc27dab commit bccab95

File tree

1 file changed

+24
-2
lines changed
  • compiler/src/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes

1 file changed

+24
-2
lines changed

compiler/src/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ProfileData.java

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,16 @@ public enum ProfileSource {
5757
*/
5858
INJECTED,
5959
/**
60-
* The profiling information comes from mature profiling information.
60+
* The profiling information comes from a profiling execution of the current program.
6161
*/
6262
PROFILED,
63+
/**
64+
* The profiling information was collected from a profiling execution of a different
65+
* program. For example, profiles of JDK methods collected from all benchmark runs and
66+
* aggregated. These profiles are then applied to JDK methods without a {@link #PROFILED}
67+
* profile.
68+
*/
69+
ADOPTED,
6370
/**
6471
* The profiling information comes from immature profiling information or some unknown
6572
* source.
@@ -84,9 +91,20 @@ public ProfileSource combine(ProfileSource other) {
8491
}
8592

8693
public static boolean isTrusted(ProfileSource source) {
87-
return source == INJECTED || source == PROFILED;
94+
return source == INJECTED || source == PROFILED || source == ADOPTED;
8895
}
8996

97+
public boolean isProfiled() {
98+
return this == PROFILED;
99+
}
100+
101+
public boolean isAdopted() {
102+
return this == ADOPTED;
103+
}
104+
105+
public boolean isUnknown() {
106+
return this == UNKNOWN;
107+
}
90108
}
91109

92110
public ProfileSource getProfileSource() {
@@ -154,6 +172,10 @@ public static BranchProbabilityData profiled(double probability) {
154172
return BranchProbabilityData.create(probability, ProfileSource.PROFILED);
155173
}
156174

175+
public static BranchProbabilityData adopted(double probability) {
176+
return BranchProbabilityData.create(probability, ProfileSource.ADOPTED);
177+
}
178+
157179
/**
158180
* Returns a singleton branch profile object with an unknown source and designated successor
159181
* probability 0.5.

0 commit comments

Comments
 (0)