Skip to content

Commit 35a1b77

Browse files
David LeopoldsederTom Rodriguez
authored andcommitted
8322636: [JVMCI] HotSpotSpeculationLog can be inconsistent across a single compile
Reviewed-by: dnsimon, never
1 parent 46965a0 commit 35a1b77

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,14 @@ byte[] getFlattenedSpeculations(boolean validate) {
207207
return result;
208208
}
209209

210+
/**
211+
* @return {@code true} if the given speculation can be performed, i.e., it never failed so far, otherwise
212+
* return {@code false}. Note, that this method returns consistent results for any given speculation for the
213+
* entire lifetime of the enclosing SpeculationLog object. This means that speculations failed during a
214+
* compilation will not be updated.
215+
*/
210216
@Override
211217
public boolean maySpeculate(SpeculationReason reason) {
212-
if (failedSpeculations == null) {
213-
collectFailedSpeculations();
214-
}
215218
if (failedSpeculations != null && failedSpeculations.length != 0) {
216219
byte[] encoding = encode(reason);
217220
return !contains(failedSpeculations, 0, encoding);

0 commit comments

Comments
 (0)