public class CompilationResult extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CompilationResult.CodeAnnotation
Provides extra information about instructions or data at specific positions in
CompilationResult.getTargetCode(). |
static class |
CompilationResult.CodeComment
A string comment about one or more instructions at a specific position in the code.
|
static class |
CompilationResult.CodeMark
An alternative to the existing
Mark which isn't very flexible since it's final. |
static class |
CompilationResult.JumpTable
Describes a table of signed offsets embedded in the code.
|
static interface |
CompilationResult.MarkId
An identified mark in the generated code.
|
| Constructor and Description |
|---|
CompilationResult(CompilationIdentifier compilationId) |
CompilationResult(CompilationIdentifier compilationId,
String name) |
CompilationResult(String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAnnotation(CompilationResult.CodeAnnotation annotation) |
void |
addInfopoint(Infopoint infopoint)
Records a custom infopoint in the code section.
|
void |
clearExceptionHandlers() |
void |
clearInfopoints() |
void |
close(OptionValues options)
Closes this compilation result to future updates.
|
boolean |
equals(Object obj) |
Assumption[] |
getAssumptions()
Gets the assumptions made during compilation.
|
int |
getBytecodeSize() |
List<CompilationResult.CodeAnnotation> |
getCodeAnnotations() |
CompilationIdentifier |
getCompilationId() |
StackSlot |
getCustomStackArea()
Start of the custom stack area.
|
List<DataPatch> |
getDataPatches() |
DataSection |
getDataSection() |
int |
getEntryBCI() |
List<ExceptionHandler> |
getExceptionHandlers() |
List<Infopoint> |
getInfopoints() |
List<CompilationResult.CodeMark> |
getMarks() |
int |
getMaxInterpreterFrameSize() |
ResolvedJavaMethod[] |
getMethods()
Gets the methods whose bytecodes were used as input to the compilation.
|
String |
getName()
Gets the name for this compilation result.
|
List<SourceMapping> |
getSourceMappings() |
SpeculationLog |
getSpeculationLog()
Gets the
SpeculationLog log, if any, used during compilation. |
byte[] |
getTargetCode() |
int |
getTargetCodeSize() |
int |
getTotalFrameSize()
The total frame size of the method in bytes.
|
int |
hashCode() |
boolean |
hasUnsafeAccess() |
Call |
recordCall(int codePos,
int size,
InvokeTarget target,
DebugInfo debugInfo,
boolean direct)
Records a call in the code array.
|
void |
recordDataPatch(int codePos,
Reference ref)
Records a data patch in the code section.
|
void |
recordDataPatchWithNote(int codePos,
Reference ref,
Object note)
Records a data patch in the code section.
|
void |
recordExceptionHandler(int codePos,
int handlerPos)
Records an exception handler for this method.
|
void |
recordImplicitException(int codePos,
int dispatchPos,
DebugInfo debugInfo)
Records an implicit exception in the code array.
|
void |
recordInfopoint(int codePos,
DebugInfo debugInfo,
InfopointReason reason)
Records an infopoint in the code array.
|
CompilationResult.CodeMark |
recordMark(int codePos,
CompilationResult.MarkId markId)
Records an instruction mark within this method.
|
void |
recordSourceMapping(int startOffset,
int endOffset,
NodeSourcePosition sourcePosition) |
void |
resetForEmittingCode()
Clears the information in this object pertaining to generating code.
|
void |
setAssumptions(Assumption[] assumptions)
Sets the assumptions made during compilation.
|
void |
setBytecodeSize(int bytecodeSize) |
void |
setCustomStackAreaOffset(StackSlot slot) |
void |
setEntryBCI(int entryBCI) |
void |
setHasUnsafeAccess(boolean hasUnsafeAccess) |
void |
setMaxInterpreterFrameSize(int maxInterpreterFrameSize) |
void |
setMethods(ResolvedJavaMethod rootMethod,
Collection<ResolvedJavaMethod> inlinedMethods)
Sets the methods whose bytecodes were used as input to the compilation.
|
void |
setSpeculationLog(SpeculationLog speculationLog)
Sets the
SpeculationLog log used during compilation. |
void |
setTargetCode(byte[] code,
int size)
Sets the machine that has been generated by the compiler.
|
void |
setTotalFrameSize(int size)
Sets the total frame size in bytes.
|
String |
toString() |
public CompilationResult(CompilationIdentifier compilationId)
public CompilationResult(CompilationIdentifier compilationId, String name)
public CompilationResult(String name)
public int getEntryBCI()
public void setEntryBCI(int entryBCI)
entryBCI - the entryBCI to setpublic void setAssumptions(Assumption[] assumptions)
public Assumption[] getAssumptions()
public void setMethods(ResolvedJavaMethod rootMethod,
Collection<ResolvedJavaMethod> inlinedMethods)
rootMethod - the root method of the compilationinlinedMethods - the methods inlined during compilationpublic ResolvedJavaMethod[] getMethods()
null if the compilation did not record method dependencies otherwise the
methods whose bytecodes were used as input to the compilation with the first element
being the root method of the compilationpublic void setSpeculationLog(SpeculationLog speculationLog)
SpeculationLog log used during compilation.public SpeculationLog getSpeculationLog()
SpeculationLog log, if any, used during compilation.public void setBytecodeSize(int bytecodeSize)
public int getBytecodeSize()
public DataSection getDataSection()
public int getTotalFrameSize()
public void setTotalFrameSize(int size)
size - the size of the frame in bytespublic int getMaxInterpreterFrameSize()
public void setMaxInterpreterFrameSize(int maxInterpreterFrameSize)
public void setTargetCode(byte[] code,
int size)
code - the machine code generatedsize - the size of the machine codepublic void recordDataPatch(int codePos,
Reference ref)
data section or directly to an inlined
constant.codePos - the position in the code that needs to be patchedref - the reference that should be inserted in the codepublic void recordDataPatchWithNote(int codePos,
Reference ref,
Object note)
data section or directly to an inlined
constant.codePos - the position in the code that needs to be patchedref - the reference that should be inserted in the codenote - a note attached to data patch for use by post-processing toolspublic Call recordCall(int codePos,
int size,
InvokeTarget target,
DebugInfo debugInfo,
boolean direct)
codePos - the position of the call in the code arraysize - the size of the call instructiontarget - the being calleddebugInfo - the debug info for the calldirect - specifies if this is a direct callpublic void recordExceptionHandler(int codePos,
int handlerPos)
codePos - the position in the code that is covered by the handlerhandlerPos - the position of the handlerpublic void recordInfopoint(int codePos,
DebugInfo debugInfo,
InfopointReason reason)
codePos - the position of the infopoint in the code arraydebugInfo - the debug info for the infopointpublic void recordImplicitException(int codePos,
int dispatchPos,
DebugInfo debugInfo)
codePos - the position of the implicit exception in the code arraydispatchPos - the position to resume execution when an implicit exception occurs.
Setting it to the same value of codePos forces a deoptimization, and will
resume execution at the default deoptimization blob.debugInfo - the debug info for the infopointpublic void addInfopoint(Infopoint infopoint)
CompilationResult.recordCall(int, int, InvokeTarget, DebugInfo, boolean).infopoint - the infopoint to record, usually a derived class from Infopointpublic void recordSourceMapping(int startOffset,
int endOffset,
NodeSourcePosition sourcePosition)
public CompilationResult.CodeMark recordMark(int codePos, CompilationResult.MarkId markId)
codePos - the position in the code that is covered by the handlermarkId - the identifier for this markpublic StackSlot getCustomStackArea()
public void setCustomStackAreaOffset(StackSlot slot)
slot - CompilationResult.getCustomStackArea()public byte[] getTargetCode()
public int getTargetCodeSize()
public List<CompilationResult.CodeAnnotation> getCodeAnnotations()
null if there are nonepublic void addAnnotation(CompilationResult.CodeAnnotation annotation)
public List<Infopoint> getInfopoints()
Site.pcOffsetpublic List<DataPatch> getDataPatches()
public List<ExceptionHandler> getExceptionHandlers()
public List<CompilationResult.CodeMark> getMarks()
code marks.public List<SourceMapping> getSourceMappings()
SourceMappingspublic String getName()
CompilationResult.getCompilationId().public CompilationIdentifier getCompilationId()
public void setHasUnsafeAccess(boolean hasUnsafeAccess)
public boolean hasUnsafeAccess()
public void resetForEmittingCode()
public void clearInfopoints()
public void clearExceptionHandlers()
public void close(OptionValues options)