jdk.nashorn.internal.ir.BaseNode Java Examples

The following examples show how to use jdk.nashorn.internal.ir.BaseNode. 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 TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a function node that is a callee in a CallNode, replace it with
 * the appropriate marker function. This is used by {@link CodeGenerator}
 * for fast scope calls
 *
 * @param function function called by a CallNode
 * @return transformed node to marker function or identity if not ident/access/indexnode
 */
private static Expression markerFunction(final Expression function) {
    if (function instanceof IdentNode) {
        return ((IdentNode)function).setIsFunction();
    } else if (function instanceof BaseNode) {
        return ((BaseNode)function).setIsFunction();
    }
    return function;
}
 
Example #2
Source File: Lower.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a function node that is a callee in a CallNode, replace it with
 * the appropriate marker function. This is used by {@link CodeGenerator}
 * for fast scope calls
 *
 * @param function function called by a CallNode
 * @return transformed node to marker function or identity if not ident/access/indexnode
 */
private static Expression markerFunction(final Expression function) {
    if (function instanceof IdentNode) {
        return ((IdentNode)function).setIsFunction();
    } else if (function instanceof BaseNode) {
        return ((BaseNode)function).setIsFunction();
    }
    return function;
}
 
Example #3
Source File: Lower.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a function node that is a callee in a CallNode, replace it with
 * the appropriate marker function. This is used by {@link CodeGenerator}
 * for fast scope calls
 *
 * @param function function called by a CallNode
 * @return transformed node to marker function or identity if not ident/access/indexnode
 */
private static Expression markerFunction(final Expression function) {
    if (function instanceof IdentNode) {
        return ((IdentNode)function).setIsFunction();
    } else if (function instanceof BaseNode) {
        return ((BaseNode)function).setIsFunction();
    }
    return function;
}
 
Example #4
Source File: Lower.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a function node that is a callee in a CallNode, replace it with
 * the appropriate marker function. This is used by {@link CodeGenerator}
 * for fast scope calls
 *
 * @param function function called by a CallNode
 * @return transformed node to marker function or identity if not ident/access/indexnode
 */
private static Expression markerFunction(final Expression function) {
    if (function instanceof IdentNode) {
        return ((IdentNode)function).setIsFunction();
    } else if (function instanceof BaseNode) {
        return ((BaseNode)function).setIsFunction();
    }
    return function;
}
 
Example #5
Source File: Lower.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a function node that is a callee in a CallNode, replace it with
 * the appropriate marker function. This is used by {@link CodeGenerator}
 * for fast scope calls
 *
 * @param function function called by a CallNode
 * @return transformed node to marker function or identity if not ident/access/indexnode
 */
private static Expression markerFunction(final Expression function) {
    if (function instanceof IdentNode) {
        return ((IdentNode)function).setIsFunction();
    } else if (function instanceof BaseNode) {
        return ((BaseNode)function).setIsFunction();
    }
    return function;
}
 
Example #6
Source File: Lower.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a function node that is a callee in a CallNode, replace it with
 * the appropriate marker function. This is used by {@link CodeGenerator}
 * for fast scope calls
 *
 * @param function function called by a CallNode
 * @return transformed node to marker function or identity if not ident/access/indexnode
 */
private static Expression markerFunction(final Expression function) {
    if (function instanceof IdentNode) {
        return ((IdentNode)function).setIsFunction();
    } else if (function instanceof BaseNode) {
        return ((BaseNode)function).setIsFunction();
    }
    return function;
}
 
Example #7
Source File: Lower.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a function node that is a callee in a CallNode, replace it with
 * the appropriate marker function. This is used by {@link CodeGenerator}
 * for fast scope calls
 *
 * @param function function called by a CallNode
 * @return transformed node to marker function or identity if not ident/access/indexnode
 */
private static Expression markerFunction(final Expression function) {
    if (function instanceof IdentNode) {
        return ((IdentNode)function).setIsFunction();
    } else if (function instanceof BaseNode) {
        return ((BaseNode)function).setIsFunction();
    }
    return function;
}
 
Example #8
Source File: Lower.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a function node that is a callee in a CallNode, replace it with
 * the appropriate marker function. This is used by {@link CodeGenerator}
 * for fast scope calls
 *
 * @param function function called by a CallNode
 * @return transformed node to marker function or identity if not ident/access/indexnode
 */
private static Expression markerFunction(final Expression function) {
    if (function instanceof IdentNode) {
        return ((IdentNode)function).setIsFunction();
    } else if (function instanceof BaseNode) {
        return ((BaseNode)function).setIsFunction();
    }
    return function;
}
 
Example #9
Source File: Lower.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a function node that is a callee in a CallNode, replace it with
 * the appropriate marker function. This is used by {@link CodeGenerator}
 * for fast scope calls
 *
 * @param function function called by a CallNode
 * @return transformed node to marker function or identity if not ident/access/indexnode
 */
private static Expression markerFunction(final Expression function) {
    if (function instanceof IdentNode) {
        return ((IdentNode)function).setIsFunction();
    } else if (function instanceof BaseNode) {
        return ((BaseNode)function).setIsFunction();
    }
    return function;
}
 
Example #10
Source File: Lower.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a function node that is a callee in a CallNode, replace it with
 * the appropriate marker function. This is used by {@link CodeGenerator}
 * for fast scope calls
 *
 * @param function function called by a CallNode
 * @return transformed node to marker function or identity if not ident/access/indexnode
 */
private static Expression markerFunction(final Expression function) {
    if (function instanceof IdentNode) {
        return ((IdentNode)function).setIsFunction();
    } else if (function instanceof BaseNode) {
        return ((BaseNode)function).setIsFunction();
    }
    return function;
}