Package org.jruby.truffle.runtime.control

Examples of org.jruby.truffle.runtime.control.RaiseException


            if (boxed.isNumeric()) {
                try {
                    return doFunction(
                            floatANode.callFloat(frame, boxed, "to_f", null));
                } catch (UseMethodMissingException e) {
                    throw new RaiseException(getContext().getCoreLibrary().typeErrorCantConvertInto(
                            boxed.getLogicalClass().getName(),
                            getContext().getCoreLibrary().getFloatClass().getName(),
                            this));
                }
            } else {
                CompilerDirectives.transferToInterpreter();

                throw new RaiseException(getContext().getCoreLibrary().typeErrorCantConvertInto(
                        boxed.getLogicalClass().getName(),
                        getContext().getCoreLibrary().getFloatClass().getName(),
                        this));
            }
        }
View Full Code Here


        }

        private double doFunction(double a) {
            if (a < 0) {
                CompilerDirectives.transferToInterpreter();
                throw new RaiseException(getContext().getCoreLibrary().mathDomainError("log", this));
            }

            return Math.log(a);
        }
View Full Code Here

        @Override
        protected double doFunction(double a, double b) {
            if (a < 0) {
                CompilerDirectives.transferToInterpreter();
                throw new RaiseException(getContext().getCoreLibrary().mathDomainError("log", this));
            }

            return Math.log(a) / Math.log(b);
        }
View Full Code Here

        @Override
        protected double doFunction(double a) {
            if (a < 0) {
                CompilerDirectives.transferToInterpreter();
                throw new RaiseException(getContext().getCoreLibrary().mathDomainError("log10", this));
            }

            return Math.log10(a);
        }
View Full Code Here

        @Override
        protected double doFunction(double a) {
            if (a < 0) {
                CompilerDirectives.transferToInterpreter();
                throw new RaiseException(getContext().getCoreLibrary().mathDomainError("log2", this));
            }

            return Math.log(a) / LOG2;
        }
View Full Code Here

            if (boxed.isNumeric()) {
                try {
                    return doFunction(floatNode.callFloat(frame, boxed, "to_f", null));
                } catch (UseMethodMissingException e) {
                    throw new RaiseException(getContext().getCoreLibrary().typeErrorCantConvertInto(
                            boxed.getLogicalClass().getName(),
                            getContext().getCoreLibrary().getFloatClass().getName(),
                            this));
                }
            } else {
                CompilerDirectives.transferToInterpreter();

                throw new RaiseException(getContext().getCoreLibrary().typeErrorCantConvertInto(
                        boxed.getLogicalClass().getName(),
                        getContext().getCoreLibrary().getFloatClass().getName(),
                        this));
            }
        }
View Full Code Here

        } catch (RaiseException exception) {
            rethrowProfile.enter();
            throw exception;
        } catch (ArithmeticException exception) {
            CompilerDirectives.transferToInterpreter();
            throw new RaiseException(translate(exception));
        } catch (UnsupportedSpecializationException exception) {
            CompilerDirectives.transferToInterpreter();
            throw new RaiseException(translate(exception));
        } catch (Throwable exception) {
            CompilerDirectives.transferToInterpreter();
            throw new RaiseException(translate(exception));
        }
    }
View Full Code Here

    private RubyBasicObject translate(ArithmeticException exception) {
        if (Options.TRUFFLE_EXCEPTIONS_PRINT_JAVA.load()) {
            exception.printStackTrace();
        }

        throw new RaiseException(getContext().getCoreLibrary().zeroDivisionError(this));
    }
View Full Code Here

        final RubyProc block = RubyArguments.getBlock(frame.getArguments());

        if (block == null) {
            CompilerDirectives.transferToInterpreter();
            throw new RaiseException(getContext().getCoreLibrary().noBlockToYieldTo(this));
        }

        if (unsplat) {
            notDesignedForCompilation();
View Full Code Here

    public void executeVoid(VirtualFrame frame) {
        final int given = RubyArguments.getUserArgumentsCount(frame.getArguments());

        if (!checkArity(given)) {
            CompilerDirectives.transferToInterpreter();
            throw new RaiseException(getContext().getCoreLibrary().argumentError(given, arity.getRequired(), this));
        }
    }
View Full Code Here

TOP

Related Classes of org.jruby.truffle.runtime.control.RaiseException

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.