public interface TruffleCompilable
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.
|
int |
countDirectCallNodes()
Returns the number of direct calls of a call target.
|
long |
engineId()
Returns a process-unique id for the underlying engine.
|
int |
getCallCount()
Return the total number of calls to this target.
|
SpeculationLog |
getCompilationSpeculationLog()
Gets a speculation log to be used for a single Truffle compilation.
|
Map<String,String> |
getCompilerOptions()
Returns a set of compiler options that where specified by the user.
|
int |
getKnownCallSiteCount() |
String |
getName()
Gets a descriptive name for this call target.
|
int |
getNonTrivialNodeCount()
Returns the estimate of the Truffle node count in this AST.
|
boolean |
isSameOrSplit(TruffleCompilable 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.
|
void |
prepareForCompilation()
Called before call target is used for runtime compilation, either as root compilation or via
inlining.
|
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
TruffleCompilable.serializeException(Throwable).suppressed - specifies whether the failure was suppressed and should be silent. Use the
TruffleCompilerRuntime.isSuppressedFailure(TruffleCompilable, 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()
int countDirectCallNodes()
int getCallCount()
boolean cancelCompilation(CharSequence reason)
boolean isSameOrSplit(TruffleCompilable ast)
ast - the ast to compare toint getKnownCallSiteCount()
void prepareForCompilation()
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.long engineId()
compiler options as they are guaranteed to be the same per
engine.