public abstract class Backend extends Object implements TargetProvider
| Modifier and Type | Class and Description |
|---|---|
static class |
Backend.CodeInstallationTask
Encapsulates custom tasks done before and after code installation.
|
static class |
Backend.CodeInstallationTaskFactory
Creates code installation tasks.
|
| Modifier and Type | Field and Description |
|---|---|
static ForeignCallSignature |
ARITHMETIC_DREM |
static ForeignCallSignature |
ARITHMETIC_FREM |
| Modifier | Constructor and Description |
|---|---|
protected |
Backend(Providers providers) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCodeInstallationTask(Backend.CodeInstallationTaskFactory factory) |
InstalledCode |
addInstalledCode(DebugContext debug,
ResolvedJavaMethod method,
CompilationRequest compilationRequest,
CompilationResult compilationResult)
Installs code based on a given compilation result.
|
protected abstract CompiledCode |
createCompiledCode(ResolvedJavaMethod method,
CompilationRequest compilationRequest,
CompilationResult compilationResult,
boolean isDefault,
OptionValues options)
Turns a Graal
CompilationResult into a CompiledCode object that can be passed
to the VM for code installation. |
InstalledCode |
createDefaultInstalledCode(DebugContext debug,
ResolvedJavaMethod method,
CompilationResult compilationResult)
Installs code based on a given compilation result and sets it as the default code to be used
when
method is invoked. |
InstalledCode |
createInstalledCode(DebugContext debug,
ResolvedJavaMethod method,
CompilationRequest compilationRequest,
CompilationResult compilationResult,
InstalledCode predefinedInstalledCode,
boolean isDefault) |
InstalledCode |
createInstalledCode(DebugContext debug,
ResolvedJavaMethod method,
CompilationRequest compilationRequest,
CompilationResult compilationResult,
InstalledCode predefinedInstalledCode,
boolean isDefault,
Object[] context)
Installs code based on a given compilation result.
|
InstalledCode |
createInstalledCode(DebugContext debug,
ResolvedJavaMethod method,
CompilationResult compilationResult,
InstalledCode predefinedInstalledCode,
boolean isDefault) |
void |
emitBackEnd(StructuredGraph graph,
Object stub,
ResolvedJavaMethod installedCodeOwner,
CompilationResult compilationResult,
CompilationResultBuilderFactory factory,
RegisterConfig config,
LIRSuites lirSuites) |
CodeCacheProvider |
getCodeCache() |
CompilationIdentifier |
getCompilationIdentifier(ResolvedJavaMethod resolvedJavaMethod)
Gets the compilation id for a given
ResolvedJavaMethod. |
ConstantReflectionProvider |
getConstantReflection() |
ForeignCallsProvider |
getForeignCalls() |
MetaAccessProvider |
getMetaAccess() |
Providers |
getProviders() |
abstract SuitesProvider |
getSuites() |
TargetDescription |
getTarget() |
LIRKind |
getValueKind(JavaKind javaKind) |
<T extends AbstractBlockBase<T>> |
newBlockOrder(int originalBlockCount,
T startBlock)
Creates a new instance of a code emission ordering computation.
|
abstract RegisterAllocationConfig |
newRegisterAllocationConfig(RegisterConfig registerConfig,
String[] allocationRestrictedTo)
Creates a new configuration for register allocation.
|
public static final ForeignCallSignature ARITHMETIC_FREM
public static final ForeignCallSignature ARITHMETIC_DREM
protected Backend(Providers providers)
public void addCodeInstallationTask(Backend.CodeInstallationTaskFactory factory)
public Providers getProviders()
public CodeCacheProvider getCodeCache()
public MetaAccessProvider getMetaAccess()
public ConstantReflectionProvider getConstantReflection()
public ForeignCallsProvider getForeignCalls()
public abstract SuitesProvider getSuites()
public TargetDescription getTarget()
getTarget in interface TargetProviderpublic LIRKind getValueKind(JavaKind javaKind)
public abstract RegisterAllocationConfig newRegisterAllocationConfig(RegisterConfig registerConfig, String[] allocationRestrictedTo)
allocationRestrictedTo - if not null, register allocation will be restricted to
registers whose names appear in this arraypublic <T extends AbstractBlockBase<T>> CodeEmissionOrder<T> newBlockOrder(int originalBlockCount, T startBlock)
protected abstract CompiledCode createCompiledCode(ResolvedJavaMethod method,
CompilationRequest compilationRequest,
CompilationResult compilationResult,
boolean isDefault,
OptionValues options)
CompilationResult into a CompiledCode object that can be passed
to the VM for code installation.public InstalledCode createInstalledCode(DebugContext debug, ResolvedJavaMethod method, CompilationResult compilationResult, InstalledCode predefinedInstalledCode, boolean isDefault)
public InstalledCode createInstalledCode(DebugContext debug, ResolvedJavaMethod method, CompilationRequest compilationRequest, CompilationResult compilationResult, InstalledCode predefinedInstalledCode, boolean isDefault)
public InstalledCode createInstalledCode(DebugContext debug, ResolvedJavaMethod method, CompilationRequest compilationRequest, CompilationResult compilationResult, InstalledCode predefinedInstalledCode, boolean isDefault, Object[] context)
method - the method compiled to produce compiledCode or null if the
input to compResult was not a ResolvedJavaMethodcompilationRequest - the compilation request or nullcompilationResult - the code to be installedpredefinedInstalledCode - a pre-allocated InstalledCode object to use as a
reference to the installed code. If null, a new InstalledCode
object will be created.isDefault - specifies if the installed code should be made the default implementation of
compRequest.getMethod(). The default implementation for a method is the
code executed for standard calls to the method. This argument is ignored if
compRequest == null.context - a custom debug context to use for the code installationjdk.vm.ci.code.BailoutException - if the code installation failedIllegalArgumentException - if installedCode != null and this platform does not
support a predefined
InstalledCode objectpublic InstalledCode addInstalledCode(DebugContext debug, ResolvedJavaMethod method, CompilationRequest compilationRequest, CompilationResult compilationResult)
method - the method compiled to produce compiledCode or null if the
input to compResult was not a ResolvedJavaMethodcompilationRequest - the request or nullcompilationResult - the compiled codejdk.vm.ci.code.BailoutException - if the code installation failedpublic InstalledCode createDefaultInstalledCode(DebugContext debug, ResolvedJavaMethod method, CompilationResult compilationResult)
method is invoked.method - the method compiled to produce compiledCode or null if the
input to compResult was not a ResolvedJavaMethodcompilationResult - the compiled codejdk.vm.ci.code.BailoutException - if the code installation failedpublic CompilationIdentifier getCompilationIdentifier(ResolvedJavaMethod resolvedJavaMethod)
ResolvedJavaMethod. Returns
CompilationIdentifier#INVALID_COMPILATION_ID in case there is no such id.resolvedJavaMethod - public void emitBackEnd(StructuredGraph graph, Object stub, ResolvedJavaMethod installedCodeOwner, CompilationResult compilationResult, CompilationResultBuilderFactory factory, RegisterConfig config, LIRSuites lirSuites)