Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -772,29 +772,25 @@ Phase moveToPhase (final Phase phase, final CompilationInfoImpl currentInfo, Lis
compiler.todo.offer(env);
}
}
currentPhase = Phase.RESOLVED;
if (!lowMemoryCancel.get()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completed without an exception/error, but still low memory cancel ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, old(er) versions of javac will not propagate the exceptions from the parse and analyze methods. See:
openjdk/jdk@4333942

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jlahoda Thanks for expanation - I don't have such a wide context, so now I better understand the core piece of this PR :)

currentPhase = Phase.RESOLVED;
}
long end = System.currentTimeMillis ();
logTime(currentInfo.getFileObject(),currentPhase,(end-start));
}
if (currentPhase == Phase.RESOLVED && phase.compareTo(Phase.UP_TO_DATE)>=0) {
currentPhase = Phase.UP_TO_DATE;
}
} catch (CancelAbort ca) {
if (lowMemoryCancel.get()) {
currentInfo.markIncomplete();
HUGE_SNAPSHOTS.add(new WeakReference<>(snapshots));
} else {
if (!lowMemoryCancel.get()) {
//real cancel
currentPhase = Phase.MODIFIED;
invalidate(false);
}
} catch (Abort abort) {
parserError = currentPhase;
} catch (RuntimeException | Error ex) {
if (lowMemoryCancel.get()) {
currentInfo.markIncomplete();
HUGE_SNAPSHOTS.add(new WeakReference<>(snapshots));
} else {
if (!lowMemoryCancel.get()) {
if (cancellable && parserCanceled.get()) {
currentPhase = Phase.MODIFIED;
invalidate(false);
Expand All @@ -805,6 +801,10 @@ Phase moveToPhase (final Phase phase, final CompilationInfoImpl currentInfo, Lis
}
}
} finally {
if (lowMemoryCancel.get()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, centralized low-memory conditions for all types of failures, not just Runtime + CancelAbort.

currentInfo.markIncomplete();
HUGE_SNAPSHOTS.add(new WeakReference<>(snapshots));
}
currentInfo.setPhase(currentPhase);
currentInfo.parserCrashed = parserError;
}
Expand Down