comparison graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/TypeFeedbackCache.java @ 5443:141817e206d4

changes to the dependencies and stamp system: * dependencies can only be of type ValueNode * exactType is a boolean flag, not a separate RiResolvedType * use different Stamp subclasses for IntegerStamp, FloatStamp, ObjectStamp and GenericStamp * use different stamp for nodes that can be a target for dependencies * use different PhiNode constructors for value- and non-value-Phis * use correct stamps for ExceptionObjectNode and CurrentThread
author Lukas Stadler <lukas.stadler@jku.at>
date Fri, 25 May 2012 11:35:18 +0200
parents 77aa8141ba41
children 438ab53efdd0
comparison
equal deleted inserted replaced
5442:2fac5abf145f 5443:141817e206d4
23 package com.oracle.graal.compiler.types; 23 package com.oracle.graal.compiler.types;
24 24
25 import java.util.*; 25 import java.util.*;
26 import java.util.Map.Entry; 26 import java.util.Map.Entry;
27 27
28 import com.oracle.graal.nodes.*;
29 import com.oracle.graal.nodes.spi.types.*;
28 import com.oracle.max.cri.ci.*; 30 import com.oracle.max.cri.ci.*;
29 import com.oracle.max.cri.ri.*; 31 import com.oracle.max.cri.ri.*;
30 import com.oracle.graal.nodes.*;
31 import com.oracle.graal.nodes.spi.types.*;
32 import com.oracle.graal.nodes.type.*;
33 32
34 public class TypeFeedbackCache implements TypeFeedbackTool, Cloneable { 33 public class TypeFeedbackCache implements TypeFeedbackTool, Cloneable {
35 34
36 public static final boolean NO_OBJECT_TYPES = false; 35 public static final boolean NO_OBJECT_TYPES = false;
37 public static final boolean NO_SCALAR_TYPES = false; 36 public static final boolean NO_SCALAR_TYPES = false;
179 types[i] = other; 178 types[i] = other;
180 } 179 }
181 ScalarTypeFeedbackStore scalar = ScalarTypeFeedbackStore.meet(types); 180 ScalarTypeFeedbackStore scalar = ScalarTypeFeedbackStore.meet(types);
182 if (scalar != null && !scalar.isEmpty()) { 181 if (scalar != null && !scalar.isEmpty()) {
183 result.scalarTypeFeedback.put(phi, scalar); 182 result.scalarTypeFeedback.put(phi, scalar);
184 phi.setStamp(StampFactory.forKind(phi.kind(), scalar.query(), null)); 183 // phi.setStamp(StampFactory.forKind(phi.kind(), scalar.query(), null));
185 } 184 }
186 } else if (phi.kind() == CiKind.Object) { 185 } else if (phi.kind() == CiKind.Object) {
187 ObjectTypeFeedbackStore[] types = new ObjectTypeFeedbackStore[phi.valueCount()]; 186 ObjectTypeFeedbackStore[] types = new ObjectTypeFeedbackStore[phi.valueCount()];
188 for (int i = 0; i < phi.valueCount(); i++) { 187 for (int i = 0; i < phi.valueCount(); i++) {
189 ObjectTypeFeedbackStore other = cacheList[i].objectTypeFeedback.get(phi.valueAt(i)); 188 ObjectTypeFeedbackStore other = cacheList[i].objectTypeFeedback.get(phi.valueAt(i));
193 types[i] = other; 192 types[i] = other;
194 } 193 }
195 ObjectTypeFeedbackStore object = ObjectTypeFeedbackStore.meet(types); 194 ObjectTypeFeedbackStore object = ObjectTypeFeedbackStore.meet(types);
196 if (object != null && !object.isEmpty()) { 195 if (object != null && !object.isEmpty()) {
197 result.objectTypeFeedback.put(phi, object); 196 result.objectTypeFeedback.put(phi, object);
198 phi.setStamp(StampFactory.forKind(phi.kind(), null, object.query())); 197 // phi.setStamp(StampFactory.forKind(phi.kind(), null, object.query()));
199 } 198 }
200 } 199 }
201 } 200 }
202 return result; 201 return result;
203 } 202 }