Java Code Examples for jdk.nashorn.internal.codegen.types.Type#SLOT_2

The following examples show how to use jdk.nashorn.internal.codegen.types.Type#SLOT_2 . 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: Label.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns a list of local variable slot types, but for those symbols that have multiple values, only the slot
 * holding the widest type is marked as live.
 * @return a list of widest local variable slot types.
 */
List<Type> getWidestLiveLocals(final List<Type> lvarTypes) {
    final List<Type> widestLiveLocals = new ArrayList<>(lvarTypes);
    boolean keepNextValue = true;
    final int size = widestLiveLocals.size();
    for(int i = size - 1; i-- > 0;) {
        if(symbolBoundary.get(i)) {
            keepNextValue = true;
        }
        final Type t = widestLiveLocals.get(i);
        if(t != Type.UNKNOWN) {
            if(keepNextValue) {
                if(t != Type.SLOT_2) {
                    keepNextValue = false;
                }
            } else {
                widestLiveLocals.set(i, Type.UNKNOWN);
            }
        }
    }
    widestLiveLocals.subList(Math.max(getFirstDeadLocal(widestLiveLocals), firstTemp), widestLiveLocals.size()).clear();
    return widestLiveLocals;
}
 
Example 2
Source File: Label.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns a list of local variable slot types, but for those symbols that have multiple values, only the slot
 * holding the widest type is marked as live.
 * @return a list of widest local variable slot types.
 */
List<Type> getWidestLiveLocals(final List<Type> lvarTypes) {
    final List<Type> widestLiveLocals = new ArrayList<>(lvarTypes);
    boolean keepNextValue = true;
    final int size = widestLiveLocals.size();
    for(int i = size - 1; i-- > 0;) {
        if(symbolBoundary.get(i)) {
            keepNextValue = true;
        }
        final Type t = widestLiveLocals.get(i);
        if(t != Type.UNKNOWN) {
            if(keepNextValue) {
                if(t != Type.SLOT_2) {
                    keepNextValue = false;
                }
            } else {
                widestLiveLocals.set(i, Type.UNKNOWN);
            }
        }
    }
    widestLiveLocals.subList(Math.max(getFirstDeadLocal(widestLiveLocals), firstTemp), widestLiveLocals.size()).clear();
    return widestLiveLocals;
}
 
Example 3
Source File: Label.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns a list of local variable slot types, but for those symbols that have multiple values, only the slot
 * holding the widest type is marked as live.
 * @return a list of widest local variable slot types.
 */
List<Type> getWidestLiveLocals(final List<Type> lvarTypes) {
    final List<Type> widestLiveLocals = new ArrayList<>(lvarTypes);
    boolean keepNextValue = true;
    final int size = widestLiveLocals.size();
    for(int i = size - 1; i-- > 0;) {
        if(symbolBoundary.get(i)) {
            keepNextValue = true;
        }
        final Type t = widestLiveLocals.get(i);
        if(t != Type.UNKNOWN) {
            if(keepNextValue) {
                if(t != Type.SLOT_2) {
                    keepNextValue = false;
                }
            } else {
                widestLiveLocals.set(i, Type.UNKNOWN);
            }
        }
    }
    widestLiveLocals.subList(Math.max(getFirstDeadLocal(widestLiveLocals), firstTemp), widestLiveLocals.size()).clear();
    return widestLiveLocals;
}
 
Example 4
Source File: Label.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns a list of local variable slot types, but for those symbols that have multiple values, only the slot
 * holding the widest type is marked as live.
 * @return a list of widest local variable slot types.
 */
List<Type> getWidestLiveLocals(final List<Type> lvarTypes) {
    final List<Type> widestLiveLocals = new ArrayList<>(lvarTypes);
    boolean keepNextValue = true;
    final int size = widestLiveLocals.size();
    for(int i = size - 1; i-- > 0;) {
        if(symbolBoundary.get(i)) {
            keepNextValue = true;
        }
        final Type t = widestLiveLocals.get(i);
        if(t != Type.UNKNOWN) {
            if(keepNextValue) {
                if(t != Type.SLOT_2) {
                    keepNextValue = false;
                }
            } else {
                widestLiveLocals.set(i, Type.UNKNOWN);
            }
        }
    }
    widestLiveLocals.subList(Math.max(getFirstDeadLocal(widestLiveLocals), firstTemp), widestLiveLocals.size()).clear();
    return widestLiveLocals;
}
 
Example 5
Source File: Label.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns a list of local variable slot types, but for those symbols that have multiple values, only the slot
 * holding the widest type is marked as live.
 * @return a list of widest local variable slot types.
 */
List<Type> getWidestLiveLocals(final List<Type> lvarTypes) {
    final List<Type> widestLiveLocals = new ArrayList<>(lvarTypes);
    boolean keepNextValue = true;
    final int size = widestLiveLocals.size();
    for(int i = size - 1; i-- > 0;) {
        if(symbolBoundary.get(i)) {
            keepNextValue = true;
        }
        final Type t = widestLiveLocals.get(i);
        if(t != Type.UNKNOWN) {
            if(keepNextValue) {
                if(t != Type.SLOT_2) {
                    keepNextValue = false;
                }
            } else {
                widestLiveLocals.set(i, Type.UNKNOWN);
            }
        }
    }
    widestLiveLocals.subList(Math.max(getFirstDeadLocal(widestLiveLocals), firstTemp), widestLiveLocals.size()).clear();
    return widestLiveLocals;
}
 
Example 6
Source File: Label.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns a list of local variable slot types, but for those symbols that have multiple values, only the slot
 * holding the widest type is marked as live.
 * @return a list of widest local variable slot types.
 */
List<Type> getWidestLiveLocals(final List<Type> lvarTypes) {
    final List<Type> widestLiveLocals = new ArrayList<>(lvarTypes);
    boolean keepNextValue = true;
    final int size = widestLiveLocals.size();
    for(int i = size - 1; i-- > 0;) {
        if(symbolBoundary.get(i)) {
            keepNextValue = true;
        }
        final Type t = widestLiveLocals.get(i);
        if(t != Type.UNKNOWN) {
            if(keepNextValue) {
                if(t != Type.SLOT_2) {
                    keepNextValue = false;
                }
            } else {
                widestLiveLocals.set(i, Type.UNKNOWN);
            }
        }
    }
    widestLiveLocals.subList(Math.max(getFirstDeadLocal(widestLiveLocals), firstTemp), widestLiveLocals.size()).clear();
    return widestLiveLocals;
}
 
Example 7
Source File: Label.java    From jdk8u_nashorn with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns a list of local variable slot types, but for those symbols that have multiple values, only the slot
 * holding the widest type is marked as live.
 * @return a list of widest local variable slot types.
 */
List<Type> getWidestLiveLocals(final List<Type> lvarTypes) {
    final List<Type> widestLiveLocals = new ArrayList<>(lvarTypes);
    boolean keepNextValue = true;
    final int size = widestLiveLocals.size();
    for(int i = size - 1; i-- > 0;) {
        if(symbolBoundary.get(i)) {
            keepNextValue = true;
        }
        final Type t = widestLiveLocals.get(i);
        if(t != Type.UNKNOWN) {
            if(keepNextValue) {
                if(t != Type.SLOT_2) {
                    keepNextValue = false;
                }
            } else {
                widestLiveLocals.set(i, Type.UNKNOWN);
            }
        }
    }
    widestLiveLocals.subList(Math.max(getFirstDeadLocal(widestLiveLocals), firstTemp), widestLiveLocals.size()).clear();
    return widestLiveLocals;
}