# HG changeset patch # User Matthias Grimmer # Date 1448528523 -3600 # Node ID d158937952b65c5df5325c7c025942428d1c0aeb # Parent b272920e26b2a52c3f024f622d8e12f3593cc9eb# Parent 7015a77b222fdddd8cae49dc04f3259660b7d4c9 Merge diff -r b272920e26b2 -r d158937952b6 mx.truffle/mx_truffle.py --- a/mx.truffle/mx_truffle.py Wed Nov 25 12:18:46 2015 +0100 +++ b/mx.truffle/mx_truffle.py Thu Nov 26 10:02:03 2015 +0100 @@ -29,6 +29,7 @@ import mx from mx_unittest import unittest +from mx_sigtest import sigtest from mx_gate import Task import mx_gate @@ -57,6 +58,8 @@ def _truffle_gate_runner(args, tasks): with Task('Truffle UnitTests', tasks) as t: if t: unittest(['--suite', 'truffle', '--enable-timing', '--verbose', '--fail-fast']) + with Task('Truffle Signature Tests', tasks) as t: + if t: sigtest(['--check', 'binary']) mx_gate.add_gate_runner(_suite, _truffle_gate_runner) diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/AssumptionsTest.java --- a/truffle/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/AssumptionsTest.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/AssumptionsTest.java Thu Nov 26 10:02:03 2015 +0100 @@ -30,6 +30,7 @@ import java.util.HashMap; import java.util.Map; +import org.junit.Ignore; import org.junit.Test; import com.oracle.truffle.api.Assumption; @@ -40,6 +41,8 @@ import com.oracle.truffle.api.dsl.NodeField; import com.oracle.truffle.api.dsl.Specialization; import com.oracle.truffle.api.dsl.UnsupportedSpecializationException; +import com.oracle.truffle.api.dsl.internal.SpecializationNode; +import com.oracle.truffle.api.dsl.internal.SpecializedNode; import com.oracle.truffle.api.dsl.test.AssumptionsTestFactory.AssumptionArrayTestFactory; import com.oracle.truffle.api.dsl.test.AssumptionsTestFactory.CacheAssumptionTestFactory; import com.oracle.truffle.api.dsl.test.AssumptionsTestFactory.FieldTestFactory; @@ -47,6 +50,7 @@ import com.oracle.truffle.api.dsl.test.AssumptionsTestFactory.MultipleAssumptionArraysTestFactory; import com.oracle.truffle.api.dsl.test.AssumptionsTestFactory.MultipleAssumptionsTestFactory; import com.oracle.truffle.api.dsl.test.AssumptionsTestFactory.NodeFieldTest2Factory; +import com.oracle.truffle.api.dsl.test.AssumptionsTestFactory.RemoveSpecializationTestFactory; import com.oracle.truffle.api.dsl.test.AssumptionsTestFactory.StaticFieldTestFactory; import com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode; @@ -319,6 +323,42 @@ } + @Ignore + @Test + public void testAssumptionRemovesSpecializationBefore() { + // This only test if a specialization on the chain before the matching one is removed. + CallTarget root = createCallTarget(RemoveSpecializationTestFactory.getInstance()); + RemoveSpecializationTest node = getNode(root); + + assertEquals(true, root.call(true)); + SpecializationNode start0 = ((SpecializedNode) node).getSpecializationNode(); + assertEquals("ValidAssumptionNode_", start0.getClass().getSimpleName()); + + node.assumption.invalidate(); + // The specialization should be removed on the next call, even if the guard does not pass + assertEquals(false, root.call(false)); + SpecializationNode start1 = ((SpecializedNode) node).getSpecializationNode(); + assertEquals("InvalidatedNode_", start1.getClass().getSimpleName()); + } + + @NodeChild + @SuppressWarnings("unused") + static class RemoveSpecializationTest extends ValueNode { + + protected final Assumption assumption = Truffle.getRuntime().createAssumption(); + + @Specialization(guards = "value", assumptions = "assumption") + boolean validAssumption(boolean value) { + return true; + } + + @Specialization + boolean invalidated(boolean value) { + return false; + } + + } + @NodeChild static class ErrorIncompatibleReturnType extends ValueNode { @ExpectError("Incompatible return type int. Assumptions must be assignable to Assumption or Assumption[].") diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api.dsl/snapshot.sigtest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/truffle/com.oracle.truffle.api.dsl/snapshot.sigtest Thu Nov 26 10:02:03 2015 +0100 @@ -0,0 +1,210 @@ +#Signature file v4.1 +#Version + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.Cached + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[PARAMETER]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.String value() + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.CreateCast + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=CLASS) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.String[] value() + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.Fallback + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=CLASS) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD]) +intf java.lang.annotation.Annotation + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.GenerateNodeFactory + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=CLASS) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE]) +intf java.lang.annotation.Annotation + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.GeneratedBy + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE]) +intf java.lang.annotation.Annotation +meth public abstract !hasdefault java.lang.String methodName() +meth public abstract java.lang.Class value() + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.ImplicitCast + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=CLASS) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD]) +intf java.lang.annotation.Annotation + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.ImportStatic + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.Class[] value() + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.NodeChild + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=CLASS) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE]) +intf java.lang.annotation.Annotation +meth public abstract !hasdefault java.lang.Class type() +meth public abstract !hasdefault java.lang.String value() +meth public abstract !hasdefault java.lang.String[] executeWith() + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.NodeChildren + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=CLASS) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE]) +intf java.lang.annotation.Annotation +meth public abstract !hasdefault com.oracle.truffle.api.dsl.NodeChild[] value() + +CLSS public abstract interface com.oracle.truffle.api.dsl.NodeFactory<%0 extends java.lang.Object> +meth public abstract !varargs {com.oracle.truffle.api.dsl.NodeFactory%0} createNode(java.lang.Object[]) +meth public abstract java.lang.Class<{com.oracle.truffle.api.dsl.NodeFactory%0}> getNodeClass() +meth public abstract java.util.List> getExecutionSignature() +meth public abstract java.util.List>> getNodeSignatures() + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.NodeField + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=CLASS) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.Class type() +meth public abstract java.lang.String name() + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.NodeFields + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=CLASS) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE]) +intf java.lang.annotation.Annotation +meth public abstract !hasdefault com.oracle.truffle.api.dsl.NodeField[] value() + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.ShortCircuit + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=CLASS) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.String value() + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.Specialization + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD]) +intf java.lang.annotation.Annotation +meth public abstract !hasdefault java.lang.Class[] rewriteOn() +meth public abstract !hasdefault java.lang.String insertBefore() +meth public abstract !hasdefault java.lang.String limit() +meth public abstract !hasdefault java.lang.String[] assumptions() +meth public abstract !hasdefault java.lang.String[] contains() +meth public abstract !hasdefault java.lang.String[] guards() + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.TypeCast + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=CLASS) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.Class value() + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.TypeCheck + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=CLASS) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.Class value() + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.TypeSystem + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=CLASS) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.Class[] value() + +CLSS public abstract interface !annotation com.oracle.truffle.api.dsl.TypeSystemReference + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=CLASS) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.Class value() + +CLSS public final com.oracle.truffle.api.dsl.UnsupportedSpecializationException +cons public !varargs init(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.nodes.Node[],java.lang.Object[]) +meth public com.oracle.truffle.api.nodes.Node getNode() +meth public com.oracle.truffle.api.nodes.Node[] getSuppliedNodes() +meth public java.lang.Object[] getSuppliedValues() +meth public java.lang.String getMessage() +supr java.lang.RuntimeException +hfds node,serialVersionUID,suppliedNodes,suppliedValues + +CLSS public abstract interface java.io.Serializable + +CLSS public java.lang.Exception +cons protected init(java.lang.String,java.lang.Throwable,boolean,boolean) +cons public init() +cons public init(java.lang.String) +cons public init(java.lang.String,java.lang.Throwable) +cons public init(java.lang.Throwable) +supr java.lang.Throwable +hfds serialVersionUID + +CLSS public java.lang.Object +cons public init() +meth protected java.lang.Object clone() throws java.lang.CloneNotSupportedException +meth protected void finalize() throws java.lang.Throwable +meth public boolean equals(java.lang.Object) +meth public final java.lang.Class getClass() +meth public final void notify() +meth public final void notifyAll() +meth public final void wait() throws java.lang.InterruptedException +meth public final void wait(long) throws java.lang.InterruptedException +meth public final void wait(long,int) throws java.lang.InterruptedException +meth public int hashCode() +meth public java.lang.String toString() + +CLSS public java.lang.RuntimeException +cons protected init(java.lang.String,java.lang.Throwable,boolean,boolean) +cons public init() +cons public init(java.lang.String) +cons public init(java.lang.String,java.lang.Throwable) +cons public init(java.lang.Throwable) +supr java.lang.Exception +hfds serialVersionUID + +CLSS public java.lang.Throwable +cons protected init(java.lang.String,java.lang.Throwable,boolean,boolean) +cons public init() +cons public init(java.lang.String) +cons public init(java.lang.String,java.lang.Throwable) +cons public init(java.lang.Throwable) +intf java.io.Serializable +meth public final java.lang.Throwable[] getSuppressed() +meth public final void addSuppressed(java.lang.Throwable) +meth public java.lang.StackTraceElement[] getStackTrace() +meth public java.lang.String getLocalizedMessage() +meth public java.lang.String getMessage() +meth public java.lang.String toString() +meth public java.lang.Throwable fillInStackTrace() +meth public java.lang.Throwable getCause() +meth public java.lang.Throwable initCause(java.lang.Throwable) +meth public void printStackTrace() +meth public void printStackTrace(java.io.PrintStream) +meth public void printStackTrace(java.io.PrintWriter) +meth public void setStackTrace(java.lang.StackTraceElement[]) +supr java.lang.Object +hfds CAUSE_CAPTION,EMPTY_THROWABLE_ARRAY,NULL_CAUSE_MESSAGE,SELF_SUPPRESSION_MESSAGE,SUPPRESSED_CAPTION,SUPPRESSED_SENTINEL,UNASSIGNED_STACK,backtrace,cause,detailMessage,serialVersionUID,stackTrace,suppressedExceptions +hcls PrintStreamOrWriter,SentinelHolder,WrappedPrintStream,WrappedPrintWriter + +CLSS public abstract interface java.lang.annotation.Annotation +meth public abstract boolean equals(java.lang.Object) +meth public abstract int hashCode() +meth public abstract java.lang.Class annotationType() +meth public abstract java.lang.String toString() + +CLSS public abstract interface !annotation java.lang.annotation.Documented + anno 0 java.lang.annotation.Documented() + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE]) +intf java.lang.annotation.Annotation + +CLSS public abstract interface !annotation java.lang.annotation.Retention + anno 0 java.lang.annotation.Documented() + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.annotation.RetentionPolicy value() + +CLSS public abstract interface !annotation java.lang.annotation.Target + anno 0 java.lang.annotation.Documented() + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.annotation.ElementType[] value() + diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/SpecializationNode.java --- a/truffle/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/SpecializationNode.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/SpecializationNode.java Thu Nov 26 10:02:03 2015 +0100 @@ -58,7 +58,7 @@ @Child protected SpecializationNode next; - final int index; + private final int index; public SpecializationNode() { this(-1); diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api.interop.java/snapshot.sigtest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/truffle/com.oracle.truffle.api.interop.java/snapshot.sigtest Thu Nov 26 10:02:03 2015 +0100 @@ -0,0 +1,58 @@ +#Signature file v4.1 +#Version + +CLSS public final com.oracle.truffle.api.interop.java.JavaInterop +meth public static <%0 extends java.lang.Object> com.oracle.truffle.api.interop.TruffleObject asTruffleFunction(java.lang.Class<{%%0}>,{%%0}) +meth public static <%0 extends java.lang.Object> {%%0} asJavaFunction(java.lang.Class<{%%0}>,com.oracle.truffle.api.interop.TruffleObject) +meth public static <%0 extends java.lang.Object> {%%0} asJavaObject(java.lang.Class<{%%0}>,com.oracle.truffle.api.interop.TruffleObject) +meth public static com.oracle.truffle.api.interop.TruffleObject asTruffleObject(java.lang.Object) +supr java.lang.Object +hfds EMPTY +hcls JavaFunctionObject,JavaObject,SingleHandler,TemporaryRoot,TruffleHandler + +CLSS public abstract interface !annotation com.oracle.truffle.api.interop.java.MethodMessage + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.String message() + +CLSS public java.lang.Object +cons public init() +meth protected java.lang.Object clone() throws java.lang.CloneNotSupportedException +meth protected void finalize() throws java.lang.Throwable +meth public boolean equals(java.lang.Object) +meth public final java.lang.Class getClass() +meth public final void notify() +meth public final void notifyAll() +meth public final void wait() throws java.lang.InterruptedException +meth public final void wait(long) throws java.lang.InterruptedException +meth public final void wait(long,int) throws java.lang.InterruptedException +meth public int hashCode() +meth public java.lang.String toString() + +CLSS public abstract interface java.lang.annotation.Annotation +meth public abstract boolean equals(java.lang.Object) +meth public abstract int hashCode() +meth public abstract java.lang.Class annotationType() +meth public abstract java.lang.String toString() + +CLSS public abstract interface !annotation java.lang.annotation.Documented + anno 0 java.lang.annotation.Documented() + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE]) +intf java.lang.annotation.Annotation + +CLSS public abstract interface !annotation java.lang.annotation.Retention + anno 0 java.lang.annotation.Documented() + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.annotation.RetentionPolicy value() + +CLSS public abstract interface !annotation java.lang.annotation.Target + anno 0 java.lang.annotation.Documented() + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.annotation.ElementType[] value() + diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api.interop/snapshot.sigtest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/truffle/com.oracle.truffle.api.interop/snapshot.sigtest Thu Nov 26 10:02:03 2015 +0100 @@ -0,0 +1,73 @@ +#Signature file v4.1 +#Version + +CLSS public final com.oracle.truffle.api.interop.ForeignAccess +innr public abstract interface static Factory +innr public abstract interface static Factory10 +meth public !varargs static java.lang.Object execute(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.frame.VirtualFrame,com.oracle.truffle.api.interop.TruffleObject,java.lang.Object[]) +meth public java.lang.String toString() +meth public static com.oracle.truffle.api.interop.ForeignAccess create(com.oracle.truffle.api.interop.ForeignAccess$Factory) +meth public static com.oracle.truffle.api.interop.ForeignAccess create(java.lang.Class,com.oracle.truffle.api.interop.ForeignAccess$Factory10) +meth public static com.oracle.truffle.api.interop.TruffleObject getReceiver(com.oracle.truffle.api.frame.Frame) +meth public static java.util.List getArguments(com.oracle.truffle.api.frame.Frame) +supr java.lang.Object +hfds factory,initThread +hcls DelegatingFactory + +CLSS public abstract interface static com.oracle.truffle.api.interop.ForeignAccess$Factory + outer com.oracle.truffle.api.interop.ForeignAccess +meth public abstract boolean canHandle(com.oracle.truffle.api.interop.TruffleObject) +meth public abstract com.oracle.truffle.api.CallTarget accessMessage(com.oracle.truffle.api.interop.Message) + +CLSS public abstract interface static com.oracle.truffle.api.interop.ForeignAccess$Factory10 + outer com.oracle.truffle.api.interop.ForeignAccess +meth public abstract com.oracle.truffle.api.CallTarget accessExecute(int) +meth public abstract com.oracle.truffle.api.CallTarget accessGetSize() +meth public abstract com.oracle.truffle.api.CallTarget accessHasSize() +meth public abstract com.oracle.truffle.api.CallTarget accessInvoke(int) +meth public abstract com.oracle.truffle.api.CallTarget accessIsBoxed() +meth public abstract com.oracle.truffle.api.CallTarget accessIsExecutable() +meth public abstract com.oracle.truffle.api.CallTarget accessIsNull() +meth public abstract com.oracle.truffle.api.CallTarget accessMessage(com.oracle.truffle.api.interop.Message) +meth public abstract com.oracle.truffle.api.CallTarget accessNew(int) +meth public abstract com.oracle.truffle.api.CallTarget accessRead() +meth public abstract com.oracle.truffle.api.CallTarget accessUnbox() +meth public abstract com.oracle.truffle.api.CallTarget accessWrite() + +CLSS public abstract com.oracle.truffle.api.interop.Message +cons protected init() +fld public final static com.oracle.truffle.api.interop.Message GET_SIZE +fld public final static com.oracle.truffle.api.interop.Message HAS_SIZE +fld public final static com.oracle.truffle.api.interop.Message IS_BOXED +fld public final static com.oracle.truffle.api.interop.Message IS_EXECUTABLE +fld public final static com.oracle.truffle.api.interop.Message IS_NULL +fld public final static com.oracle.truffle.api.interop.Message READ +fld public final static com.oracle.truffle.api.interop.Message UNBOX +fld public static com.oracle.truffle.api.interop.Message WRITE +meth public abstract boolean equals(java.lang.Object) +meth public abstract int hashCode() +meth public final com.oracle.truffle.api.nodes.Node createNode() +meth public static com.oracle.truffle.api.interop.Message createExecute(int) +meth public static com.oracle.truffle.api.interop.Message createInvoke(int) +meth public static com.oracle.truffle.api.interop.Message createNew(int) +meth public static com.oracle.truffle.api.interop.Message valueOf(java.lang.String) +meth public static java.lang.String toString(com.oracle.truffle.api.interop.Message) +supr java.lang.Object + +CLSS public abstract interface com.oracle.truffle.api.interop.TruffleObject +meth public abstract com.oracle.truffle.api.interop.ForeignAccess getForeignAccess() + +CLSS public java.lang.Object +cons public init() +meth protected java.lang.Object clone() throws java.lang.CloneNotSupportedException +meth protected void finalize() throws java.lang.Throwable +meth public boolean equals(java.lang.Object) +meth public final java.lang.Class getClass() +meth public final void notify() +meth public final void notifyAll() +meth public final void wait() throws java.lang.InterruptedException +meth public final void wait(long) throws java.lang.InterruptedException +meth public final void wait(long,int) throws java.lang.InterruptedException +meth public int hashCode() +meth public java.lang.String toString() + diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api.object/snapshot.sigtest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/truffle/com.oracle.truffle.api.object/snapshot.sigtest Thu Nov 26 10:02:03 2015 +0100 @@ -0,0 +1,349 @@ +#Signature file v4.1 +#Version + +CLSS public abstract interface com.oracle.truffle.api.TypedObject +meth public abstract java.lang.Object getTypeIdentifier() + +CLSS public abstract interface com.oracle.truffle.api.interop.TruffleObject +meth public abstract com.oracle.truffle.api.interop.ForeignAccess getForeignAccess() + +CLSS public com.oracle.truffle.api.nodes.SlowPathException +cons public init() +cons public init(java.lang.String) +cons public init(java.lang.String,java.lang.Throwable) +cons public init(java.lang.Throwable) +meth public java.lang.Throwable fillInStackTrace() +supr java.lang.Exception +hfds serialVersionUID + +CLSS public abstract interface com.oracle.truffle.api.object.BooleanLocation +intf com.oracle.truffle.api.object.TypedLocation +meth public abstract boolean getBoolean(com.oracle.truffle.api.object.DynamicObject,boolean) +meth public abstract boolean getBoolean(com.oracle.truffle.api.object.DynamicObject,com.oracle.truffle.api.object.Shape) +meth public abstract java.lang.Class getType() +meth public abstract void setBoolean(com.oracle.truffle.api.object.DynamicObject,boolean) throws com.oracle.truffle.api.object.FinalLocationException +meth public abstract void setBoolean(com.oracle.truffle.api.object.DynamicObject,boolean,com.oracle.truffle.api.object.Shape) throws com.oracle.truffle.api.object.FinalLocationException +meth public abstract void setBoolean(com.oracle.truffle.api.object.DynamicObject,boolean,com.oracle.truffle.api.object.Shape,com.oracle.truffle.api.object.Shape) + +CLSS public abstract interface com.oracle.truffle.api.object.DoubleLocation +intf com.oracle.truffle.api.object.TypedLocation +meth public abstract double getDouble(com.oracle.truffle.api.object.DynamicObject,boolean) +meth public abstract double getDouble(com.oracle.truffle.api.object.DynamicObject,com.oracle.truffle.api.object.Shape) +meth public abstract java.lang.Class getType() +meth public abstract void setDouble(com.oracle.truffle.api.object.DynamicObject,double) throws com.oracle.truffle.api.object.FinalLocationException +meth public abstract void setDouble(com.oracle.truffle.api.object.DynamicObject,double,com.oracle.truffle.api.object.Shape) throws com.oracle.truffle.api.object.FinalLocationException +meth public abstract void setDouble(com.oracle.truffle.api.object.DynamicObject,double,com.oracle.truffle.api.object.Shape,com.oracle.truffle.api.object.Shape) + +CLSS public abstract com.oracle.truffle.api.object.DynamicObject +cons public init() +intf com.oracle.truffle.api.TypedObject +intf com.oracle.truffle.api.interop.TruffleObject +meth public abstract boolean delete(java.lang.Object) +meth public abstract boolean isEmpty() +meth public abstract boolean set(java.lang.Object,java.lang.Object) +meth public abstract boolean updateShape() +meth public abstract com.oracle.truffle.api.object.DynamicObject copy(com.oracle.truffle.api.object.Shape) +meth public abstract com.oracle.truffle.api.object.Shape getShape() +meth public abstract int size() +meth public abstract java.lang.Object get(java.lang.Object,java.lang.Object) +meth public abstract void define(java.lang.Object,java.lang.Object,int) +meth public abstract void define(java.lang.Object,java.lang.Object,int,com.oracle.truffle.api.object.LocationFactory) +meth public abstract void setShapeAndGrow(com.oracle.truffle.api.object.Shape,com.oracle.truffle.api.object.Shape) +meth public abstract void setShapeAndResize(com.oracle.truffle.api.object.Shape,com.oracle.truffle.api.object.Shape) +meth public final boolean containsKey(java.lang.Object) +meth public final java.lang.Object get(java.lang.Object) +meth public final void define(java.lang.Object,java.lang.Object) +supr java.lang.Object + +CLSS public abstract interface com.oracle.truffle.api.object.DynamicObjectFactory +meth public abstract !varargs com.oracle.truffle.api.object.DynamicObject newInstance(java.lang.Object[]) +meth public abstract com.oracle.truffle.api.object.Shape getShape() + +CLSS public final com.oracle.truffle.api.object.FinalLocationException +cons public init() +supr com.oracle.truffle.api.nodes.SlowPathException +hfds serialVersionUID + +CLSS public final com.oracle.truffle.api.object.HiddenKey +cons public init(java.lang.String) +meth public java.lang.String getName() +meth public java.lang.String toString() +supr java.lang.Object +hfds name + +CLSS public final com.oracle.truffle.api.object.IncompatibleLocationException +cons public init() +supr com.oracle.truffle.api.nodes.SlowPathException +hfds serialVersionUID + +CLSS public abstract interface com.oracle.truffle.api.object.IntLocation +intf com.oracle.truffle.api.object.TypedLocation +meth public abstract int getInt(com.oracle.truffle.api.object.DynamicObject,boolean) +meth public abstract int getInt(com.oracle.truffle.api.object.DynamicObject,com.oracle.truffle.api.object.Shape) +meth public abstract java.lang.Class getType() +meth public abstract void setInt(com.oracle.truffle.api.object.DynamicObject,int) throws com.oracle.truffle.api.object.FinalLocationException +meth public abstract void setInt(com.oracle.truffle.api.object.DynamicObject,int,com.oracle.truffle.api.object.Shape) throws com.oracle.truffle.api.object.FinalLocationException +meth public abstract void setInt(com.oracle.truffle.api.object.DynamicObject,int,com.oracle.truffle.api.object.Shape,com.oracle.truffle.api.object.Shape) + +CLSS public abstract com.oracle.truffle.api.object.Layout +cons public init() +fld public final static java.lang.String OPTION_PREFIX = "truffle.object." +innr public final static !enum ImplicitCast +innr public final static Builder +meth protected static com.oracle.truffle.api.object.LayoutFactory getFactory() +meth protected static java.util.EnumSet getAllowedImplicitCasts(com.oracle.truffle.api.object.Layout$Builder) +meth public abstract com.oracle.truffle.api.object.DynamicObject newInstance(com.oracle.truffle.api.object.Shape) +meth public abstract com.oracle.truffle.api.object.Shape createShape(com.oracle.truffle.api.object.ObjectType) +meth public abstract com.oracle.truffle.api.object.Shape createShape(com.oracle.truffle.api.object.ObjectType,java.lang.Object) +meth public abstract com.oracle.truffle.api.object.Shape createShape(com.oracle.truffle.api.object.ObjectType,java.lang.Object,int) +meth public abstract com.oracle.truffle.api.object.Shape$Allocator createAllocator() +meth public abstract java.lang.Class getType() +meth public static com.oracle.truffle.api.object.Layout createLayout() +meth public static com.oracle.truffle.api.object.Layout$Builder newLayout() +supr java.lang.Object +hfds LAYOUT_FACTORY + +CLSS public final static com.oracle.truffle.api.object.Layout$Builder + outer com.oracle.truffle.api.object.Layout +meth public com.oracle.truffle.api.object.Layout build() +meth public com.oracle.truffle.api.object.Layout$Builder addAllowedImplicitCast(com.oracle.truffle.api.object.Layout$ImplicitCast) +meth public com.oracle.truffle.api.object.Layout$Builder setAllowedImplicitCasts(java.util.EnumSet) +supr java.lang.Object +hfds allowedImplicitCasts + +CLSS public final static !enum com.oracle.truffle.api.object.Layout$ImplicitCast + outer com.oracle.truffle.api.object.Layout +fld public final static com.oracle.truffle.api.object.Layout$ImplicitCast IntToDouble +fld public final static com.oracle.truffle.api.object.Layout$ImplicitCast IntToLong +meth public static com.oracle.truffle.api.object.Layout$ImplicitCast valueOf(java.lang.String) +meth public static com.oracle.truffle.api.object.Layout$ImplicitCast[] values() +supr java.lang.Enum + +CLSS public abstract interface com.oracle.truffle.api.object.LayoutFactory +meth public abstract com.oracle.truffle.api.object.Layout createLayout(com.oracle.truffle.api.object.Layout$Builder) +meth public abstract com.oracle.truffle.api.object.Property createProperty(java.lang.Object,com.oracle.truffle.api.object.Location) +meth public abstract com.oracle.truffle.api.object.Property createProperty(java.lang.Object,com.oracle.truffle.api.object.Location,int) +meth public abstract int getPriority() + +CLSS public abstract com.oracle.truffle.api.object.Location +cons public init() +meth protected abstract java.lang.Object getInternal(com.oracle.truffle.api.object.DynamicObject) +meth protected abstract void setInternal(com.oracle.truffle.api.object.DynamicObject,java.lang.Object) throws com.oracle.truffle.api.object.IncompatibleLocationException +meth protected static boolean checkShape(com.oracle.truffle.api.object.DynamicObject,com.oracle.truffle.api.object.Shape) +meth protected static com.oracle.truffle.api.object.FinalLocationException finalLocation() throws com.oracle.truffle.api.object.FinalLocationException +meth protected static com.oracle.truffle.api.object.IncompatibleLocationException incompatibleLocation() throws com.oracle.truffle.api.object.IncompatibleLocationException +meth public abstract boolean equals(java.lang.Object) +meth public abstract int hashCode() +meth public boolean canSet(com.oracle.truffle.api.object.DynamicObject,java.lang.Object) +meth public boolean canSet(java.lang.Object) +meth public boolean canStore(java.lang.Object) +meth public boolean isConstant() +meth public boolean isFinal() +meth public final java.lang.Object get(com.oracle.truffle.api.object.DynamicObject) +meth public final java.lang.Object get(com.oracle.truffle.api.object.DynamicObject,com.oracle.truffle.api.object.Shape) +meth public final void set(com.oracle.truffle.api.object.DynamicObject,java.lang.Object) throws com.oracle.truffle.api.object.FinalLocationException,com.oracle.truffle.api.object.IncompatibleLocationException +meth public final void set(com.oracle.truffle.api.object.DynamicObject,java.lang.Object,com.oracle.truffle.api.object.Shape,com.oracle.truffle.api.object.Shape) throws com.oracle.truffle.api.object.IncompatibleLocationException +meth public java.lang.Object get(com.oracle.truffle.api.object.DynamicObject,boolean) +meth public void set(com.oracle.truffle.api.object.DynamicObject,java.lang.Object,com.oracle.truffle.api.object.Shape) throws com.oracle.truffle.api.object.FinalLocationException,com.oracle.truffle.api.object.IncompatibleLocationException +supr java.lang.Object + +CLSS public abstract interface com.oracle.truffle.api.object.LocationFactory +meth public abstract com.oracle.truffle.api.object.Location createLocation(com.oracle.truffle.api.object.Shape,java.lang.Object) + +CLSS public final !enum com.oracle.truffle.api.object.LocationModifier +fld public final static com.oracle.truffle.api.object.LocationModifier Final +fld public final static com.oracle.truffle.api.object.LocationModifier NonNull +meth public static com.oracle.truffle.api.object.LocationModifier valueOf(java.lang.String) +meth public static com.oracle.truffle.api.object.LocationModifier[] values() +supr java.lang.Enum + +CLSS public abstract interface com.oracle.truffle.api.object.LongLocation +intf com.oracle.truffle.api.object.TypedLocation +meth public abstract java.lang.Class getType() +meth public abstract long getLong(com.oracle.truffle.api.object.DynamicObject,boolean) +meth public abstract long getLong(com.oracle.truffle.api.object.DynamicObject,com.oracle.truffle.api.object.Shape) +meth public abstract void setLong(com.oracle.truffle.api.object.DynamicObject,long) throws com.oracle.truffle.api.object.FinalLocationException +meth public abstract void setLong(com.oracle.truffle.api.object.DynamicObject,long,com.oracle.truffle.api.object.Shape) throws com.oracle.truffle.api.object.FinalLocationException +meth public abstract void setLong(com.oracle.truffle.api.object.DynamicObject,long,com.oracle.truffle.api.object.Shape,com.oracle.truffle.api.object.Shape) + +CLSS public abstract interface com.oracle.truffle.api.object.ObjectLocation +intf com.oracle.truffle.api.object.TypedLocation +meth public abstract boolean isNonNull() +meth public abstract java.lang.Class getType() + +CLSS public com.oracle.truffle.api.object.ObjectType +cons public init() +meth public boolean equals(com.oracle.truffle.api.object.DynamicObject,java.lang.Object) +meth public com.oracle.truffle.api.interop.ForeignAccess getForeignAccessFactory() +meth public int hashCode(com.oracle.truffle.api.object.DynamicObject) +meth public java.lang.Object createShapeData(com.oracle.truffle.api.object.Shape) +meth public java.lang.String toString(com.oracle.truffle.api.object.DynamicObject) +supr java.lang.Object + +CLSS public abstract com.oracle.truffle.api.object.Property +cons protected init() +meth public abstract boolean isHidden() +meth public abstract boolean isSame(com.oracle.truffle.api.object.Property) +meth public abstract boolean isShadow() +meth public abstract com.oracle.truffle.api.object.Location getLocation() +meth public abstract com.oracle.truffle.api.object.Property copyWithFlags(int) +meth public abstract com.oracle.truffle.api.object.Property copyWithRelocatable(boolean) +meth public abstract com.oracle.truffle.api.object.Property relocate(com.oracle.truffle.api.object.Location) +meth public abstract int getFlags() +meth public abstract java.lang.Object get(com.oracle.truffle.api.object.DynamicObject,boolean) +meth public abstract java.lang.Object get(com.oracle.truffle.api.object.DynamicObject,com.oracle.truffle.api.object.Shape) +meth public abstract java.lang.Object getKey() +meth public abstract void set(com.oracle.truffle.api.object.DynamicObject,java.lang.Object,com.oracle.truffle.api.object.Shape) throws com.oracle.truffle.api.object.FinalLocationException,com.oracle.truffle.api.object.IncompatibleLocationException +meth public abstract void set(com.oracle.truffle.api.object.DynamicObject,java.lang.Object,com.oracle.truffle.api.object.Shape,com.oracle.truffle.api.object.Shape) throws com.oracle.truffle.api.object.IncompatibleLocationException +meth public abstract void setGeneric(com.oracle.truffle.api.object.DynamicObject,java.lang.Object,com.oracle.truffle.api.object.Shape) +meth public abstract void setGeneric(com.oracle.truffle.api.object.DynamicObject,java.lang.Object,com.oracle.truffle.api.object.Shape,com.oracle.truffle.api.object.Shape) +meth public abstract void setInternal(com.oracle.truffle.api.object.DynamicObject,java.lang.Object) +meth public abstract void setSafe(com.oracle.truffle.api.object.DynamicObject,java.lang.Object,com.oracle.truffle.api.object.Shape) +meth public abstract void setSafe(com.oracle.truffle.api.object.DynamicObject,java.lang.Object,com.oracle.truffle.api.object.Shape,com.oracle.truffle.api.object.Shape) +meth public static com.oracle.truffle.api.object.Property create(java.lang.Object,com.oracle.truffle.api.object.Location,int) +supr java.lang.Object + +CLSS public abstract com.oracle.truffle.api.object.Shape +cons public init() +innr public abstract interface static Pred +innr public abstract static Allocator +meth public abstract boolean check(com.oracle.truffle.api.object.DynamicObject) +meth public abstract boolean hasProperty(java.lang.Object) +meth public abstract boolean hasTransitionWithKey(java.lang.Object) +meth public abstract boolean isLeaf() +meth public abstract boolean isRelated(com.oracle.truffle.api.object.Shape) +meth public abstract boolean isValid() +meth public abstract com.oracle.truffle.api.Assumption getLeafAssumption() +meth public abstract com.oracle.truffle.api.Assumption getValidAssumption() +meth public abstract com.oracle.truffle.api.object.DynamicObject newInstance() +meth public abstract com.oracle.truffle.api.object.DynamicObjectFactory createFactory() +meth public abstract com.oracle.truffle.api.object.Layout getLayout() +meth public abstract com.oracle.truffle.api.object.ObjectType getObjectType() +meth public abstract com.oracle.truffle.api.object.Property getLastProperty() +meth public abstract com.oracle.truffle.api.object.Property getProperty(java.lang.Object) +meth public abstract com.oracle.truffle.api.object.Shape addProperty(com.oracle.truffle.api.object.Property) +meth public abstract com.oracle.truffle.api.object.Shape append(com.oracle.truffle.api.object.Property) +meth public abstract com.oracle.truffle.api.object.Shape changeType(com.oracle.truffle.api.object.ObjectType) +meth public abstract com.oracle.truffle.api.object.Shape createSeparateShape(java.lang.Object) +meth public abstract com.oracle.truffle.api.object.Shape defineProperty(java.lang.Object,java.lang.Object,int) +meth public abstract com.oracle.truffle.api.object.Shape defineProperty(java.lang.Object,java.lang.Object,int,com.oracle.truffle.api.object.LocationFactory) +meth public abstract com.oracle.truffle.api.object.Shape getParent() +meth public abstract com.oracle.truffle.api.object.Shape getRoot() +meth public abstract com.oracle.truffle.api.object.Shape removeProperty(com.oracle.truffle.api.object.Property) +meth public abstract com.oracle.truffle.api.object.Shape replaceProperty(com.oracle.truffle.api.object.Property,com.oracle.truffle.api.object.Property) +meth public abstract com.oracle.truffle.api.object.Shape reservePrimitiveExtensionArray() +meth public abstract com.oracle.truffle.api.object.Shape tryMerge(com.oracle.truffle.api.object.Shape) +meth public abstract com.oracle.truffle.api.object.Shape$Allocator allocator() +meth public abstract int getId() +meth public abstract int getPropertyCount() +meth public abstract java.lang.Iterable getProperties() +meth public abstract java.lang.Iterable getKeys() +meth public abstract java.lang.Object getData() +meth public abstract java.lang.Object getMutex() +meth public abstract java.lang.Object getSharedData() +meth public abstract java.util.List getPropertyList() +meth public abstract java.util.List getPropertyList(com.oracle.truffle.api.object.Shape$Pred) +meth public abstract java.util.List getPropertyListInternal(boolean) +meth public abstract java.util.List getKeyList() +meth public abstract java.util.List getKeyList(com.oracle.truffle.api.object.Shape$Pred) +supr java.lang.Object + +CLSS public abstract static com.oracle.truffle.api.object.Shape$Allocator + outer com.oracle.truffle.api.object.Shape +cons public init() +meth protected abstract com.oracle.truffle.api.object.Location locationForType(java.lang.Class,boolean,boolean) +meth protected abstract com.oracle.truffle.api.object.Location locationForValue(java.lang.Object,boolean,boolean) +meth public abstract com.oracle.truffle.api.object.Location constantLocation(java.lang.Object) +meth public abstract com.oracle.truffle.api.object.Location declaredLocation(java.lang.Object) +meth public abstract com.oracle.truffle.api.object.Shape$Allocator addLocation(com.oracle.truffle.api.object.Location) +meth public abstract com.oracle.truffle.api.object.Shape$Allocator copy() +meth public final com.oracle.truffle.api.object.Location locationForType(java.lang.Class) +meth public final com.oracle.truffle.api.object.Location locationForType(java.lang.Class,java.util.EnumSet) +meth public final com.oracle.truffle.api.object.Location locationForValue(java.lang.Object) +meth public final com.oracle.truffle.api.object.Location locationForValue(java.lang.Object,java.util.EnumSet) +supr java.lang.Object + +CLSS public abstract interface static com.oracle.truffle.api.object.Shape$Pred<%0 extends java.lang.Object> + outer com.oracle.truffle.api.object.Shape +meth public abstract boolean test({com.oracle.truffle.api.object.Shape$Pred%0}) + +CLSS public abstract interface com.oracle.truffle.api.object.ShapeListener +meth public abstract void onPropertyTransition(java.lang.Object) + +CLSS public abstract interface com.oracle.truffle.api.object.TypedLocation +meth public abstract java.lang.Class getType() +meth public abstract java.lang.Object get(com.oracle.truffle.api.object.DynamicObject,boolean) +meth public abstract java.lang.Object get(com.oracle.truffle.api.object.DynamicObject,com.oracle.truffle.api.object.Shape) +meth public abstract void set(com.oracle.truffle.api.object.DynamicObject,java.lang.Object) throws com.oracle.truffle.api.object.FinalLocationException,com.oracle.truffle.api.object.IncompatibleLocationException +meth public abstract void set(com.oracle.truffle.api.object.DynamicObject,java.lang.Object,com.oracle.truffle.api.object.Shape) throws com.oracle.truffle.api.object.FinalLocationException,com.oracle.truffle.api.object.IncompatibleLocationException +meth public abstract void set(com.oracle.truffle.api.object.DynamicObject,java.lang.Object,com.oracle.truffle.api.object.Shape,com.oracle.truffle.api.object.Shape) throws com.oracle.truffle.api.object.IncompatibleLocationException + +CLSS public abstract interface java.io.Serializable + +CLSS public abstract interface java.lang.Comparable<%0 extends java.lang.Object> +meth public abstract int compareTo({java.lang.Comparable%0}) + +CLSS public abstract java.lang.Enum<%0 extends java.lang.Enum<{java.lang.Enum%0}>> +cons protected init(java.lang.String,int) +intf java.io.Serializable +intf java.lang.Comparable<{java.lang.Enum%0}> +meth protected final java.lang.Object clone() throws java.lang.CloneNotSupportedException +meth protected final void finalize() +meth public final boolean equals(java.lang.Object) +meth public final int compareTo({java.lang.Enum%0}) +meth public final int hashCode() +meth public final int ordinal() +meth public final java.lang.Class<{java.lang.Enum%0}> getDeclaringClass() +meth public final java.lang.String name() +meth public java.lang.String toString() +meth public static <%0 extends java.lang.Enum<{%%0}>> {%%0} valueOf(java.lang.Class<{%%0}>,java.lang.String) +supr java.lang.Object +hfds name,ordinal + +CLSS public java.lang.Exception +cons protected init(java.lang.String,java.lang.Throwable,boolean,boolean) +cons public init() +cons public init(java.lang.String) +cons public init(java.lang.String,java.lang.Throwable) +cons public init(java.lang.Throwable) +supr java.lang.Throwable +hfds serialVersionUID + +CLSS public java.lang.Object +cons public init() +meth protected java.lang.Object clone() throws java.lang.CloneNotSupportedException +meth protected void finalize() throws java.lang.Throwable +meth public boolean equals(java.lang.Object) +meth public final java.lang.Class getClass() +meth public final void notify() +meth public final void notifyAll() +meth public final void wait() throws java.lang.InterruptedException +meth public final void wait(long) throws java.lang.InterruptedException +meth public final void wait(long,int) throws java.lang.InterruptedException +meth public int hashCode() +meth public java.lang.String toString() + +CLSS public java.lang.Throwable +cons protected init(java.lang.String,java.lang.Throwable,boolean,boolean) +cons public init() +cons public init(java.lang.String) +cons public init(java.lang.String,java.lang.Throwable) +cons public init(java.lang.Throwable) +intf java.io.Serializable +meth public final java.lang.Throwable[] getSuppressed() +meth public final void addSuppressed(java.lang.Throwable) +meth public java.lang.StackTraceElement[] getStackTrace() +meth public java.lang.String getLocalizedMessage() +meth public java.lang.String getMessage() +meth public java.lang.String toString() +meth public java.lang.Throwable fillInStackTrace() +meth public java.lang.Throwable getCause() +meth public java.lang.Throwable initCause(java.lang.Throwable) +meth public void printStackTrace() +meth public void printStackTrace(java.io.PrintStream) +meth public void printStackTrace(java.io.PrintWriter) +meth public void setStackTrace(java.lang.StackTraceElement[]) +supr java.lang.Object +hfds CAUSE_CAPTION,EMPTY_THROWABLE_ARRAY,NULL_CAUSE_MESSAGE,SELF_SUPPRESSION_MESSAGE,SUPPRESSED_CAPTION,SUPPRESSED_SENTINEL,UNASSIGNED_STACK,backtrace,cause,detailMessage,serialVersionUID,stackTrace,suppressedExceptions +hcls PrintStreamOrWriter,SentinelHolder,WrappedPrintStream,WrappedPrintWriter + diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/source/SourceSectionTest.java --- a/truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/source/SourceSectionTest.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/source/SourceSectionTest.java Thu Nov 26 10:02:03 2015 +0100 @@ -38,7 +38,7 @@ private final Source shortSource = Source.fromText("01", null); - private final Source longSource = Source.fromText("01234\n67\n9\n", null); + private final Source longSource = Source.fromText("01234\n67\n9\n", "long"); public void emptySourceTest0() { SourceSection section = emptySource.createSection("test", 0, 0); @@ -84,4 +84,47 @@ assertEquals(section.getCode(), ""); } + @Test + public void testGetCode() { + assertEquals("01234", longSource.createSection("test", 0, 5).getCode()); + assertEquals("67", longSource.createSection("test", 6, 2).getCode()); + assertEquals("9", longSource.createSection("test", 9, 1).getCode()); + } + + @Test + public void testGetShortDescription() { + assertEquals("long:1", longSource.createSection("test", 0, 5).getShortDescription()); + assertEquals("long:2", longSource.createSection("test", 6, 2).getShortDescription()); + assertEquals("long:3", longSource.createSection("test", 9, 1).getShortDescription()); + } + + @Test(expected = IllegalArgumentException.class) + public void testOutOfRange1() { + longSource.createSection("test", 9, 5); + } + + @Test(expected = IllegalArgumentException.class) + public void testOutOfRange2() { + longSource.createSection("test", -1, 1); + } + + @Test(expected = IllegalArgumentException.class) + public void testOutOfRange3() { + longSource.createSection("test", 1, -1); + } + + @Test(expected = IllegalArgumentException.class) + public void testOutOfRange4() { + longSource.createSection("test", 3, 1, 9, 5); + } + + @Test(expected = IllegalArgumentException.class) + public void testOutOfRange5() { + longSource.createSection("test", 1, 1, -1, 1); + } + + @Test(expected = IllegalArgumentException.class) + public void testOutOfRange6() { + longSource.createSection("test", 1, 1, 1, -1); + } } diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/vm/EngineTest.java --- a/truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/vm/EngineTest.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/vm/EngineTest.java Thu Nov 26 10:02:03 2015 +0100 @@ -24,8 +24,10 @@ import com.oracle.truffle.api.source.Source; import com.oracle.truffle.api.vm.PolyglotEngine; +import java.io.IOException; import java.util.List; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; @@ -47,6 +49,42 @@ assertNotNull(res); } + @Test + public void checkCachingOfNodes() throws IOException { + PolyglotEngine vm1 = createBuilder().build(); + PolyglotEngine vm2 = createBuilder().build(); + + PolyglotEngine.Language language1 = vm1.getLanguages().get("application/x-test-hash"); + PolyglotEngine.Language language2 = vm2.getLanguages().get("application/x-test-hash"); + PolyglotEngine.Language alt1 = vm1.getLanguages().get("application/x-test-hash-alt"); + PolyglotEngine.Language alt2 = vm2.getLanguages().get("application/x-test-hash-alt"); + final Source sharedSource = Source.fromText("anything", "something"); + + Object hashIn1Round1 = language1.eval(sharedSource).get(); + Object hashIn2Round1 = language2.eval(sharedSource).get(); + Object hashIn1Round2 = language1.eval(sharedSource).get(); + Object hashIn2Round2 = language2.eval(sharedSource).get(); + + Object altIn1Round1 = alt1.eval(sharedSource).get(); + Object altIn2Round1 = alt2.eval(sharedSource).get(); + Object altIn1Round2 = alt1.eval(sharedSource).get(); + Object altIn2Round2 = alt2.eval(sharedSource).get(); + + assertEquals("Two executions in 1st engine share the nodes", hashIn1Round1, hashIn1Round2); + assertEquals("Two executions in 2nd engine share the nodes", hashIn2Round1, hashIn2Round2); + + assertEquals("Two alternative executions in 1st engine share the nodes", altIn1Round1, altIn1Round2); + assertEquals("Two alternative executions in 2nd engine share the nodes", altIn2Round1, altIn2Round2); + + assertNotEquals("Two executions in different languages don't share the nodes", hashIn1Round1, altIn1Round1); + assertNotEquals("Two executions in different languages don't share the nodes", hashIn1Round1, altIn2Round1); + assertNotEquals("Two executions in different languages don't share the nodes", hashIn2Round2, altIn1Round2); + assertNotEquals("Two executions in different languages don't share the nodes", hashIn2Round2, altIn2Round2); + + assertNotEquals("Two executions in different engines don't share the nodes", hashIn1Round1, hashIn2Round1); + assertNotEquals("Two executions in different engines don't share the nodes", hashIn2Round2, hashIn1Round2); + } + protected Thread forbiddenThread() { return null; } diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/vm/HashLanguage.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/vm/HashLanguage.java Thu Nov 26 10:02:03 2015 +0100 @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.truffle.api.test.vm; + +import com.oracle.truffle.api.CallTarget; +import com.oracle.truffle.api.Truffle; +import com.oracle.truffle.api.TruffleLanguage; +import com.oracle.truffle.api.TruffleLanguage.Env; +import com.oracle.truffle.api.frame.MaterializedFrame; +import com.oracle.truffle.api.frame.VirtualFrame; +import com.oracle.truffle.api.instrument.Visualizer; +import com.oracle.truffle.api.instrument.WrapperNode; +import com.oracle.truffle.api.nodes.Node; +import com.oracle.truffle.api.nodes.RootNode; +import com.oracle.truffle.api.source.Source; +import java.io.IOException; + +@TruffleLanguage.Registration(name = "Hash", mimeType = "application/x-test-hash", version = "1.0") +public class HashLanguage extends TruffleLanguage { + public static final HashLanguage INSTANCE = new HashLanguage(); + + @Override + protected Env createContext(Env env) { + return env; + } + + @Override + protected CallTarget parse(Source code, Node context, String... argumentNames) throws IOException { + return Truffle.getRuntime().createCallTarget(new HashNode(this, code)); + } + + @Override + protected Object findExportedSymbol(Env context, String globalName, boolean onlyExplicit) { + return null; + } + + @Override + protected Object getLanguageGlobal(Env context) { + return null; + } + + @Override + protected boolean isObjectOfLanguage(Object object) { + return false; + } + + @Override + protected Visualizer getVisualizer() { + return null; + } + + @Override + protected boolean isInstrumentable(Node node) { + return false; + } + + @Override + protected WrapperNode createWrapperNode(Node node) { + throw new UnsupportedOperationException(); + } + + @Override + protected Object evalInContext(Source source, Node node, MaterializedFrame mFrame) throws IOException { + throw new UnsupportedOperationException("Not supported yet."); // To change body of + // generated methods, choose + // Tools | Templates. + } + + private static class HashNode extends RootNode { + private static int counter; + private final Source code; + private final int id; + + public HashNode(HashLanguage hash, Source code) { + super(hash.getClass(), null, null); + this.code = code; + id = ++counter; + } + + @Override + public Object execute(VirtualFrame frame) { + return System.identityHashCode(this) + "@" + code.getCode() + " @ " + id; + } + } + + @TruffleLanguage.Registration(name = "AltHash", mimeType = "application/x-test-hash-alt", version = "1.0") + public static final class SubLang extends HashLanguage { + public static final SubLang INSTANCE = new SubLang(); + } +} diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api.vm/snapshot.sigtest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/truffle/com.oracle.truffle.api.vm/snapshot.sigtest Thu Nov 26 10:02:03 2015 +0100 @@ -0,0 +1,142 @@ +#Signature file v4.1 +#Version + +CLSS public abstract com.oracle.truffle.api.vm.EventConsumer<%0 extends java.lang.Object> +cons public init(java.lang.Class<{com.oracle.truffle.api.vm.EventConsumer%0}>) +meth protected abstract void on({com.oracle.truffle.api.vm.EventConsumer%0}) +supr java.lang.Object +hfds type + +CLSS public com.oracle.truffle.api.vm.IncompleteSourceException +cons public init() +cons public init(java.lang.Throwable) +supr java.io.IOException + +CLSS public com.oracle.truffle.api.vm.PolyglotEngine +innr public Builder +innr public Language +innr public Value +meth public com.oracle.truffle.api.vm.PolyglotEngine$Value eval(com.oracle.truffle.api.source.Source) throws java.io.IOException +meth public com.oracle.truffle.api.vm.PolyglotEngine$Value findGlobalSymbol(java.lang.String) +meth public java.util.Map getLanguages() +meth public static com.oracle.truffle.api.vm.PolyglotEngine$Builder buildNew() +meth public void dispose() +supr java.lang.Object +hfds JAVA_INTEROP_ENABLED,LOG,SPI,debugger,disposed,err,executor,globals,handlers,in,initThread,instrumenter,langs,out +hcls SPIAccessor + +CLSS public com.oracle.truffle.api.vm.PolyglotEngine$Builder + outer com.oracle.truffle.api.vm.PolyglotEngine +meth public com.oracle.truffle.api.vm.PolyglotEngine build() +meth public com.oracle.truffle.api.vm.PolyglotEngine$Builder executor(java.util.concurrent.Executor) +meth public com.oracle.truffle.api.vm.PolyglotEngine$Builder globalSymbol(java.lang.String,java.lang.Object) +meth public com.oracle.truffle.api.vm.PolyglotEngine$Builder onEvent(com.oracle.truffle.api.vm.EventConsumer) +meth public com.oracle.truffle.api.vm.PolyglotEngine$Builder setErr(java.io.OutputStream) +meth public com.oracle.truffle.api.vm.PolyglotEngine$Builder setIn(java.io.InputStream) +meth public com.oracle.truffle.api.vm.PolyglotEngine$Builder setOut(java.io.OutputStream) +supr java.lang.Object +hfds err,executor,globals,handlers,in,out + +CLSS public com.oracle.truffle.api.vm.PolyglotEngine$Language + outer com.oracle.truffle.api.vm.PolyglotEngine +meth public com.oracle.truffle.api.vm.PolyglotEngine$Value eval(com.oracle.truffle.api.source.Source) throws java.io.IOException +meth public com.oracle.truffle.api.vm.PolyglotEngine$Value getGlobalObject() +meth public java.lang.String getName() +meth public java.lang.String getVersion() +meth public java.lang.String toString() +meth public java.util.Set getMimeTypes() +supr java.lang.Object +hfds env,info + +CLSS public com.oracle.truffle.api.vm.PolyglotEngine$Value + outer com.oracle.truffle.api.vm.PolyglotEngine +meth public !varargs com.oracle.truffle.api.vm.PolyglotEngine$Value invoke(java.lang.Object,java.lang.Object[]) throws java.io.IOException +meth public <%0 extends java.lang.Object> {%%0} as(java.lang.Class<{%%0}>) throws java.io.IOException +meth public java.lang.Object get() throws java.io.IOException +meth public java.lang.String toString() +supr java.lang.Object +hfds language,ready,result,target + +CLSS public java.io.IOException +cons public init() +cons public init(java.lang.String) +cons public init(java.lang.String,java.lang.Throwable) +cons public init(java.lang.Throwable) +supr java.lang.Exception +hfds serialVersionUID + +CLSS public abstract interface java.io.Serializable + +CLSS public java.lang.Exception +cons protected init(java.lang.String,java.lang.Throwable,boolean,boolean) +cons public init() +cons public init(java.lang.String) +cons public init(java.lang.String,java.lang.Throwable) +cons public init(java.lang.Throwable) +supr java.lang.Throwable +hfds serialVersionUID + +CLSS public java.lang.Object +cons public init() +meth protected java.lang.Object clone() throws java.lang.CloneNotSupportedException +meth protected void finalize() throws java.lang.Throwable +meth public boolean equals(java.lang.Object) +meth public final java.lang.Class getClass() +meth public final void notify() +meth public final void notifyAll() +meth public final void wait() throws java.lang.InterruptedException +meth public final void wait(long) throws java.lang.InterruptedException +meth public final void wait(long,int) throws java.lang.InterruptedException +meth public int hashCode() +meth public java.lang.String toString() + +CLSS public java.lang.Throwable +cons protected init(java.lang.String,java.lang.Throwable,boolean,boolean) +cons public init() +cons public init(java.lang.String) +cons public init(java.lang.String,java.lang.Throwable) +cons public init(java.lang.Throwable) +intf java.io.Serializable +meth public final java.lang.Throwable[] getSuppressed() +meth public final void addSuppressed(java.lang.Throwable) +meth public java.lang.StackTraceElement[] getStackTrace() +meth public java.lang.String getLocalizedMessage() +meth public java.lang.String getMessage() +meth public java.lang.String toString() +meth public java.lang.Throwable fillInStackTrace() +meth public java.lang.Throwable getCause() +meth public java.lang.Throwable initCause(java.lang.Throwable) +meth public void printStackTrace() +meth public void printStackTrace(java.io.PrintStream) +meth public void printStackTrace(java.io.PrintWriter) +meth public void setStackTrace(java.lang.StackTraceElement[]) +supr java.lang.Object +hfds CAUSE_CAPTION,EMPTY_THROWABLE_ARRAY,NULL_CAUSE_MESSAGE,SELF_SUPPRESSION_MESSAGE,SUPPRESSED_CAPTION,SUPPRESSED_SENTINEL,UNASSIGNED_STACK,backtrace,cause,detailMessage,serialVersionUID,stackTrace,suppressedExceptions +hcls PrintStreamOrWriter,SentinelHolder,WrappedPrintStream,WrappedPrintWriter + +CLSS public abstract interface java.lang.annotation.Annotation +meth public abstract boolean equals(java.lang.Object) +meth public abstract int hashCode() +meth public abstract java.lang.Class annotationType() +meth public abstract java.lang.String toString() + +CLSS public abstract interface !annotation java.lang.annotation.Documented + anno 0 java.lang.annotation.Documented() + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE]) +intf java.lang.annotation.Annotation + +CLSS public abstract interface !annotation java.lang.annotation.Retention + anno 0 java.lang.annotation.Documented() + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.annotation.RetentionPolicy value() + +CLSS public abstract interface !annotation java.lang.annotation.Target + anno 0 java.lang.annotation.Documented() + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.annotation.ElementType[] value() + diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api.vm/src/com/oracle/truffle/api/vm/PolyglotEngine.java --- a/truffle/com.oracle.truffle.api.vm/src/com/oracle/truffle/api/vm/PolyglotEngine.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api.vm/src/com/oracle/truffle/api/vm/PolyglotEngine.java Thu Nov 26 10:02:03 2015 +0100 @@ -61,6 +61,7 @@ import com.oracle.truffle.api.nodes.Node; import com.oracle.truffle.api.nodes.RootNode; import com.oracle.truffle.api.source.Source; +import java.util.WeakHashMap; import java.util.logging.Level; /** @@ -422,7 +423,7 @@ try (Closeable d = SPI.executionStart(this, -1, debugger, s)) { TruffleLanguage langImpl = l.getImpl(true); fillLang[0] = langImpl; - return SPI.eval(langImpl, s); + return SPI.eval(langImpl, s, l.cache); } } @@ -724,10 +725,12 @@ * {@link PolyglotEngine#eval(com.oracle.truffle.api.source.Source) a code is evaluated} in it. */ public class Language { + private final Map cache; private final LanguageCache info; private TruffleLanguage.Env env; Language(LanguageCache info) { + this.cache = new WeakHashMap<>(); this.info = info; } @@ -885,8 +888,8 @@ } @Override - public Object eval(TruffleLanguage l, Source s) throws IOException { - return super.eval(l, s); + protected Object eval(TruffleLanguage l, Source s, Map cache) throws IOException { + return super.eval(l, s, cache); } @Override diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api/snapshot.sigtest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/truffle/com.oracle.truffle.api/snapshot.sigtest Thu Nov 26 10:02:03 2015 +0100 @@ -0,0 +1,1236 @@ +#Signature file v4.1 +#Version + +CLSS public abstract interface com.oracle.truffle.api.Assumption +meth public abstract boolean isValid() +meth public abstract java.lang.String getName() +meth public abstract void check() throws com.oracle.truffle.api.nodes.InvalidAssumptionException +meth public abstract void invalidate() + +CLSS public abstract interface com.oracle.truffle.api.CallTarget +meth public abstract !varargs java.lang.Object call(java.lang.Object[]) + +CLSS public final com.oracle.truffle.api.CompilerAsserts +meth public static <%0 extends java.lang.Object> void compilationConstant(java.lang.Object) +meth public static <%0 extends java.lang.Object> void partialEvaluationConstant(java.lang.Object) +meth public static void neverPartOfCompilation() +meth public static void neverPartOfCompilation(java.lang.String) +supr java.lang.Object + +CLSS public final com.oracle.truffle.api.CompilerDirectives +cons public init() +fld public final static double FASTPATH_PROBABILITY = 0.9999 +fld public final static double LIKELY_PROBABILITY = 0.75 +fld public final static double SLOWPATH_PROBABILITY = 1.0E-4 +fld public final static double UNLIKELY_PROBABILITY = 0.25 +innr public abstract interface static !annotation CompilationFinal +innr public abstract interface static !annotation TruffleBoundary +innr public abstract interface static !annotation ValueType +meth public static <%0 extends java.lang.Object> {%%0} interpreterOnly(java.util.concurrent.Callable<{%%0}>) throws java.lang.Exception +meth public static boolean inCompiledCode() +meth public static boolean inInterpreter() +meth public static boolean injectBranchProbability(double,boolean) +meth public static boolean isCompilationConstant(java.lang.Object) +meth public static boolean isPartialEvaluationConstant(java.lang.Object) +meth public static void bailout(java.lang.String) +meth public static void ensureVirtualized(java.lang.Object) +meth public static void ensureVirtualizedHere(java.lang.Object) +meth public static void interpreterOnly(java.lang.Runnable) +meth public static void materialize(java.lang.Object) +meth public static void transferToInterpreter() +meth public static void transferToInterpreterAndInvalidate() +supr java.lang.Object + +CLSS public abstract interface static !annotation com.oracle.truffle.api.CompilerDirectives$CompilationFinal + outer com.oracle.truffle.api.CompilerDirectives + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[FIELD]) +intf java.lang.annotation.Annotation + +CLSS public abstract interface static !annotation com.oracle.truffle.api.CompilerDirectives$TruffleBoundary + outer com.oracle.truffle.api.CompilerDirectives + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD, CONSTRUCTOR]) +intf java.lang.annotation.Annotation +meth public abstract !hasdefault boolean throwsControlFlowException() + +CLSS public abstract interface static !annotation com.oracle.truffle.api.CompilerDirectives$ValueType + outer com.oracle.truffle.api.CompilerDirectives + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE]) +intf java.lang.annotation.Annotation + +CLSS public abstract interface com.oracle.truffle.api.CompilerOptions +meth public abstract boolean supportsOption(java.lang.String) +meth public abstract void setOption(java.lang.String,java.lang.Object) + +CLSS public com.oracle.truffle.api.ExactMath +cons public init() +meth public static int addExact(int,int) +meth public static int multiplyExact(int,int) +meth public static int multiplyHigh(int,int) +meth public static int multiplyHighUnsigned(int,int) +meth public static int subtractExact(int,int) +meth public static long addExact(long,long) +meth public static long multiplyExact(long,long) +meth public static long multiplyHigh(long,long) +meth public static long multiplyHighUnsigned(long,long) +meth public static long subtractExact(long,long) +supr java.lang.Object + +CLSS public abstract com.oracle.truffle.api.ExecutionContext +cons protected init() +meth public com.oracle.truffle.api.CompilerOptions getCompilerOptions() +supr java.lang.Object + +CLSS public abstract interface com.oracle.truffle.api.LoopCountReceiver +meth public abstract void reportLoopCount(int) + +CLSS public com.oracle.truffle.api.OptimizationFailedException +cons public init(java.lang.Throwable,com.oracle.truffle.api.RootCallTarget) +meth public com.oracle.truffle.api.RootCallTarget getCallTarget() +supr java.lang.RuntimeException +hfds callTarget,serialVersionUID + +CLSS public abstract interface com.oracle.truffle.api.ReplaceObserver +meth public abstract boolean nodeReplaced(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.nodes.Node,java.lang.CharSequence) + +CLSS public abstract interface com.oracle.truffle.api.RootCallTarget +intf com.oracle.truffle.api.CallTarget +meth public abstract com.oracle.truffle.api.nodes.RootNode getRootNode() + +CLSS public com.oracle.truffle.api.Truffle +cons public init() +meth public static com.oracle.truffle.api.TruffleRuntime getRuntime() +supr java.lang.Object +hfds RUNTIME + +CLSS public abstract com.oracle.truffle.api.TruffleLanguage<%0 extends java.lang.Object> +cons protected init() +innr public abstract interface static !annotation Registration +innr public final static Env +meth protected abstract !varargs com.oracle.truffle.api.CallTarget parse(com.oracle.truffle.api.source.Source,com.oracle.truffle.api.nodes.Node,java.lang.String[]) throws java.io.IOException +meth protected abstract boolean isInstrumentable(com.oracle.truffle.api.nodes.Node) +meth protected abstract boolean isObjectOfLanguage(java.lang.Object) +meth protected abstract com.oracle.truffle.api.instrument.Visualizer getVisualizer() +meth protected abstract com.oracle.truffle.api.instrument.WrapperNode createWrapperNode(com.oracle.truffle.api.nodes.Node) +meth protected abstract java.lang.Object evalInContext(com.oracle.truffle.api.source.Source,com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.frame.MaterializedFrame) throws java.io.IOException +meth protected abstract java.lang.Object findExportedSymbol({com.oracle.truffle.api.TruffleLanguage%0},java.lang.String,boolean) +meth protected abstract java.lang.Object getLanguageGlobal({com.oracle.truffle.api.TruffleLanguage%0}) +meth protected abstract {com.oracle.truffle.api.TruffleLanguage%0} createContext(com.oracle.truffle.api.TruffleLanguage$Env) +meth protected final com.oracle.truffle.api.nodes.Node createFindContextNode() +meth protected final {com.oracle.truffle.api.TruffleLanguage%0} findContext(com.oracle.truffle.api.nodes.Node) +meth protected java.lang.String toString({com.oracle.truffle.api.TruffleLanguage%0},java.lang.Object) +meth protected void disposeContext({com.oracle.truffle.api.TruffleLanguage%0}) +supr java.lang.Object +hfds API,compiled +hcls AccessAPI,LangCtx + +CLSS public final static com.oracle.truffle.api.TruffleLanguage$Env + outer com.oracle.truffle.api.TruffleLanguage +meth public com.oracle.truffle.api.instrument.Instrumenter instrumenter() +meth public java.io.InputStream in() +meth public java.io.OutputStream err() +meth public java.io.OutputStream out() +meth public java.lang.Object importSymbol(java.lang.String) +supr java.lang.Object +hfds err,in,instrumenter,lang,langCtx,out,vm + +CLSS public abstract interface static !annotation com.oracle.truffle.api.TruffleLanguage$Registration + outer com.oracle.truffle.api.TruffleLanguage + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=SOURCE) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.String name() +meth public abstract java.lang.String version() +meth public abstract java.lang.String[] mimeType() + +CLSS public final com.oracle.truffle.api.TruffleOptions +fld public final static boolean DetailedRewriteReasons +fld public final static boolean TraceASTJSON +fld public final static boolean TraceRewrites +fld public static com.oracle.truffle.api.nodes.NodeCost TraceRewritesFilterFromCost +fld public static com.oracle.truffle.api.nodes.NodeCost TraceRewritesFilterToCost +fld public static java.lang.String TraceRewritesFilterClass +supr java.lang.Object + +CLSS public abstract interface com.oracle.truffle.api.TruffleRuntime +meth public abstract <%0 extends java.lang.Object> {%%0} getCapability(java.lang.Class<{%%0}>) +meth public abstract <%0 extends java.lang.Object> {%%0} iterateFrames(com.oracle.truffle.api.frame.FrameInstanceVisitor<{%%0}>) +meth public abstract com.oracle.truffle.api.Assumption createAssumption() +meth public abstract com.oracle.truffle.api.Assumption createAssumption(java.lang.String) +meth public abstract com.oracle.truffle.api.CompilerOptions createCompilerOptions() +meth public abstract com.oracle.truffle.api.RootCallTarget createCallTarget(com.oracle.truffle.api.nodes.RootNode) +meth public abstract com.oracle.truffle.api.frame.FrameInstance getCallerFrame() +meth public abstract com.oracle.truffle.api.frame.FrameInstance getCurrentFrame() +meth public abstract com.oracle.truffle.api.frame.MaterializedFrame createMaterializedFrame(java.lang.Object[]) +meth public abstract com.oracle.truffle.api.frame.MaterializedFrame createMaterializedFrame(java.lang.Object[],com.oracle.truffle.api.frame.FrameDescriptor) +meth public abstract com.oracle.truffle.api.frame.VirtualFrame createVirtualFrame(java.lang.Object[],com.oracle.truffle.api.frame.FrameDescriptor) +meth public abstract com.oracle.truffle.api.nodes.DirectCallNode createDirectCallNode(com.oracle.truffle.api.CallTarget) +meth public abstract com.oracle.truffle.api.nodes.IndirectCallNode createIndirectCallNode() +meth public abstract com.oracle.truffle.api.nodes.LoopNode createLoopNode(com.oracle.truffle.api.nodes.RepeatingNode) +meth public abstract java.lang.String getName() +meth public abstract java.util.Collection getCallTargets() +meth public abstract void notifyTransferToInterpreter() + +CLSS public abstract interface com.oracle.truffle.api.TruffleRuntimeAccess +meth public abstract com.oracle.truffle.api.TruffleRuntime getRuntime() + +CLSS public abstract interface com.oracle.truffle.api.TypedObject +meth public abstract java.lang.Object getTypeIdentifier() + +CLSS public abstract com.oracle.truffle.api.debug.Breakpoint +innr public final static !enum State +meth public abstract boolean isEnabled() +meth public abstract java.lang.String getLocationDescription() +meth public abstract void dispose() +meth public abstract void setCondition(java.lang.String) throws java.io.IOException +meth public abstract void setEnabled(boolean) +meth public com.oracle.truffle.api.source.Source getCondition() +meth public final boolean isOneShot() +meth public final com.oracle.truffle.api.debug.Breakpoint$State getState() +meth public final int getHitCount() +meth public final int getIgnoreCount() +meth public final void setIgnoreCount(int) +meth public java.lang.String toString() +supr java.lang.Object +hfds hitCount,ignoreCount,isOneShot,state + +CLSS public final static !enum com.oracle.truffle.api.debug.Breakpoint$State + outer com.oracle.truffle.api.debug.Breakpoint +fld public final static com.oracle.truffle.api.debug.Breakpoint$State DISABLED +fld public final static com.oracle.truffle.api.debug.Breakpoint$State DISABLED_UNRESOLVED +fld public final static com.oracle.truffle.api.debug.Breakpoint$State DISPOSED +fld public final static com.oracle.truffle.api.debug.Breakpoint$State ENABLED +fld public final static com.oracle.truffle.api.debug.Breakpoint$State ENABLED_UNRESOLVED +meth public java.lang.String getName() +meth public java.lang.String toString() +meth public static com.oracle.truffle.api.debug.Breakpoint$State valueOf(java.lang.String) +meth public static com.oracle.truffle.api.debug.Breakpoint$State[] values() +supr java.lang.Enum +hfds name + +CLSS public final com.oracle.truffle.api.debug.Debugger +meth public com.oracle.truffle.api.debug.Breakpoint setLineBreakpoint(int,com.oracle.truffle.api.source.LineLocation,boolean) throws java.io.IOException +meth public com.oracle.truffle.api.debug.Breakpoint setTagBreakpoint(int,com.oracle.truffle.api.instrument.SyntaxTag,boolean) throws java.io.IOException +meth public java.util.Collection getBreakpoints() +supr java.lang.Object +hfds ACCESSOR,CALL_TAG,OUT,STEPPING_TAG,TRACE,TRACE_PREFIX,breakpointCallback,debugContext,instrumenter,lastSource,lineBreaks,tagBreaks,vm,warningLog +hcls AccessorDebug,BreakpointCallback,Continue,DebugExecutionContext,StepInto,StepOut,StepOver,StepOverNested,StepStrategy,WarningLog + +CLSS public final com.oracle.truffle.api.debug.ExecutionEvent +meth public com.oracle.truffle.api.debug.Debugger getDebugger() +meth public void prepareContinue() +meth public void prepareStepInto() +supr java.lang.Object +hfds debugger + +CLSS public final com.oracle.truffle.api.debug.SuspendedEvent +meth public com.oracle.truffle.api.debug.Debugger getDebugger() +meth public com.oracle.truffle.api.frame.MaterializedFrame getFrame() +meth public com.oracle.truffle.api.nodes.Node getNode() +meth public java.lang.Object eval(java.lang.String,com.oracle.truffle.api.frame.FrameInstance) throws java.io.IOException +meth public java.util.List getStack() +meth public java.util.List getRecentWarnings() +meth public void prepareContinue() +meth public void prepareStepInto(int) +meth public void prepareStepOut() +meth public void prepareStepOver(int) +supr java.lang.Object +hfds astNode,debugger,frames,mFrame,recentWarnings + +CLSS public abstract interface com.oracle.truffle.api.frame.Frame +meth public abstract boolean getBoolean(com.oracle.truffle.api.frame.FrameSlot) throws com.oracle.truffle.api.frame.FrameSlotTypeException +meth public abstract boolean isBoolean(com.oracle.truffle.api.frame.FrameSlot) +meth public abstract boolean isByte(com.oracle.truffle.api.frame.FrameSlot) +meth public abstract boolean isDouble(com.oracle.truffle.api.frame.FrameSlot) +meth public abstract boolean isFloat(com.oracle.truffle.api.frame.FrameSlot) +meth public abstract boolean isInt(com.oracle.truffle.api.frame.FrameSlot) +meth public abstract boolean isLong(com.oracle.truffle.api.frame.FrameSlot) +meth public abstract boolean isObject(com.oracle.truffle.api.frame.FrameSlot) +meth public abstract byte getByte(com.oracle.truffle.api.frame.FrameSlot) throws com.oracle.truffle.api.frame.FrameSlotTypeException +meth public abstract com.oracle.truffle.api.frame.FrameDescriptor getFrameDescriptor() +meth public abstract com.oracle.truffle.api.frame.MaterializedFrame materialize() +meth public abstract double getDouble(com.oracle.truffle.api.frame.FrameSlot) throws com.oracle.truffle.api.frame.FrameSlotTypeException +meth public abstract float getFloat(com.oracle.truffle.api.frame.FrameSlot) throws com.oracle.truffle.api.frame.FrameSlotTypeException +meth public abstract int getInt(com.oracle.truffle.api.frame.FrameSlot) throws com.oracle.truffle.api.frame.FrameSlotTypeException +meth public abstract java.lang.Object getObject(com.oracle.truffle.api.frame.FrameSlot) throws com.oracle.truffle.api.frame.FrameSlotTypeException +meth public abstract java.lang.Object getValue(com.oracle.truffle.api.frame.FrameSlot) +meth public abstract java.lang.Object[] getArguments() +meth public abstract long getLong(com.oracle.truffle.api.frame.FrameSlot) throws com.oracle.truffle.api.frame.FrameSlotTypeException +meth public abstract void setBoolean(com.oracle.truffle.api.frame.FrameSlot,boolean) +meth public abstract void setByte(com.oracle.truffle.api.frame.FrameSlot,byte) +meth public abstract void setDouble(com.oracle.truffle.api.frame.FrameSlot,double) +meth public abstract void setFloat(com.oracle.truffle.api.frame.FrameSlot,float) +meth public abstract void setInt(com.oracle.truffle.api.frame.FrameSlot,int) +meth public abstract void setLong(com.oracle.truffle.api.frame.FrameSlot,long) +meth public abstract void setObject(com.oracle.truffle.api.frame.FrameSlot,java.lang.Object) + +CLSS public final com.oracle.truffle.api.frame.FrameDescriptor +cons public init() +cons public init(java.lang.Object) +intf java.lang.Cloneable +meth public com.oracle.truffle.api.Assumption getNotInFrameAssumption(java.lang.Object) +meth public com.oracle.truffle.api.Assumption getVersion() +meth public com.oracle.truffle.api.frame.FrameDescriptor copy() +meth public com.oracle.truffle.api.frame.FrameDescriptor shallowCopy() +meth public com.oracle.truffle.api.frame.FrameSlot addFrameSlot(java.lang.Object) +meth public com.oracle.truffle.api.frame.FrameSlot addFrameSlot(java.lang.Object,com.oracle.truffle.api.frame.FrameSlotKind) +meth public com.oracle.truffle.api.frame.FrameSlot addFrameSlot(java.lang.Object,java.lang.Object,com.oracle.truffle.api.frame.FrameSlotKind) +meth public com.oracle.truffle.api.frame.FrameSlot findFrameSlot(java.lang.Object) +meth public com.oracle.truffle.api.frame.FrameSlot findOrAddFrameSlot(java.lang.Object) +meth public com.oracle.truffle.api.frame.FrameSlot findOrAddFrameSlot(java.lang.Object,com.oracle.truffle.api.frame.FrameSlotKind) +meth public com.oracle.truffle.api.frame.FrameSlot findOrAddFrameSlot(java.lang.Object,java.lang.Object,com.oracle.truffle.api.frame.FrameSlotKind) +meth public int getSize() +meth public java.lang.Object getDefaultValue() +meth public java.lang.String toString() +meth public java.util.List getSlots() +meth public java.util.Set getIdentifiers() +meth public static com.oracle.truffle.api.frame.FrameDescriptor create() +meth public static com.oracle.truffle.api.frame.FrameDescriptor create(java.lang.Object) +meth public void removeFrameSlot(java.lang.Object) +supr java.lang.Object +hfds defaultValue,identifierToNotInFrameAssumptionMap,identifierToSlotMap,slots,version + +CLSS public abstract interface com.oracle.truffle.api.frame.FrameInstance +innr public final static !enum FrameAccess +meth public abstract boolean isVirtualFrame() +meth public abstract com.oracle.truffle.api.CallTarget getCallTarget() +meth public abstract com.oracle.truffle.api.frame.Frame getFrame(com.oracle.truffle.api.frame.FrameInstance$FrameAccess,boolean) +meth public abstract com.oracle.truffle.api.nodes.Node getCallNode() + +CLSS public final static !enum com.oracle.truffle.api.frame.FrameInstance$FrameAccess + outer com.oracle.truffle.api.frame.FrameInstance +fld public final static com.oracle.truffle.api.frame.FrameInstance$FrameAccess MATERIALIZE +fld public final static com.oracle.truffle.api.frame.FrameInstance$FrameAccess NONE +fld public final static com.oracle.truffle.api.frame.FrameInstance$FrameAccess READ_ONLY +fld public final static com.oracle.truffle.api.frame.FrameInstance$FrameAccess READ_WRITE +meth public static com.oracle.truffle.api.frame.FrameInstance$FrameAccess valueOf(java.lang.String) +meth public static com.oracle.truffle.api.frame.FrameInstance$FrameAccess[] values() +supr java.lang.Enum + +CLSS public abstract interface com.oracle.truffle.api.frame.FrameInstanceVisitor<%0 extends java.lang.Object> +meth public abstract {com.oracle.truffle.api.frame.FrameInstanceVisitor%0} visitFrame(com.oracle.truffle.api.frame.FrameInstance) + +CLSS public final com.oracle.truffle.api.frame.FrameSlot +cons public init(com.oracle.truffle.api.frame.FrameDescriptor,java.lang.Object,java.lang.Object,int,com.oracle.truffle.api.frame.FrameSlotKind) +intf java.lang.Cloneable +meth public com.oracle.truffle.api.frame.FrameDescriptor getFrameDescriptor() +meth public com.oracle.truffle.api.frame.FrameSlotKind getKind() +meth public int getIndex() +meth public java.lang.Object getIdentifier() +meth public java.lang.Object getInfo() +meth public java.lang.String toString() +meth public void setKind(com.oracle.truffle.api.frame.FrameSlotKind) +supr java.lang.Object +hfds descriptor,identifier,index,info,kind + +CLSS public final !enum com.oracle.truffle.api.frame.FrameSlotKind +fld public final byte tag +fld public final static com.oracle.truffle.api.frame.FrameSlotKind Boolean +fld public final static com.oracle.truffle.api.frame.FrameSlotKind Byte +fld public final static com.oracle.truffle.api.frame.FrameSlotKind Double +fld public final static com.oracle.truffle.api.frame.FrameSlotKind Float +fld public final static com.oracle.truffle.api.frame.FrameSlotKind Illegal +fld public final static com.oracle.truffle.api.frame.FrameSlotKind Int +fld public final static com.oracle.truffle.api.frame.FrameSlotKind Long +fld public final static com.oracle.truffle.api.frame.FrameSlotKind Object +meth public static com.oracle.truffle.api.frame.FrameSlotKind valueOf(java.lang.String) +meth public static com.oracle.truffle.api.frame.FrameSlotKind[] values() +supr java.lang.Enum + +CLSS public final com.oracle.truffle.api.frame.FrameSlotTypeException +cons public init() +supr com.oracle.truffle.api.nodes.SlowPathException +hfds serialVersionUID + +CLSS public final com.oracle.truffle.api.frame.FrameUtil +cons public init() +meth public static boolean getBooleanSafe(com.oracle.truffle.api.frame.Frame,com.oracle.truffle.api.frame.FrameSlot) +meth public static byte getByteSafe(com.oracle.truffle.api.frame.Frame,com.oracle.truffle.api.frame.FrameSlot) +meth public static double getDoubleSafe(com.oracle.truffle.api.frame.Frame,com.oracle.truffle.api.frame.FrameSlot) +meth public static float getFloatSafe(com.oracle.truffle.api.frame.Frame,com.oracle.truffle.api.frame.FrameSlot) +meth public static int getIntSafe(com.oracle.truffle.api.frame.Frame,com.oracle.truffle.api.frame.FrameSlot) +meth public static java.lang.Object getObjectSafe(com.oracle.truffle.api.frame.Frame,com.oracle.truffle.api.frame.FrameSlot) +meth public static long getLongSafe(com.oracle.truffle.api.frame.Frame,com.oracle.truffle.api.frame.FrameSlot) +supr java.lang.Object + +CLSS public abstract interface com.oracle.truffle.api.frame.MaterializedFrame +intf com.oracle.truffle.api.frame.Frame + +CLSS public abstract interface com.oracle.truffle.api.frame.VirtualFrame +intf com.oracle.truffle.api.frame.Frame + +CLSS public abstract interface com.oracle.truffle.api.instrument.ASTPrinter +meth public abstract java.lang.String printNodeWithInstrumentation(com.oracle.truffle.api.nodes.Node) +meth public abstract java.lang.String printTreeToString(com.oracle.truffle.api.nodes.Node,int) +meth public abstract java.lang.String printTreeToString(com.oracle.truffle.api.nodes.Node,int,com.oracle.truffle.api.nodes.Node) +meth public abstract void printTree(java.io.PrintWriter,com.oracle.truffle.api.nodes.Node,int,com.oracle.truffle.api.nodes.Node) + +CLSS public abstract interface com.oracle.truffle.api.instrument.ASTProber +meth public abstract void probeAST(com.oracle.truffle.api.instrument.Instrumenter,com.oracle.truffle.api.nodes.RootNode) + +CLSS public abstract interface com.oracle.truffle.api.instrument.EvalInstrumentListener +meth public abstract void onExecution(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.frame.VirtualFrame,java.lang.Object) +meth public abstract void onFailure(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.frame.VirtualFrame,java.lang.Exception) + +CLSS public abstract com.oracle.truffle.api.instrument.EventHandlerNode +cons protected init() +intf com.oracle.truffle.api.instrument.InstrumentationNode +meth public abstract com.oracle.truffle.api.instrument.Probe getProbe() +meth public abstract void enter(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.frame.VirtualFrame) +meth public abstract void returnExceptional(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.frame.VirtualFrame,java.lang.Throwable) +meth public abstract void returnValue(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.frame.VirtualFrame,java.lang.Object) +meth public abstract void returnVoid(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.frame.VirtualFrame) +supr com.oracle.truffle.api.nodes.Node + +CLSS public abstract com.oracle.truffle.api.instrument.Instrument +meth public boolean isDisposed() +meth public final java.lang.String getInstrumentInfo() +meth public void dispose() +supr java.lang.Object +hfds instrumentInfo,isDisposed + +CLSS public abstract interface com.oracle.truffle.api.instrument.InstrumentationNode +meth public abstract java.lang.String instrumentationInfo() + +CLSS public final com.oracle.truffle.api.instrument.Instrumenter +innr public abstract static Tool +meth public com.oracle.truffle.api.instrument.Instrumenter$Tool install(com.oracle.truffle.api.instrument.Instrumenter$Tool) +meth public com.oracle.truffle.api.instrument.Probe probe(com.oracle.truffle.api.nodes.Node) +meth public com.oracle.truffle.api.instrument.ProbeInstrument attach(com.oracle.truffle.api.instrument.Probe,com.oracle.truffle.api.instrument.SimpleInstrumentListener,java.lang.String) +meth public com.oracle.truffle.api.instrument.ProbeInstrument attach(com.oracle.truffle.api.instrument.Probe,com.oracle.truffle.api.instrument.StandardInstrumentListener,java.lang.String) +meth public com.oracle.truffle.api.instrument.ProbeInstrument attach(com.oracle.truffle.api.instrument.Probe,java.lang.Class,com.oracle.truffle.api.source.Source,com.oracle.truffle.api.instrument.EvalInstrumentListener,java.lang.String) +meth public com.oracle.truffle.api.instrument.TagInstrument attach(com.oracle.truffle.api.instrument.SyntaxTag,com.oracle.truffle.api.instrument.StandardAfterInstrumentListener,java.lang.String) +meth public com.oracle.truffle.api.instrument.TagInstrument attach(com.oracle.truffle.api.instrument.SyntaxTag,com.oracle.truffle.api.instrument.StandardBeforeInstrumentListener,java.lang.String) +meth public java.util.Collection findProbesTaggedAs(com.oracle.truffle.api.instrument.SyntaxTag) +meth public void addProbeListener(com.oracle.truffle.api.instrument.ProbeListener) +meth public void registerASTProber(com.oracle.truffle.api.instrument.ASTProber) +meth public void removeProbeListener(com.oracle.truffle.api.instrument.ProbeListener) +meth public void unregisterASTProber(com.oracle.truffle.api.instrument.ASTProber) +supr java.lang.Object +hfds ACCESSOR,OUT,TRACE,TRACE_PREFIX,afterTagInstrument,astProbers,beforeTagInstrument,probeListeners,probes,testVM,tools,vm +hcls AccessorInstrument,ToolState + +CLSS public abstract static com.oracle.truffle.api.instrument.Instrumenter$Tool + outer com.oracle.truffle.api.instrument.Instrumenter +cons protected init() +meth protected abstract boolean internalInstall() +meth protected abstract void internalDispose() +meth protected abstract void internalReset() +meth protected final com.oracle.truffle.api.instrument.Instrumenter getInstrumenter() +meth protected void internalSetEnabled(boolean) +meth public final boolean isEnabled() +meth public final void dispose() +meth public final void reset() +meth public final void setEnabled(boolean) +supr java.lang.Object +hfds instrumenter,toolState + +CLSS public final com.oracle.truffle.api.instrument.KillException +cons public init() +supr com.oracle.truffle.api.nodes.ControlFlowException +hfds serialVersionUID + +CLSS public final com.oracle.truffle.api.instrument.Probe +meth public boolean isTaggedAs(com.oracle.truffle.api.instrument.SyntaxTag) +meth public com.oracle.truffle.api.source.SourceSection getProbedSourceSection() +meth public java.lang.String getShortDescription() +meth public java.util.Collection getSyntaxTags() +meth public void tagAs(com.oracle.truffle.api.instrument.SyntaxTag,java.lang.Object) +supr java.lang.Object +hfds OUT,TRACE,TRACE_PREFIX,instrumenter,isAfterTagInstrumentActive,isBeforeTagInstrumentActive,language,probeNodeClones,probeStateUnchangedAssumption,probeStateUnchangedCyclic,sourceSection,tags + +CLSS public com.oracle.truffle.api.instrument.ProbeException +cons public init(com.oracle.truffle.api.instrument.ProbeFailure$Reason,com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.nodes.Node,java.lang.Object) +meth public com.oracle.truffle.api.instrument.ProbeFailure getFailure() +meth public java.lang.String toString() +supr java.lang.RuntimeException +hfds failure,serialVersionUID + +CLSS public final com.oracle.truffle.api.instrument.ProbeFailure +cons public init(com.oracle.truffle.api.instrument.ProbeFailure$Reason,com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.nodes.Node,java.lang.Object) +innr public final static !enum Reason +meth public com.oracle.truffle.api.instrument.ProbeFailure$Reason getReason() +meth public com.oracle.truffle.api.nodes.Node getChild() +meth public com.oracle.truffle.api.nodes.Node getParent() +meth public java.lang.Object getWrapper() +meth public java.lang.String getMessage() +supr java.lang.Object +hfds child,parent,reason,wrapper + +CLSS public final static !enum com.oracle.truffle.api.instrument.ProbeFailure$Reason + outer com.oracle.truffle.api.instrument.ProbeFailure +fld public final static com.oracle.truffle.api.instrument.ProbeFailure$Reason NOT_INSTRUMENTABLE +fld public final static com.oracle.truffle.api.instrument.ProbeFailure$Reason NO_PARENT +fld public final static com.oracle.truffle.api.instrument.ProbeFailure$Reason NO_WRAPPER +fld public final static com.oracle.truffle.api.instrument.ProbeFailure$Reason WRAPPER_NODE +fld public final static com.oracle.truffle.api.instrument.ProbeFailure$Reason WRAPPER_TYPE +meth public java.lang.String getMessage() +meth public static com.oracle.truffle.api.instrument.ProbeFailure$Reason valueOf(java.lang.String) +meth public static com.oracle.truffle.api.instrument.ProbeFailure$Reason[] values() +supr java.lang.Enum +hfds message + +CLSS public abstract com.oracle.truffle.api.instrument.ProbeInstrument +fld protected com.oracle.truffle.api.instrument.Probe probe +innr public abstract interface static TruffleOptListener +meth protected void innerDispose() +meth public com.oracle.truffle.api.instrument.Probe getProbe() +supr com.oracle.truffle.api.instrument.Instrument +hfds NO_ARGS +hcls AbstractInstrumentNode,EvalInstrument,SimpleInstrument,StandardInstrument,TruffleOptInstrument + +CLSS public abstract interface static com.oracle.truffle.api.instrument.ProbeInstrument$TruffleOptListener + outer com.oracle.truffle.api.instrument.ProbeInstrument +meth public abstract void notifyIsCompiled(boolean) + +CLSS public abstract interface com.oracle.truffle.api.instrument.ProbeListener +meth public abstract void endASTProbing(com.oracle.truffle.api.nodes.RootNode) +meth public abstract void newProbeInserted(com.oracle.truffle.api.instrument.Probe) +meth public abstract void probeTaggedAs(com.oracle.truffle.api.instrument.Probe,com.oracle.truffle.api.instrument.SyntaxTag,java.lang.Object) +meth public abstract void startASTProbing(com.oracle.truffle.api.nodes.RootNode) + +CLSS public final com.oracle.truffle.api.instrument.QuitException +cons public init() +supr com.oracle.truffle.api.nodes.ControlFlowException +hfds serialVersionUID + +CLSS public abstract interface com.oracle.truffle.api.instrument.SimpleInstrumentListener +meth public abstract void onEnter(com.oracle.truffle.api.instrument.Probe) +meth public abstract void onReturnExceptional(com.oracle.truffle.api.instrument.Probe,java.lang.Throwable) +meth public abstract void onReturnValue(com.oracle.truffle.api.instrument.Probe,java.lang.Object) +meth public abstract void onReturnVoid(com.oracle.truffle.api.instrument.Probe) + +CLSS public abstract interface com.oracle.truffle.api.instrument.StandardAfterInstrumentListener +meth public abstract void onReturnExceptional(com.oracle.truffle.api.instrument.Probe,com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.frame.VirtualFrame,java.lang.Throwable) +meth public abstract void onReturnValue(com.oracle.truffle.api.instrument.Probe,com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.frame.VirtualFrame,java.lang.Object) +meth public abstract void onReturnVoid(com.oracle.truffle.api.instrument.Probe,com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.frame.VirtualFrame) + +CLSS public abstract interface com.oracle.truffle.api.instrument.StandardBeforeInstrumentListener +meth public abstract void onEnter(com.oracle.truffle.api.instrument.Probe,com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.frame.VirtualFrame) + +CLSS public abstract interface com.oracle.truffle.api.instrument.StandardInstrumentListener +meth public abstract void onEnter(com.oracle.truffle.api.instrument.Probe,com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.frame.VirtualFrame) +meth public abstract void onReturnExceptional(com.oracle.truffle.api.instrument.Probe,com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.frame.VirtualFrame,java.lang.Throwable) +meth public abstract void onReturnValue(com.oracle.truffle.api.instrument.Probe,com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.frame.VirtualFrame,java.lang.Object) +meth public abstract void onReturnVoid(com.oracle.truffle.api.instrument.Probe,com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.frame.VirtualFrame) + +CLSS public final !enum com.oracle.truffle.api.instrument.StandardSyntaxTag +fld public final static com.oracle.truffle.api.instrument.StandardSyntaxTag ASSIGNMENT +fld public final static com.oracle.truffle.api.instrument.StandardSyntaxTag CALL +fld public final static com.oracle.truffle.api.instrument.StandardSyntaxTag PERIODIC +fld public final static com.oracle.truffle.api.instrument.StandardSyntaxTag START_LOOP +fld public final static com.oracle.truffle.api.instrument.StandardSyntaxTag START_METHOD +fld public final static com.oracle.truffle.api.instrument.StandardSyntaxTag STATEMENT +fld public final static com.oracle.truffle.api.instrument.StandardSyntaxTag THROW +intf com.oracle.truffle.api.instrument.SyntaxTag +meth public java.lang.String getDescription() +meth public java.lang.String getName() +meth public static com.oracle.truffle.api.instrument.StandardSyntaxTag valueOf(java.lang.String) +meth public static com.oracle.truffle.api.instrument.StandardSyntaxTag[] values() +supr java.lang.Enum +hfds description,name + +CLSS public abstract interface com.oracle.truffle.api.instrument.SyntaxTag +meth public abstract java.lang.String getDescription() +meth public abstract java.lang.String name() + +CLSS public abstract com.oracle.truffle.api.instrument.TagInstrument +cons protected init(com.oracle.truffle.api.instrument.Instrumenter,com.oracle.truffle.api.instrument.SyntaxTag,java.lang.String) +meth protected final com.oracle.truffle.api.instrument.Instrumenter getInstrumenter() +meth public final com.oracle.truffle.api.instrument.SyntaxTag getTag() +supr com.oracle.truffle.api.instrument.Instrument +hfds instrumenter,tag +hcls AfterTagInstrument,BeforeTagInstrument + +CLSS public abstract interface com.oracle.truffle.api.instrument.Visualizer +meth public abstract com.oracle.truffle.api.instrument.ASTPrinter getASTPrinter() +meth public abstract java.lang.String displayCallTargetName(com.oracle.truffle.api.CallTarget) +meth public abstract java.lang.String displayIdentifier(com.oracle.truffle.api.frame.FrameSlot) +meth public abstract java.lang.String displayMethodName(com.oracle.truffle.api.nodes.Node) +meth public abstract java.lang.String displaySourceLocation(com.oracle.truffle.api.nodes.Node) +meth public abstract java.lang.String displayValue(java.lang.Object,int) + +CLSS public abstract interface com.oracle.truffle.api.instrument.WrapperNode +intf com.oracle.truffle.api.instrument.InstrumentationNode +meth public abstract com.oracle.truffle.api.instrument.Probe getProbe() +meth public abstract com.oracle.truffle.api.nodes.Node getChild() +meth public abstract void insertEventHandlerNode(com.oracle.truffle.api.instrument.EventHandlerNode) + +CLSS public com.oracle.truffle.api.nodes.ControlFlowException +cons public init() +meth public final java.lang.Throwable fillInStackTrace() +supr java.lang.RuntimeException +hfds serialVersionUID + +CLSS public abstract com.oracle.truffle.api.nodes.DirectCallNode +cons protected init(com.oracle.truffle.api.CallTarget) +fld protected final com.oracle.truffle.api.CallTarget callTarget +meth public abstract boolean cloneCallTarget() +meth public abstract boolean isCallTargetCloningAllowed() +meth public abstract boolean isInlinable() +meth public abstract boolean isInliningForced() +meth public abstract com.oracle.truffle.api.CallTarget getClonedCallTarget() +meth public abstract java.lang.Object call(com.oracle.truffle.api.frame.VirtualFrame,java.lang.Object[]) +meth public abstract void forceInlining() +meth public com.oracle.truffle.api.CallTarget getCallTarget() +meth public com.oracle.truffle.api.CallTarget getCurrentCallTarget() +meth public final boolean isCallTargetCloned() +meth public final com.oracle.truffle.api.nodes.RootNode getCurrentRootNode() +meth public java.lang.String toString() +meth public static com.oracle.truffle.api.nodes.DirectCallNode create(com.oracle.truffle.api.CallTarget) +supr com.oracle.truffle.api.nodes.Node + +CLSS public abstract interface !annotation com.oracle.truffle.api.nodes.ExplodeLoop + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD]) +intf java.lang.annotation.Annotation +meth public abstract !hasdefault boolean merge() + +CLSS public com.oracle.truffle.api.nodes.GraphPrintVisitor +cons public init() +fld public final static int GraphVisualizerPort = 4444 +fld public final static java.lang.String GraphVisualizerAddress = "127.0.0.1" +innr public GraphPrintAdapter +innr public abstract interface static !annotation CustomGraphPrintHandler +innr public abstract interface static !annotation NullGraphPrintHandler +innr public abstract interface static GraphPrintHandler +meth protected java.lang.Object getElementByObject(java.lang.Object) +meth protected void connectNodes(java.lang.Object,java.lang.Object,java.lang.String) +meth protected void createElementForNode(java.lang.Object) +meth protected void setNodeProperty(java.lang.Object,java.lang.String,java.lang.Object) +meth public com.oracle.truffle.api.nodes.GraphPrintVisitor beginGraph(java.lang.String) +meth public com.oracle.truffle.api.nodes.GraphPrintVisitor beginGroup(java.lang.String) +meth public com.oracle.truffle.api.nodes.GraphPrintVisitor visit(java.lang.Object) +meth public java.lang.String toString() +meth public void printToFile(java.io.File) +meth public void printToNetwork(boolean) +meth public void printToSysout() +supr java.lang.Object +hfds dom,edgeList,edgesElement,graphDocument,graphElement,groupElement,id,nodeMap,nodesElement,prevNodeMap + +CLSS public abstract interface static !annotation com.oracle.truffle.api.nodes.GraphPrintVisitor$CustomGraphPrintHandler + outer com.oracle.truffle.api.nodes.GraphPrintVisitor + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.Class handler() + +CLSS public com.oracle.truffle.api.nodes.GraphPrintVisitor$GraphPrintAdapter + outer com.oracle.truffle.api.nodes.GraphPrintVisitor +cons public init(com.oracle.truffle.api.nodes.GraphPrintVisitor) +meth public void connectNodes(java.lang.Object,java.lang.Object) +meth public void createElementForNode(java.lang.Object) +meth public void setNodeProperty(java.lang.Object,java.lang.String,java.lang.Object) +meth public void visit(java.lang.Object) +supr java.lang.Object + +CLSS public abstract interface static com.oracle.truffle.api.nodes.GraphPrintVisitor$GraphPrintHandler + outer com.oracle.truffle.api.nodes.GraphPrintVisitor +meth public abstract void visit(java.lang.Object,com.oracle.truffle.api.nodes.GraphPrintVisitor$GraphPrintAdapter) + +CLSS public abstract interface static !annotation com.oracle.truffle.api.nodes.GraphPrintVisitor$NullGraphPrintHandler + outer com.oracle.truffle.api.nodes.GraphPrintVisitor + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE]) +intf java.lang.annotation.Annotation + +CLSS public abstract com.oracle.truffle.api.nodes.IndirectCallNode +cons public init() +meth public abstract java.lang.Object call(com.oracle.truffle.api.frame.VirtualFrame,com.oracle.truffle.api.CallTarget,java.lang.Object[]) +meth public static com.oracle.truffle.api.nodes.IndirectCallNode create() +supr com.oracle.truffle.api.nodes.Node + +CLSS public final com.oracle.truffle.api.nodes.InvalidAssumptionException +cons public init() +supr com.oracle.truffle.api.nodes.SlowPathException +hfds serialVersionUID + +CLSS public abstract com.oracle.truffle.api.nodes.LoopNode +cons public init() +meth public abstract com.oracle.truffle.api.nodes.RepeatingNode getRepeatingNode() +meth public abstract void executeLoop(com.oracle.truffle.api.frame.VirtualFrame) +supr com.oracle.truffle.api.nodes.Node + +CLSS public abstract com.oracle.truffle.api.nodes.Node +cons protected init() +cons protected init(com.oracle.truffle.api.source.SourceSection) +innr public abstract interface static !annotation Child +innr public abstract interface static !annotation Children +intf com.oracle.truffle.api.nodes.NodeInterface +intf java.lang.Cloneable +meth protected final <%0 extends com.oracle.truffle.api.nodes.Node> {%%0} insert({%%0}) +meth protected final <%0 extends com.oracle.truffle.api.nodes.Node> {%%0}[] insert({%%0}[]) +meth protected void onReplace(com.oracle.truffle.api.nodes.Node,java.lang.CharSequence) +meth public com.oracle.truffle.api.nodes.Node copy() +meth public com.oracle.truffle.api.nodes.Node deepCopy() +meth public com.oracle.truffle.api.nodes.NodeCost getCost() +meth public com.oracle.truffle.api.source.SourceSection getEncapsulatingSourceSection() +meth public com.oracle.truffle.api.source.SourceSection getSourceSection() +meth public final <%0 extends com.oracle.truffle.api.nodes.Node> {%%0} replace({%%0}) +meth public final <%0 extends com.oracle.truffle.api.nodes.Node> {%%0} replace({%%0},java.lang.CharSequence) +meth public final <%0 extends java.lang.Object> {%%0} atomic(java.util.concurrent.Callable<{%%0}>) +meth public final boolean isSafelyReplaceableBy(com.oracle.truffle.api.nodes.Node) +meth public final com.oracle.truffle.api.nodes.Node getParent() +meth public final com.oracle.truffle.api.nodes.RootNode getRootNode() +meth public final java.lang.Iterable getChildren() +meth public final void accept(com.oracle.truffle.api.nodes.NodeVisitor) +meth public final void adoptChildren() +meth public final void atomic(java.lang.Runnable) +meth public java.lang.String getDescription() +meth public java.lang.String getLanguage() +meth public java.lang.String toString() +meth public java.util.Map getDebugProperties() +meth public void assignSourceSection(com.oracle.truffle.api.source.SourceSection) +meth public void clearSourceSection() +supr java.lang.Object +hfds ACCESSOR,GIL,IN_ATOMIC_BLOCK,nodeClass,parent,sourceSection +hcls AccessorNodes + +CLSS public abstract interface static !annotation com.oracle.truffle.api.nodes.Node$Child + outer com.oracle.truffle.api.nodes.Node + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[FIELD]) +intf java.lang.annotation.Annotation + +CLSS public abstract interface static !annotation com.oracle.truffle.api.nodes.Node$Children + outer com.oracle.truffle.api.nodes.Node + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[FIELD]) +intf java.lang.annotation.Annotation + +CLSS public final com.oracle.truffle.api.nodes.NodeClass +cons public init(java.lang.Class) +meth public boolean equals(java.lang.Object) +meth public com.oracle.truffle.api.nodes.NodeFieldAccessor getNodeClassField() +meth public com.oracle.truffle.api.nodes.NodeFieldAccessor getParentField() +meth public com.oracle.truffle.api.nodes.NodeFieldAccessor[] getChildFields() +meth public com.oracle.truffle.api.nodes.NodeFieldAccessor[] getChildrenFields() +meth public com.oracle.truffle.api.nodes.NodeFieldAccessor[] getCloneableFields() +meth public com.oracle.truffle.api.nodes.NodeFieldAccessor[] getFields() +meth public int hashCode() +meth public java.util.Iterator makeIterator(com.oracle.truffle.api.nodes.Node) +meth public static com.oracle.truffle.api.nodes.NodeClass get(com.oracle.truffle.api.nodes.Node) +meth public static com.oracle.truffle.api.nodes.NodeClass get(java.lang.Class) +supr java.lang.Object +hfds childFields,childrenFields,clazz,cloneableFields,fields,nodeClassField,nodeClasses,parentField +hcls NodeIterator + +CLSS public abstract com.oracle.truffle.api.nodes.NodeCloneable +cons public init() +intf java.lang.Cloneable +meth protected java.lang.Object clone() +supr java.lang.Object + +CLSS public final !enum com.oracle.truffle.api.nodes.NodeCost +fld public final static com.oracle.truffle.api.nodes.NodeCost MEGAMORPHIC +fld public final static com.oracle.truffle.api.nodes.NodeCost MONOMORPHIC +fld public final static com.oracle.truffle.api.nodes.NodeCost NONE +fld public final static com.oracle.truffle.api.nodes.NodeCost POLYMORPHIC +fld public final static com.oracle.truffle.api.nodes.NodeCost UNINITIALIZED +meth public boolean isTrivial() +meth public static com.oracle.truffle.api.nodes.NodeCost valueOf(java.lang.String) +meth public static com.oracle.truffle.api.nodes.NodeCost[] values() +supr java.lang.Enum + +CLSS public abstract com.oracle.truffle.api.nodes.NodeFieldAccessor +cons protected init(com.oracle.truffle.api.nodes.NodeFieldAccessor$NodeFieldKind,java.lang.Class,java.lang.String,java.lang.Class) +fld protected final java.lang.Class type +innr public abstract static AbstractUnsafeNodeFieldAccessor +innr public final static !enum NodeFieldKind +meth protected static com.oracle.truffle.api.nodes.NodeFieldAccessor create(com.oracle.truffle.api.nodes.NodeFieldAccessor$NodeFieldKind,java.lang.reflect.Field) +meth public abstract java.lang.Object getObject(com.oracle.truffle.api.nodes.Node) +meth public abstract java.lang.Object loadValue(com.oracle.truffle.api.nodes.Node) +meth public abstract void putObject(com.oracle.truffle.api.nodes.Node,java.lang.Object) +meth public com.oracle.truffle.api.nodes.NodeFieldAccessor$NodeFieldKind getKind() +meth public java.lang.Class getDeclaringClass() +meth public java.lang.Class getType() +meth public java.lang.String getName() +supr java.lang.Object +hfds USE_UNSAFE,declaringClass,kind,name +hcls ReflectionNodeField,UnsafeNodeField + +CLSS public abstract static com.oracle.truffle.api.nodes.NodeFieldAccessor$AbstractUnsafeNodeFieldAccessor + outer com.oracle.truffle.api.nodes.NodeFieldAccessor +cons protected init(com.oracle.truffle.api.nodes.NodeFieldAccessor$NodeFieldKind,java.lang.Class,java.lang.String,java.lang.Class) +meth public abstract long getOffset() +meth public java.lang.Object getObject(com.oracle.truffle.api.nodes.Node) +meth public java.lang.Object loadValue(com.oracle.truffle.api.nodes.Node) +meth public void putObject(com.oracle.truffle.api.nodes.Node,java.lang.Object) +supr com.oracle.truffle.api.nodes.NodeFieldAccessor +hfds unsafe + +CLSS public final static !enum com.oracle.truffle.api.nodes.NodeFieldAccessor$NodeFieldKind + outer com.oracle.truffle.api.nodes.NodeFieldAccessor +fld public final static com.oracle.truffle.api.nodes.NodeFieldAccessor$NodeFieldKind CHILD +fld public final static com.oracle.truffle.api.nodes.NodeFieldAccessor$NodeFieldKind CHILDREN +fld public final static com.oracle.truffle.api.nodes.NodeFieldAccessor$NodeFieldKind DATA +fld public final static com.oracle.truffle.api.nodes.NodeFieldAccessor$NodeFieldKind NODE_CLASS +fld public final static com.oracle.truffle.api.nodes.NodeFieldAccessor$NodeFieldKind PARENT +meth public static com.oracle.truffle.api.nodes.NodeFieldAccessor$NodeFieldKind valueOf(java.lang.String) +meth public static com.oracle.truffle.api.nodes.NodeFieldAccessor$NodeFieldKind[] values() +supr java.lang.Enum + +CLSS public abstract interface !annotation com.oracle.truffle.api.nodes.NodeInfo + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE]) +intf java.lang.annotation.Annotation +meth public abstract !hasdefault com.oracle.truffle.api.nodes.NodeCost cost() +meth public abstract !hasdefault java.lang.String description() +meth public abstract !hasdefault java.lang.String language() +meth public abstract !hasdefault java.lang.String shortName() + +CLSS public abstract interface com.oracle.truffle.api.nodes.NodeInterface + +CLSS public final com.oracle.truffle.api.nodes.NodeUtil +cons public init() +innr public abstract interface static NodeCountFilter +meth public static <%0 extends com.oracle.truffle.api.nodes.Node> {%%0} cloneNode({%%0}) +meth public static <%0 extends com.oracle.truffle.api.nodes.Node> {%%0} nonAtomicReplace(com.oracle.truffle.api.nodes.Node,{%%0},java.lang.CharSequence) +meth public static <%0 extends java.lang.Object> java.util.List<{%%0}> findAllNodeInstances(com.oracle.truffle.api.nodes.Node,java.lang.Class<{%%0}>) +meth public static <%0 extends java.lang.Object> java.util.List<{%%0}> findAllParents(com.oracle.truffle.api.nodes.Node,java.lang.Class<{%%0}>) +meth public static <%0 extends java.lang.Object> {%%0} findFirstNodeInstance(com.oracle.truffle.api.nodes.Node,java.lang.Class<{%%0}>) +meth public static <%0 extends java.lang.Object> {%%0} findParent(com.oracle.truffle.api.nodes.Node,java.lang.Class<{%%0}>) +meth public static <%0 extends java.lang.Object> {%%0}[] concat({%%0}[],{%%0}[]) +meth public static <%0 extends java.lang.annotation.Annotation> {%%0} findAnnotation(java.lang.Class,java.lang.Class<{%%0}>) +meth public static boolean forEachChild(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.nodes.NodeVisitor) +meth public static boolean isReplacementSafe(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.nodes.Node) +meth public static boolean replaceChild(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.nodes.Node) +meth public static boolean verify(com.oracle.truffle.api.nodes.Node) +meth public static com.oracle.truffle.api.nodes.Node getNthParent(com.oracle.truffle.api.nodes.Node,int) +meth public static com.oracle.truffle.api.nodes.NodeFieldAccessor findChildField(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.nodes.Node) +meth public static int countNodes(com.oracle.truffle.api.nodes.Node) +meth public static int countNodes(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.nodes.NodeUtil$NodeCountFilter) +meth public static java.lang.String printCompactTreeToString(com.oracle.truffle.api.nodes.Node) +meth public static java.lang.String printSourceAttributionTree(com.oracle.truffle.api.nodes.Node) +meth public static java.lang.String printSyntaxTags(java.lang.Object) +meth public static java.lang.String printTreeToString(com.oracle.truffle.api.nodes.Node) +meth public static java.util.Iterator makeRecursiveIterator(com.oracle.truffle.api.nodes.Node) +meth public static java.util.List collectNodes(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.nodes.Node) +meth public static java.util.List findNodeChildren(com.oracle.truffle.api.nodes.Node) +meth public static void printCompactTree(java.io.OutputStream,com.oracle.truffle.api.nodes.Node) +meth public static void printSourceAttributionTree(java.io.OutputStream,com.oracle.truffle.api.nodes.Node) +meth public static void printSourceAttributionTree(java.io.PrintWriter,com.oracle.truffle.api.nodes.Node) +meth public static void printTree(java.io.OutputStream,com.oracle.truffle.api.nodes.Node) +meth public static void printTree(java.io.PrintWriter,com.oracle.truffle.api.nodes.Node) +supr java.lang.Object +hcls NodeCounter,RecursiveNodeIterator + +CLSS public abstract interface static com.oracle.truffle.api.nodes.NodeUtil$NodeCountFilter + outer com.oracle.truffle.api.nodes.NodeUtil +fld public final static com.oracle.truffle.api.nodes.NodeUtil$NodeCountFilter NO_FILTER +meth public abstract boolean isCounted(com.oracle.truffle.api.nodes.Node) + +CLSS public abstract interface com.oracle.truffle.api.nodes.NodeVisitor +meth public abstract boolean visit(com.oracle.truffle.api.nodes.Node) + +CLSS public abstract interface com.oracle.truffle.api.nodes.RepeatingNode +intf com.oracle.truffle.api.nodes.NodeInterface +meth public abstract boolean executeRepeating(com.oracle.truffle.api.frame.VirtualFrame) + +CLSS public abstract com.oracle.truffle.api.nodes.RootNode +cons protected init(java.lang.Class,com.oracle.truffle.api.source.SourceSection,com.oracle.truffle.api.frame.FrameDescriptor) +meth protected boolean isInstrumentable() +meth public abstract java.lang.Object execute(com.oracle.truffle.api.frame.VirtualFrame) +meth public boolean isCloningAllowed() +meth public com.oracle.truffle.api.CompilerOptions getCompilerOptions() +meth public com.oracle.truffle.api.ExecutionContext getExecutionContext() +meth public com.oracle.truffle.api.nodes.Node copy() +meth public final com.oracle.truffle.api.RootCallTarget getCallTarget() +meth public final com.oracle.truffle.api.frame.FrameDescriptor getFrameDescriptor() +meth public final void applyInstrumentation() +meth public final void reportLoopCount(int) +meth public final void setCallTarget(com.oracle.truffle.api.RootCallTarget) +meth public static com.oracle.truffle.api.nodes.RootNode createConstantNode(java.lang.Object) +supr com.oracle.truffle.api.nodes.Node +hfds callTarget,frameDescriptor,language +hcls Constant + +CLSS public com.oracle.truffle.api.nodes.SlowPathException +cons public init() +cons public init(java.lang.String) +cons public init(java.lang.String,java.lang.Throwable) +cons public init(java.lang.Throwable) +meth public java.lang.Throwable fillInStackTrace() +supr java.lang.Exception +hfds serialVersionUID + +CLSS public final com.oracle.truffle.api.nodes.UnexpectedResultException +cons public init(java.lang.Object) +meth public java.lang.Object getResult() +supr com.oracle.truffle.api.nodes.SlowPathException +hfds result,serialVersionUID + +CLSS public final com.oracle.truffle.api.nodes.serial.PostOrderDeserializer +cons public init(com.oracle.truffle.api.nodes.serial.SerializerConstantPool) +meth public <%0 extends com.oracle.truffle.api.nodes.Node> {%%0} deserialize(byte[],java.lang.Class<{%%0}>) +supr java.lang.Object +hfds cp,stack,unsafe +hcls FixedSizeNodeStack,HierarchicalStack + +CLSS public final com.oracle.truffle.api.nodes.serial.PostOrderSerializer +cons public init(com.oracle.truffle.api.nodes.serial.SerializerConstantPool) +meth public byte[] serialize(com.oracle.truffle.api.nodes.Node) +supr java.lang.Object +hfds cp,unsafe + +CLSS public abstract interface com.oracle.truffle.api.nodes.serial.SerializerConstantPool +meth public abstract double getDouble(int) +meth public abstract float getFloat(int) +meth public abstract int getInt(int) +meth public abstract int putClass(java.lang.Class) +meth public abstract int putDouble(double) +meth public abstract int putFloat(float) +meth public abstract int putInt(int) +meth public abstract int putLong(long) +meth public abstract int putObject(java.lang.Class,java.lang.Object) +meth public abstract java.lang.Class getClass(int) +meth public abstract java.lang.Object getObject(java.lang.Class,int) +meth public abstract long getLong(int) + +CLSS public com.oracle.truffle.api.nodes.serial.UnsupportedConstantPoolTypeException +cons public init() +cons public init(java.lang.String) +cons public init(java.lang.String,java.lang.Throwable) +cons public init(java.lang.Throwable) +supr java.lang.RuntimeException +hfds serialVersionUID + +CLSS public com.oracle.truffle.api.nodes.serial.VariableLengthIntBuffer +cons public init(byte[]) +cons public init(java.nio.ByteBuffer) +fld public final static int NULL = -1 +meth public boolean hasRemaining() +meth public byte[] getBytes() +meth public int get() +meth public java.nio.ByteBuffer getBuffer() +meth public void put(int) +supr java.lang.Object +hfds buffer + +CLSS public final com.oracle.truffle.api.source.LineLocation +intf java.lang.Comparable +meth public boolean equals(java.lang.Object) +meth public com.oracle.truffle.api.source.Source getSource() +meth public int compareTo(com.oracle.truffle.api.source.LineLocation) +meth public int getLineNumber() +meth public int hashCode() +meth public java.lang.String getShortDescription() +meth public java.lang.String toString() +supr java.lang.Object +hfds line,source + +CLSS public abstract com.oracle.truffle.api.source.Source +meth public abstract java.io.Reader getReader() +meth public abstract java.lang.String getCode() +meth public abstract java.lang.String getName() +meth public abstract java.lang.String getPath() +meth public abstract java.lang.String getShortName() +meth public abstract java.net.URL getURL() +meth public final com.oracle.truffle.api.source.LineLocation createLineLocation(int) +meth public final com.oracle.truffle.api.source.Source withMimeType(java.lang.String) +meth public final com.oracle.truffle.api.source.SourceSection createSection(java.lang.String,int) +meth public final com.oracle.truffle.api.source.SourceSection createSection(java.lang.String,int,int) +meth public final com.oracle.truffle.api.source.SourceSection createSection(java.lang.String,int,int,int) +meth public final com.oracle.truffle.api.source.SourceSection createSection(java.lang.String,int,int,int,int) +meth public final int getColumnNumber(int) +meth public final int getLength() +meth public final int getLineCount() +meth public final int getLineLength(int) +meth public final int getLineNumber(int) +meth public final int getLineStartOffset(int) +meth public final java.io.InputStream getInputStream() +meth public final java.lang.String getCode(int) +meth public java.lang.String getCode(int,int) +meth public java.lang.String getMimeType() +meth public static com.oracle.truffle.api.source.Source find(java.lang.String) +meth public static com.oracle.truffle.api.source.Source fromAppendableText(java.lang.String) +meth public static com.oracle.truffle.api.source.Source fromBytes(byte[],int,int,java.lang.String,java.nio.charset.Charset) +meth public static com.oracle.truffle.api.source.Source fromBytes(byte[],java.lang.String,java.nio.charset.Charset) +meth public static com.oracle.truffle.api.source.Source fromFileName(java.lang.CharSequence,java.lang.String) throws java.io.IOException +meth public static com.oracle.truffle.api.source.Source fromFileName(java.lang.String) throws java.io.IOException +meth public static com.oracle.truffle.api.source.Source fromFileName(java.lang.String,boolean) throws java.io.IOException +meth public static com.oracle.truffle.api.source.Source fromNamedAppendableText(java.lang.String) +meth public static com.oracle.truffle.api.source.Source fromNamedText(java.lang.CharSequence,java.lang.String) +meth public static com.oracle.truffle.api.source.Source fromReader(java.io.Reader,java.lang.String) throws java.io.IOException +meth public static com.oracle.truffle.api.source.Source fromText(java.lang.CharSequence,java.lang.String) +meth public static com.oracle.truffle.api.source.Source fromURL(java.net.URL,java.lang.String) throws java.io.IOException +meth public static com.oracle.truffle.api.source.Source subSource(com.oracle.truffle.api.source.Source,int) +meth public static com.oracle.truffle.api.source.Source subSource(com.oracle.truffle.api.source.Source,int,int) +meth public static void setFileCaching(boolean) +meth public void appendCode(java.lang.CharSequence) +supr java.lang.Object +hfds LOG,fileCacheEnabled,mimeType,nameToSource,textMap +hcls AppendableLiteralSource,BytesSource,ClientManagedFileSource,FileSource,LiteralSource,SubSource,TextMap,URLSource + +CLSS public final com.oracle.truffle.api.source.SourceSection +meth public boolean equals(java.lang.Object) +meth public com.oracle.truffle.api.source.LineLocation getLineLocation() +meth public com.oracle.truffle.api.source.Source getSource() +meth public int getCharEndIndex() +meth public int getCharIndex() +meth public int getCharLength() +meth public int getEndColumn() +meth public int getEndLine() +meth public int getStartColumn() +meth public int getStartLine() +meth public int hashCode() +meth public java.lang.String getCode() +meth public java.lang.String getIdentifier() +meth public java.lang.String getShortDescription() +meth public java.lang.String toString() +meth public static com.oracle.truffle.api.source.SourceSection createUnavailable(java.lang.String,java.lang.String) +supr java.lang.Object +hfds charIndex,charLength,identifier,kind,source,startColumn,startLine + +CLSS public final com.oracle.truffle.api.utilities.AlwaysValidAssumption +fld public final static com.oracle.truffle.api.utilities.AlwaysValidAssumption INSTANCE +intf com.oracle.truffle.api.Assumption +meth public boolean isValid() +meth public java.lang.String getName() +meth public void check() throws com.oracle.truffle.api.nodes.InvalidAssumptionException +meth public void invalidate() +supr java.lang.Object + +CLSS public com.oracle.truffle.api.utilities.AssumedValue<%0 extends java.lang.Object> +cons public init(java.lang.String,{com.oracle.truffle.api.utilities.AssumedValue%0}) +cons public init({com.oracle.truffle.api.utilities.AssumedValue%0}) +meth public void set({com.oracle.truffle.api.utilities.AssumedValue%0}) +meth public {com.oracle.truffle.api.utilities.AssumedValue%0} get() +supr java.lang.Object +hfds assumption,name,value + +CLSS public final com.oracle.truffle.api.utilities.BinaryConditionProfile +meth public boolean profile(boolean) +meth public boolean wasFalse() +meth public boolean wasTrue() +meth public java.lang.String toString() +supr com.oracle.truffle.api.utilities.ConditionProfile +hfds wasFalse,wasTrue + +CLSS public final com.oracle.truffle.api.utilities.BranchProfile +meth public boolean isVisited() +meth public java.lang.String toString() +meth public static com.oracle.truffle.api.utilities.BranchProfile create() +meth public void enter() +supr com.oracle.truffle.api.nodes.NodeCloneable +hfds visited + +CLSS public abstract com.oracle.truffle.api.utilities.ConditionProfile +meth public abstract boolean profile(boolean) +meth public static com.oracle.truffle.api.utilities.ConditionProfile createBinaryProfile() +meth public static com.oracle.truffle.api.utilities.ConditionProfile createCountingProfile() +supr com.oracle.truffle.api.nodes.NodeCloneable + +CLSS public final com.oracle.truffle.api.utilities.CountingConditionProfile +meth public boolean profile(boolean) +meth public int getFalseCount() +meth public int getTrueCount() +meth public java.lang.String toString() +supr com.oracle.truffle.api.utilities.ConditionProfile +hfds falseCount,trueCount + +CLSS public com.oracle.truffle.api.utilities.CyclicAssumption +cons public init(java.lang.String) +meth public com.oracle.truffle.api.Assumption getAssumption() +meth public void invalidate() +supr java.lang.Object +hfds assumption,name + +CLSS public com.oracle.truffle.api.utilities.JSONHelper +cons public init() +innr public abstract static JSONStringBuilder +innr public final static JSONArrayBuilder +innr public final static JSONObjectBuilder +meth public static com.oracle.truffle.api.utilities.JSONHelper$JSONArrayBuilder array() +meth public static com.oracle.truffle.api.utilities.JSONHelper$JSONObjectBuilder object() +meth public static java.lang.String getResult() +meth public static void dumpNewChild(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.nodes.Node) +meth public static void dumpNewNode(com.oracle.truffle.api.nodes.Node) +meth public static void dumpReplaceChild(com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.nodes.Node,java.lang.CharSequence) +meth public static void restart() +supr java.lang.Object +hfds AstJsonDumpBuilder + +CLSS public final static com.oracle.truffle.api.utilities.JSONHelper$JSONArrayBuilder + outer com.oracle.truffle.api.utilities.JSONHelper +meth protected void appendTo(java.lang.StringBuilder) +meth public com.oracle.truffle.api.utilities.JSONHelper$JSONArrayBuilder add(com.oracle.truffle.api.utilities.JSONHelper$JSONStringBuilder) +meth public com.oracle.truffle.api.utilities.JSONHelper$JSONArrayBuilder add(java.lang.Boolean) +meth public com.oracle.truffle.api.utilities.JSONHelper$JSONArrayBuilder add(java.lang.Number) +meth public com.oracle.truffle.api.utilities.JSONHelper$JSONArrayBuilder add(java.lang.String) +supr com.oracle.truffle.api.utilities.JSONHelper$JSONStringBuilder +hfds contents + +CLSS public final static com.oracle.truffle.api.utilities.JSONHelper$JSONObjectBuilder + outer com.oracle.truffle.api.utilities.JSONHelper +meth protected void appendTo(java.lang.StringBuilder) +meth public com.oracle.truffle.api.utilities.JSONHelper$JSONObjectBuilder add(java.lang.String,com.oracle.truffle.api.utilities.JSONHelper$JSONStringBuilder) +meth public com.oracle.truffle.api.utilities.JSONHelper$JSONObjectBuilder add(java.lang.String,java.lang.Boolean) +meth public com.oracle.truffle.api.utilities.JSONHelper$JSONObjectBuilder add(java.lang.String,java.lang.Number) +meth public com.oracle.truffle.api.utilities.JSONHelper$JSONObjectBuilder add(java.lang.String,java.lang.String) +supr com.oracle.truffle.api.utilities.JSONHelper$JSONStringBuilder +hfds contents + +CLSS public abstract static com.oracle.truffle.api.utilities.JSONHelper$JSONStringBuilder + outer com.oracle.truffle.api.utilities.JSONHelper +cons public init() +meth protected abstract void appendTo(java.lang.StringBuilder) +meth protected static void appendValue(java.lang.StringBuilder,java.lang.Object) +meth public final java.lang.String toString() +supr java.lang.Object + +CLSS public final com.oracle.truffle.api.utilities.NeverValidAssumption +fld public final static com.oracle.truffle.api.utilities.NeverValidAssumption INSTANCE +intf com.oracle.truffle.api.Assumption +meth public boolean isValid() +meth public java.lang.String getName() +meth public void check() throws com.oracle.truffle.api.nodes.InvalidAssumptionException +meth public void invalidate() +supr java.lang.Object + +CLSS public com.oracle.truffle.api.utilities.PrimitiveValueProfile +meth public <%0 extends java.lang.Object> {%%0} profile({%%0}) +meth public boolean isGeneric() +meth public boolean isUninitialized() +meth public boolean profile(boolean) +meth public byte profile(byte) +meth public char profile(char) +meth public double profile(double) +meth public float profile(float) +meth public int profile(int) +meth public java.lang.Object getCachedValue() +meth public java.lang.String toString() +meth public long profile(long) +meth public short profile(short) +meth public static boolean exactCompare(double,double) +meth public static boolean exactCompare(float,float) +supr com.oracle.truffle.api.utilities.ValueProfile +hfds GENERIC,UNINITIALIZED,cachedValue + +CLSS public com.oracle.truffle.api.utilities.UnionAssumption +cons public init(com.oracle.truffle.api.Assumption,com.oracle.truffle.api.Assumption) +cons public init(java.lang.String,com.oracle.truffle.api.Assumption,com.oracle.truffle.api.Assumption) +intf com.oracle.truffle.api.Assumption +meth public boolean isValid() +meth public java.lang.String getName() +meth public void check() throws com.oracle.truffle.api.nodes.InvalidAssumptionException +meth public void invalidate() +supr java.lang.Object +hfds first,name,second + +CLSS public abstract com.oracle.truffle.api.utilities.ValueProfile +cons public init() +meth public abstract <%0 extends java.lang.Object> {%%0} profile({%%0}) +meth public static com.oracle.truffle.api.utilities.PrimitiveValueProfile createPrimitiveProfile() +meth public static com.oracle.truffle.api.utilities.ValueProfile createClassProfile() +meth public static com.oracle.truffle.api.utilities.ValueProfile createIdentityProfile() +supr com.oracle.truffle.api.nodes.NodeCloneable + +CLSS public abstract interface java.io.Serializable + +CLSS public abstract interface java.lang.Cloneable + +CLSS public abstract interface java.lang.Comparable<%0 extends java.lang.Object> +meth public abstract int compareTo({java.lang.Comparable%0}) + +CLSS public abstract java.lang.Enum<%0 extends java.lang.Enum<{java.lang.Enum%0}>> +cons protected init(java.lang.String,int) +intf java.io.Serializable +intf java.lang.Comparable<{java.lang.Enum%0}> +meth protected final java.lang.Object clone() throws java.lang.CloneNotSupportedException +meth protected final void finalize() +meth public final boolean equals(java.lang.Object) +meth public final int compareTo({java.lang.Enum%0}) +meth public final int hashCode() +meth public final int ordinal() +meth public final java.lang.Class<{java.lang.Enum%0}> getDeclaringClass() +meth public final java.lang.String name() +meth public java.lang.String toString() +meth public static <%0 extends java.lang.Enum<{%%0}>> {%%0} valueOf(java.lang.Class<{%%0}>,java.lang.String) +supr java.lang.Object +hfds name,ordinal + +CLSS public java.lang.Exception +cons protected init(java.lang.String,java.lang.Throwable,boolean,boolean) +cons public init() +cons public init(java.lang.String) +cons public init(java.lang.String,java.lang.Throwable) +cons public init(java.lang.Throwable) +supr java.lang.Throwable +hfds serialVersionUID + +CLSS public java.lang.Object +cons public init() +meth protected java.lang.Object clone() throws java.lang.CloneNotSupportedException +meth protected void finalize() throws java.lang.Throwable +meth public boolean equals(java.lang.Object) +meth public final java.lang.Class getClass() +meth public final void notify() +meth public final void notifyAll() +meth public final void wait() throws java.lang.InterruptedException +meth public final void wait(long) throws java.lang.InterruptedException +meth public final void wait(long,int) throws java.lang.InterruptedException +meth public int hashCode() +meth public java.lang.String toString() + +CLSS public java.lang.RuntimeException +cons protected init(java.lang.String,java.lang.Throwable,boolean,boolean) +cons public init() +cons public init(java.lang.String) +cons public init(java.lang.String,java.lang.Throwable) +cons public init(java.lang.Throwable) +supr java.lang.Exception +hfds serialVersionUID + +CLSS public java.lang.Throwable +cons protected init(java.lang.String,java.lang.Throwable,boolean,boolean) +cons public init() +cons public init(java.lang.String) +cons public init(java.lang.String,java.lang.Throwable) +cons public init(java.lang.Throwable) +intf java.io.Serializable +meth public final java.lang.Throwable[] getSuppressed() +meth public final void addSuppressed(java.lang.Throwable) +meth public java.lang.StackTraceElement[] getStackTrace() +meth public java.lang.String getLocalizedMessage() +meth public java.lang.String getMessage() +meth public java.lang.String toString() +meth public java.lang.Throwable fillInStackTrace() +meth public java.lang.Throwable getCause() +meth public java.lang.Throwable initCause(java.lang.Throwable) +meth public void printStackTrace() +meth public void printStackTrace(java.io.PrintStream) +meth public void printStackTrace(java.io.PrintWriter) +meth public void setStackTrace(java.lang.StackTraceElement[]) +supr java.lang.Object +hfds CAUSE_CAPTION,EMPTY_THROWABLE_ARRAY,NULL_CAUSE_MESSAGE,SELF_SUPPRESSION_MESSAGE,SUPPRESSED_CAPTION,SUPPRESSED_SENTINEL,UNASSIGNED_STACK,backtrace,cause,detailMessage,serialVersionUID,stackTrace,suppressedExceptions +hcls PrintStreamOrWriter,SentinelHolder,WrappedPrintStream,WrappedPrintWriter + +CLSS public abstract interface java.lang.annotation.Annotation +meth public abstract boolean equals(java.lang.Object) +meth public abstract int hashCode() +meth public abstract java.lang.Class annotationType() +meth public abstract java.lang.String toString() + +CLSS public abstract interface !annotation java.lang.annotation.Documented + anno 0 java.lang.annotation.Documented() + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE]) +intf java.lang.annotation.Annotation + +CLSS public abstract interface !annotation java.lang.annotation.Retention + anno 0 java.lang.annotation.Documented() + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.annotation.RetentionPolicy value() + +CLSS public abstract interface !annotation java.lang.annotation.Target + anno 0 java.lang.annotation.Documented() + anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME) + anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE]) +intf java.lang.annotation.Annotation +meth public abstract java.lang.annotation.ElementType[] value() + diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java --- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java Thu Nov 26 10:02:03 2015 +0100 @@ -180,7 +180,8 @@ /** * Marks fields that should be considered final for a Truffle compilation although they are not - * final while executing in the interpreter. + * final while executing in the interpreter. If the field type is an array type, the compiler + * considers reads with a constant index as constants. */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD}) diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleLanguage.java --- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleLanguage.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleLanguage.java Thu Nov 26 10:02:03 2015 +0100 @@ -31,9 +31,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import java.util.Collections; import java.util.Map; -import java.util.WeakHashMap; import com.oracle.truffle.api.debug.Debugger; import com.oracle.truffle.api.debug.SuspendedEvent; @@ -72,8 +70,6 @@ */ @SuppressWarnings("javadoc") public abstract class TruffleLanguage { - private final Map compiled = Collections.synchronizedMap(new WeakHashMap()); - /** * Constructor to be called by subclasses. */ @@ -161,8 +157,10 @@ /** * Parses the provided source and generates appropriate AST. The parsing should execute no user - * code, it should only create the {@link Node} tree to represent the source. The parsing may be - * performed in a context (specified as another {@link Node}) or without context. The + * code, it should only create the {@link Node} tree to represent the source. If the provided + * source does not correspond naturally to a call target, the returned call target should create + * and if necessary initialize the corresponding language entity and return it. The parsing may + * be performed in a context (specified as another {@link Node}) or without context. The * {@code argumentNames} may contain symbolic names for actual parameters of the call to the * returned value. The result should be a call target with method * {@link CallTarget#call(java.lang.Object...)} that accepts as many arguments as were provided @@ -198,6 +196,7 @@ * asks all known languages for onlyExplicit symbols and only when none is found, * it does one more round with onlyExplicit set to false. * + * @param context context to locate the global symbol in * @param globalName the name of the global symbol to find * @param onlyExplicit should the language seek for implicitly exported object or only consider * the explicitly exported ones? @@ -213,6 +212,7 @@ * language) but technically it can be one of Java primitive wrappers ({@link Integer}, * {@link Double}, {@link Short}, etc.). * + * @param context context to find the language global in * @return the global object or null if the language does not support such concept */ protected abstract Object getLanguageGlobal(C context); @@ -459,14 +459,14 @@ } @Override - protected Object eval(TruffleLanguage language, Source source) throws IOException { - CallTarget target = language.compiled.get(source); + protected Object eval(TruffleLanguage language, Source source, Map cache) throws IOException { + CallTarget target = cache.get(source); if (target == null) { target = language.parse(source, null); if (target == null) { throw new IOException("Parsing has not produced a CallTarget for " + source); } - language.compiled.put(source, target); + cache.put(source, target); } try { return target.call(); diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleOptions.java --- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleOptions.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleOptions.java Thu Nov 26 10:02:03 2015 +0100 @@ -24,10 +24,12 @@ */ package com.oracle.truffle.api; +import java.security.AccessController; +import java.security.PrivilegedAction; + import com.oracle.truffle.api.nodes.NodeCost; import com.oracle.truffle.api.nodes.NodeInfo; -import java.security.AccessController; -import java.security.PrivilegedAction; +import com.oracle.truffle.api.source.Source; /** * Class containing general Truffle options. @@ -85,6 +87,13 @@ public static final boolean TraceASTJSON; /** + * Enables auto-reload of file-based {@link Source} when the file is changed on disk. + *

