当前位置: 首页>>代码示例>>Java>>正文


Java CompilationRequest类代码示例

本文整理汇总了Java中jdk.vm.ci.code.CompilationRequest的典型用法代码示例。如果您正苦于以下问题:Java CompilationRequest类的具体用法?Java CompilationRequest怎么用?Java CompilationRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CompilationRequest类属于jdk.vm.ci.code包,在下文中一共展示了CompilationRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: asCompilationRequest

import jdk.vm.ci.code.CompilationRequest; //导入依赖的package包/类
/**
 * Returns the {@link CompilationRequestIdentifier#getRequest() request} from a
 * {@link CompilationRequestIdentifier}. Returns {@code null} if the
 * {@link CompilationIdentifier identifier} does not have one.
 */
static CompilationRequest asCompilationRequest(CompilationIdentifier compilationId) {
    if (compilationId instanceof CompilationRequestIdentifier) {
        return ((CompilationRequestIdentifier) compilationId).getRequest();
    }
    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:CompilationRequestIdentifier.java

示例2: compileMethod

import jdk.vm.ci.code.CompilationRequest; //导入依赖的package包/类
@SuppressWarnings("try")
CompilationRequestResult compileMethod(CompilationRequest request, boolean installAsDefault) {
    if (graalRuntime.isShutdown()) {
        return HotSpotCompilationRequestResult.failure(String.format("Shutdown entered"), false);
    }

    ResolvedJavaMethod method = request.getMethod();
    OptionValues options = graalRuntime.getOptions(method);

    if (graalRuntime.isBootstrapping()) {
        if (DebugOptions.BootstrapInitializeOnly.getValue(options)) {
            return HotSpotCompilationRequestResult.failure(String.format("Skip compilation because %s is enabled", DebugOptions.BootstrapInitializeOnly.getName()), true);
        }
        if (bootstrapWatchDog != null) {
            if (bootstrapWatchDog.hitCriticalCompilationRateOrTimeout()) {
                // Drain the compilation queue to expedite completion of the bootstrap
                return HotSpotCompilationRequestResult.failure("hit critical bootstrap compilation rate or timeout", true);
            }
        }
    }
    HotSpotCompilationRequest hsRequest = (HotSpotCompilationRequest) request;
    try (CompilationWatchDog w1 = CompilationWatchDog.watch(method, hsRequest.getId(), options);
                    BootstrapWatchDog.Watch w2 = bootstrapWatchDog == null ? null : bootstrapWatchDog.watch(request);
                    CompilationAlarm alarm = CompilationAlarm.trackCompilationPeriod(options);) {
        if (compilationCounters != null) {
            compilationCounters.countCompilation(method);
        }
        CompilationTask task = new CompilationTask(jvmciRuntime, this, hsRequest, true, installAsDefault, options);
        CompilationRequestResult r = null;
        try (DebugContext debug = graalRuntime.openDebugContext(options, task.getCompilationIdentifier(), method, getDebugHandlersFactories());
                        Activation a = debug.activate()) {
            r = task.runCompilation(debug);
        }
        assert r != null;
        return r;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:38,代码来源:HotSpotGraalCompiler.java

示例3: compileMethod

import jdk.vm.ci.code.CompilationRequest; //导入依赖的package包/类
@Override
@SuppressWarnings("try")
public CompilationRequestResult compileMethod(CompilationRequest request) {
    if (graalRuntime.isShutdown()) {
        return HotSpotCompilationRequestResult.failure(String.format("Shutdown entered"), false);
    }
    OptionValues options = graalRuntime.getOptions();
    if (graalRuntime.isBootstrapping()) {
        if (GraalDebugConfig.Options.BootstrapInitializeOnly.getValue(options)) {
            return HotSpotCompilationRequestResult.failure(String.format("Skip compilation because %s is enabled", GraalDebugConfig.Options.BootstrapInitializeOnly.getName()), true);
        }
        if (bootstrapWatchDog != null) {
            if (bootstrapWatchDog.hitCriticalCompilationRateOrTimeout()) {
                // Drain the compilation queue to expedite completion of the bootstrap
                return HotSpotCompilationRequestResult.failure("hit critical bootstrap compilation rate or timeout", true);
            }
        }
    }
    ResolvedJavaMethod method = request.getMethod();
    HotSpotCompilationRequest hsRequest = (HotSpotCompilationRequest) request;
    try (CompilationWatchDog w1 = CompilationWatchDog.watch(method, hsRequest.getId(), options);
                    BootstrapWatchDog.Watch w2 = bootstrapWatchDog == null ? null : bootstrapWatchDog.watch(request);
                    CompilationAlarm alarm = CompilationAlarm.trackCompilationPeriod(options);) {
        if (compilationCounters != null) {
            compilationCounters.countCompilation(method);
        }
        // Ensure a debug configuration for this thread is initialized
        DebugEnvironment.ensureInitialized(options, graalRuntime.getHostProviders().getSnippetReflection());
        CompilationTask task = new CompilationTask(jvmciRuntime, this, hsRequest, true, true, options);
        CompilationRequestResult r = null;
        try (DebugConfigScope dcs = Debug.setConfig(new TopLevelDebugConfig());
                        Debug.Scope s = Debug.methodMetricsScope("HotSpotGraalCompiler", MethodMetricsRootScopeInfo.create(method), true, method)) {
            r = task.runCompilation();
        }
        assert r != null;
        return r;
    }
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:39,代码来源:HotSpotGraalCompiler.java

示例4: createInstalledCode

import jdk.vm.ci.code.CompilationRequest; //导入依赖的package包/类
/**
 * @see #createInstalledCode(DebugContext, ResolvedJavaMethod, CompilationRequest,
 *      CompilationResult, SpeculationLog, InstalledCode, boolean, Object[])
 */
@SuppressWarnings("try")
public InstalledCode createInstalledCode(DebugContext debug, ResolvedJavaMethod method, CompilationRequest compilationRequest, CompilationResult compilationResult,
                SpeculationLog speculationLog, InstalledCode predefinedInstalledCode, boolean isDefault) {
    return createInstalledCode(debug, method, compilationRequest, compilationResult, speculationLog, predefinedInstalledCode, isDefault, null);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:Backend.java

示例5: open

import jdk.vm.ci.code.CompilationRequest; //导入依赖的package包/类
void open(CompilationRequest r) {
    assert this.request == null;
    this.request = r;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:BootstrapWatchDog.java

示例6: createCompiledCode

import jdk.vm.ci.code.CompilationRequest; //导入依赖的package包/类
@Override
public CompiledCode createCompiledCode(ResolvedJavaMethod method, CompilationRequest compilationRequest, CompilationResult compResult) {
    HotSpotCompilationRequest compRequest = compilationRequest instanceof HotSpotCompilationRequest ? (HotSpotCompilationRequest) compilationRequest : null;
    return HotSpotCompiledCodeBuilder.createCompiledCode(getCodeCache(), method, compRequest, compResult);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:HotSpotBackend.java

示例7: compileMethod

import jdk.vm.ci.code.CompilationRequest; //导入依赖的package包/类
public HotSpotCompilationRequestResult compileMethod(CompilationRequest request) {
    throw new JVMCIError("no JVMCI compiler selected");
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:4,代码来源:HotSpotJVMCICompilerConfig.java

示例8: compileMethod

import jdk.vm.ci.code.CompilationRequest; //导入依赖的package包/类
@Override
public CompilationRequestResult compileMethod(CompilationRequest request) {
    // do nothing
    return new EmptyCompilationRequestResult();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:JVMCIHelpers.java

示例9: compileMethod

import jdk.vm.ci.code.CompilationRequest; //导入依赖的package包/类
public CompilationRequestResult compileMethod(CompilationRequest request) {
    throw new JVMCIError("no JVMCI compiler selected");
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:4,代码来源:HotSpotJVMCICompilerConfig.java

示例10: compileMethod

import jdk.vm.ci.code.CompilationRequest; //导入依赖的package包/类
@Override
public CompilationRequestResult compileMethod(CompilationRequest request) {
    // do nothing
    return CompilationRequestResult.failure("no compiler configured", true);
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:6,代码来源:JVMCIHelpers.java

示例11: createInstalledCode

import jdk.vm.ci.code.CompilationRequest; //导入依赖的package包/类
/**
 * Installs code based on a given compilation result.
 *
 * @param method the method compiled to produce {@code compiledCode} or {@code null} if the
 *            input to {@code compResult} was not a {@link ResolvedJavaMethod}
 * @param compilationRequest the compilation request or {@code null}
 * @param compilationResult the code to be compiled
 * @param predefinedInstalledCode a pre-allocated {@link InstalledCode} object to use as a
 *            reference to the installed code. If {@code null}, a new {@link InstalledCode}
 *            object will be created.
 * @param speculationLog the speculation log to be used
 * @param isDefault specifies if the installed code should be made the default implementation of
 *            {@code compRequest.getMethod()}. The default implementation for a method is the
 *            code executed for standard calls to the method. This argument is ignored if
 *            {@code compRequest == null}.
 * @return a reference to the compiled and ready-to-run installed code
 * @throws BailoutException if the code installation failed
 */
@SuppressWarnings("try")
public InstalledCode createInstalledCode(ResolvedJavaMethod method, CompilationRequest compilationRequest, CompilationResult compilationResult,
                SpeculationLog speculationLog, InstalledCode predefinedInstalledCode, boolean isDefault) {
    try (Scope s2 = Debug.scope("CodeInstall", getProviders().getCodeCache(), compilationResult)) {
        CompiledCode compiledCode = createCompiledCode(method, compilationRequest, compilationResult);
        return getProviders().getCodeCache().installCode(method, compiledCode, predefinedInstalledCode, speculationLog, isDefault);
    } catch (Throwable e) {
        throw Debug.handle(e);
    }
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:29,代码来源:Backend.java

示例12: createCompiledCode

import jdk.vm.ci.code.CompilationRequest; //导入依赖的package包/类
/**
 * Turns a Graal {@link CompilationResult} into a {@link CompiledCode} object that can be passed
 * to the VM for code installation.
 */
protected abstract CompiledCode createCompiledCode(ResolvedJavaMethod method, CompilationRequest compilationRequest, CompilationResult compilationResult);
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:Backend.java

示例13: addInstalledCode

import jdk.vm.ci.code.CompilationRequest; //导入依赖的package包/类
/**
 * Installs code based on a given compilation result.
 *
 * @param method the method compiled to produce {@code compiledCode} or {@code null} if the
 *            input to {@code compResult} was not a {@link ResolvedJavaMethod}
 * @param compilationRequest the request or {@code null}
 * @param compilationResult the code to be compiled
 * @return a reference to the compiled and ready-to-run installed code
 * @throws BailoutException if the code installation failed
 */
public InstalledCode addInstalledCode(DebugContext debug, ResolvedJavaMethod method, CompilationRequest compilationRequest, CompilationResult compilationResult) {
    return createInstalledCode(debug, method, compilationRequest, compilationResult, null, null, false);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:Backend.java

示例14: compileMethod

import jdk.vm.ci.code.CompilationRequest; //导入依赖的package包/类
/**
 * Services a compilation request. This object should compile the method to machine code and
 * install it in the code cache if the compilation is successful.
 */
CompilationRequestResult compileMethod(CompilationRequest request);
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:JVMCICompiler.java

示例15: addInstalledCode

import jdk.vm.ci.code.CompilationRequest; //导入依赖的package包/类
/**
 * Installs code based on a given compilation result.
 *
 * @param method the method compiled to produce {@code compiledCode} or {@code null} if the
 *            input to {@code compResult} was not a {@link ResolvedJavaMethod}
 * @param compilationRequest the request or {@code null}
 * @param compilationResult the code to be compiled
 * @return a reference to the compiled and ready-to-run installed code
 * @throws BailoutException if the code installation failed
 */
public InstalledCode addInstalledCode(ResolvedJavaMethod method, CompilationRequest compilationRequest, CompilationResult compilationResult) {
    return createInstalledCode(method, compilationRequest, compilationResult, null, null, false);
}
 
开发者ID:graalvm,项目名称:graal-core,代码行数:14,代码来源:Backend.java


注:本文中的jdk.vm.ci.code.CompilationRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。