Record Class BytecodeStackFrame
java.lang.Object
java.lang.Record
org.ek9lang.compiler.backend.jvm.BytecodeStackFrame
public record BytecodeStackFrame(String scopeId, BytecodeFrameType frameType, Object contextData)
extends Record
Single frame on bytecode generation context stack.
Mirrors IRStackFrame pattern from IR generation phase.
Each frame represents a control flow construct (loop, switch, try-catch, if-chain) and carries type-specific context data accessed via generic getContextData().
-
Constructor Summary
ConstructorsConstructorDescriptionBytecodeStackFrame(String scopeId, BytecodeFrameType frameType, Object contextData) Creates an instance of aBytecodeStackFramerecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic BytecodeStackFramebasic(String scopeId, BytecodeFrameType frameType) Create frame with no context data.Returns the value of thecontextDatarecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theframeTyperecord component.<T> TgetContextData(Class<T> expectedType) Type-safe context data retrieval.final inthashCode()Returns a hash code value for this object.scopeId()Returns the value of thescopeIdrecord component.final StringtoString()Returns a string representation of this record class.static BytecodeStackFramewithContext(String scopeId, BytecodeFrameType frameType, Object contextData) Create frame with type-specific context data.
-
Constructor Details
-
BytecodeStackFrame
Creates an instance of aBytecodeStackFramerecord class.- Parameters:
scopeId- the value for thescopeIdrecord componentframeType- the value for theframeTyperecord componentcontextData- the value for thecontextDatarecord component
-
-
Method Details
-
basic
Create frame with no context data. -
withContext
public static BytecodeStackFrame withContext(String scopeId, BytecodeFrameType frameType, Object contextData) Create frame with type-specific context data. -
getContextData
Type-safe context data retrieval.- Parameters:
expectedType- Class of expected context data type- Returns:
- Context data cast to expected type, or null if not assignable
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
scopeId
Returns the value of thescopeIdrecord component.- Returns:
- the value of the
scopeIdrecord component
-
frameType
Returns the value of theframeTyperecord component.- Returns:
- the value of the
frameTyperecord component
-
contextData
Returns the value of thecontextDatarecord component.- Returns:
- the value of the
contextDatarecord component
-