Class RecursiveHandler
- java.lang.Object
-
- com.tonic.analysis.execution.invoke.RecursiveHandler
-
- All Implemented Interfaces:
InvocationHandler
public final class RecursiveHandler extends Object implements InvocationHandler
Invocation handler that pushes interpreter frames for bytecode-backed methods, dispatches registered natives, and stubs absent bodies with default values.
-
-
Constructor Summary
Constructors Constructor Description RecursiveHandler(ClassResolver resolver)Creates a handler with an empty native registry.RecursiveHandler(ClassResolver resolver, NativeRegistry nativeRegistry)Creates a handler backed by the given native registry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InvocationResultinvoke(MethodEntry method, ObjectInstance receiver, ConcreteValue[] args, InvocationContext context)Executes a resolved call.
-
-
-
Constructor Detail
-
RecursiveHandler
public RecursiveHandler(ClassResolver resolver)
Creates a handler with an empty native registry.- Parameters:
resolver- resolves virtual dispatch targets- Throws:
IllegalArgumentException- if resolver is null
-
RecursiveHandler
public RecursiveHandler(ClassResolver resolver, NativeRegistry nativeRegistry)
Creates a handler backed by the given native registry.- Parameters:
resolver- resolves virtual dispatch targetsnativeRegistry- supplies handlers for native methods- Throws:
IllegalArgumentException- if resolver or nativeRegistry is null
-
-
Method Detail
-
invoke
public InvocationResult invoke(MethodEntry method, ObjectInstance receiver, ConcreteValue[] args, InvocationContext context)
Description copied from interface:InvocationHandlerExecutes a resolved call.- Specified by:
invokein interfaceInvocationHandler- Parameters:
method- the resolved targetreceiver- the instance for an instance call, null for a static callargs- the argument values in declaration ordercontext- the interpreter services available for the duration of the call- Returns:
- the outcome: a completed value, a guest exception, a delegation, or a frame to push
-
-