Java Code Examples for jdk.nashorn.internal.objects.annotations.SpecializedFunction.LinkLogic#isEmpty()

The following examples show how to use jdk.nashorn.internal.objects.annotations.SpecializedFunction.LinkLogic#isEmpty() . 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: Specialization.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor
 *
 * @param mh  invoker method handler
 * @param linkLogicClass extra link logic needed for this function. Instances of this class also contains logic for checking
 *  if this can be linked on its first encounter, which is needed as per our standard linker semantics
 * @param isOptimistic is this an optimistic native method, i.e. can it throw {@link UnwarrantedOptimismException}
 *   which would have to lead to a relink and return value processing
 */
public Specialization(final MethodHandle mh, final Class<? extends LinkLogic> linkLogicClass, final boolean isOptimistic) {
    this.mh             = mh;
    this.isOptimistic   = isOptimistic;
    if (linkLogicClass != null) {
        //null out the "empty" link logic class for optimization purposes
        //we only use the empty instance because we can't default class annotations
        //to null
        this.linkLogicClass = LinkLogic.isEmpty(linkLogicClass) ? null : linkLogicClass;
    } else {
        this.linkLogicClass = null;
    }
 }
 
Example 2
Source File: Specialization.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor
 *
 * @param mh  invoker method handler
 * @param linkLogicClass extra link logic needed for this function. Instances of this class also contains logic for checking
 *  if this can be linked on its first encounter, which is needed as per our standard linker semantics
 * @param isOptimistic is this an optimistic native method, i.e. can it throw {@link UnwarrantedOptimismException}
 *   which would have to lead to a relink and return value processing
 */
public Specialization(final MethodHandle mh, final Class<? extends LinkLogic> linkLogicClass, final boolean isOptimistic) {
    this.mh             = mh;
    this.isOptimistic   = isOptimistic;
    if (linkLogicClass != null) {
        //null out the "empty" link logic class for optimization purposes
        //we only use the empty instance because we can't default class annotations
        //to null
        this.linkLogicClass = LinkLogic.isEmpty(linkLogicClass) ? null : linkLogicClass;
    } else {
        this.linkLogicClass = null;
    }
 }
 
Example 3
Source File: Specialization.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor
 *
 * @param mh  invoker method handler
 * @param linkLogicClass extra link logic needed for this function. Instances of this class also contains logic for checking
 *  if this can be linked on its first encounter, which is needed as per our standard linker semantics
 * @param isOptimistic is this an optimistic native method, i.e. can it throw {@link UnwarrantedOptimismException}
 *   which would have to lead to a relink and return value processing
 */
public Specialization(final MethodHandle mh, final Class<? extends LinkLogic> linkLogicClass, final boolean isOptimistic) {
    this.mh             = mh;
    this.isOptimistic   = isOptimistic;
    if (linkLogicClass != null) {
        //null out the "empty" link logic class for optimization purposes
        //we only use the empty instance because we can't default class annotations
        //to null
        this.linkLogicClass = LinkLogic.isEmpty(linkLogicClass) ? null : linkLogicClass;
    } else {
        this.linkLogicClass = null;
    }
 }
 
Example 4
Source File: Specialization.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor
 *
 * @param mh  invoker method handler
 * @param linkLogicClass extra link logic needed for this function. Instances of this class also contains logic for checking
 *  if this can be linked on its first encounter, which is needed as per our standard linker semantics
 * @param isOptimistic is this an optimistic native method, i.e. can it throw {@link UnwarrantedOptimismException}
 *   which would have to lead to a relink and return value processing
 */
public Specialization(final MethodHandle mh, final Class<? extends LinkLogic> linkLogicClass, final boolean isOptimistic) {
    this.mh             = mh;
    this.isOptimistic   = isOptimistic;
    if (linkLogicClass != null) {
        //null out the "empty" link logic class for optimization purposes
        //we only use the empty instance because we can't default class annotations
        //to null
        this.linkLogicClass = LinkLogic.isEmpty(linkLogicClass) ? null : linkLogicClass;
    } else {
        this.linkLogicClass = null;
    }
 }
 
Example 5
Source File: Specialization.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor
 *
 * @param mh  invoker method handler
 * @param linkLogicClass extra link logic needed for this function. Instances of this class also contains logic for checking
 *  if this can be linked on its first encounter, which is needed as per our standard linker semantics
 * @param isOptimistic is this an optimistic native method, i.e. can it throw {@link UnwarrantedOptimismException}
 *   which would have to lead to a relink and return value processing
 * @param convertsNumericArgs true if it is safe to convert arguments to numbers
 */
public Specialization(final MethodHandle mh, final Class<? extends LinkLogic> linkLogicClass,
                      final boolean isOptimistic, final boolean convertsNumericArgs) {
    this.mh             = mh;
    this.isOptimistic   = isOptimistic;
    this.convertsNumericArgs = convertsNumericArgs;
    if (linkLogicClass != null) {
        //null out the "empty" link logic class for optimization purposes
        //we only use the empty instance because we can't default class annotations
        //to null
        this.linkLogicClass = LinkLogic.isEmpty(linkLogicClass) ? null : linkLogicClass;
    } else {
        this.linkLogicClass = null;
    }
 }
 
Example 6
Source File: Specialization.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor
 *
 * @param mh  invoker method handler
 * @param linkLogicClass extra link logic needed for this function. Instances of this class also contains logic for checking
 *  if this can be linked on its first encounter, which is needed as per our standard linker semantics
 * @param isOptimistic is this an optimistic native method, i.e. can it throw {@link UnwarrantedOptimismException}
 *   which would have to lead to a relink and return value processing
 */
public Specialization(final MethodHandle mh, final Class<? extends LinkLogic> linkLogicClass, final boolean isOptimistic) {
    this.mh             = mh;
    this.isOptimistic   = isOptimistic;
    if (linkLogicClass != null) {
        //null out the "empty" link logic class for optimization purposes
        //we only use the empty instance because we can't default class annotations
        //to null
        this.linkLogicClass = LinkLogic.isEmpty(linkLogicClass) ? null : linkLogicClass;
    } else {
        this.linkLogicClass = null;
    }
 }
 
Example 7
Source File: Specialization.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructor
 *
 * @param mh  invoker method handler
 * @param linkLogicClass extra link logic needed for this function. Instances of this class also contains logic for checking
 *  if this can be linked on its first encounter, which is needed as per our standard linker semantics
 * @param isOptimistic is this an optimistic native method, i.e. can it throw {@link UnwarrantedOptimismException}
 *   which would have to lead to a relink and return value processing
 */
public Specialization(final MethodHandle mh, final Class<? extends LinkLogic> linkLogicClass, final boolean isOptimistic) {
    this.mh             = mh;
    this.isOptimistic   = isOptimistic;
    if (linkLogicClass != null) {
        //null out the "empty" link logic class for optimization purposes
        //we only use the empty instance because we can't default class annotations
        //to null
        this.linkLogicClass = LinkLogic.isEmpty(linkLogicClass) ? null : linkLogicClass;
    } else {
        this.linkLogicClass = null;
    }
 }