Mercurial > hg > truffle
comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/DynamicNewInstanceNode.java @ 21931:40aff2bb1880
Preserve stateBefore when creating newInstanceNode and newArrayNode during canonicalization
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Thu, 11 Jun 2015 20:40:11 -0700 |
parents | ae5bee2d61b2 |
children |
comparison
equal
deleted
inserted
replaced
21930:b09503284ac8 | 21931:40aff2bb1880 |
---|---|
36 public static final NodeClass<DynamicNewInstanceNode> TYPE = NodeClass.create(DynamicNewInstanceNode.class); | 36 public static final NodeClass<DynamicNewInstanceNode> TYPE = NodeClass.create(DynamicNewInstanceNode.class); |
37 | 37 |
38 @Input ValueNode clazz; | 38 @Input ValueNode clazz; |
39 | 39 |
40 public DynamicNewInstanceNode(ValueNode clazz, boolean fillContents) { | 40 public DynamicNewInstanceNode(ValueNode clazz, boolean fillContents) { |
41 this(TYPE, clazz, fillContents); | 41 this(TYPE, clazz, fillContents, null); |
42 } | 42 } |
43 | 43 |
44 protected DynamicNewInstanceNode(NodeClass<? extends DynamicNewInstanceNode> c, ValueNode clazz, boolean fillContents) { | 44 protected DynamicNewInstanceNode(NodeClass<? extends DynamicNewInstanceNode> c, ValueNode clazz, boolean fillContents, FrameState stateBefore) { |
45 super(c, StampFactory.objectNonNull(), fillContents); | 45 super(c, StampFactory.objectNonNull(), fillContents, stateBefore); |
46 this.clazz = clazz; | 46 this.clazz = clazz; |
47 } | 47 } |
48 | 48 |
49 public ValueNode getInstanceType() { | 49 public ValueNode getInstanceType() { |
50 return clazz; | 50 return clazz; |
69 return this; | 69 return this; |
70 } | 70 } |
71 | 71 |
72 /** Hook for subclasses to instantiate a subclass of {@link NewInstanceNode}. */ | 72 /** Hook for subclasses to instantiate a subclass of {@link NewInstanceNode}. */ |
73 protected NewInstanceNode createNewInstanceNode(ResolvedJavaType type) { | 73 protected NewInstanceNode createNewInstanceNode(ResolvedJavaType type) { |
74 return new NewInstanceNode(type, fillContents()); | 74 return new NewInstanceNode(type, fillContents(), stateBefore()); |
75 } | 75 } |
76 | 76 |
77 public static boolean throwsInstantiationException(Class<?> type) { | 77 public static boolean throwsInstantiationException(Class<?> type) { |
78 return type.isPrimitive() || type.isArray() || type.isInterface() || Modifier.isAbstract(type.getModifiers()) || type == Class.class; | 78 return type.isPrimitive() || type.isArray() || type.isInterface() || Modifier.isAbstract(type.getModifiers()) || type == Class.class; |
79 } | 79 } |