Search in sources :

Example 1 with GraalSupport

use of com.oracle.svm.graal.GraalSupport in project graal by oracle.

the class RuntimeStrengthenStampsPhase method duringSetup.

@Override
public void duringSetup(DuringSetupAccess c) {
    DuringSetupAccessImpl config = (DuringSetupAccessImpl) c;
    try {
        /*
             * Check early that the classpath is set up correctly. The base class of SubstrateType
             * is the NodeClass from Truffle. So we require Truffle on the class path for any images
             * and tests that use Graal at run time.
             */
        config.getMetaAccess().lookupJavaType(SubstrateType.class);
    } catch (NoClassDefFoundError ex) {
        throw VMError.shouldNotReachHere("Building a native image with Graal support requires Truffle on the class path. For unit tests run with 'svmtest', add the option '--truffle'.");
    }
    ImageSingletons.add(GraalSupport.class, new GraalSupport());
    objectReplacer = new GraalObjectReplacer(config.getUniverse(), config.getMetaAccess());
    config.registerObjectReplacer(objectReplacer);
}
Also used : GraalSupport(com.oracle.svm.graal.GraalSupport) DuringSetupAccessImpl(com.oracle.svm.hosted.FeatureImpl.DuringSetupAccessImpl)

Aggregations

GraalSupport (com.oracle.svm.graal.GraalSupport)1 DuringSetupAccessImpl (com.oracle.svm.hosted.FeatureImpl.DuringSetupAccessImpl)1