graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File graal-hsail Sdiff graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta

graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java

Print this page




 663                     VirtualObjectNode virtual = commit.getVirtualObjects().get(objIndex);
 664                     int entryCount = virtual.entryCount();
 665 
 666                     FixedWithNextNode newObject;
 667                     if (virtual instanceof VirtualInstanceNode) {
 668                         newObject = graph.add(new NewInstanceNode(virtual.type(), true));
 669                     } else {
 670                         ResolvedJavaType element = ((VirtualArrayNode) virtual).componentType();
 671                         newObject = graph.add(new NewArrayNode(element, ConstantNode.forInt(entryCount, graph), true));
 672                     }
 673                     graph.addBeforeFixed(commit, newObject);
 674                     allocations[objIndex] = newObject;
 675                 }
 676                 int valuePos = 0;
 677                 for (int objIndex = 0; objIndex < commit.getVirtualObjects().size(); objIndex++) {
 678                     VirtualObjectNode virtual = commit.getVirtualObjects().get(objIndex);
 679                     int entryCount = virtual.entryCount();
 680 
 681                     ValueNode newObject = allocations[objIndex];
 682                     if (virtual instanceof VirtualInstanceNode) {
 683                         VirtualInstanceNode instance = (VirtualInstanceNode) virtual;
 684                         for (int i = 0; i < entryCount; i++) {
 685                             ValueNode value = commit.getValues().get(valuePos++);
 686                             if (value instanceof VirtualObjectNode) {
 687                                 value = allocations[commit.getVirtualObjects().indexOf(value)];
 688                             }
 689                             if (!(value.isConstant() && value.asConstant().isDefaultForKind())) {
 690                                 WriteNode write = new WriteNode(newObject, value, createFieldLocation(graph, (HotSpotResolvedJavaField) instance.field(i)), WriteBarrierType.NONE,
 691                                                 instance.field(i).getKind() == Kind.Object);
 692 
 693                                 graph.addBeforeFixed(commit, graph.add(write));
 694                             }
 695                         }
 696 
 697                     } else {
 698                         VirtualArrayNode array = (VirtualArrayNode) virtual;
 699                         ResolvedJavaType element = array.componentType();
 700                         for (int i = 0; i < entryCount; i++) {
 701                             ValueNode value = commit.getValues().get(valuePos++);
 702                             if (value instanceof VirtualObjectNode) {
 703                                 int indexOf = commit.getVirtualObjects().indexOf(value);
 704                                 assert indexOf != -1 : commit + " " + value;
 705                                 value = allocations[indexOf];
 706                             }
 707                             if (!(value.isConstant() && value.asConstant().isDefaultForKind())) {
 708                                 WriteNode write = new WriteNode(newObject, value, createArrayLocation(graph, element.getKind(), ConstantNode.forInt(i, graph)), WriteBarrierType.NONE,
 709                                                 value.kind() == Kind.Object);
 710                                 graph.addBeforeFixed(commit, graph.add(write));
 711                             }




 663                     VirtualObjectNode virtual = commit.getVirtualObjects().get(objIndex);
 664                     int entryCount = virtual.entryCount();
 665 
 666                     FixedWithNextNode newObject;
 667                     if (virtual instanceof VirtualInstanceNode) {
 668                         newObject = graph.add(new NewInstanceNode(virtual.type(), true));
 669                     } else {
 670                         ResolvedJavaType element = ((VirtualArrayNode) virtual).componentType();
 671                         newObject = graph.add(new NewArrayNode(element, ConstantNode.forInt(entryCount, graph), true));
 672                     }
 673                     graph.addBeforeFixed(commit, newObject);
 674                     allocations[objIndex] = newObject;
 675                 }
 676                 int valuePos = 0;
 677                 for (int objIndex = 0; objIndex < commit.getVirtualObjects().size(); objIndex++) {
 678                     VirtualObjectNode virtual = commit.getVirtualObjects().get(objIndex);
 679                     int entryCount = virtual.entryCount();
 680 
 681                     ValueNode newObject = allocations[objIndex];
 682                     if (virtual instanceof VirtualInstanceNode) {
 683                         VirtualInstanceNode virtualInstance = (VirtualInstanceNode) virtual;
 684                         for (int i = 0; i < entryCount; i++) {
 685                             ValueNode value = commit.getValues().get(valuePos++);
 686                             if (value instanceof VirtualObjectNode) {
 687                                 value = allocations[commit.getVirtualObjects().indexOf(value)];
 688                             }
 689                             if (!(value.isConstant() && value.asConstant().isDefaultForKind())) {
 690                                 WriteNode write = new WriteNode(newObject, value, createFieldLocation(graph, (HotSpotResolvedJavaField) virtualInstance.field(i)), WriteBarrierType.NONE,
 691                                                 virtualInstance.field(i).getKind() == Kind.Object);
 692 
 693                                 graph.addBeforeFixed(commit, graph.add(write));
 694                             }
 695                         }
 696 
 697                     } else {
 698                         VirtualArrayNode array = (VirtualArrayNode) virtual;
 699                         ResolvedJavaType element = array.componentType();
 700                         for (int i = 0; i < entryCount; i++) {
 701                             ValueNode value = commit.getValues().get(valuePos++);
 702                             if (value instanceof VirtualObjectNode) {
 703                                 int indexOf = commit.getVirtualObjects().indexOf(value);
 704                                 assert indexOf != -1 : commit + " " + value;
 705                                 value = allocations[indexOf];
 706                             }
 707                             if (!(value.isConstant() && value.asConstant().isDefaultForKind())) {
 708                                 WriteNode write = new WriteNode(newObject, value, createArrayLocation(graph, element.getKind(), ConstantNode.forInt(i, graph)), WriteBarrierType.NONE,
 709                                                 value.kind() == Kind.Object);
 710                                 graph.addBeforeFixed(commit, graph.add(write));
 711                             }


graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File