本文整理汇总了Java中jdk.vm.ci.hotspot.HotSpotCodeCacheProvider类的典型用法代码示例。如果您正苦于以下问题:Java HotSpotCodeCacheProvider类的具体用法?Java HotSpotCodeCacheProvider怎么用?Java HotSpotCodeCacheProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HotSpotCodeCacheProvider类属于jdk.vm.ci.hotspot包,在下文中一共展示了HotSpotCodeCacheProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
public static void main(String[] args) throws Throwable {
HotSpotJVMCIRuntime jvmciRuntime = HotSpotJVMCIRuntime.runtime();
HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) jvmciRuntime.getCompiler();
HotSpotGraalRuntimeProvider graalRuntime = compiler.getGraalRuntime();
HotSpotCodeCacheProvider codeCache = graalRuntime.getHostProviders().getCodeCache();
OptionValues options = loadOptions(graalRuntime.getOptions());
int iterations = Options.Iterations.getValue(options);
for (int i = 0; i < iterations; i++) {
codeCache.resetCompilationStatistics();
TTY.println("CompileTheWorld : iteration " + i);
CompileTheWorld ctw = new CompileTheWorld(jvmciRuntime, compiler, options);
ctw.compile();
}
// This is required as non-daemon threads can be started by class initializers
System.exit(0);
}
示例2: compileMethod
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
private CompilationResult compileMethod(ResolvedJavaMethod javaMethod, CompilationIdentifier compilationId) {
HotSpotProviders providers = getHotSpotProviders();
SuitesProvider suitesProvider = providers.getSuites();
OptionValues options = getOptions();
Suites suites = suitesProvider.getDefaultSuites(options).copy();
LIRSuites lirSuites = suitesProvider.getDefaultLIRSuites(options);
removeInliningPhase(suites);
StructuredGraph graph = new StructuredGraph.Builder(options, AllowAssumptions.NO).method(javaMethod).compilationId(compilationId).build();
MetaAccessProvider metaAccess = providers.getMetaAccess();
Plugins plugins = new Plugins(new InvocationPlugins());
HotSpotCodeCacheProvider codeCache = providers.getCodeCache();
boolean infoPoints = codeCache.shouldDebugNonSafepoints();
GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true).withNodeSourcePosition(infoPoints);
new GraphBuilderPhase.Instance(metaAccess, providers.getStampProvider(), providers.getConstantReflection(), providers.getConstantFieldProvider(), config, OptimisticOptimizations.ALL,
null).apply(graph);
PhaseSuite<HighTierContext> graphBuilderSuite = getGraphBuilderSuite(codeCache, suitesProvider);
Backend backend = getHotSpotBackend();
CompilationResultBuilderFactory factory = getOptimizedCallTargetInstrumentationFactory(backend.getTarget().arch.getName());
return compileGraph(graph, javaMethod, providers, backend, graphBuilderSuite, OptimisticOptimizations.ALL, graph.getProfilingInfo(), suites, lirSuites, new CompilationResult(), factory);
}
示例3: installNativeFunctionStub
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
/**
* Creates and installs a stub for calling a native function.
*/
@SuppressWarnings("try")
void installNativeFunctionStub(HotSpotNativeFunctionHandle function) {
Plugins plugins = new Plugins(providers.getGraphBuilderPlugins());
plugins.prependParameterPlugin(new ConstantBindingParameterPlugin(new Object[]{function, null}, providers.getMetaAccess(), providers.getSnippetReflection()));
PhaseSuite<HighTierContext> graphBuilder = new PhaseSuite<>();
graphBuilder.appendPhase(new GraphBuilderPhase(GraphBuilderConfiguration.getDefault(plugins)));
Suites suites = providers.getSuites().getDefaultSuites(options);
LIRSuites lirSuites = providers.getSuites().getDefaultLIRSuites(options);
StructuredGraph g = new StructuredGraph.Builder(options).method(callStubMethod).compilationId(backend.getCompilationIdentifier(callStubMethod)).build();
CompilationResult compResult = GraalCompiler.compileGraph(g, callStubMethod, providers, backend, graphBuilder, OptimisticOptimizations.ALL, DefaultProfilingInfo.get(TriState.UNKNOWN), suites,
lirSuites, new CompilationResult(), CompilationResultBuilderFactory.Default);
HotSpotCodeCacheProvider codeCache = providers.getCodeCache();
try (Scope s = Debug.scope("CodeInstall", codeCache, g.method(), compResult)) {
HotSpotCompiledCode compiledCode = HotSpotCompiledCodeBuilder.createCompiledCode(codeCache, g.method(), null, compResult);
function.code = codeCache.addCode(g.method(), compiledCode, null, null);
} catch (Throwable e) {
throw Debug.handle(e);
}
}
示例4: main
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
public static void main(String[] args) throws Throwable {
Services.exportJVMCITo(CompileTheWorld.class);
HotSpotJVMCIRuntime jvmciRuntime = HotSpotJVMCIRuntime.runtime();
HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) jvmciRuntime.getCompiler();
HotSpotGraalRuntimeProvider graalRuntime = compiler.getGraalRuntime();
HotSpotCodeCacheProvider codeCache = graalRuntime.getHostProviders().getCodeCache();
OptionValues options = loadOptions(graalRuntime.getOptions());
int iterations = Options.Iterations.getValue(options);
for (int i = 0; i < iterations; i++) {
codeCache.resetCompilationStatistics();
TTY.println("CompileTheWorld : iteration " + i);
CompileTheWorld ctw = new CompileTheWorld(jvmciRuntime, compiler, options);
ctw.compile();
}
// This is required as non-daemon threads can be started by class initializers
System.exit(0);
}
示例5: HotSpotProviders
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
public HotSpotProviders(MetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection, ConstantFieldProvider constantField,
HotSpotForeignCallsProvider foreignCalls, LoweringProvider lowerer, Replacements replacements, SuitesProvider suites,
HotSpotRegistersProvider registers,
SnippetReflectionProvider snippetReflection, HotSpotWordTypes wordTypes, Plugins graphBuilderPlugins) {
super(metaAccess, codeCache, constantReflection, constantField, foreignCalls, lowerer, replacements, new HotSpotStampProvider());
this.suites = suites;
this.registers = registers;
this.snippetReflection = snippetReflection;
this.wordTypes = wordTypes;
this.graphBuilderPlugins = graphBuilderPlugins;
}
示例6: notifyInstall
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
@Override
public void notifyInstall(HotSpotCodeCacheProvider codeCache, InstalledCode installedCode, CompiledCode compiledCode) {
DebugContext debug = DebugContext.forCurrentThread();
if (debug.isDumpEnabled(DebugContext.BASIC_LEVEL)) {
CompilationResult compResult = debug.contextLookup(CompilationResult.class);
assert compResult != null : "can't dump installed code properly without CompilationResult";
debug.dump(DebugContext.BASIC_LEVEL, installedCode, "After code installation");
}
if (debug.isLogEnabled()) {
debug.log("%s", codeCache.disassemble(installedCode));
}
for (HotSpotCodeCacheListener listener : listeners) {
listener.notifyInstall(codeCache, installedCode, compiledCode);
}
}
示例7: notifyInstall
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
@Override
public void notifyInstall(HotSpotCodeCacheProvider codeCache, InstalledCode installedCode, CompiledCode compiledCode) {
if (Debug.isDumpEnabled(Debug.BASIC_LEVEL)) {
CompilationResult compResult = Debug.contextLookup(CompilationResult.class);
assert compResult != null : "can't dump installed code properly without CompilationResult";
Debug.dump(Debug.BASIC_LEVEL, installedCode, "After code installation");
}
if (Debug.isLogEnabled()) {
Debug.log("%s", codeCache.disassemble(installedCode));
}
}
示例8: createForeignCalls
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
protected AMD64HotSpotForeignCallsProvider createForeignCalls(HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotGraalRuntimeProvider runtime, HotSpotMetaAccessProvider metaAccess,
HotSpotCodeCacheProvider codeCache, WordTypes wordTypes, Value[] nativeABICallerSaveRegisters) {
return new AMD64HotSpotForeignCallsProvider(jvmciRuntime, runtime, metaAccess, codeCache, wordTypes, nativeABICallerSaveRegisters);
}
示例9: createForeignCalls
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
protected HotSpotHostForeignCallsProvider createForeignCalls(HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotGraalRuntimeProvider runtime, HotSpotMetaAccessProvider metaAccess,
HotSpotCodeCacheProvider codeCache, WordTypes wordTypes, Value[] nativeABICallerSaveRegisters) {
return new AArch64HotSpotForeignCallsProvider(jvmciRuntime, runtime, metaAccess, codeCache, wordTypes, nativeABICallerSaveRegisters);
}
示例10: getCodeCache
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
@Override
public HotSpotCodeCacheProvider getCodeCache() {
return (HotSpotCodeCacheProvider) super.getCodeCache();
}
示例11: disassembleInstalledCode
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
@Override
public String disassembleInstalledCode(CodeCacheProvider codeCache, CompilationResult compResult, InstalledCode code) {
return ((HotSpotCodeCacheProvider) codeCache).disassemble(code);
}
示例12: createCodeCache
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) {
return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig);
}
示例13: createBackend
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection,
StackIntrospection stackIntrospection) {
return new JVMCIBackend(metaAccess, codeCache, constantReflection, stackIntrospection);
}
示例14: createBackend
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, HotSpotConstantReflectionProvider constantReflection,
StackIntrospection stackIntrospection) {
return new JVMCIBackend(metaAccess, codeCache, constantReflection, stackIntrospection);
}
示例15: notifyInstall
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; //导入依赖的package包/类
@Override
public void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider,
InstalledCode installedCode, CompiledCode compiledCode) {
gotInstallNotification++;
}