50 PseudoRandom.shuffle(argType);
51 for (Type type : argType) {
52 try {
53 Factory<IRNode> expressionFactory = new IRNodeBuilder()
54 .setComplexityLimit(complexityLimit - 1)
55 .setOperatorLimit(operatorLimit - 1)
56 .setOwnerKlass((TypeKlass) ownerClass)
57 .setExceptionSafe(exceptionSafe)
58 .setNoConsts(noconsts)
59 .setResultType(type)
60 .getExpressionFactory();
61 SymbolTable.push();
62 if (type.equals(resultType) ||
63 ((!exceptionSafe || exceptionSafe && !(type instanceof TypeKlass))
64 && type.canExplicitlyCastTo(resultType))) {
65 // In safe mode we cannot explicitly cast an object, because it may throw.
66 CastOperator castOperator = new CastOperator(resultType, expressionFactory.produce());
67 SymbolTable.merge();
68 return castOperator;
69 }
70 throw new ProductionFailedException();
71 } catch (ProductionFailedException e) {
72 SymbolTable.pop();
73 }
74 }
75 throw new ProductionFailedException();
76 }
77 }
|
50 PseudoRandom.shuffle(argType);
51 for (Type type : argType) {
52 try {
53 Factory<IRNode> expressionFactory = new IRNodeBuilder()
54 .setComplexityLimit(complexityLimit - 1)
55 .setOperatorLimit(operatorLimit - 1)
56 .setOwnerKlass((TypeKlass) ownerClass)
57 .setExceptionSafe(exceptionSafe)
58 .setNoConsts(noconsts)
59 .setResultType(type)
60 .getExpressionFactory();
61 SymbolTable.push();
62 if (type.equals(resultType) ||
63 ((!exceptionSafe || exceptionSafe && !(type instanceof TypeKlass))
64 && type.canExplicitlyCastTo(resultType))) {
65 // In safe mode we cannot explicitly cast an object, because it may throw.
66 CastOperator castOperator = new CastOperator(resultType, expressionFactory.produce());
67 SymbolTable.merge();
68 return castOperator;
69 }
70 SymbolTable.pop();
71 } catch (ProductionFailedException e) {
72 SymbolTable.pop();
73 }
74 }
75 throw new ProductionFailedException();
76 }
77 }
|