Java Code Examples for jdk.nashorn.internal.ir.IdentNode#position()

The following examples show how to use jdk.nashorn.internal.ir.IdentNode#position() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Lower.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Calculate a synthetic eval location for a node for the stacktrace, for example src#17<eval>
 * @param node a node
 * @return eval location
 */
private String evalLocation(final IdentNode node) {
    final Source source = lc.getCurrentFunction().getSource();
    final int pos = node.position();
    // Code installer is null when running with --compile-only, use 0 as id in that case
    final long id = installer == null ? 0 : installer.getUniqueEvalId();
    return new StringBuilder().
        append(source.getName()).
        append('#').
        append(source.getLine(pos)).
        append(':').
        append(source.getColumn(pos)).
        append("<eval>@").
        append(id).
        toString();
}
 
Example 2
Source File: Lower.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Calculate a synthetic eval location for a node for the stacktrace, for example src#17<eval>
 * @param node a node
 * @return eval location
 */
private String evalLocation(final IdentNode node) {
    final Source source = lc.getCurrentFunction().getSource();
    final int pos = node.position();
    // Code installer is null when running with --compile-only, use 0 as id in that case
    final long id = installer == null ? 0 : installer.getUniqueEvalId();
    return new StringBuilder().
        append(source.getName()).
        append('#').
        append(source.getLine(pos)).
        append(':').
        append(source.getColumn(pos)).
        append("<eval>@").
        append(id).
        toString();
}
 
Example 3
Source File: Lower.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Calculate a synthetic eval location for a node for the stacktrace, for example src#17<eval>
 * @param node a node
 * @return eval location
 */
private String evalLocation(final IdentNode node) {
    final Source source = lc.getCurrentFunction().getSource();
    final int pos = node.position();
    return new StringBuilder().
        append(source.getName()).
        append('#').
        append(source.getLine(pos)).
        append(':').
        append(source.getColumn(pos)).
        append("<eval>").
        toString();
}
 
Example 4
Source File: Lower.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Calculate a synthetic eval location for a node for the stacktrace, for example src#17<eval>
 * @param node a node
 * @return eval location
 */
private String evalLocation(final IdentNode node) {
    final Source source = lc.getCurrentFunction().getSource();
    final int pos = node.position();
    return new StringBuilder().
        append(source.getName()).
        append('#').
        append(source.getLine(pos)).
        append(':').
        append(source.getColumn(pos)).
        append("<eval>").
        toString();
}
 
Example 5
Source File: Lower.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Calculate a synthetic eval location for a node for the stacktrace, for example src#17<eval>
 * @param node a node
 * @return eval location
 */
private String evalLocation(final IdentNode node) {
    final Source source = lc.getCurrentFunction().getSource();
    final int pos = node.position();
    return new StringBuilder().
        append(source.getName()).
        append('#').
        append(source.getLine(pos)).
        append(':').
        append(source.getColumn(pos)).
        append("<eval>").
        toString();
}
 
Example 6
Source File: Lower.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Calculate a synthetic eval location for a node for the stacktrace, for example src#17<eval>
 * @param node a node
 * @return eval location
 */
private String evalLocation(final IdentNode node) {
    final Source source = lc.getCurrentFunction().getSource();
    final int pos = node.position();
    return new StringBuilder().
        append(source.getName()).
        append('#').
        append(source.getLine(pos)).
        append(':').
        append(source.getColumn(pos)).
        append("<eval>").
        toString();
}
 
Example 7
Source File: Lower.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Calculate a synthetic eval location for a node for the stacktrace, for example src#17<eval>
 * @param node a node
 * @return eval location
 */
private String evalLocation(final IdentNode node) {
    final Source source = lc.getCurrentFunction().getSource();
    final int pos = node.position();
    return new StringBuilder().
        append(source.getName()).
        append('#').
        append(source.getLine(pos)).
        append(':').
        append(source.getColumn(pos)).
        append("<eval>").
        toString();
}
 
Example 8
Source File: Lower.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Calculate a synthetic eval location for a node for the stacktrace, for example src#17<eval>
 * @param node a node
 * @return eval location
 */
private String evalLocation(final IdentNode node) {
    final Source source = lc.getCurrentFunction().getSource();
    final int pos = node.position();
    return new StringBuilder().
        append(source.getName()).
        append('#').
        append(source.getLine(pos)).
        append(':').
        append(source.getColumn(pos)).
        append("<eval>").
        toString();
}
 
Example 9
Source File: Lower.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Calculate a synthetic eval location for a node for the stacktrace, for example src#17<eval>
 * @param node a node
 * @return eval location
 */
private String evalLocation(final IdentNode node) {
    final Source source = lc.getCurrentFunction().getSource();
    final int pos = node.position();
    return new StringBuilder().
        append(source.getName()).
        append('#').
        append(source.getLine(pos)).
        append(':').
        append(source.getColumn(pos)).
        append("<eval>").
        toString();
}