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

    Modifier and Type
    Method
    Description
    create(Class type, Object object)
    Return a representation of a "constant" suitable for optimization in the current runtime.
  • Method Details

    • create

      Object create(Class type, Object object)
      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 conform
      object - the object which represents the constant's value
      Returns:
      a constant representation suitable for optimization