src/jdk/nashorn/internal/codegen/CodeGenerator.java

Print this page




1939         return false;
1940     }
1941 
1942     @Override
1943     public boolean enterThrowNode(final ThrowNode throwNode) {
1944         lineNumber(throwNode);
1945 
1946         if (throwNode.isSyntheticRethrow()) {
1947             //do not wrap whatever this is in an ecma exception, just rethrow it
1948             load(throwNode.getExpression());
1949             method.athrow();
1950             return false;
1951         }
1952 
1953         method._new(ECMAException.class).dup();
1954 
1955         final Source source     = lc.getCurrentFunction().getSource();
1956 
1957         final Expression expression = throwNode.getExpression();
1958         final int        position   = throwNode.position();
1959         final int        line       = source.getLine(position);
1960         final int        column     = source.getColumn(position);
1961 
1962         load(expression);
1963         assert expression.getType().isObject();
1964 
1965         method.load(source.getName());
1966         method.load(line);
1967         method.load(column);
1968         method.invoke(ECMAException.THROW_INIT);
1969 
1970         method.athrow();
1971 
1972         return false;
1973     }
1974 
1975     @Override
1976     public boolean enterTryNode(final TryNode tryNode) {
1977         lineNumber(tryNode);
1978 
1979         final Block       body        = tryNode.getBody();




1939         return false;
1940     }
1941 
1942     @Override
1943     public boolean enterThrowNode(final ThrowNode throwNode) {
1944         lineNumber(throwNode);
1945 
1946         if (throwNode.isSyntheticRethrow()) {
1947             //do not wrap whatever this is in an ecma exception, just rethrow it
1948             load(throwNode.getExpression());
1949             method.athrow();
1950             return false;
1951         }
1952 
1953         method._new(ECMAException.class).dup();
1954 
1955         final Source source     = lc.getCurrentFunction().getSource();
1956 
1957         final Expression expression = throwNode.getExpression();
1958         final int        position   = throwNode.position();
1959         final int        line       = throwNode.getLineNumber();
1960         final int        column     = source.getColumn(position);
1961 
1962         load(expression);
1963         assert expression.getType().isObject();
1964 
1965         method.load(source.getName());
1966         method.load(line);
1967         method.load(column);
1968         method.invoke(ECMAException.THROW_INIT);
1969 
1970         method.athrow();
1971 
1972         return false;
1973     }
1974 
1975     @Override
1976     public boolean enterTryNode(final TryNode tryNode) {
1977         lineNumber(tryNode);
1978 
1979         final Block       body        = tryNode.getBody();