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 Details

    • MethodHandleConstantFactory

      private MethodHandleConstantFactory()
  • Method Details

    • create

      public Object create(Class type, Object object)
      Description copied from interface: OptoFactory.ConstantFactory
      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.
      Specified by:
      create in interface OptoFactory.ConstantFactory
      Parameters:
      type - the type to which the constant should conform
      object - the object which represents the constant's value
      Returns:
      a constant representation suitable for optimization