Search in sources :

Example 6 with ClassfileBytecodeProvider

use of org.graalvm.compiler.replacements.classfile.ClassfileBytecodeProvider in project graal by oracle.

the class ReplacementsTest method getSystemClassLoaderBytecodeProvider.

/**
 * Gets a {@link ClassfileBytecodeProvider} that enables snippets and intrinsics to be loaded
 * from the system class path (instead of from the JVMCI class path or Graal module).
 */
protected final ClassfileBytecodeProvider getSystemClassLoaderBytecodeProvider() {
    ReplacementsImpl d = (ReplacementsImpl) getReplacements();
    MetaAccessProvider metaAccess = d.providers.getMetaAccess();
    ClassfileBytecodeProvider bytecodeProvider = new ClassfileBytecodeProvider(metaAccess, d.snippetReflection, ClassLoader.getSystemClassLoader());
    return bytecodeProvider;
}
Also used : ClassfileBytecodeProvider(org.graalvm.compiler.replacements.classfile.ClassfileBytecodeProvider) ReplacementsImpl(org.graalvm.compiler.replacements.ReplacementsImpl) MetaAccessProvider(jdk.vm.ci.meta.MetaAccessProvider)

Example 7 with ClassfileBytecodeProvider

use of org.graalvm.compiler.replacements.classfile.ClassfileBytecodeProvider in project graal by oracle.

the class ClassfileBytecodeProviderTest method checkClass.

protected void checkClass(MetaAccessProvider metaAccess, SnippetReflectionProvider snippetReflection, String className) throws ClassNotFoundException {
    Class<?> c = Class.forName(className, true, getClass().getClassLoader());
    ClassfileBytecodeProvider cbp = new ClassfileBytecodeProvider(metaAccess, snippetReflection);
    for (Method method : c.getDeclaredMethods()) {
        checkMethod(cbp, metaAccess, method);
    }
}
Also used : ClassfileBytecodeProvider(org.graalvm.compiler.replacements.classfile.ClassfileBytecodeProvider) Method(java.lang.reflect.Method) ProfiledMethod(jdk.vm.ci.meta.JavaMethodProfile.ProfiledMethod) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod)

Aggregations

ClassfileBytecodeProvider (org.graalvm.compiler.replacements.classfile.ClassfileBytecodeProvider)7 TargetDescription (jdk.vm.ci.code.TargetDescription)3 HotSpotCodeCacheProvider (jdk.vm.ci.hotspot.HotSpotCodeCacheProvider)3 HotSpotConstantReflectionProvider (jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider)3 HotSpotMetaAccessProvider (jdk.vm.ci.hotspot.HotSpotMetaAccessProvider)3 Value (jdk.vm.ci.meta.Value)3 JVMCIBackend (jdk.vm.ci.runtime.JVMCIBackend)3 BytecodeProvider (org.graalvm.compiler.bytecode.BytecodeProvider)3 GraalHotSpotVMConfig (org.graalvm.compiler.hotspot.GraalHotSpotVMConfig)3 HotSpotReplacementsImpl (org.graalvm.compiler.hotspot.HotSpotReplacementsImpl)3 HotSpotGraalConstantFieldProvider (org.graalvm.compiler.hotspot.meta.HotSpotGraalConstantFieldProvider)3 HotSpotGraphBuilderPlugins (org.graalvm.compiler.hotspot.meta.HotSpotGraphBuilderPlugins)3 HotSpotLoweringProvider (org.graalvm.compiler.hotspot.meta.HotSpotLoweringProvider)3 HotSpotProviders (org.graalvm.compiler.hotspot.meta.HotSpotProviders)3 HotSpotRegistersProvider (org.graalvm.compiler.hotspot.meta.HotSpotRegistersProvider)3 HotSpotSnippetReflectionProvider (org.graalvm.compiler.hotspot.meta.HotSpotSnippetReflectionProvider)3 HotSpotStampProvider (org.graalvm.compiler.hotspot.meta.HotSpotStampProvider)3 HotSpotSuitesProvider (org.graalvm.compiler.hotspot.meta.HotSpotSuitesProvider)3 HotSpotWordTypes (org.graalvm.compiler.hotspot.word.HotSpotWordTypes)3 Plugins (org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins)3