Package com.oracle.truffle.api.frame

Examples of com.oracle.truffle.api.frame.FrameDescriptor


        private final CallTarget callTarget;

        public MaxBlock(RubyContext context) {
            final SourceSection sourceSection = new CoreSourceSection("Array", "max");

            frameDescriptor = new FrameDescriptor();
            frameSlot = frameDescriptor.addFrameSlot("maximum_memo");

            sharedMethodInfo = SharedMethodInfo.generated(sourceSection, "max");

            callTarget = Truffle.getRuntime().createCallTarget(new RubyRootNode(
View Full Code Here


        private final CallTarget callTarget;

        public MinBlock(RubyContext context) {
            final SourceSection sourceSection = new CoreSourceSection("Array", "min");

            frameDescriptor = new FrameDescriptor();
            frameSlot = frameDescriptor.addFrameSlot("minimum_memo");

            sharedMethodInfo = SharedMethodInfo.generated(sourceSection, "min");

            callTarget = Truffle.getRuntime().createCallTarget(new RubyRootNode(
View Full Code Here

        final RubyContext context = getContext();

        final SharedMethodInfo sharedMethodInfo = SharedMethodInfo.generatedBlock(sourceSection, symbol);

        final RubyRootNode rootNode = new RubyRootNode(context, sourceSection, new FrameDescriptor(), sharedMethodInfo,
                new SymbolProcNode(context, sourceSection, symbol));

        final CallTarget callTarget = Truffle.getRuntime().createCallTarget(rootNode);

        return new RubyProc(context.getCoreLibrary().getProcClass(), RubyProc.Type.PROC, sharedMethodInfo, callTarget,
View Full Code Here

            formatFrame(context, frame, lines);
        }
    }

    private static void formatFrame(RubyContext context, MaterializedFrame frame, List<String> lines) {
        final FrameDescriptor frameDescriptor = frame.getFrameDescriptor();

        for (Object identifier : frameDescriptor.getIdentifiers()) {
            lines.add(String.format("        %s = %s", identifier, DebugBacktraceFormatter.debugString(context, frame.getValue(frameDescriptor.findFrameSlot(identifier)))));
        }
    }
View Full Code Here

    private static String formatLine(RubyContext context, Activation activation) {
        final StringBuilder builder = new StringBuilder();
        builder.append(formatBasicLine(activation));

        final MaterializedFrame frame = activation.getMaterializedFrame();
        final FrameDescriptor frameDescriptor = frame.getFrameDescriptor();

        builder.append(" self=");
        builder.append(debugString(context, RubyArguments.getSelf(frame.getArguments())));

        for (Object identifier : frameDescriptor.getIdentifiers()) {
            if (identifier instanceof String) {
                builder.append(" ");
                builder.append(identifier);
                builder.append("=");
                builder.append(debugString(context, frame.getValue(frameDescriptor.findFrameSlot(identifier))));
            }
        }
        return builder.toString();
    }
View Full Code Here

TOP

Related Classes of com.oracle.truffle.api.frame.FrameDescriptor

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.