本文整理汇总了Java中jdk.vm.ci.meta.SpeculationLog类的典型用法代码示例。如果您正苦于以下问题:Java SpeculationLog类的具体用法?Java SpeculationLog怎么用?Java SpeculationLog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SpeculationLog类属于jdk.vm.ci.meta包,在下文中一共展示了SpeculationLog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: StructuredGraph
import jdk.vm.ci.meta.SpeculationLog; //导入依赖的package包/类
private StructuredGraph(String name,
ResolvedJavaMethod method,
int entryBCI,
Assumptions assumptions,
SpeculationLog speculationLog,
boolean useProfilingInfo,
CompilationIdentifier compilationId,
OptionValues options,
DebugContext debug,
Cancellable cancellable) {
super(name, options, debug);
this.setStart(add(new StartNode()));
this.rootMethod = method;
this.graphId = uniqueGraphIds.incrementAndGet();
this.compilationId = compilationId;
this.entryBCI = entryBCI;
this.assumptions = assumptions;
this.speculationLog = speculationLog;
this.useProfilingInfo = useProfilingInfo;
this.cancellable = cancellable;
}
示例2: createGraph
import jdk.vm.ci.meta.SpeculationLog; //导入依赖的package包/类
public StructuredGraph createGraph(ResolvedJavaMethod method, int entryBCI, boolean useProfilingInfo, CompilationIdentifier compilationId, OptionValues options, DebugContext debug) {
HotSpotBackend backend = graalRuntime.getHostBackend();
HotSpotProviders providers = backend.getProviders();
final boolean isOSR = entryBCI != JVMCICompiler.INVOCATION_ENTRY_BCI;
StructuredGraph graph = method.isNative() || isOSR ? null : getIntrinsicGraph(method, providers, compilationId, options, debug);
if (graph == null) {
SpeculationLog speculationLog = method.getSpeculationLog();
if (speculationLog != null) {
speculationLog.collectFailedSpeculations();
}
graph = new StructuredGraph.Builder(options, debug, AllowAssumptions.ifTrue(OptAssumptions.getValue(options))).method(method).entryBCI(entryBCI).speculationLog(
speculationLog).useProfilingInfo(useProfilingInfo).compilationId(compilationId).build();
}
return graph;
}
示例3: StructuredGraph
import jdk.vm.ci.meta.SpeculationLog; //导入依赖的package包/类
private StructuredGraph(String name,
ResolvedJavaMethod method,
int entryBCI,
Assumptions assumptions,
SpeculationLog speculationLog,
boolean useProfilingInfo,
CompilationIdentifier compilationId,
OptionValues options,
Cancellable cancellable) {
super(name, options);
this.setStart(add(new StartNode()));
this.rootMethod = method;
this.graphId = uniqueGraphIds.incrementAndGet();
this.compilationId = compilationId;
this.entryBCI = entryBCI;
this.assumptions = assumptions;
this.speculationLog = speculationLog;
this.useProfilingInfo = useProfilingInfo;
this.cancellable = cancellable;
}
示例4: getSpeculationLog
import jdk.vm.ci.meta.SpeculationLog; //导入依赖的package包/类
public SpeculationLog getSpeculationLog() {
Map<Long, SpeculationLog> map = SpeculationLogs.get(holder.mirror());
synchronized (map) {
SpeculationLog log = map.get(this.metaspaceMethod);
if (log == null) {
log = new HotSpotSpeculationLog();
map.put(metaspaceMethod, log);
}
return log;
}
}
示例5: installCode
import jdk.vm.ci.meta.SpeculationLog; //导入依赖的package包/类
public InstalledCode installCode(ResolvedJavaMethod method, CompiledCode compiledCode, InstalledCode installedCode, SpeculationLog log, boolean isDefault) {
InstalledCode resultInstalledCode;
if (installedCode == null) {
if (method == null) {
// Must be a stub
resultInstalledCode = new HotSpotRuntimeStub(((HotSpotCompiledCode) compiledCode).getName());
} else {
resultInstalledCode = new HotSpotNmethod((HotSpotResolvedJavaMethod) method, ((HotSpotCompiledCode) compiledCode).getName(), isDefault);
}
} else {
resultInstalledCode = installedCode;
}
HotSpotSpeculationLog speculationLog = (log != null && log.hasSpeculations()) ? (HotSpotSpeculationLog) log : null;
int result = runtime.getCompilerToVM().installCode(target, (HotSpotCompiledCode) compiledCode, resultInstalledCode, speculationLog);
if (result != config.codeInstallResultOk) {
String resultDesc = config.getCodeInstallResultDescription(result);
if (compiledCode instanceof HotSpotCompiledNmethod) {
HotSpotCompiledNmethod compiledNmethod = (HotSpotCompiledNmethod) compiledCode;
String msg = compiledNmethod.getInstallationFailureMessage();
if (msg != null) {
msg = String.format("Code installation failed: %s%n%s", resultDesc, msg);
} else {
msg = String.format("Code installation failed: %s", resultDesc);
}
if (result == config.codeInstallResultDependenciesInvalid) {
throw new AssertionError(resultDesc + " " + msg);
}
throw new BailoutException(result != config.codeInstallResultDependenciesFailed, msg);
} else {
throw new BailoutException("Error installing %s: %s", ((HotSpotCompiledCode) compiledCode).getName(), resultDesc);
}
}
return logOrDump(resultInstalledCode, compiledCode);
}
示例6: compile
import jdk.vm.ci.meta.SpeculationLog; //导入依赖的package包/类
public CompilationResult compile(ResolvedJavaMethod method, int entryBCI, boolean useProfilingInfo, CompilationIdentifier compilationId, OptionValues options) {
HotSpotBackend backend = graalRuntime.getHostBackend();
HotSpotProviders providers = backend.getProviders();
final boolean isOSR = entryBCI != JVMCICompiler.INVOCATION_ENTRY_BCI;
StructuredGraph graph = method.isNative() || isOSR ? null : getIntrinsicGraph(method, providers, compilationId, options);
if (graph == null) {
SpeculationLog speculationLog = method.getSpeculationLog();
if (speculationLog != null) {
speculationLog.collectFailedSpeculations();
}
graph = new StructuredGraph.Builder(options, AllowAssumptions.ifTrue(OptAssumptions.getValue(options))).method(method).entryBCI(entryBCI).speculationLog(
speculationLog).useProfilingInfo(useProfilingInfo).compilationId(compilationId).build();
}
Suites suites = getSuites(providers, options);
LIRSuites lirSuites = getLIRSuites(providers, options);
ProfilingInfo profilingInfo = useProfilingInfo ? method.getProfilingInfo(!isOSR, isOSR) : DefaultProfilingInfo.get(TriState.FALSE);
OptimisticOptimizations optimisticOpts = getOptimisticOpts(profilingInfo, options);
/*
* Cut off never executed code profiles if there is code, e.g. after the osr loop, that is
* never executed.
*/
if (isOSR && !OnStackReplacementPhase.Options.DeoptAfterOSR.getValue(options)) {
optimisticOpts.remove(Optimization.RemoveNeverExecutedCode);
}
CompilationResult result = new CompilationResult();
result.setEntryBCI(entryBCI);
boolean shouldDebugNonSafepoints = providers.getCodeCache().shouldDebugNonSafepoints();
PhaseSuite<HighTierContext> graphBuilderSuite = configGraphBuilderSuite(providers.getSuites().getDefaultGraphBuilderSuite(), shouldDebugNonSafepoints, isOSR);
GraalCompiler.compileGraph(graph, method, providers, backend, graphBuilderSuite, optimisticOpts, profilingInfo, suites, lirSuites, result, CompilationResultBuilderFactory.Default);
if (!isOSR && useProfilingInfo) {
ProfilingInfo profile = profilingInfo;
profile.setCompilerIRSize(StructuredGraph.class, graph.getNodeCount());
}
return result;
}
示例7: createInstalledCode
import jdk.vm.ci.meta.SpeculationLog; //导入依赖的package包/类
/**
* @see #createInstalledCode(DebugContext, ResolvedJavaMethod, CompilationRequest,
* CompilationResult, SpeculationLog, InstalledCode, boolean, Object[])
*/
public InstalledCode createInstalledCode(DebugContext debug, ResolvedJavaMethod method, CompilationResult compilationResult,
SpeculationLog speculationLog, InstalledCode predefinedInstalledCode, boolean isDefault) {
return createInstalledCode(debug, method, null, compilationResult, speculationLog, predefinedInstalledCode, isDefault, null);
}
示例8: getSpeculationLog
import jdk.vm.ci.meta.SpeculationLog; //导入依赖的package包/类
public SpeculationLog getSpeculationLog() {
return speculationLog;
}
示例9: speculationLog
import jdk.vm.ci.meta.SpeculationLog; //导入依赖的package包/类
public Builder speculationLog(SpeculationLog log) {
this.speculationLog = log;
return this;
}
示例10: getSpeculationLog
import jdk.vm.ci.meta.SpeculationLog; //导入依赖的package包/类
protected SpeculationLog getSpeculationLog() {
return null;
}
示例11: computeValue
import jdk.vm.ci.meta.SpeculationLog; //导入依赖的package包/类
@Override
protected Map<Long, SpeculationLog> computeValue(java.lang.Class<?> type) {
return new HashMap<>(4);
}
示例12: createSpeculationLog
import jdk.vm.ci.meta.SpeculationLog; //导入依赖的package包/类
public SpeculationLog createSpeculationLog() {
return new HotSpotSpeculationLog();
}
示例13: createInstalledCode
import jdk.vm.ci.meta.SpeculationLog; //导入依赖的package包/类
/**
* @see #createInstalledCode(ResolvedJavaMethod, CompilationRequest, CompilationResult,
* SpeculationLog, InstalledCode, boolean)
*/
public InstalledCode createInstalledCode(ResolvedJavaMethod method, CompilationResult compilationResult,
SpeculationLog speculationLog, InstalledCode predefinedInstalledCode, boolean isDefault) {
return createInstalledCode(method, null, compilationResult, speculationLog, predefinedInstalledCode, isDefault);
}
示例14: createSpeculationLog
import jdk.vm.ci.meta.SpeculationLog; //导入依赖的package包/类
@Override
public SpeculationLog createSpeculationLog() {
return new HotSpotSpeculationLog();
}
示例15: getSpeculationLog
import jdk.vm.ci.meta.SpeculationLog; //导入依赖的package包/类
protected synchronized SpeculationLog getSpeculationLog() {
if (speculationLog == null) {
speculationLog = ((GraalTruffleRuntime) Truffle.getRuntime()).createSpeculationLog();
}
return speculationLog;
}