Skip to content

Commit 9afa449

Browse files
committed
Skip methods not reachable in current layer from compilation.
1 parent 6cf285a commit 9afa449

File tree

1 file changed

+14
-1
lines changed
  • substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code

1 file changed

+14
-1
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code/CompileQueue.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ private static boolean parseInCurrentLayer(HostedMethod method) {
990990
SVMImageLayerLoader imageLayerLoader = HostedImageLayerBuildingSupport.singleton().getLoader();
991991
hasAnalyzedGraph = imageLayerLoader.hasStrengthenedGraph(method.wrapped);
992992
}
993-
assert hasAnalyzedGraph || method.isCompiledInPriorLayer() || method.compilationInfo.inParseQueue.get() : method;
993+
assert hasAnalyzedGraph || !method.wrapped.reachableInCurrentLayer() || method.isCompiledInPriorLayer() || method.compilationInfo.inParseQueue.get() : method;
994994
return hasAnalyzedGraph;
995995
}
996996

@@ -1205,6 +1205,19 @@ protected void ensureCompiled(HostedMethod method, CompileReason reason) {
12051205
*/
12061206
return;
12071207
}
1208+
if (ImageLayerBuildingSupport.buildingExtensionLayer() && !method.wrapped.reachableInCurrentLayer()) {
1209+
assert method.wrapped.isInBaseLayer();
1210+
/*
1211+
* This method was reached and analyzed in the base layer, but it was not compiled in
1212+
* that layer, e.g., because it was always inlined. It is referenced in the app layer,
1213+
* but it was not reached during this layer's analysis, so its base layer graph was not
1214+
* loaded. However, it is considered as a potential compilation target because it is the
1215+
* implementation of a method invoked in this layer. Since we don't have an analysis
1216+
* graph we cannot compile it, however it should not be called at run time since it was
1217+
* not reached during analysis. (GR-64200)
1218+
*/
1219+
return;
1220+
}
12081221

12091222
CompilationInfo compilationInfo = method.compilationInfo;
12101223
assert method.getMultiMethodKey() != SubstrateCompilationDirectives.RUNTIME_COMPILED_METHOD;

0 commit comments

Comments
 (0)