Package org.teavm.model

Examples of org.teavm.model.MethodReference


            MethodReference[] references = new MethodReference[end - start];
            for (int i = 0; i < references.length; ++i) {
                long item = exactMethods[data[start + i]];
                int classIndex = (int)(item >>> 32);
                int methodIndex = (int)item;
                references[i] = new MethodReference(classNames[classIndex],
                        MethodDescriptor.parse(methods[methodIndex]));
            }
            return references;
        }
View Full Code Here


        host.add(new ClassLookupDependencySupport());
        host.add(new NewInstanceDependencySupport());
        host.add(new ObjectEnrichRenderer());
        ServiceLoaderSupport serviceLoaderSupp = new ServiceLoaderSupport(host.getClassLoader());
        host.add(serviceLoaderSupp);
        MethodReference loadServicesMethod = new MethodReference(ServiceLoader.class, "loadServices",
                Class.class, Object[].class);
        host.add(loadServicesMethod, serviceLoaderSupp);
        JavacSupport javacSupport = new JavacSupport();
        host.add(javacSupport);
View Full Code Here

                if (i > 0) {
                    writer.append(", ");
                }
                String implName = implementations.get(i);
                writer.append("[").appendClass(implName).append(", ").appendMethodBody(
                        new MethodReference(implName, new MethodDescriptor("<init>", ValueType.VOID)))
                        .append("]");
            }
            writer.append("];").softNewLine();
        }
        writer.outdent().append("}").softNewLine();
View Full Code Here

        }
    }

    @Override
    public void methodAchieved(final DependencyAgent agent, MethodDependency method) {
        MethodReference ref = method.getReference();
        if (ref.getClassName().equals("java.util.ServiceLoader") && ref.getName().equals("loadServices")) {
            method.getResult().propagate(agent.getType("[java.lang.Object"));
            stack = method.getStack();
            allClassesNode.connect(method.getResult().getArrayItem());
            method.getResult().getArrayItem().addConsumer(new DependencyConsumer() {
                @Override public void consume(DependencyAgentType type) {
View Full Code Here

            });
        }
    }

    private void initConstructor(DependencyAgent agent, String type) {
        MethodReference ctor = new MethodReference(type, new MethodDescriptor("<init>", ValueType.VOID));
        agent.linkMethod(ctor, stack).use();
    }
View Full Code Here

    private InvocationExpr parseInvocationExpr(InvocationType invocationType, DataInput input) throws IOException {
        InvocationExpr expr = new InvocationExpr();
        expr.setType(invocationType);
        String className = symbolTable.at(input.readInt());
        MethodDescriptor method = MethodDescriptor.parse(symbolTable.at(input.readInt()));
        expr.setMethod(new MethodReference(className, method));
        int argCount = input.readShort();
        for (int i = 0; i < argCount; ++i) {
            expr.getArguments().add(readExpr(input));
        }
        return expr;
View Full Code Here

                            jsFrame.getLocation().getColumn());
                } else {
                    loc = null;
                }
                boolean empty = loc == null || (loc.getFileName() == null && loc.getLine() < 0);
                MethodReference method = !empty ? debugInformation.getMethodAt(jsFrame.getLocation().getLine(),
                        jsFrame.getLocation().getColumn()) : null;
                if (!empty || !wasEmpty) {
                    VariableMap vars = new VariableMap(jsFrame.getVariables(), this, jsFrame.getLocation());
                    frames.add(new CallFrame(this, jsFrame, loc, method, vars));
                }
View Full Code Here

        return super.getText(element);
    }


    private String callFrameAsString(CallFrame callFrame) {
        MethodReference method = callFrame.getMethod();
        if (method == null) {
            return locationAsString(callFrame.getOriginalLocation());
        }
        StringBuilder sb = new StringBuilder();
        sb.append(classAsString(method.getClassName())).append('.').append(method.getName()).append('(');
        MethodDescriptor desc = method.getDescriptor();
        for (int i = 0; i < desc.parameterCount(); ++i) {
            if (i > 0) {
                sb.append(',');
            }
            sb.append(typeAsString(desc.parameterType(i)));
View Full Code Here

TOP

Related Classes of org.teavm.model.MethodReference

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.