Package java.lang.invoke

Examples of java.lang.invoke.ConstantCallSite


                    MethodType.methodType(boolean.class, Object.class));
        } else { // "not"
            target = MethodHandles.explicitCastArguments(NOT,
                    MethodType.methodType(Object.class, Object.class));
        }
        return new ConstantCallSite(target);
    }
View Full Code Here


  public static CallSite constructorBootstrap(Lookup lookup, String selector,
      MethodType type, String referenceString) throws Throwable {
    Reference reference = Reference.factory.value_(referenceString);
    Constructor constructor = ImageBootstrapper.systemMapping.classMappingAtReference_(reference).identityClass().getConstructor();
    MethodHandle constructorHandle = lookup.unreflectConstructor(constructor);
    return new ConstantCallSite(constructorHandle.asType(type));
  }
View Full Code Here

        .value_(namespaceString);
    AbsoluteReference fullReference = namespace.$slash$(Symbol
        .value(selector));
    final AlmostFinalValue singletonHolder = ImageBootstrapper.systemMapping
        .resolveSingletonHolder_(fullReference);
    return new ConstantCallSite(singletonHolder.createGetter());
  }
View Full Code Here

        .resolveSingletonHolder_(fullReference);
    final MethodHandle target = lookup.findVirtual(
        AlmostFinalValue.class,
        "setValue",
        MethodType.methodType(Object.class, Object.class)).bindTo(singletonHolder);
    return new ConstantCallSite(target);
  }
View Full Code Here

    public static CallSite getByteListBootstrap(Lookup lookup, String name, MethodType type, String asString, String encodingName) {
        byte[] bytes = RuntimeHelpers.stringToRawBytes(asString);
        Encoding encoding = EncodingDB.getEncodings().get(encodingName.getBytes()).getEncoding();
        ByteList byteList = new ByteList(bytes, encoding);
       
        return new ConstantCallSite(constant(ByteList.class, byteList));
    }
View Full Code Here

            case 'S':
                callSite = MethodIndex.getSuperCallSite();
                break;
        }
       
        return new ConstantCallSite(constant(org.jruby.runtime.CallSite.class, callSite));
    }
View Full Code Here

    }

    public static CallSite getBigIntegerBootstrap(Lookup lookup, String name, MethodType type, String asString) {
        BigInteger byteList = new BigInteger(asString, 16);
       
        return new ConstantCallSite(constant(BigInteger.class, byteList));
    }
View Full Code Here

    public static CallSite string(Lookup lookup, String name, MethodType type, String value, int encoding) {
        MethodHandle handle = Binder
                .from(IRubyObject.class, ThreadContext.class)
                .insert(0, new Class[]{String.class, int.class}, value, encoding)
                .invokeStaticQuiet(MethodHandles.lookup(), Bootstrap.class, "string");
        CallSite site = new ConstantCallSite(handle);
        return site;
    }
View Full Code Here

    public static CallSite array(Lookup lookup, String name, MethodType type) {
        MethodHandle handle = Binder
                .from(type)
                .collect(1, IRubyObject[].class)
                .invokeStaticQuiet(MethodHandles.lookup(), Bootstrap.class, "array");
        CallSite site = new ConstantCallSite(handle);
        return site;
    }
View Full Code Here

        }
      }
    }

    if (classRef != null) {
      return new ConstantCallSite(constant(Class.class, classRef));
    }
    throw new ClassNotFoundException("Dynamic resolution failed for name: " + name);
  }
View Full Code Here

TOP

Related Classes of java.lang.invoke.ConstantCallSite

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.