comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java @ 9475:6f84aacfdf3c

Infer stamp for LoadIndexedNode, so that we have more precise type information for the result of the array load. This is important when the array is a originally a phi function (whithout any type information) and the phi function gets eliminated later on.
author Christian Wimmer <christian.wimmer@oracle.com>
date Wed, 01 May 2013 09:11:13 -0700
parents 0b646334c5f7
children ef6915cf1e59
comparison
equal deleted inserted replaced
9474:85f83b7b3616 9475:6f84aacfdf3c
51 return StampFactory.forKind(kind); 51 return StampFactory.forKind(kind);
52 } 52 }
53 } 53 }
54 54
55 @Override 55 @Override
56 public boolean inferStamp() {
57 return updateStamp(createStamp(array(), elementKind()));
58 }
59
60 @Override
56 public void virtualize(VirtualizerTool tool) { 61 public void virtualize(VirtualizerTool tool) {
57 State arrayState = tool.getObjectState(array()); 62 State arrayState = tool.getObjectState(array());
58 if (arrayState != null && arrayState.getState() == EscapeState.Virtual) { 63 if (arrayState != null && arrayState.getState() == EscapeState.Virtual) {
59 ValueNode indexValue = tool.getReplacedValue(index()); 64 ValueNode indexValue = tool.getReplacedValue(index());
60 int index = indexValue.isConstant() ? indexValue.asConstant().asInt() : -1; 65 int index = indexValue.isConstant() ? indexValue.asConstant().asInt() : -1;