comparison graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java @ 11265:ef6915cf1e59

Add illegal stamp Remove ValueNode.(object|integer)Stamp: use explicit tests/casts Fix ObjectStamp.join Introduce ObjectStamp.castTo Add some tests for ObjectStamp.join
author Gilles Duboscq <duboscq@ssw.jku.at>
date Thu, 08 Aug 2013 18:17:47 +0200
parents dacc97879751
children 153a347e54c4
comparison
equal deleted inserted replaced
11264:7894695caee6 11265:ef6915cf1e59
912 this.exception = exception; 912 this.exception = exception;
913 } 913 }
914 } 914 }
915 915
916 private void emitNullCheck(ValueNode receiver) { 916 private void emitNullCheck(ValueNode receiver) {
917 if (receiver.stamp().nonNull()) { 917 if (ObjectStamp.isObjectNonNull(receiver.stamp())) {
918 return; 918 return;
919 } 919 }
920 BlockPlaceholderNode trueSucc = currentGraph.add(new BlockPlaceholderNode()); 920 BlockPlaceholderNode trueSucc = currentGraph.add(new BlockPlaceholderNode());
921 BlockPlaceholderNode falseSucc = currentGraph.add(new BlockPlaceholderNode()); 921 BlockPlaceholderNode falseSucc = currentGraph.add(new BlockPlaceholderNode());
922 append(new IfNode(currentGraph.unique(new IsNullNode(receiver)), trueSucc, falseSucc, 0.01)); 922 append(new IfNode(currentGraph.unique(new IsNullNode(receiver)), trueSucc, falseSucc, 0.01));
1101 invokeDirect(target, args); 1101 invokeDirect(target, args);
1102 return; 1102 return;
1103 } 1103 }
1104 // 1. check if the exact type of the receiver can be determined 1104 // 1. check if the exact type of the receiver can be determined
1105 ResolvedJavaType exact = klass.asExactType(); 1105 ResolvedJavaType exact = klass.asExactType();
1106 if (exact == null && receiver.objectStamp().isExactType()) { 1106 if (exact == null && receiver.stamp() instanceof ObjectStamp) {
1107 exact = receiver.objectStamp().type(); 1107 ObjectStamp receiverStamp = (ObjectStamp) receiver.stamp();
1108 if (receiverStamp.isExactType()) {
1109 exact = receiverStamp.type();
1110 }
1108 } 1111 }
1109 if (exact != null) { 1112 if (exact != null) {
1110 // either the holder class is exact, or the receiver object has an exact type 1113 // either the holder class is exact, or the receiver object has an exact type
1111 ResolvedJavaMethod exactMethod = exact.resolveMethod(target); 1114 ResolvedJavaMethod exactMethod = exact.resolveMethod(target);
1112 if (exactMethod != null) { 1115 if (exactMethod != null) {