|
67 | 67 | import com.oracle.graal.pointsto.meta.ObjectReachableCallback;
|
68 | 68 | import com.oracle.svm.common.meta.MultiMethod;
|
69 | 69 | import com.oracle.svm.core.LinkerInvocation;
|
70 |
| -import com.oracle.svm.core.SubstrateOptions; |
71 | 70 | import com.oracle.svm.core.annotate.Delete;
|
72 | 71 | import com.oracle.svm.core.feature.InternalFeature;
|
73 | 72 | import com.oracle.svm.core.graal.code.SubstrateBackend;
|
|
76 | 75 | import com.oracle.svm.core.meta.SharedField;
|
77 | 76 | import com.oracle.svm.core.meta.SharedMethod;
|
78 | 77 | import com.oracle.svm.core.meta.SharedType;
|
79 |
| -import com.oracle.svm.core.option.SubstrateOptionsParser; |
80 | 78 | import com.oracle.svm.core.util.UserError;
|
81 | 79 | import com.oracle.svm.core.util.VMError;
|
82 | 80 | import com.oracle.svm.hosted.ameta.FieldValueInterceptionSupport;
|
@@ -360,16 +358,14 @@ public SVMHost getHostVM() {
|
360 | 358 | public static class BeforeAnalysisAccessImpl extends AnalysisAccessBase implements Feature.BeforeAnalysisAccess {
|
361 | 359 |
|
362 | 360 | private final NativeLibraries nativeLibraries;
|
363 |
| - private final boolean concurrentReachabilityHandlers; |
364 | 361 | private final ReachabilityHandler reachabilityHandler;
|
365 |
| - private ClassForNameSupport classForNameSupport; |
| 362 | + private final ClassForNameSupport classForNameSupport; |
366 | 363 |
|
367 | 364 | public BeforeAnalysisAccessImpl(FeatureHandler featureHandler, ImageClassLoader imageClassLoader, Inflation bb, NativeLibraries nativeLibraries,
|
368 | 365 | DebugContext debugContext) {
|
369 | 366 | super(featureHandler, imageClassLoader, bb, debugContext);
|
370 | 367 | this.nativeLibraries = nativeLibraries;
|
371 |
| - this.concurrentReachabilityHandlers = SubstrateOptions.RunReachabilityHandlersConcurrently.getValue(bb.getOptions()); |
372 |
| - this.reachabilityHandler = concurrentReachabilityHandlers ? ConcurrentReachabilityHandler.singleton() : ReachabilityHandlerFeature.singleton(); |
| 368 | + this.reachabilityHandler = new ConcurrentReachabilityHandler(); |
373 | 369 | this.classForNameSupport = ClassForNameSupport.currentLayer();
|
374 | 370 | }
|
375 | 371 |
|
@@ -491,10 +487,6 @@ public void registerClassInitializerReachabilityHandler(Consumer<DuringAnalysisA
|
491 | 487 | reachabilityHandler.registerClassInitializerReachabilityHandler(this, callback, clazz);
|
492 | 488 | }
|
493 | 489 |
|
494 |
| - public boolean concurrentReachabilityHandlers() { |
495 |
| - return concurrentReachabilityHandlers; |
496 |
| - } |
497 |
| - |
498 | 490 | @Override
|
499 | 491 | public void registerFieldValueTransformer(Field field, FieldValueTransformer transformer) {
|
500 | 492 | FieldValueInterceptionSupport.singleton().registerFieldValueTransformer(field, transformer);
|
@@ -534,20 +526,21 @@ public boolean getAndResetRequireAnalysisIteration() {
|
534 | 526 |
|
535 | 527 | public static class ConcurrentAnalysisAccessImpl extends DuringAnalysisAccessImpl {
|
536 | 528 |
|
537 |
| - private static final String concurrentReachabilityOption = SubstrateOptionsParser.commandArgument(SubstrateOptions.RunReachabilityHandlersConcurrently, "-"); |
538 |
| - |
539 | 529 | public ConcurrentAnalysisAccessImpl(FeatureHandler featureHandler, ImageClassLoader imageClassLoader, Inflation bb, NativeLibraries nativeLibraries, DebugContext debugContext) {
|
540 | 530 | super(featureHandler, imageClassLoader, bb, nativeLibraries, debugContext);
|
541 | 531 | }
|
542 | 532 |
|
543 | 533 | @Override
|
544 | 534 | public void requireAnalysisIteration() {
|
545 | 535 | if (bb.executorIsStarted()) {
|
546 |
| - String msg = "Calling DuringAnalysisAccessImpl.requireAnalysisIteration() is not necessary when running the reachability handlers concurrently during analysis. " + |
547 |
| - "To fallback to running the reachability handlers sequentially, i.e., from Feature.duringAnalysis(), you can add the " + concurrentReachabilityOption + |
548 |
| - " option to the native-image command. Note that the fallback option is deprecated and it will be removed in a future release."; |
549 |
| - throw VMError.shouldNotReachHere(msg); |
| 536 | + throw VMError.shouldNotReachHere("Calling DuringAnalysisAccessImpl.requireAnalysisIteration() is not necessary when running the reachability handlers concurrently during analysis."); |
550 | 537 | }
|
| 538 | + /* |
| 539 | + * While it may seem wrong that the concurrent analysis accessor can request an |
| 540 | + * additional analysis iteration this is necessary because the concurrent reachability |
| 541 | + * callbacks can be forced to run synchronously in the single-threaded "during analysis" |
| 542 | + * phase when elements are marked as reachable from Feature.duringAnalysis hooks. |
| 543 | + */ |
551 | 544 | super.requireAnalysisIteration();
|
552 | 545 | }
|
553 | 546 |
|
|
0 commit comments