Package com.oracle.truffle.sl.runtime
Class SLObject
java.lang.Object
com.oracle.truffle.api.object.DynamicObject
com.oracle.truffle.sl.runtime.SLObject
- All Implemented Interfaces:
com.oracle.truffle.api.interop.TruffleObject
public final class SLObject
extends com.oracle.truffle.api.object.DynamicObject
implements com.oracle.truffle.api.interop.TruffleObject
Represents an SL object.
This class defines operations that can be performed on SL Objects. While we could define all
these operations as individual AST nodes, we opted to define those operations by using
a Truffle library, or more concretely the
InteropLibrary. This has several advantages, but the primary one is that it allows SL
objects to be used in the interoperability message protocol, i.e. It allows other languages and
tools to operate on SL objects without necessarily knowing they are SL objects.
SL Objects are essentially instances of DynamicObject (objects whose members can be
dynamically added and removed). We also annotate the class with ExportLibrary with value
InteropLibrary.class. This essentially ensures that the build system and
runtime know that this class specifies the interop messages (i.e. operations) that SL can do on
SLObject instances.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.oracle.truffle.api.object.DynamicObject
com.oracle.truffle.api.object.DynamicObject.DynamicField -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.oracle.truffle.api.object.DynamicObject
clone, getShape
-
Field Details
-
CACHE_LIMIT
protected static final int CACHE_LIMIT- See Also:
-
-
Constructor Details
-
SLObject
public SLObject(com.oracle.truffle.api.object.Shape shape)
-