Class InvocationResult


  • public final class InvocationResult
    extends Object
    Outcome of a method invocation attempt, pairing a status with the value, exception, or frame it produced.
    • Method Detail

      • completed

        public static InvocationResult completed​(ConcreteValue value)
        Creates a result for a call that completed normally.
        Parameters:
        value - the return value, or null for void
        Returns:
        the completed result
      • pushFrame

        public static InvocationResult pushFrame​(StackFrame frame)
        Creates a result instructing the interpreter to execute the given callee frame.
        Parameters:
        frame - the frame to push
        Returns:
        the push-frame result
        Throws:
        IllegalArgumentException - if frame is null
      • delegated

        public static InvocationResult delegated()
        Creates a result marking the call as handed off to an external executor.
        Returns:
        the delegated result
      • nativeHandled

        public static InvocationResult nativeHandled​(ConcreteValue value)
        Creates a result for a call satisfied by a native handler.
        Parameters:
        value - the handler's return value, or null for void
        Returns:
        the native-handled result
      • getReturnValue

        public ConcreteValue getReturnValue()
        Returns:
        the return value
      • getException

        public ObjectInstance getException()
        Returns:
        the exception
      • getNewFrame

        public StackFrame getNewFrame()
        Returns:
        the new frame
      • isCompleted

        public boolean isCompleted()
        Returns:
        true if the status is COMPLETED
      • isPushFrame

        public boolean isPushFrame()
        Returns:
        true if the status is PUSH_FRAME
      • isDelegated

        public boolean isDelegated()
        Returns:
        true if the status is DELEGATED
      • isNativeHandled

        public boolean isNativeHandled()
        Returns:
        true if the status is NATIVE_HANDLED
      • isException

        public boolean isException()
        Returns:
        true if the status is EXCEPTION