Skip to content

Commit

Permalink
Refactor ImageHeapScanner.
Browse files Browse the repository at this point in the history
  • Loading branch information
cstancu committed Jan 15, 2024
1 parent fcda673 commit 22cc05e
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -518,16 +518,16 @@ protected void onObjectReachable(ImageHeapConstant imageHeapConstant, ScanReason

AnalysisType type = imageHeapConstant.getType(metaAccess);
Object object = bb.getSnippetReflectionProvider().asObject(Object.class, imageHeapConstant);
try {
/* Simulated constants don't have a backing object and don't need to be processed. */
if (object != null) {
/* Simulated constants don't have a backing object and don't need to be processed. */
if (object != null) {
try {
type.notifyObjectReachable(universe.getConcurrentAnalysisAccess(), object);
} catch (UnsupportedFeatureException e) {
/* Enhance the unsupported feature message with the object trace and rethrow. */
StringBuilder backtrace = new StringBuilder();
ObjectScanner.buildObjectBacktrace(bb, reason, backtrace);
throw new UnsupportedFeatureException(e.getMessage() + System.lineSeparator() + backtrace);
}
} catch (UnsupportedFeatureException e) {
/* Enhance the unsupported feature message with the object trace and rethrow. */
StringBuilder backtrace = new StringBuilder();
ObjectScanner.buildObjectBacktrace(bb, reason, backtrace);
throw new UnsupportedFeatureException(e.getMessage() + System.lineSeparator() + backtrace);
}

markTypeInstantiated(objectType, reason);
Expand Down

0 comments on commit 22cc05e

Please sign in to comment.