Elide GraalVM25.6.0-elide.4
All types
Versions and modules

MaterializedLocalAccessor

Javaclassin com.oracle.truffle.api.bytecodesince 24.2

public final class MaterializedLocalAccessor
Inheritance
  1. Object
  2. MaterializedLocalAccessor

Operation parameter that allows an operation to get, set, and clear the value of a local from a materialized frame of the current root node or an outer root node. This class can only be used if the root node supports materialized local accesses.

To use a materialized local accessor, declare a ConstantOperand on the operation. The corresponding builder method for the operation will take a BytecodeLocal argument for the local to be accessed. At run time, a MaterializedLocalAccessor for the local will be supplied as a parameter to the operation.

Materialized local accessors are useful to implement behaviour that cannot be implemented with the builtin materialized local operations (like StoreLocalMaterialized), nor with plain local accessors.

All of the materialized accessor methods take a bytecode node and the current frame. The bytecode node should be the current bytecode node (not necessarily corresponding to the root node that declares the local); it should be compilation-final. The frame should contain the local and be materialized.

Example usage:

@Operation
@ConstantOperand(type = MaterializedLocalAccessor.class)
public static final class GetMaterializedLocal {
    @Specialization
    public static Object perform(VirtualFrame frame,
                    MaterializedLocalAccessor accessor,
                    MaterializedFrame materializedFrame,
                    @Bind BytecodeNode bytecodeNode) {
        return accessor.getObject(bytecodeNode, materializedFrame);
    }
}

Methods22

String toString()

toString

since 24.2
public String toString()

Returns a string representation of a MaterializedLocalAccessor.

Returns

String
No description.

Overrides toString().

Object getObject(BytecodeNode, MaterializedFrame)

getObject

since 24.2
public Object getObject(BytecodeNode bytecodeNode, MaterializedFrame frame)

Loads an object from the local.

Parameters

bytecodeNodeBytecodeNode
No description.
frameMaterializedFrame
No description.

Returns

Object
No description.
boolean getBoolean(BytecodeNode, MaterializedFrame)

getBoolean

since 24.2
public boolean getBoolean(
    BytecodeNode bytecodeNode,
    MaterializedFrame frame
) throws UnexpectedResultException

Loads a boolean from the local.

Parameters

bytecodeNodeBytecodeNode
No description.
frameMaterializedFrame
No description.

Returns

boolean
No description.

Throws

byte getByte(BytecodeNode, MaterializedFrame)

getByte

since 24.2
public byte getByte(
    BytecodeNode bytecodeNode,
    MaterializedFrame frame
) throws UnexpectedResultException

Loads a byte from the local.

Parameters

bytecodeNodeBytecodeNode
No description.
frameMaterializedFrame
No description.

Returns

byte
No description.

Throws

int getInt(BytecodeNode, MaterializedFrame)

getInt

since 24.2
public int getInt(
    BytecodeNode bytecodeNode,
    MaterializedFrame frame
) throws UnexpectedResultException

Loads an int from the local.

Parameters

bytecodeNodeBytecodeNode
No description.
frameMaterializedFrame
No description.

Returns

int
No description.

Throws

long getLong(BytecodeNode, MaterializedFrame)

getLong

since 24.2
public long getLong(
    BytecodeNode bytecodeNode,
    MaterializedFrame frame
) throws UnexpectedResultException

Loads a long from the local.

Parameters

bytecodeNodeBytecodeNode
No description.
frameMaterializedFrame
No description.

Returns

long
No description.

Throws

float getFloat(BytecodeNode, MaterializedFrame)

getFloat

since 24.2
public float getFloat(
    BytecodeNode bytecodeNode,
    MaterializedFrame frame
) throws UnexpectedResultException

Loads a float from the local.

Parameters

bytecodeNodeBytecodeNode
No description.
frameMaterializedFrame
No description.

Returns

float
No description.

Throws

double getDouble(BytecodeNode, MaterializedFrame)

getDouble

since 24.2
public double getDouble(
    BytecodeNode bytecodeNode,
    MaterializedFrame frame
) throws UnexpectedResultException

Loads a double from the local.

Parameters

bytecodeNodeBytecodeNode
No description.
frameMaterializedFrame
No description.

Returns

double
No description.

Throws

void setObject(BytecodeNode, MaterializedFrame, Object)

setObject

