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

The following examples show how to use jdk.nashorn.internal.codegen.types.Type#UNDEFINED . 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: LocalVariableTypesCalculator.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean enterReturnNode(final ReturnNode returnNode) {
    if(!reachable) {
        return false;
    }

    final Expression returnExpr = returnNode.getExpression();
    final Type returnExprType;
    if(returnExpr != null) {
        returnExprType = visitExpressionOnEmptyStack(returnExpr).type;
    } else {
        assertTypeStackIsEmpty();
        returnExprType = Type.UNDEFINED;
    }
    returnType = Type.widestReturnType(returnType, returnExprType);
    doesNotContinueSequentially();
    return false;
}
 
Example 2
Source File: LocalVariableTypesCalculator.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean enterReturnNode(final ReturnNode returnNode) {
    if(!reachable) {
        return false;
    }

    final Expression returnExpr = returnNode.getExpression();
    final Type returnExprType;
    if(returnExpr != null) {
        returnExprType = visitExpressionOnEmptyStack(returnExpr).type;
    } else {
        assertTypeStackIsEmpty();
        returnExprType = Type.UNDEFINED;
    }
    returnType = Type.widestReturnType(returnType, returnExprType);
    doesNotContinueSequentially();
    return false;
}
 
Example 3
Source File: LocalVariableTypesCalculator.java    From jdk8u_nashorn with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean enterReturnNode(final ReturnNode returnNode) {
    if(!reachable) {
        return false;
    }

    final Expression returnExpr = returnNode.getExpression();
    final Type returnExprType;
    if(returnExpr != null) {
        returnExprType = visitExpressionOnEmptyStack(returnExpr).type;
    } else {
        assertTypeStackIsEmpty();
        returnExprType = Type.UNDEFINED;
    }
    returnType = Type.widestReturnType(returnType, returnExprType);
    doesNotContinueSequentially();
    return false;
}
 
Example 4
Source File: LocalVariableTypesCalculator.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean enterReturnNode(final ReturnNode returnNode) {
    if(!reachable) {
        return false;
    }

    final Expression returnExpr = returnNode.getExpression();
    final Type returnExprType;
    if(returnExpr != null) {
        returnExprType = visitExpressionOnEmptyStack(returnExpr).type;
    } else {
        assertTypeStackIsEmpty();
        returnExprType = Type.UNDEFINED;
    }
    returnType = Type.widestReturnType(returnType, returnExprType);
    doesNotContinueSequentially();
    return false;
}
 
Example 5
Source File: LocalVariableConversion.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static char getTypeChar(final Type type) {
    if(type == Type.UNDEFINED) {
        return 'U';
    } else if(type.isObject()) {
        return 'O';
    } else if(type == Type.BOOLEAN) {
        return 'Z';
    }
    return type.getBytecodeStackType();
}
 
Example 6
Source File: Expression.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
void optimisticTypeToString(final StringBuilder sb, final boolean optimistic) {
    sb.append('{');
    final Type type = getType();
    final String desc = type == Type.UNDEFINED ? "U" : type.getDescriptor();

    sb.append(desc.charAt(desc.length() - 1) == ';' ? "O" : desc);
    if (isOptimistic() && optimistic) {
        sb.append(OPT_IDENTIFIER);
        final int pp = ((Optimistic)this).getProgramPoint();
        if (UnwarrantedOptimismException.isValid(pp)) {
            sb.append('_').append(pp);
        }
    }
    sb.append('}');
}
 
Example 7
Source File: IdentNode.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Type getType() {
    if(type != null) {
        return type;
    } else if(symbol != null && symbol.isScope()) {
        return Type.OBJECT;
    }
    return Type.UNDEFINED;
}
 
Example 8
Source File: LocalVariableConversion.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static char getTypeChar(final Type type) {
    if(type == Type.UNDEFINED) {
        return 'U';
    } else if(type.isObject()) {
        return 'O';
    } else if(type == Type.BOOLEAN) {
        return 'Z';
    }
    return type.getBytecodeStackType();
}
 
