comparison graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectObjectStoreNode.java @ 16895:06c15e88d383

added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
author Doug Simon <doug.simon@oracle.com>
date Mon, 18 Aug 2014 14:04:21 +0200
parents cbd42807a31f
children f90dcdbbb75e
comparison
equal deleted inserted replaced
16894:cc7aaa92c27d 16895:06c15e88d383
41 @Input private ValueNode value; 41 @Input private ValueNode value;
42 @Input private ValueNode offset; 42 @Input private ValueNode offset;
43 private final int displacement; 43 private final int displacement;
44 private final LocationIdentity locationIdentity; 44 private final LocationIdentity locationIdentity;
45 45
46 public DirectObjectStoreNode(ValueNode object, int displacement, ValueNode offset, ValueNode value, LocationIdentity locationIdentity) { 46 public static DirectObjectStoreNode create(ValueNode object, int displacement, ValueNode offset, ValueNode value, LocationIdentity locationIdentity) {
47 return new DirectObjectStoreNodeGen(object, displacement, offset, value, locationIdentity);
48 }
49
50 protected DirectObjectStoreNode(ValueNode object, int displacement, ValueNode offset, ValueNode value, LocationIdentity locationIdentity) {
47 super(StampFactory.forVoid()); 51 super(StampFactory.forVoid());
48 this.object = object; 52 this.object = object;
49 this.value = value; 53 this.value = value;
50 this.offset = offset; 54 this.offset = offset;
51 this.displacement = displacement; 55 this.displacement = displacement;
59 public static native void storeLong(Object obj, @ConstantNodeParameter int displacement, long offset, long value, @ConstantNodeParameter LocationIdentity locationIdenity); 63 public static native void storeLong(Object obj, @ConstantNodeParameter int displacement, long offset, long value, @ConstantNodeParameter LocationIdentity locationIdenity);
60 64
61 @Override 65 @Override
62 public void lower(LoweringTool tool) { 66 public void lower(LoweringTool tool) {
63 IndexedLocationNode location = IndexedLocationNode.create(locationIdentity, value.getKind(), displacement, offset, graph(), 1); 67 IndexedLocationNode location = IndexedLocationNode.create(locationIdentity, value.getKind(), displacement, offset, graph(), 1);
64 JavaWriteNode write = graph().add(new JavaWriteNode(object, value, location, BarrierType.NONE, value.getKind() == Kind.Object, false)); 68 JavaWriteNode write = graph().add(JavaWriteNode.create(object, value, location, BarrierType.NONE, value.getKind() == Kind.Object, false));
65 graph().replaceFixedWithFixed(this, write); 69 graph().replaceFixedWithFixed(this, write);
66 70
67 tool.getLowerer().lower(write, tool); 71 tool.getLowerer().lower(write, tool);
68 } 72 }
69 } 73 }