Tabnine Logo
RuntimeConfiguration
Code IndexAdd Tabnine to your IDE (free)

How to use
RuntimeConfiguration
in
com.oracle.svm.core.graal.meta

Best Java code snippets using com.oracle.svm.core.graal.meta.RuntimeConfiguration (Showing top 20 results out of 315)

origin: com.oracle.substratevm/svm

@Override
public Backend getHostBackend() {
  return GraalSupport.getRuntimeConfig().getBackendForNormalMethod();
}
origin: com.oracle.substratevm/svm

protected Providers getProviders() {
  return runtimeConfig.getProviders();
}
origin: com.oracle.substratevm/svm

@SuppressWarnings("unchecked")
@Override
public <T> T getCapability(Class<T> clazz) {
  if (clazz == RuntimeProvider.class) {
    return (T) this;
  } else if (clazz == SnippetReflectionProvider.class) {
    return (T) GraalSupport.getRuntimeConfig().getSnippetReflection();
  } else if (clazz == StackIntrospection.class) {
    return (T) SubstrateStackIntrospection.SINGLETON;
  }
  return null;
}
origin: com.oracle.substratevm/svm

  @Override
  public Node canonical(CanonicalizerTool tool) {
    if (runtimeConfig.isFullyInitialized()) {
      final int vtableEntryOffset = runtimeConfig.getVTableOffset(NULLARY_CONSTRUCTOR_OFFSET);
      return ConstantNode.forIntegerKind(FrameAccess.getWordKind(), vtableEntryOffset);
    }
    return this;
  }
}
origin: com.oracle.substratevm/library-support

