Package org.jruby.runtime.opto
Interface OptoFactory.ConstantFactory
- Enclosing class:
OptoFactory
public static interface OptoFactory.ConstantFactory
A factory for abstract "constant" representations of objects. This is currently only used by our invokedynamic
support to cache the "constant" handles that wrap common literal fixnums and symbols. See #2058.
-
Method Summary
-
Method Details
-
create
Return 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.- 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
-