+ * Can be set with {@code -Dtruffle.AutoReloadFileSource=true}. + */ + public static final boolean AutoReloadFileSource; + + /** * Forces ahead-of-time initialization. */ public static final boolean AOT; @@ -98,7 +107,7 @@ } static { - final boolean[] values = new boolean[4]; + final boolean[] values = new boolean[5]; AccessController.doPrivileged(new PrivilegedAction() { public Void run() { values[0] = Boolean.getBoolean("truffle.TraceRewrites"); @@ -108,6 +117,7 @@ values[1] = Boolean.getBoolean("truffle.DetailedRewriteReasons"); values[2] = Boolean.getBoolean("truffle.TraceASTJSON"); values[3] = Boolean.getBoolean("com.oracle.truffle.aot"); + values[4] = Boolean.getBoolean("truffle.AutoReloadFileSource"); return null; } }); @@ -115,5 +125,6 @@ DetailedRewriteReasons = values[1]; TraceASTJSON = values[2]; AOT = values[3]; + AutoReloadFileSource = values[4]; } } diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/Accessor.java --- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/Accessor.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/Accessor.java Thu Nov 26 10:02:03 2015 +0100 @@ -49,6 +49,7 @@ import com.oracle.truffle.api.nodes.Node; import com.oracle.truffle.api.nodes.RootNode; import com.oracle.truffle.api.source.Source; +import java.util.Map; /** * Communication between PolyglotEngine, TruffleLanguage API/SPI, and other services. @@ -153,8 +154,8 @@ return API.attachEnv(vm, language, stdOut, stdErr, stdIn, instrumenter); } - protected Object eval(TruffleLanguage l, Source s) throws IOException { - return API.eval(l, s); + protected Object eval(TruffleLanguage l, Source s, Map cache) throws IOException { + return API.eval(l, s, cache); } protected Object evalInContext(Object vm, SuspendedEvent ev, String code, FrameInstance frame) throws IOException { diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/GraphPrintVisitor.java --- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/GraphPrintVisitor.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/GraphPrintVisitor.java Thu Nov 26 10:02:03 2015 +0100 @@ -142,7 +142,7 @@ private static final XMLOutputFactory XML_OUTPUT_FACTORY = XMLOutputFactory.newInstance(); private final XMLStreamWriter xmlstream; - protected XMLImpl(OutputStream outputStream) { + XMLImpl(OutputStream outputStream) { try { this.xmlstream = XML_OUTPUT_FACTORY.createXMLStreamWriter(outputStream); } catch (XMLStreamException | FactoryConfigurationError e) { @@ -435,25 +435,37 @@ } } - protected NodeElement getElementByObject(Object obj) { + /** + * @deprecated to be removed + */ + @Deprecated + protected Object getElementByObject(Object obj) { + return getElementByObjectImpl(obj); + } + + final NodeElement getElementByObjectImpl(Object obj) { return nodeMap.get(obj); } + /** + * @deprecated to be removed + */ + @Deprecated protected void createElementForNode(Object node) { boolean exists = nodeMap.containsKey(node); if (!exists) { int nodeId = !exists ? oldOrNextId(node) : nextId(); nodeMap.put(node, new NodeElement(nodeId)); - setNodeProperty(node, "name", node.getClass().getSimpleName().replaceFirst("Node$", "")); + setNodePropertyImpl(node, "name", node.getClass().getSimpleName().replaceFirst("Node$", "")); NodeInfo nodeInfo = node.getClass().getAnnotation(NodeInfo.class); if (nodeInfo != null) { - setNodeProperty(node, "cost", nodeInfo.cost()); + setNodePropertyImpl(node, "cost", nodeInfo.cost()); if (!nodeInfo.shortName().isEmpty()) { - setNodeProperty(node, "shortName", nodeInfo.shortName()); + setNodePropertyImpl(node, "shortName", nodeInfo.shortName()); } } - setNodeProperty(node, "class", node.getClass().getSimpleName()); + setNodePropertyImpl(node, "class", node.getClass().getSimpleName()); if (node instanceof Node) { readNodeProperties((Node) node); copyDebugProperties((Node) node); @@ -461,15 +473,23 @@ } } + /** + * @deprecated to be removed + */ + @Deprecated protected void setNodeProperty(Object node, String propertyName, Object value) { - NodeElement nodeElem = getElementByObject(node); + setNodePropertyImpl(node, propertyName, value); + } + + final void setNodePropertyImpl(Object node, String propertyName, Object value) { + NodeElement nodeElem = getElementByObjectImpl(node); nodeElem.getProperties().put(propertyName, value); } private void copyDebugProperties(Node node) { Map debugProperties = node.getDebugProperties(); for (Map.Entry property : debugProperties.entrySet()) { - setNodeProperty(node, property.getKey(), property.getValue()); + setNodePropertyImpl(node, property.getKey(), property.getValue()); } } @@ -478,17 +498,25 @@ for (NodeFieldAccessor field : fields) { if (field.getKind() == NodeFieldKind.DATA) { String key = field.getName(); - if (!getElementByObject(node).getProperties().containsKey(key)) { + if (!getElementByObjectImpl(node).getProperties().containsKey(key)) { Object value = field.loadValue(node); - setNodeProperty(node, key, value); + setNodePropertyImpl(node, key, value); } } } } + /** + * @deprecated to be removed + */ + @Deprecated protected void connectNodes(Object a, Object b, String label) { - NodeElement fromNode = getElementByObject(a); - NodeElement toNode = getElementByObject(b); + connectNodesImpl(a, b, label); + } + + final void connectNodesImpl(Object a, Object b, String label) { + NodeElement fromNode = getElementByObjectImpl(a); + NodeElement toNode = getElementByObjectImpl(b); if (fromNode == null || toNode == null) { return; } @@ -510,7 +538,7 @@ } // if node is visited once again, skip - if (getElementByObject(node) != null) { + if (getElementByObjectImpl(node) != null) { return this; } @@ -593,19 +621,19 @@ } public void connectNodes(Object node, Object child) { - GraphPrintVisitor.this.connectNodes(node, child, null); + GraphPrintVisitor.this.connectNodesImpl(node, child, null); } public void connectNodes(Object node, Object child, String label) { - GraphPrintVisitor.this.connectNodes(node, child, label); + GraphPrintVisitor.this.connectNodesImpl(node, child, label); } public void setNodeProperty(Object node, String propertyName, Object value) { - GraphPrintVisitor.this.setNodeProperty(node, propertyName, value); + GraphPrintVisitor.this.setNodePropertyImpl(node, propertyName, value); } public boolean visited(Object node) { - return GraphPrintVisitor.this.getElementByObject(node) != null; + return GraphPrintVisitor.this.getElementByObjectImpl(node) != null; } } diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java --- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java Thu Nov 26 10:02:03 2015 +0100 @@ -430,6 +430,9 @@ public final void atomic(Runnable closure) { RootNode rootNode = getRootNode(); + // Major Assumption: parent is never null after a node got adopted + // it is never reset to null, and thus, rootNode is always reachable. + // GIL: used for nodes that are replace in ASTs that are not yet adopted synchronized (rootNode != null ? rootNode : GIL) { assert enterAtomic(); try { @@ -443,6 +446,9 @@ public final T atomic(Callable closure) { try { RootNode rootNode = getRootNode(); + // Major Assumption: parent is never null after a node got adopted + // it is never reset to null, and thus, rootNode is always reachable. + // GIL: used for nodes that are replace in ASTs that are not yet adopted synchronized (rootNode != null ? rootNode : GIL) { assert enterAtomic(); try { diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeClass.java --- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeClass.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeClass.java Thu Nov 26 10:02:03 2015 +0100 @@ -24,22 +24,15 @@ */ package com.oracle.truffle.api.nodes; -import com.oracle.truffle.api.nodes.Node.Child; -import com.oracle.truffle.api.nodes.Node.Children; -import com.oracle.truffle.api.nodes.NodeFieldAccessor.NodeFieldKind; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; import java.security.AccessController; import java.security.PrivilegedAction; -import java.util.ArrayList; import java.util.Iterator; -import java.util.List; /** * Information about a {@link Node} class. A single instance of this class is allocated for every * subclass of {@link Node} that is used. */ -public final class NodeClass { +public abstract class NodeClass { private static final ClassValue nodeClasses = new ClassValue() { @SuppressWarnings("unchecked") @Override @@ -47,25 +40,12 @@ assert Node.class.isAssignableFrom(clazz); return AccessController.doPrivileged(new PrivilegedAction() { public NodeClass run() { - return new NodeClass((Class) clazz); + return new NodeClassImpl((Class) clazz); } }); } }; - private static final NodeFieldAccessor[] EMPTY_NODE_FIELD_ARRAY = new NodeFieldAccessor[0]; - - // The comprehensive list of all fields. - private final NodeFieldAccessor[] fields; - // Separate arrays for the frequently accessed fields. - private final NodeFieldAccessor parentField; - private final NodeFieldAccessor nodeClassField; - private final NodeFieldAccessor[] childFields; - private final NodeFieldAccessor[] childrenFields; - private final NodeFieldAccessor[] cloneableFields; - - private final Class clazz; - public static NodeClass get(Class clazz) { return nodeClasses.get(clazz); } @@ -74,185 +54,29 @@ return node.getNodeClass(); } - NodeClass(Class clazz) { - List fieldsList = new ArrayList<>(); - NodeFieldAccessor parentFieldTmp = null; - NodeFieldAccessor nodeClassFieldTmp = null; - List childFieldList = new ArrayList<>(); - List childrenFieldList = new ArrayList<>(); - List cloneableFieldList = new ArrayList<>(); - - for (Field field : NodeUtil.getAllFields(clazz)) { - if (Modifier.isStatic(field.getModifiers()) || field.isSynthetic()) { - continue; - } - - NodeFieldAccessor nodeField; - if (field.getDeclaringClass() == Node.class && field.getName().equals("parent")) { - assert Node.class.isAssignableFrom(field.getType()); - nodeField = NodeFieldAccessor.create(NodeFieldKind.PARENT, field); - parentFieldTmp = nodeField; - } else if (field.getDeclaringClass() == Node.class && field.getName().equals("nodeClass")) { - assert NodeClass.class.isAssignableFrom(field.getType()); - nodeField = NodeFieldAccessor.create(NodeFieldKind.NODE_CLASS, field); - nodeClassFieldTmp = nodeField; - } else if (field.getAnnotation(Child.class) != null) { - checkChildField(field); - nodeField = NodeFieldAccessor.create(NodeFieldKind.CHILD, field); - childFieldList.add(nodeField); - } else if (field.getAnnotation(Children.class) != null) { - checkChildrenField(field); - nodeField = NodeFieldAccessor.create(NodeFieldKind.CHILDREN, field); - childrenFieldList.add(nodeField); - } else { - nodeField = NodeFieldAccessor.create(NodeFieldKind.DATA, field); - if (NodeCloneable.class.isAssignableFrom(field.getType())) { - cloneableFieldList.add(nodeField); - } - } - fieldsList.add(nodeField); - } - - if (parentFieldTmp == null) { - throw new AssertionError("parent field not found"); - } - - this.fields = fieldsList.toArray(EMPTY_NODE_FIELD_ARRAY); - this.nodeClassField = nodeClassFieldTmp; - this.parentField = parentFieldTmp; - this.childFields = childFieldList.toArray(EMPTY_NODE_FIELD_ARRAY); - this.childrenFields = childrenFieldList.toArray(EMPTY_NODE_FIELD_ARRAY); - this.cloneableFields = cloneableFieldList.toArray(EMPTY_NODE_FIELD_ARRAY); - this.clazz = clazz; - } - - public NodeFieldAccessor getNodeClassField() { - return nodeClassField; - } - - public NodeFieldAccessor[] getCloneableFields() { - return cloneableFields; - } - - private static boolean isNodeType(Class clazz) { - return Node.class.isAssignableFrom(clazz) || (clazz.isInterface() && NodeInterface.class.isAssignableFrom(clazz)); - } - - private static void checkChildField(Field field) { - if (!isNodeType(field.getType())) { - throw new AssertionError("@Child field type must be a subclass of Node or an interface extending NodeInterface (" + field + ")"); - } - if (Modifier.isFinal(field.getModifiers())) { - throw new AssertionError("@Child field must not be final (" + field + ")"); - } - } - - private static void checkChildrenField(Field field) { - if (!(field.getType().isArray() && isNodeType(field.getType().getComponentType()))) { - throw new AssertionError("@Children field type must be an array of a subclass of Node or an interface extending NodeInterface (" + field + ")"); - } - if (!Modifier.isFinal(field.getModifiers())) { - throw new AssertionError("@Children field must be final (" + field + ")"); - } - } - - public NodeFieldAccessor[] getFields() { - return fields; - } - - public NodeFieldAccessor getParentField() { - return parentField; + @SuppressWarnings("unused") + public NodeClass(Class clazz) { } - public NodeFieldAccessor[] getChildFields() { - return childFields; - } + public abstract NodeFieldAccessor getNodeClassField(); - public NodeFieldAccessor[] getChildrenFields() { - return childrenFields; - } - - @Override - public int hashCode() { - return clazz.hashCode(); - } + public abstract NodeFieldAccessor[] getCloneableFields(); - @Override - public boolean equals(Object obj) { - if (obj instanceof NodeClass) { - NodeClass other = (NodeClass) obj; - return clazz.equals(other.clazz); - } - return false; - } - - public Iterator makeIterator(Node node) { - assert clazz.isInstance(node); - return new NodeIterator(this, node); - } + public abstract NodeFieldAccessor[] getFields(); - private static final class NodeIterator implements Iterator { - private final NodeFieldAccessor[] childFields; - private final NodeFieldAccessor[] childrenFields; - private final Node node; - private final int childrenCount; - private int index; + public abstract NodeFieldAccessor getParentField(); - protected NodeIterator(NodeClass nodeClass, Node node) { - this.childFields = nodeClass.getChildFields(); - this.childrenFields = nodeClass.getChildrenFields(); - this.node = node; - this.childrenCount = childrenCount(); - this.index = 0; - } + public abstract NodeFieldAccessor[] getChildFields(); - private int childrenCount() { - int nodeCount = childFields.length; - for (NodeFieldAccessor childrenField : childrenFields) { - Object[] children = ((Object[]) childrenField.getObject(node)); - if (children != null) { - nodeCount += children.length; - } - } - return nodeCount; - } + public abstract NodeFieldAccessor[] getChildrenFields(); + + public abstract Iterator makeIterator(Node node); - private Node nodeAt(int idx) { - int nodeCount = childFields.length; - if (idx < nodeCount) { - return (Node) childFields[idx].getObject(node); - } else { - for (NodeFieldAccessor childrenField : childrenFields) { - Object[] nodeArray = (Object[]) childrenField.getObject(node); - if (idx < nodeCount + nodeArray.length) { - return (Node) nodeArray[idx - nodeCount]; - } - nodeCount += nodeArray.length; - } - } - return null; - } - - private void forward() { - if (index < childrenCount) { - index++; - } - } - - public boolean hasNext() { - return index < childrenCount; - } - - public Node next() { - try { - return nodeAt(index); - } finally { - forward(); - } - } - - public void remove() { - throw new UnsupportedOperationException(); - } - } + /** + * The {@link Class} this NodeClass has been {@link #NodeClass(java.lang.Class) + * created for}. + * + * @return the clazz of node this NodeClass describes + */ + public abstract Class getType(); } diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeClassImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeClassImpl.java Thu Nov 26 10:02:03 2015 +0100 @@ -0,0 +1,263 @@ +/* + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.truffle.api.nodes; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import com.oracle.truffle.api.nodes.Node.Child; +import com.oracle.truffle.api.nodes.Node.Children; +import com.oracle.truffle.api.nodes.NodeFieldAccessor.NodeFieldKind; + +/** + * Information about a {@link Node} class. A single instance of this class is allocated for every + * subclass of {@link Node} that is used. + */ +final class NodeClassImpl extends NodeClass { + private static final NodeFieldAccessor[] EMPTY_NODE_FIELD_ARRAY = new NodeFieldAccessor[0]; + + // The comprehensive list of all fields. + private final NodeFieldAccessor[] fields; + // Separate arrays for the frequently accessed fields. + private final NodeFieldAccessor parentField; + private final NodeFieldAccessor nodeClassField; + private final NodeFieldAccessor[] childFields; + private final NodeFieldAccessor[] childrenFields; + private final NodeFieldAccessor[] cloneableFields; + + private final Class clazz; + + NodeClassImpl(Class clazz) { + super(clazz); + if (!Node.class.isAssignableFrom(clazz)) { + throw new IllegalArgumentException(); + } + + List fieldsList = new ArrayList<>(); + NodeFieldAccessor parentFieldTmp = null; + NodeFieldAccessor nodeClassFieldTmp = null; + List childFieldList = new ArrayList<>(); + List childrenFieldList = new ArrayList<>(); + List cloneableFieldList = new ArrayList<>(); + + try { + Field field = Node.class.getDeclaredField("parent"); + assert Node.class.isAssignableFrom(field.getType()); + parentFieldTmp = NodeFieldAccessor.create(NodeFieldKind.PARENT, field); + field = Node.class.getDeclaredField("nodeClass"); + assert NodeClass.class.isAssignableFrom(field.getType()); + nodeClassFieldTmp = NodeFieldAccessor.create(NodeFieldKind.NODE_CLASS, field); + } catch (NoSuchFieldException e) { + throw new AssertionError("Node field not found", e); + } + + collectInstanceFields(clazz, fieldsList, childFieldList, childrenFieldList, cloneableFieldList); + + this.fields = fieldsList.toArray(EMPTY_NODE_FIELD_ARRAY); + this.nodeClassField = nodeClassFieldTmp; + this.parentField = parentFieldTmp; + this.childFields = childFieldList.toArray(EMPTY_NODE_FIELD_ARRAY); + this.childrenFields = childrenFieldList.toArray(EMPTY_NODE_FIELD_ARRAY); + this.cloneableFields = cloneableFieldList.toArray(EMPTY_NODE_FIELD_ARRAY); + this.clazz = clazz; + } + + private static void collectInstanceFields(Class clazz, List fieldsList, List childFieldList, List childrenFieldList, + List cloneableFieldList) { + if (clazz.getSuperclass() != null) { + collectInstanceFields(clazz.getSuperclass(), fieldsList, childFieldList, childrenFieldList, cloneableFieldList); + } + Field[] declaredFields = clazz.getDeclaredFields(); + for (Field field : declaredFields) { + if (Modifier.isStatic(field.getModifiers()) || field.isSynthetic()) { + continue; + } + + NodeFieldAccessor nodeField; + if (field.getDeclaringClass() == Node.class && (field.getName().equals("parent") || field.getName().equals("nodeClass"))) { + continue; + } else if (field.getAnnotation(Child.class) != null) { + checkChildField(field); + nodeField = NodeFieldAccessor.create(NodeFieldKind.CHILD, field); + childFieldList.add(nodeField); + } else if (field.getAnnotation(Children.class) != null) { + checkChildrenField(field); + nodeField = NodeFieldAccessor.create(NodeFieldKind.CHILDREN, field); + childrenFieldList.add(nodeField); + } else { + nodeField = NodeFieldAccessor.create(NodeFieldKind.DATA, field); + if (NodeCloneable.class.isAssignableFrom(field.getType())) { + cloneableFieldList.add(nodeField); + } + } + fieldsList.add(nodeField); + } + } + + @Override + public NodeFieldAccessor getNodeClassField() { + return nodeClassField; + } + + @Override + public NodeFieldAccessor[] getCloneableFields() { + return cloneableFields; + } + + private static boolean isNodeType(Class clazz) { + return Node.class.isAssignableFrom(clazz) || (clazz.isInterface() && NodeInterface.class.isAssignableFrom(clazz)); + } + + private static void checkChildField(Field field) { + if (!isNodeType(field.getType())) { + throw new AssertionError("@Child field type must be a subclass of Node or an interface extending NodeInterface (" + field + ")"); + } + if (Modifier.isFinal(field.getModifiers())) { + throw new AssertionError("@Child field must not be final (" + field + ")"); + } + } + + private static void checkChildrenField(Field field) { + if (!(field.getType().isArray() && isNodeType(field.getType().getComponentType()))) { + throw new AssertionError("@Children field type must be an array of a subclass of Node or an interface extending NodeInterface (" + field + ")"); + } + if (!Modifier.isFinal(field.getModifiers())) { + throw new AssertionError("@Children field must be final (" + field + ")"); + } + } + + @Override + public NodeFieldAccessor[] getFields() { + return fields; + } + + @Override + public NodeFieldAccessor getParentField() { + return parentField; + } + + @Override + public NodeFieldAccessor[] getChildFields() { + return childFields; + } + + @Override + public NodeFieldAccessor[] getChildrenFields() { + return childrenFields; + } + + @Override + public int hashCode() { + return clazz.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof NodeClassImpl) { + NodeClassImpl other = (NodeClassImpl) obj; + return clazz.equals(other.clazz); + } + return false; + } + + @Override + public Iterator makeIterator(Node node) { + assert clazz.isInstance(node); + return new NodeIterator(this, node); + } + + @Override + public Class getType() { + return clazz; + } + + private static final class NodeIterator implements Iterator { + private final NodeFieldAccessor[] childFields; + private final NodeFieldAccessor[] childrenFields; + private final Node node; + private final int childrenCount; + private int index; + + protected NodeIterator(NodeClassImpl nodeClass, Node node) { + this.childFields = nodeClass.getChildFields(); + this.childrenFields = nodeClass.getChildrenFields(); + this.node = node; + this.childrenCount = childrenCount(); + this.index = 0; + } + + private int childrenCount() { + int nodeCount = childFields.length; + for (NodeFieldAccessor childrenField : childrenFields) { + Object[] children = ((Object[]) childrenField.getObject(node)); + if (children != null) { + nodeCount += children.length; + } + } + return nodeCount; + } + + private Node nodeAt(int idx) { + int nodeCount = childFields.length; + if (idx < nodeCount) { + return (Node) childFields[idx].getObject(node); + } else { + for (NodeFieldAccessor childrenField : childrenFields) { + Object[] nodeArray = (Object[]) childrenField.getObject(node); + if (idx < nodeCount + nodeArray.length) { + return (Node) nodeArray[idx - nodeCount]; + } + nodeCount += nodeArray.length; + } + } + return null; + } + + private void forward() { + if (index < childrenCount) { + index++; + } + } + + public boolean hasNext() { + return index < childrenCount; + } + + public Node next() { + try { + return nodeAt(index); + } finally { + forward(); + } + } + + public void remove() { + throw new UnsupportedOperationException(); + } + } +} diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java --- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java Thu Nov 26 10:02:03 2015 +0100 @@ -30,7 +30,6 @@ import java.io.StringWriter; import java.lang.annotation.Annotation; import java.lang.reflect.Array; -import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -383,15 +382,6 @@ return true; } - /** Returns all declared fields in the class hierarchy. */ - static Field[] getAllFields(Class clazz) { - Field[] declaredFields = clazz.getDeclaredFields(); - if (clazz.getSuperclass() != null) { - return concat(getAllFields(clazz.getSuperclass()), declaredFields); - } - return declaredFields; - } - public static T[] concat(T[] first, T[] second) { T[] result = Arrays.copyOf(first, first.length + second.length); System.arraycopy(second, 0, result, first.length, second.length); diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/UnexpectedResultException.java --- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/UnexpectedResultException.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/UnexpectedResultException.java Thu Nov 26 10:02:03 2015 +0100 @@ -43,7 +43,7 @@ * @param result the alternative result */ public UnexpectedResultException(Object result) { - CompilerDirectives.transferToInterpreter(); + CompilerDirectives.transferToInterpreterAndInvalidate(); this.result = result; } diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java --- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java Thu Nov 26 10:02:03 2015 +0100 @@ -54,6 +54,7 @@ import com.oracle.truffle.api.CompilerAsserts; import com.oracle.truffle.api.TruffleLanguage.Registration; +import com.oracle.truffle.api.TruffleOptions; /** * Representation of a guest language source code unit and its contents. Sources originate in @@ -229,7 +230,6 @@ */ public static Source fromText(CharSequence chars, String description) { CompilerAsserts.neverPartOfCompilation(); - assert chars != null; return new LiteralSource(description, chars.toString()); } @@ -833,7 +833,12 @@ private final String path; // Normalized path description of an actual file private String code = null; // A cache of the file's contents - private long timeStamp; // timestamp of the cache in the file system + + /** + * Timestamp of the cache in the file system. Enabled by setting + * {@link TruffleOptions.AutoReloadFileSource} to true. + */ + private long timeStamp; public FileSource(File file, String name, String path) { this.file = file.getAbsoluteFile(); @@ -859,10 +864,12 @@ @Override public String getCode() { if (fileCacheEnabled) { - if (code == null || timeStamp != file.lastModified()) { + if (code == null || (TruffleOptions.AutoReloadFileSource && timeStamp != file.lastModified())) { try { code = read(getReader()); - timeStamp = file.lastModified(); + if (TruffleOptions.AutoReloadFileSource) { + timeStamp = file.lastModified(); + } } catch (IOException e) { } } @@ -887,7 +894,7 @@ @Override public Reader getReader() { - if (code != null && timeStamp == file.lastModified()) { + if (code != null && (TruffleOptions.AutoReloadFileSource && timeStamp == file.lastModified())) { return new StringReader(code); } try { diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/SourceSection.java --- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/SourceSection.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/SourceSection.java Thu Nov 26 10:02:03 2015 +0100 @@ -170,9 +170,10 @@ } /** - * Returns text described by this section. + * Returns the source code fragment described by this section. * - * @return the code as a String object + * @return the code as a string, or {@code ""} if the SourceSection was created + * using {@link #createUnavailable}. */ public String getCode() { return source == null ? "" : source.getCode(charIndex, charLength); @@ -182,7 +183,7 @@ * Returns a short description of the source section, using just the file name, rather than its * full path. * - * @return a short description of the source section + * @return a short description of the source section formatted as {@code :}. */ public String getShortDescription() { if (source == null) { @@ -191,9 +192,21 @@ return String.format("%s:%d", source.getShortName(), startLine); } + /** + * Returns an implementation-defined string representation of this source section to be used for + * debugging purposes only. + * + * @see #getCode() + * @see #getShortDescription() + */ @Override public String toString() { - return getShortDescription(); + if (source == null) { + return kind + ": " + identifier; + } else { + return "source=" + source.getShortName() + " pos=" + charIndex + " len=" + charLength + " line=" + startLine + " col=" + startColumn + + (identifier != null ? " identifier=" + identifier : "") + " code=" + getCode(); + } } @Override diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/CountingConditionProfile.java --- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/CountingConditionProfile.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/CountingConditionProfile.java Thu Nov 26 10:02:03 2015 +0100 @@ -52,14 +52,18 @@ CompilerDirectives.transferToInterpreterAndInvalidate(); } if (CompilerDirectives.inInterpreter()) { - trueCount++; + if (trueCount < Integer.MAX_VALUE) { + trueCount++; + } } } else { if (falseCount == 0) { CompilerDirectives.transferToInterpreterAndInvalidate(); } if (CompilerDirectives.inInterpreter()) { - falseCount++; + if (falseCount < Integer.MAX_VALUE) { + falseCount++; + } } } return CompilerDirectives.injectBranchProbability((double) trueCount / (double) (trueCount + falseCount), value); diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/ParsingCachedTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/truffle/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/ParsingCachedTest.java Thu Nov 26 10:02:03 2015 +0100 @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * The Universal Permissive License (UPL), Version 1.0 + * + * Subject to the condition set forth below, permission is hereby granted to any + * person obtaining a copy of this software, associated documentation and/or + * data (collectively the "Software"), free of charge and under any and all + * copyright rights in the Software, and any and all patent rights owned or + * freely licensable by each licensor hereunder covering either (i) the + * unmodified Software as contributed to or provided by such licensor, or (ii) + * the Larger Works (as defined below), to deal in both + * + * (a) the Software, and + * + * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if + * one is included with the Software each a "Larger Work" to which the Software + * is contributed by such licensors), + * + * without restriction, including without limitation the rights to copy, create + * derivative works of, display, perform, and distribute the Software and make, + * use, sell, offer for sale, import, export, have made, and have sold the + * Software and the Larger Work(s), and to sublicense the foregoing rights on + * either these or other terms. + * + * This license is subject to the following condition: + * + * The above copyright notice and either this complete permission notice or at a + * minimum a reference to the UPL must be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package com.oracle.truffle.sl.test; + +import com.oracle.truffle.api.source.Source; +import com.oracle.truffle.api.vm.PolyglotEngine; +import com.oracle.truffle.sl.SLLanguage; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ParsingCachedTest { + + @Test + public void stepInStepOver() throws Throwable { + Source nullSrc = Source.fromText("function main() {}", "yields null").withMimeType("application/x-sl"); + + PolyglotEngine engine = PolyglotEngine.newBuilder().build(); + int cnt = SLLanguage.parsingCount(); + Object res = engine.eval(nullSrc).get(); + assertNull("Is null", res); + assertEquals("One parsing happened", cnt + 1, SLLanguage.parsingCount()); + + Object res2 = engine.eval(nullSrc).get(); + assertNull("Still null", res2); + assertEquals("No more parsing happened", cnt + 1, SLLanguage.parsingCount()); + } + +} diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLTckTest.java --- a/truffle/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLTckTest.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLTckTest.java Thu Nov 26 10:02:03 2015 +0100 @@ -180,7 +180,7 @@ @Override protected String evaluateSource() { - return "interopEval"; + return "eval"; } // diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.sl.test/src/tests/Eval.output --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/truffle/com.oracle.truffle.sl.test/src/tests/Eval.output Thu Nov 26 10:02:03 2015 +0100 @@ -0,0 +1,1 @@ +16 diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.sl.test/src/tests/Eval.sl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/truffle/com.oracle.truffle.sl.test/src/tests/Eval.sl Thu Nov 26 10:02:03 2015 +0100 @@ -0,0 +1,4 @@ +function main() { + eval("application/x-sl", "function foo() { return 14 + 2; }"); + println(foo()); +} diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLLanguage.java --- a/truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLLanguage.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLLanguage.java Thu Nov 26 10:02:03 2015 +0100 @@ -50,7 +50,7 @@ import java.util.List; import com.oracle.truffle.api.CallTarget; -import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; +import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.RootCallTarget; import com.oracle.truffle.api.Truffle; import com.oracle.truffle.api.TruffleLanguage; @@ -114,6 +114,8 @@ import com.oracle.truffle.sl.runtime.SLFunction; import com.oracle.truffle.sl.runtime.SLFunctionRegistry; import com.oracle.truffle.sl.runtime.SLNull; +import java.util.Map; +import java.util.WeakHashMap; /** * SL is a simple language to demonstrate and showcase features of Truffle. The implementation is as @@ -204,8 +206,12 @@ public static final String builtinKind = "SL builtin"; private static List> builtins = Collections.emptyList(); private static Visualizer visualizer = new SLDefaultVisualizer(); + private static int parsingCount; + + private final Map compiled; private SLLanguage() { + compiled = Collections.synchronizedMap(new WeakHashMap()); } public static final SLLanguage INSTANCE = new SLLanguage(); @@ -258,6 +264,10 @@ reportToolDemos(); } + public static int parsingCount() { + return parsingCount; + } + /** * Parse and run the specified SL source. Factored out in a separate method so that it can also * be used by the unit test harness. @@ -415,6 +425,11 @@ @Override protected CallTarget parse(Source code, final Node node, String... argumentNames) throws IOException { + CallTarget cached = compiled.get(code); + if (cached != null) { + return cached; + } + parsingCount++; final SLContext c = new SLContext(this); final Exception[] failed = {null}; try { @@ -424,9 +439,16 @@ failed[0] = e; } RootNode rootNode = new RootNode(SLLanguage.class, null, null) { - @TruffleBoundary @Override public Object execute(VirtualFrame frame) { + /* + * We do not expect this node to be part of anything that gets compiled for + * performance reason. It can be compiled though when doing compilation stress + * testing. But in this case it is fine to just deoptimize. Note that we cannot + * declare the method as @TruffleBoundary because it has a VirtualFrame parameter. + */ + CompilerDirectives.transferToInterpreter(); + if (failed[0] instanceof RuntimeException) { throw (RuntimeException) failed[0]; } @@ -455,7 +477,9 @@ return null; } }; - return Truffle.getRuntime().createCallTarget(rootNode); + cached = Truffle.getRuntime().createCallTarget(rootNode); + compiled.put(code, cached); + return cached; } @Override @@ -480,9 +504,6 @@ @Override protected Visualizer getVisualizer() { - if (visualizer == null) { - visualizer = new SLDefaultVisualizer(); - } return visualizer; } diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLEvalBuiltin.java --- a/truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLEvalBuiltin.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLEvalBuiltin.java Thu Nov 26 10:02:03 2015 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * The Universal Permissive License (UPL), Version 1.0 @@ -40,7 +40,12 @@ */ package com.oracle.truffle.sl.builtins; +import com.oracle.truffle.api.CallTarget; +import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; +import com.oracle.truffle.api.dsl.Cached; import com.oracle.truffle.api.dsl.Specialization; +import com.oracle.truffle.api.frame.VirtualFrame; +import com.oracle.truffle.api.nodes.DirectCallNode; import com.oracle.truffle.api.nodes.NodeInfo; import com.oracle.truffle.api.source.Source; import com.oracle.truffle.api.source.SourceSection; @@ -48,22 +53,44 @@ import java.io.IOException; /** - * Builtin function to parse a text in other language. + * Builtin function to evaluate source code in any supported language. + *

+ * The call target is cached against the mime type and the source code, so that if they are the same + * each time then a direct call will be made to a cached AST, allowing it to be compiled and + * possibly inlined. */ -@NodeInfo(shortName = "interopEval") +@NodeInfo(shortName = "eval") public abstract class SLEvalBuiltin extends SLBuiltinNode { public SLEvalBuiltin() { - super(SourceSection.createUnavailable(SLLanguage.builtinKind, "interopEval")); + super(SourceSection.createUnavailable(SLLanguage.builtinKind, "eval")); + } + + @SuppressWarnings("unused") + @Specialization(guards = {"stringsEqual(mimeType, cachedMimeType)", "stringsEqual(code, cachedCode)"}) + public Object evalCached(VirtualFrame frame, String mimeType, String code, @Cached("mimeType") String cachedMimeType, @Cached("code") String cachedCode, + @Cached("create(parse(mimeType, code))") DirectCallNode callNode) { + return callNode.call(frame, new Object[]{}); } - @Specialization - public Object interopEval(String mimeType, String code) { - Source source = Source.fromText(code, "").withMimeType(mimeType); + @TruffleBoundary + @Specialization(contains = "evalCached") + public Object evalUncached(String mimeType, String code) { + return parse(mimeType, code).call(); + } + + protected CallTarget parse(String mimeType, String code) { + final Source source = Source.fromText(code, "(eval)").withMimeType(mimeType); + try { - return getContext().evalAny(source); + return getContext().parse(source); } catch (IOException ex) { throw new IllegalArgumentException(ex); } } + + protected boolean stringsEqual(String a, String b) { + return a.equals(b); + } + } diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/access/SLWritePropertyCacheNode.java --- a/truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/access/SLWritePropertyCacheNode.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/access/SLWritePropertyCacheNode.java Thu Nov 26 10:02:03 2015 +0100 @@ -40,11 +40,10 @@ */ package com.oracle.truffle.sl.nodes.access; -import com.oracle.truffle.api.Assumption; +import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.api.dsl.Cached; import com.oracle.truffle.api.dsl.Specialization; -import com.oracle.truffle.api.nodes.InvalidAssumptionException; import com.oracle.truffle.api.nodes.Node; import com.oracle.truffle.api.object.DynamicObject; import com.oracle.truffle.api.object.FinalLocationException; @@ -52,8 +51,6 @@ import com.oracle.truffle.api.object.Location; import com.oracle.truffle.api.object.Property; import com.oracle.truffle.api.object.Shape; -import com.oracle.truffle.api.utilities.AlwaysValidAssumption; -import com.oracle.truffle.api.utilities.NeverValidAssumption; public abstract class SLWritePropertyCacheNode extends Node { protected static final int CACHE_LIMIT = 3; @@ -66,17 +63,10 @@ public abstract void executeObject(DynamicObject receiver, Object value); - @Specialization(guards = {"location != null", "shape.check(receiver)", "canSet(location, receiver, value)"}, assumptions = {"shape.getValidAssumption()"}, limit = "CACHE_LIMIT") + @Specialization(guards = {"location != null", "shape.check(receiver)", "canSet(location, receiver, value)"}, assumptions = "shape.getValidAssumption()", limit = "CACHE_LIMIT") public void writeExistingPropertyCached(DynamicObject receiver, Object value, // @Cached("lookupLocation(receiver, value)") Location location, // - @Cached("receiver.getShape()") Shape shape, // - @Cached("ensureValid(receiver)") Assumption validAssumption) { - try { - validAssumption.check(); - } catch (InvalidAssumptionException e) { - executeObject(receiver, value); - return; - } + @Cached("receiver.getShape()") Shape shape) { try { location.set(receiver, value, shape); } catch (IncompatibleLocationException | FinalLocationException e) { @@ -84,36 +74,33 @@ } } - @Specialization(guards = {"existing == null", "shapeBefore.check(receiver)", "canSet(newLocation, receiver, value)"}, assumptions = {"shapeBefore.getValidAssumption()", - "shapeAfter.getValidAssumption()"}, limit = "CACHE_LIMIT") + @Specialization(guards = {"existingLocation == null", "oldShape.check(receiver)", "canSet(newLocation, receiver, value)"}, assumptions = {"oldShape.getValidAssumption()", + "newShape.getValidAssumption()"}, limit = "CACHE_LIMIT") public void writeNewPropertyCached(DynamicObject receiver, Object value, // - @Cached("lookupLocation(receiver, value)") @SuppressWarnings("unused") Location existing, // - @Cached("receiver.getShape()") Shape shapeBefore, // - @Cached("defineProperty(receiver, value)") Shape shapeAfter, // - @Cached("getLocation(shapeAfter)") Location newLocation, // - @Cached("ensureValid(receiver)") Assumption validAssumption) { + @Cached("lookupLocation(receiver, value)") @SuppressWarnings("unused") Location existingLocation, // + @Cached("receiver.getShape()") Shape oldShape, // + @Cached("defineProperty(oldShape, value)") Shape newShape, // + @Cached("getLocation(newShape)") Location newLocation) { try { - validAssumption.check(); - } catch (InvalidAssumptionException e) { - executeObject(receiver, value); - return; - } - try { - newLocation.set(receiver, value, shapeBefore, shapeAfter); + newLocation.set(receiver, value, oldShape, newShape); } catch (IncompatibleLocationException e) { throw new IllegalStateException(e); } } - @Specialization(contains = {"writeExistingPropertyCached", "writeNewPropertyCached"}) + @Specialization(guards = "updateShape(receiver)") + public void updateShape(DynamicObject receiver, Object value) { + executeObject(receiver, value); + } + @TruffleBoundary + @Specialization(contains = {"writeExistingPropertyCached", "writeNewPropertyCached", "updateShape"}) public void writeUncached(DynamicObject receiver, Object value) { receiver.define(propertyName, value); } protected final Location lookupLocation(DynamicObject object, Object value) { - final Shape oldShape = object.getShape(); - final Property property = oldShape.getProperty(propertyName); + final Property property = object.getShape().getProperty(propertyName); if (property != null && property.getLocation().canSet(object, value)) { return property.getLocation(); @@ -122,22 +109,21 @@ } } - protected final Shape defineProperty(DynamicObject receiver, Object value) { - Shape oldShape = receiver.getShape(); - Shape newShape = oldShape.defineProperty(propertyName, value, 0); - return newShape; + protected final Shape defineProperty(Shape oldShape, Object value) { + return oldShape.defineProperty(propertyName, value, 0); } protected final Location getLocation(Shape newShape) { return newShape.getProperty(propertyName).getLocation(); } - protected static Assumption ensureValid(DynamicObject receiver) { - return receiver.updateShape() ? NeverValidAssumption.INSTANCE : AlwaysValidAssumption.INSTANCE; - } - protected static boolean canSet(Location location, DynamicObject receiver, Object value) { return location.canSet(receiver, value); } + protected static boolean updateShape(DynamicObject object) { + CompilerDirectives.transferToInterpreter(); + return object.updateShape(); + } + } diff -r b272920e26b2 -r d158937952b6 truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/runtime/SLContext.java --- a/truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/runtime/SLContext.java Wed Nov 25 12:18:46 2015 +0100 +++ b/truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/runtime/SLContext.java Thu Nov 26 10:02:03 2015 +0100 @@ -40,6 +40,7 @@ */ package com.oracle.truffle.sl.runtime; +import com.oracle.truffle.api.CallTarget; import com.oracle.truffle.api.ExecutionContext; import com.oracle.truffle.api.TruffleLanguage; import com.oracle.truffle.api.dsl.NodeFactory; @@ -243,8 +244,8 @@ throw new IllegalStateException(a + " is not a Truffle value"); } - public Object evalAny(Source source) throws IOException { - return env.parse(source).call(); + public CallTarget parse(Source source) throws IOException { + return env.parse(source); } /**