since 24.2
public void setObject(BytecodeNode bytecodeNode, MaterializedFrame frame, Object value)

Stores an object into the local.

Parameters

bytecodeNodeBytecodeNode
No description.
frameMaterializedFrame
No description.
valueObject
No description.
void setBoolean(BytecodeNode, MaterializedFrame, boolean)

setBoolean

since 24.2
public void setBoolean(BytecodeNode bytecodeNode, MaterializedFrame frame, boolean value)

Stores a boolean into the local.

Parameters

bytecodeNodeBytecodeNode
No description.
frameMaterializedFrame
No description.
valueboolean
No description.
void setByte(BytecodeNode, MaterializedFrame, byte)

setByte

since 24.2
public void setByte(BytecodeNode bytecodeNode, MaterializedFrame frame, byte value)

Stores a byte into the local.

Parameters

bytecodeNodeBytecodeNode
No description.
frameMaterializedFrame
No description.
valuebyte
No description.
void setInt(BytecodeNode, MaterializedFrame, int)

setInt

since 24.2
public void setInt(BytecodeNode bytecodeNode, MaterializedFrame frame, int value)

Stores an int into the local.

Parameters

bytecodeNodeBytecodeNode
No description.
frameMaterializedFrame
No description.
valueint
No description.
void setLong(BytecodeNode, MaterializedFrame, long)

setLong

since 24.2
public void setLong(BytecodeNode bytecodeNode, MaterializedFrame frame, long value)

Stores a long into the local.

Parameters

bytecodeNodeBytecodeNode
No description.
frameMaterializedFrame
No description.
valuelong
No description.
void setFloat(BytecodeNode, MaterializedFrame, float)

setFloat

since 24.2
public void setFloat(BytecodeNode bytecodeNode, MaterializedFrame frame, float value)

Stores a float into the local.

Parameters

bytecodeNodeBytecodeNode
No description.
frameMaterializedFrame
No description.
valuefloat
No description.
void setDouble(BytecodeNode, MaterializedFrame, double)

setDouble

since 24.2
public void setDouble(BytecodeNode bytecodeNode, MaterializedFrame frame, double value)

Stores a double into the local.

Parameters

bytecodeNodeBytecodeNode
No description.
frameMaterializedFrame
No description.
valuedouble
No description.
void clear(BytecodeNode, MaterializedFrame)

clear

since 24.2
public void clear(BytecodeNode bytecodeNode, MaterializedFrame frame)

Clears the local from the frame.

Clearing the slot marks the frame slot as illegal. An exception will be thrown if it is read before being set. Clearing does not insert a default local value, if specified.

Parameters

bytecodeNodeBytecodeNode
No description.
frameMaterializedFrame
No description.
boolean isCleared(BytecodeNode, MaterializedFrame)

isCleared

since 24.2
public boolean isCleared(BytecodeNode bytecodeNode, MaterializedFrame frame)

Checks whether the local has been cleared (and a new value has not been set).

This method also returns true if a local has not been initialized and no default local value is specified.

Parameters

bytecodeNodeBytecodeNode
No description.
frameMaterializedFrame
No description.

Returns

boolean
No description.
Object getLocalName(BytecodeNode)

getLocalName

since 24.2
public Object getLocalName(BytecodeNode bytecodeNode)

Returns the name associated with the local.

Parameters

bytecodeNodeBytecodeNode
No description.

Returns

Object
No description.
Object getLocalInfo(BytecodeNode)

getLocalInfo

since 24.2
public Object getLocalInfo(BytecodeNode bytecodeNode)

Returns the info associated with the local.

Parameters

bytecodeNodeBytecodeNode
No description.

Returns

Object
No description.
static MaterializedLocalAccessor constantOf(int, BytecodeLocal)

constantOf

staticsince 24.2
public static MaterializedLocalAccessor constantOf(int rootIndex, BytecodeLocal local)

Obtains a MaterializedLocalAccessor. This method is invoked by the generated code and should not be called directly.

Parameters

rootIndexint
No description.
localBytecodeLocal
No description.

Returns

boolean equals(Object)Described in equals(java.lang.Object).

equals

public boolean equals(Object obj)

Described in equals(java.lang.Object).

Parameters

objObject
No description.

Returns

boolean
No description.
int hashCode()Described in hashCode().

hashCode

public int hashCode()

Described in hashCode().

Returns

int
No description.

Inherited members