< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotWordOperationPlugin.java

Print this page




 104             case POINTER_NE:
 105                 assert args.length == 2;
 106                 HotspotOpcode opcode = operation.opcode();
 107                 ValueNode left = args[0];
 108                 ValueNode right = args[1];
 109                 assert left.stamp(NodeView.DEFAULT) instanceof MetaspacePointerStamp : left + " " + left.stamp(NodeView.DEFAULT);
 110                 assert right.stamp(NodeView.DEFAULT) instanceof MetaspacePointerStamp : right + " " + right.stamp(NodeView.DEFAULT);
 111                 assert opcode == POINTER_EQ || opcode == POINTER_NE;
 112 
 113                 PointerEqualsNode comparison = b.add(new PointerEqualsNode(left, right));
 114                 ValueNode eqValue = b.add(forBoolean(opcode == POINTER_EQ));
 115                 ValueNode neValue = b.add(forBoolean(opcode == POINTER_NE));
 116                 b.addPush(returnKind, ConditionalNode.create(comparison, eqValue, neValue, NodeView.DEFAULT));
 117                 break;
 118 
 119             case IS_NULL:
 120                 assert args.length == 1;
 121                 ValueNode pointer = args[0];
 122                 assert pointer.stamp(NodeView.DEFAULT) instanceof MetaspacePointerStamp;
 123 
 124                 LogicNode isNull = b.addWithInputs(IsNullNode.create(pointer));
 125                 b.addPush(returnKind, ConditionalNode.create(isNull, b.add(forBoolean(true)), b.add(forBoolean(false)), NodeView.DEFAULT));
 126                 break;
 127 
 128             case FROM_POINTER:
 129                 assert args.length == 1;
 130                 b.addPush(returnKind, new PointerCastNode(StampFactory.forKind(wordKind), args[0]));
 131                 break;
 132 
 133             case TO_KLASS_POINTER:
 134                 assert args.length == 1;
 135                 b.addPush(returnKind, new PointerCastNode(KlassPointerStamp.klass(), args[0]));
 136                 break;
 137 
 138             case TO_METHOD_POINTER:
 139                 assert args.length == 1;
 140                 b.addPush(returnKind, new PointerCastNode(MethodPointerStamp.method(), args[0]));
 141                 break;
 142 
 143             case READ_KLASS_POINTER:
 144                 assert args.length == 2 || args.length == 3;


 104             case POINTER_NE:
 105                 assert args.length == 2;
 106                 HotspotOpcode opcode = operation.opcode();
 107                 ValueNode left = args[0];
 108                 ValueNode right = args[1];
 109                 assert left.stamp(NodeView.DEFAULT) instanceof MetaspacePointerStamp : left + " " + left.stamp(NodeView.DEFAULT);
 110                 assert right.stamp(NodeView.DEFAULT) instanceof MetaspacePointerStamp : right + " " + right.stamp(NodeView.DEFAULT);
 111                 assert opcode == POINTER_EQ || opcode == POINTER_NE;
 112 
 113                 PointerEqualsNode comparison = b.add(new PointerEqualsNode(left, right));
 114                 ValueNode eqValue = b.add(forBoolean(opcode == POINTER_EQ));
 115                 ValueNode neValue = b.add(forBoolean(opcode == POINTER_NE));
 116                 b.addPush(returnKind, ConditionalNode.create(comparison, eqValue, neValue, NodeView.DEFAULT));
 117                 break;
 118 
 119             case IS_NULL:
 120                 assert args.length == 1;
 121                 ValueNode pointer = args[0];
 122                 assert pointer.stamp(NodeView.DEFAULT) instanceof MetaspacePointerStamp;
 123 
 124                 LogicNode isNull = b.add(IsNullNode.create(pointer));
 125                 b.addPush(returnKind, ConditionalNode.create(isNull, b.add(forBoolean(true)), b.add(forBoolean(false)), NodeView.DEFAULT));
 126                 break;
 127 
 128             case FROM_POINTER:
 129                 assert args.length == 1;
 130                 b.addPush(returnKind, new PointerCastNode(StampFactory.forKind(wordKind), args[0]));
 131                 break;
 132 
 133             case TO_KLASS_POINTER:
 134                 assert args.length == 1;
 135                 b.addPush(returnKind, new PointerCastNode(KlassPointerStamp.klass(), args[0]));
 136                 break;
 137 
 138             case TO_METHOD_POINTER:
 139                 assert args.length == 1;
 140                 b.addPush(returnKind, new PointerCastNode(MethodPointerStamp.method(), args[0]));
 141                 break;
 142 
 143             case READ_KLASS_POINTER:
 144                 assert args.length == 2 || args.length == 3;
< prev index next >