Package org.jruby.truffle.runtime.core

Examples of org.jruby.truffle.runtime.core.RubyArray


            for (int n = 0; n < count; n++) {
                System.arraycopy(store, 0, newStore, storeLength * n, storeLength);
            }

            return new RubyArray(getContext().getCoreLibrary().getArrayClass(), array.getAllocationSite(), newStore, newStoreLength);
        }
View Full Code Here


            for (int n = 0; n < count; n++) {
                System.arraycopy(store, 0, newStore, storeLength * n, storeLength);
            }

            return new RubyArray(getContext().getCoreLibrary().getArrayClass(), array.getAllocationSite(), newStore, newStoreLength);
        }
View Full Code Here

    @Specialization(guards = "isNull")
    public RubyArray sliceNull(RubyArray array) {
        notDesignedForCompilation();

        return new RubyArray(getContext().getCoreLibrary().getArrayClass());
    }
View Full Code Here

    public RubyArray sliceIntegerFixnum(RubyArray array) {
        notDesignedForCompilation();
        final int to = array.getSize() + this.to;

        if (from >= to) {
            return new RubyArray(getContext().getCoreLibrary().getArrayClass());
        } else {
            return new RubyArray(getContext().getCoreLibrary().getArrayClass(), Arrays.copyOfRange((int[]) array.getStore(), from, to), to - from);
        }
    }
View Full Code Here

    public RubyArray sliceLongFixnum(RubyArray array) {
        notDesignedForCompilation();
        final int to = array.getSize() + this.to;

        if (from >= to) {
            return new RubyArray(getContext().getCoreLibrary().getArrayClass());
        } else {
            return new RubyArray(getContext().getCoreLibrary().getArrayClass(), Arrays.copyOfRange((long[]) array.getStore(), from, to), to - from);
        }
    }
View Full Code Here

    public RubyArray sliceFloat(RubyArray array) {
        notDesignedForCompilation();
        final int to = array.getSize() + this.to;

        if (from >= to) {
            return new RubyArray(getContext().getCoreLibrary().getArrayClass());
        } else {
            return new RubyArray(getContext().getCoreLibrary().getArrayClass(), Arrays.copyOfRange((double[]) array.getStore(), from, to), to - from);
        }
    }
View Full Code Here

    public RubyArray sliceObject(RubyArray array) {
        notDesignedForCompilation();
        final int to = array.getSize() + this.to;

        if (from >= to) {
            return new RubyArray(getContext().getCoreLibrary().getArrayClass());
        } else {
            return new RubyArray(getContext().getCoreLibrary().getArrayClass(), Arrays.copyOfRange((Object[]) array.getStore(), from, to), to - from);
        }
    }
View Full Code Here

    @ExplodeLoop
    @Override
    public boolean canHandle(VirtualFrame frame, RubyBasicObject exception) {
        notDesignedForCompilation();

        final RubyArray handlingClasses = (RubyArray) handlingClassesArray.execute(frame);

        final RubyClass exceptionRubyClass = exception.getLogicalClass();

        for (Object handlingClass : handlingClasses.slowToArray()) {
            if (ModuleOperations.assignableTo(exceptionRubyClass, (RubyClass) handlingClass)) {
                return true;
            }
        }
View Full Code Here

            super(context, sourceSection, values);
        }

        @Override
        public RubyArray executeArray(VirtualFrame frame) {
            return new RubyArray(getContext().getCoreLibrary().getArrayClass(), null, 0);
        }
View Full Code Here

                    return makeGeneric(frame, executedObjects);
                }
            }

            return new RubyArray(getContext().getCoreLibrary().getArrayClass(), executedValues, values.length);
        }
View Full Code Here

TOP

Related Classes of org.jruby.truffle.runtime.core.RubyArray

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.