Example 9
Source File: Expression.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
void optimisticTypeToString(final StringBuilder sb, final boolean optimistic) {
    sb.append('{');
    final Type type = getType();
    final String desc = type == Type.UNDEFINED ? "U" : type.getDescriptor();

    sb.append(desc.charAt(desc.length() - 1) == ';' ? "O" : desc);
    if (isOptimistic() && optimistic) {
        sb.append(OPT_IDENTIFIER);
        final int pp = ((Optimistic)this).getProgramPoint();
        if (UnwarrantedOptimismException.isValid(pp)) {
            sb.append('_').append(pp);
        }
    }
    sb.append('}');
}
 
Example 10
Source File: LocalVariableConversion.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static char getTypeChar(final Type type) {
    if(type == Type.UNDEFINED) {
        return 'U';
    } else if(type.isObject()) {
        return 'O';
    } else if(type == Type.BOOLEAN) {
        return 'Z';
    }
    return type.getBytecodeStackType();
}
 
Example 11
Source File: IdentNode.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Type getType() {
    if(type != null) {
        return type;
    } else if(symbol != null && symbol.isScope()) {
        return Type.OBJECT;
    }
    return Type.UNDEFINED;
}
 
Example 12
Source File: LocalVariableConversion.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static char getTypeChar(final Type type) {
    if(type == Type.UNDEFINED) {
        return 'U';
    } else if(type.isObject()) {
        return 'O';
    } else if(type == Type.BOOLEAN) {
        return 'Z';
    }
    return type.getBytecodeStackType();
}
 
Example 13
Source File: IdentNode.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Type getType() {
    if(type != null) {
        return type;
    } else if(symbol != null && symbol.isScope()) {
        return Type.OBJECT;
    }
    return Type.UNDEFINED;
}
 
Example 14
Source File: Expression.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
void optimisticTypeToString(final StringBuilder sb, final boolean optimistic) {
    sb.append('{');
    final Type type = getType();
    final String desc = type == Type.UNDEFINED ? "U" : type.getDescriptor();

    sb.append(desc.charAt(desc.length() - 1) == ';' ? "O" : desc);
    if (isOptimistic() && optimistic) {
        sb.append(OPT_IDENTIFIER);
        final int pp = ((Optimistic)this).getProgramPoint();
        if (UnwarrantedOptimismException.isValid(pp)) {
            sb.append('_').append(pp);
        }
    }
    sb.append('}');
}
 
Example 15
Source File: IdentNode.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Type getType() {
    if(type != null) {
        return type;
    } else if(symbol != null && symbol.isScope()) {
        return Type.OBJECT;
    }
    return Type.UNDEFINED;
}
 
Example 16
Source File: Expression.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
void optimisticTypeToString(final StringBuilder sb, final boolean optimistic) {
    sb.append('{');
    final Type type = getType();
    final String desc = type == Type.UNDEFINED ? "U" : type.getDescriptor();

    sb.append(desc.charAt(desc.length() - 1) == ';' ? "O" : desc);
    if (isOptimistic() && optimistic) {
        sb.append(OPT_IDENTIFIER);
        final int pp = ((Optimistic)this).getProgramPoint();
        if (UnwarrantedOptimismException.isValid(pp)) {
            sb.append('_').append(pp);
        }
    }
    sb.append('}');
}
 
Example 17
Source File: Expression.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
void optimisticTypeToString(final StringBuilder sb, final boolean optimistic) {
    sb.append('{');
    final Type type = getType();
    final String desc = type == Type.UNDEFINED ? "U" : type.getDescriptor();

    sb.append(desc.charAt(desc.length() - 1) == ';' ? "O" : desc);
    if (isOptimistic() && optimistic) {
        sb.append(OPT_IDENTIFIER);
        final int pp = ((Optimistic)this).getProgramPoint();
        if (UnwarrantedOptimismException.isValid(pp)) {
            sb.append('_').append(pp);
        }
    }
    sb.append('}');
}
 
Example 18
Source File: BinaryNode.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private static Type undefinedToNumber(final Type type) {
    return type == Type.UNDEFINED ? Type.NUMBER : type;
}
 
Example 19
Source File: BinaryNode.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private static Type undefinedToNumber(final Type type) {
    return type == Type.UNDEFINED ? Type.NUMBER : type;
}
 
Example 20
Source File: BinaryNode.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private static Type undefinedToNumber(final Type type) {
    return type == Type.UNDEFINED ? Type.NUMBER : type;
}