public interface CompilableTruffleAST
TruffleCompiler
.Modifier and Type | Method and Description |
---|---|
JavaConstant |
asJavaConstant()
Gets this AST as a compiler constant.
|
boolean |
cancelCompilation(CharSequence reason)
Cancel the compilation of this truffle ast.
|
void |
dequeueInlined()
Cancel the compilation of this truffle ast.
|
int |
getCallCount()
Return the total number of calls to this target.
|
TruffleCallNode[] |
getCallNodes()
Returns the list of call nodes in this AST.
|
SpeculationLog |
getCompilationSpeculationLog()
Gets a speculation log to be used for a single Truffle compilation.
|
int |
getKnownCallSiteCount() |
String |
getName()
Gets a descriptive name for this call target.
|
JavaConstant |
getNodeRewritingAssumptionConstant() |
int |
getNonTrivialNodeCount()
Returns the estimate of the Truffle node count in this AST.
|
JavaConstant |
getValidRootAssumptionConstant() |
boolean |
isSameOrSplit(CompilableTruffleAST ast) |
boolean |
isTrivial() |
void |
onCompilationFailed(Supplier<String> serializedException,
boolean suppressed,
boolean bailout,
boolean permanentBailout,
boolean graphTooBig)
Notifies this object that a compilation of the AST it represents failed.
|
boolean |
onInvalidate(Object source,
CharSequence reason,
boolean wasActive)
Invoked when installed code associated with this AST was invalidated due to assumption
invalidation.
|
static String |
serializeException(Throwable e)
Returns
e serialized as a string. |
JavaConstant asJavaConstant()
SpeculationLog getCompilationSpeculationLog()
void onCompilationFailed(Supplier<String> serializedException, boolean suppressed, boolean bailout, boolean permanentBailout, boolean graphTooBig)
serializedException
- serializedException a serialized representation of the exception
representing the reason for compilation failure. See
CompilableTruffleAST.serializeException(Throwable)
.suppressed
- specifies whether the failure was suppressed and should be silent. Use the
TruffleCompilerRuntime.isSuppressedFailure(CompilableTruffleAST, Supplier)
to determine if the failure should be suppressed.bailout
- specifies whether the failure was a bailout or an error in the compiler. A
bailout means the compiler aborted the compilation based on some of property of
the AST (e.g., too big). A non-bailout means an unexpected error in the compiler
itself.permanentBailout
- specifies if a bailout is due to a condition that probably won't
change if this AST is compiled again. This value is meaningless if
bailout == false
.graphTooBig
- graph was too bigboolean onInvalidate(Object source, CharSequence reason, boolean wasActive)
String getName()
int getNonTrivialNodeCount()
TruffleCallNode[] getCallNodes()
int getCallCount()
boolean cancelCompilation(CharSequence reason)
void dequeueInlined()
boolean isSameOrSplit(CompilableTruffleAST ast)
ast
- the ast to compare toint getKnownCallSiteCount()
JavaConstant getNodeRewritingAssumptionConstant()
JavaConstant
representing the assumption that the nodes of the AST were not
rewritten.JavaConstant getValidRootAssumptionConstant()
JavaConstant
representing the assumption that the compiled code of the AST
was not invalidated.static String serializeException(Throwable e)
e
serialized as a string. The format of the returned string is:
(class_name ":")+ "\n" stack_trace
where the first class_name
is e.getClass().getName()
and every subsequent
class_name
is the super class of the previous one up to but not including
Throwable
. For example:
"java.lang.NullPointerException:java.lang.RuntimeException:java.lang.Exception:\n" + "java.lang.NullPointerException: compiler error\n\tat MyClass.mash(MyClass.java:9)\n\tat MyClass.main(MyClass.java:6)"
boolean isTrivial()
true
is the root nodes of this AST trivial, false
otherwise.