public CompileFunction createCustomCompileFunction() {
  return (debug, method, identifier, reason, config) -> {
    SubstrateBackend backend = config.getBackendForNormalMethod();
    VMError.guarantee(backend.getTarget().arch instanceof AMD64, "currently only implemented on AMD64");
    // Determine register for jmethodID argument
    HostedProviders providers = (HostedProviders) config.getProviders();
    List<JavaType> parameters = new ArrayList<>();
    parameters.add(providers.getMetaAccess().lookupJavaType(JNIEnvironment.class));
    parameters.add(providers.getMetaAccess().lookupJavaType(JNIObjectHandle.class));
    if (nonVirtual) {
      parameters.add(providers.getMetaAccess().lookupJavaType(JNIObjectHandle.class));
    }
    parameters.add(providers.getMetaAccess().lookupJavaType(JNIMethodId.class));
    ResolvedJavaType returnType = providers.getWordTypes().getWordImplType();
    CallingConvention callingConvention = backend.getCodeCache().getRegisterConfig().getCallingConvention(
            SubstrateCallingConventionType.NativeCall, returnType, parameters.toArray(new JavaType[0]), backend);
    RegisterValue methodIdArg = (RegisterValue) callingConvention.getArgument(parameters.size() - 1);
    return backend.createJNITrampolineMethod(method, identifier, methodIdArg, getFieldOffset(providers));
  };
}
origin: com.oracle.substratevm/svm

  dest = sConstantFieldProvider;
} else if (source instanceof ForeignCallsProvider) {
  dest = GraalSupport.getRuntimeConfig().getProviders().getForeignCalls();
} else if (source instanceof HostedSnippetReflectionProvider) {
  dest = GraalSupport.getRuntimeConfig().getSnippetReflection();
origin: com.oracle.substratevm/svm

OptionValues options = hosted ? HostedOptionValues.singleton() : RuntimeOptionValues.singleton();
Providers runtimeCallProviders = runtimeConfig != null ? runtimeConfig.getBackendForNormalMethod().getProviders() : providers;
SubstrateForeignCallsProvider foreignCallsProvider = (SubstrateForeignCallsProvider) providers.getForeignCalls();
for (SubstrateForeignCallDescriptor descriptor : SnippetRuntime.getRuntimeCalls()) {
  Iterable<DebugHandlersFactory> factories = runtimeConfig != null ? runtimeConfig.getDebugHandlersFactories() : Collections.singletonList(new GraalDebugHandlersFactory(snippetReflection));
  lowerer.setConfiguration(runtimeConfig, options, factories, providers, snippetReflection);
  NonSnippetLowerings.registerLowerings(runtimeConfig, mustNotAllocatePredicate, options, factories, providers, snippetReflection, lowerings);
origin: com.oracle.substratevm/svm

if (runtimeConfig != null && runtimeConfig.getProviders() instanceof HostedProviders) {
  ((HostedProviders) runtimeConfig.getProviders()).setGraphBuilderPlugins(plugins);
  for (SubstrateBackend backend : runtimeConfig.getBackends()) {
    ((HostedProviders) backend.getProviders()).setGraphBuilderPlugins(plugins);
origin: com.oracle.substratevm/svm

int vtableEntryOffset = runtimeConfig.getVTableOffset(method.getVTableIndex());
hub = graph.unique(new LoadHubNode(runtimeConfig.getProviders().getStampProvider(), graph.maybeAddOrUnique(PiNode.create(receiver, nullCheck))));
AddressNode address = graph.unique(new OffsetAddressNode(hub, ConstantNode.forIntegerKind(FrameAccess.getWordKind(), vtableEntryOffset, graph)));
ReadNode entry = graph.add(new ReadNode(address, NamedLocationIdentity.FINAL_LOCATION, FrameAccess.getWordStamp(), BarrierType.NONE));
origin: com.oracle.substratevm/svm

public static InstalledCode compileAndInstall(OptionValues options, RuntimeConfiguration runtimeConfig, Suites suites, LIRSuites lirSuites, SubstrateMethod method, boolean testTrampolineJumps) {
  updateGraalArchitectureWithHostCPUFeatures(runtimeConfig.lookupBackend(method));
  DebugContext debug = DebugContext.create(options, new GraalDebugHandlersFactory(GraalSupport.getRuntimeConfig().getSnippetReflection()));
  // create the installed code descriptor
  SubstrateInstalledCodeImpl installedCode = new SubstrateInstalledCodeImpl(method);
  // do compilation and code installation and update the installed code descriptor
  SubstrateGraalUtils.doCompileAndInstall(debug, runtimeConfig, suites, lirSuites, method, installedCode, testTrampolineJumps);
  // return the installed code
  return installedCode;
}
origin: com.oracle.substratevm/svm

public int getVTableOffset(int vTableIndex) {
  assert isFullyInitialized();
  return vtableBaseOffset + vTableIndex * vtableEntrySize;
}
origin: com.oracle.substratevm/svm

public DebugContext openDebugContext(OptionValues options, CompilationIdentifier compilationId, Object compilable, PrintStream logStream) {
  Description description = new Description(compilable, compilationId.toString(CompilationIdentifier.Verbosity.ID));
  return DebugContext.create(options, description, metricValues, logStream, runtimeConfig.getDebugHandlersFactories());
}
origin: com.oracle.substratevm/svm

@Override
protected ValueNode createReadArrayComponentHub(StructuredGraph graph, ValueNode arrayHub, FixedNode anchor) {
  ConstantNode componentHubOffset = ConstantNode.forIntegerKind(target.wordJavaKind, runtimeConfig.getComponentHubOffset(), graph);
  AddressNode componentHubAddress = graph.unique(new OffsetAddressNode(arrayHub, componentHubOffset));
  FloatingReadNode componentHubRef = graph.unique(new FloatingReadNode(componentHubAddress, NamedLocationIdentity.FINAL_LOCATION, null, hubStamp, null, BarrierType.NONE));
  return maybeUncompress(componentHubRef);
}
origin: com.oracle.substratevm/svm

public SharedRuntimeConfigurationBuilder build() {
  wordTypes = new WordTypes(metaAccess, FrameAccess.getWordKind());
  Providers p = createProviders(null, null, null, null, null, null, null, null);
  StampProvider stampProvider = createStampProvider(p);
  p = createProviders(null, null, null, null, null, null, stampProvider, null);
  ConstantReflectionProvider constantReflection = createConstantReflectionProvider(p);
  p = createProviders(null, constantReflection, null, null, null, null, stampProvider, null);
  ConstantFieldProvider constantFieldProvider = createConstantFieldProvider(p);
  SnippetReflectionProvider snippetReflection = createSnippetReflectionProvider();
  ForeignCallsProvider foreignCalls = createForeignCallsProvider();
  p = createProviders(null, constantReflection, constantFieldProvider, foreignCalls, null, null, stampProvider, snippetReflection);
  LoweringProvider lowerer = createLoweringProvider(p);
  p = createProviders(null, constantReflection, constantFieldProvider, foreignCalls, lowerer, null, stampProvider, snippetReflection);
  Replacements replacements = createReplacements(p, snippetReflection);
  p = createProviders(null, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider, snippetReflection);
  EnumMap<ConfigKind, SubstrateBackend> backends = new EnumMap<>(ConfigKind.class);
  for (ConfigKind config : ConfigKind.values()) {
    RegisterConfig registerConfig = ImageSingletons.lookup(SubstrateRegisterConfigFactory.class).newRegisterFactory(config, metaAccess, ConfigurationValues.getTarget(),
            SubstrateOptions.UseStackBasePointer.getValue());
    CodeCacheProvider codeCacheProvider = createCodeCacheProvider(registerConfig);
    Providers newProviders = createProviders(codeCacheProvider, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider,
            snippetReflection);
    backends.put(config, GraalConfiguration.instance().createBackend(newProviders));
  }
  runtimeConfig = new RuntimeConfiguration(p, snippetReflection, backends, wordTypes);
  return this;
}
origin: com.oracle.substratevm/svm

args.add("trueValue", replacer.trueValue);
args.add("falseValue", replacer.falseValue);
args.add("bitsOffset", runtimeConfig.getInstanceOfBitOffset(fromTypeID));
args.add("bitMask", 1 << (fromTypeID % 8));
return args;
origin: com.oracle.substratevm/svm

RuntimeConfiguration runtimeConfig = runtimeConfigBuilder.getRuntimeConfig();
Providers runtimeProviders = runtimeConfig.getProviders();
WordTypes wordTypes = runtimeConfigBuilder.getWordTypes();
hostedProviders = new HostedProviders(runtimeProviders.getMetaAccess(), runtimeProviders.getCodeCache(), runtimeProviders.getConstantReflection(), runtimeProviders.getConstantFieldProvider(),
        runtimeProviders.getForeignCalls(), runtimeProviders.getLowerer(), runtimeProviders.getReplacements(), runtimeProviders.getStampProvider(),
        runtimeConfig.getSnippetReflection(), wordTypes);
        config.getImageClassLoader(), false, false);
DebugContext debug = DebugContext.forCurrentThread();
NativeImageGenerator.registerReplacements(debug, featureHandler, runtimeConfig, runtimeConfig.getProviders(), runtimeConfig.getSnippetReflection(), false);
featureHandler.forEachGraalFeature(feature -> feature.registerCodeObserver(runtimeConfig));
Suites suites = NativeImageGenerator.createSuites(featureHandler, runtimeConfig, runtimeConfig.getSnippetReflection(), false);
LIRSuites lirSuites = NativeImageGenerator.createLIRSuites(featureHandler, runtimeConfig.getProviders(), false);
Suites firstTierSuites = NativeImageGenerator.createFirstTierSuites(featureHandler, runtimeConfig, runtimeConfig.getSnippetReflection(), false);
LIRSuites firstTierLirSuites = NativeImageGenerator.createFirstTierLIRSuites(featureHandler, runtimeConfig.getProviders(), false);
GraalSupport.setRuntimeConfig(runtimeConfig, suites, lirSuites, firstTierSuites, firstTierLirSuites);
origin: com.oracle.substratevm/svm

public int getComponentHubOffset() {
  assert isFullyInitialized();
  return componentHubOffset;
}
origin: com.oracle.substratevm/svm

protected void callForReplacements(DebugContext debug, FeatureHandler featureHandler, @SuppressWarnings("hiding") RuntimeConfiguration runtimeConfig, SnippetReflectionProvider snippetReflection) {
  NativeImageGenerator.registerReplacements(debug, featureHandler, runtimeConfig, runtimeConfig.getProviders(), snippetReflection, true);
}
origin: com.oracle.substratevm/svm

  @Override
  public <T extends Architecture> Backend getBackend(Class<T> arch) {
    assert arch.isInstance(GraalSupport.getRuntimeConfig().getBackendForNormalMethod().getTarget().arch);
    return GraalSupport.getRuntimeConfig().getBackendForNormalMethod();
  }
}
origin: com.oracle.substratevm/svm

public int getInstanceOfBitOffset(int bitIndex) {
  assert isFullyInitialized();
  return instanceOfBitsOffset + bitIndex / 8;
}
com.oracle.svm.core.graal.metaRuntimeConfiguration

Javadoc

Configuration used by Graal at runtime to compile and install code in the same runtime.

Most used methods

  • getBackendForNormalMethod
  • getProviders
  • <init>
  • getBackends
  • getComponentHubOffset
  • getDebugHandlersFactories
  • getInstanceOfBitOffset
  • getSnippetReflection
  • getVTableOffset
  • isFullyInitialized
  • lookupBackend
  • setLazyState
  • lookupBackend,
  • setLazyState

Popular in Java

  • Reactive rest calls using spring rest template
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getExternalFilesDir (Context)
  • requestLocationUpdates (LocationManager)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now