Package org.jruby.runtime.opto
Class OptoFactory.MethodHandleConstantFactory
java.lang.Object
org.jruby.runtime.opto.OptoFactory.MethodHandleConstantFactory
- All Implemented Interfaces:
OptoFactory.ConstantFactory
- Enclosing class:
- OptoFactory
private static class OptoFactory.MethodHandleConstantFactory
extends Object
implements OptoFactory.ConstantFactory
A constant factory that produces MethodHandle constants that drop an initial ThreadContext argument.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
MethodHandleConstantFactory
private MethodHandleConstantFactory()
-
-
Method Details
-
create
Description copied from interface:OptoFactory.ConstantFactoryReturn a representation of a "constant" suitable for optimization in the current runtime. For invokedynamic, this produces a MethodHandles.constant wrapper around the given object, typed with the given type.- Specified by:
createin interfaceOptoFactory.ConstantFactory- Parameters:
type- the type to which the constant should conformobject- the object which represents the constant's value- Returns:
- a constant representation suitable for optimization
-