Package java.lang.invoke

Examples of java.lang.invoke.ConstantCallSite


            fieldA = Container.class.getDeclaredField("a");
            fieldB = Container.class.getDeclaredField("b");
            fieldC = Container.class.getDeclaredField("c");
            MethodHandles.Lookup lookup = MethodHandles.lookup();
            mhsa = new ConstantCallSite(lookup.findSetter(Container.class, "a", Long.TYPE));
            mhsb = new ConstantCallSite(lookup.findSetter(Container.class, "b", Integer.TYPE));
            mhsc = new ConstantCallSite(lookup.findSetter(Container.class, "c", Short.TYPE));
            mhga = new ConstantCallSite(lookup.findGetter(Container.class, "a", Long.TYPE));
            mhgb = new ConstantCallSite(lookup.findGetter(Container.class, "b", Integer.TYPE));
            mhgc = new ConstantCallSite(lookup.findGetter(Container.class, "c", Short.TYPE));
        } catch (Exception ex) {

        }
    }
View Full Code Here


import static seph.lang.Types.*;

public class SephCallSite extends MutableCallSite {
    public static CallSite bootstrap(MethodHandles.Lookup lookup, String name, MethodType type, Object... arguments) {
        if(name.intern() == "seph:pumpTailCall") {
            return new ConstantCallSite(PUMP_MH.bindTo(SThread.TAIL_MARKER));
            // return genMH(SThread.TAIL_MARKER);
        } else if(name.startsWith("seph:activationFor:")) {
            return new ConstantCallSite(createActivationForMH(name, (MethodHandle)arguments[0], (MethodHandle)arguments[1]));
        } else {
            return new SephCallSite(lookup, name, type, arguments);
        }
    }
View Full Code Here

        @Override
        public FunctionBinding bindFunction(long bindingId, String name, ByteCodeNode getSessionByteCode, List<TypedByteCodeNode> arguments)
        {
            MethodHandle methodHandle = inMethod.bindTo(constantValues);
            methodHandle = methodHandle.asType(MethodType.methodType(boolean.class, valueType));
            return new FunctionBinding(bindingId, name, new ConstantCallSite(methodHandle), arguments, false);
        }
View Full Code Here

            }
        }
        catch(IllegalAccessException|NoSuchMethodException e) {
            throw new BootstrapMethodError(e);
        }
        return new ConstantCallSite(MethodHandles.convertArguments(mh, callSiteType));
    }
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.