comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/DynamicNewArrayNode.java @ 19403:7e2c87dae93e

Create static final NodeClass field named TYPE in Node subclasses.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Mon, 16 Feb 2015 15:43:03 +0100
parents f57d86eb036f
children 61d3cb8e1280
comparison
equal deleted inserted replaced
19402:a306749d3e86 19403:7e2c87dae93e
1 /* 1 /*
2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
37 * The {@code DynamicNewArrayNode} is used for allocation of arrays when the type is not a 37 * The {@code DynamicNewArrayNode} is used for allocation of arrays when the type is not a
38 * compile-time constant. 38 * compile-time constant.
39 */ 39 */
40 @NodeInfo 40 @NodeInfo
41 public class DynamicNewArrayNode extends AbstractNewArrayNode { 41 public class DynamicNewArrayNode extends AbstractNewArrayNode {
42 public static final NodeClass TYPE = NodeClass.get(DynamicNewArrayNode.class);
42 43
43 @Input ValueNode elementType; 44 @Input ValueNode elementType;
44 45
45 /** 46 /**
46 * A non-null value indicating the worst case element type. Mainly useful for distinguishing 47 * A non-null value indicating the worst case element type. Mainly useful for distinguishing
47 * Object arrays from primitive arrays. 48 * Object arrays from primitive arrays.
48 */ 49 */
49 protected final Kind knownElementKind; 50 protected final Kind knownElementKind;
50 51
51 public DynamicNewArrayNode(ValueNode elementType, ValueNode length) { 52 public DynamicNewArrayNode(ValueNode elementType, ValueNode length) {
52 this(elementType, length, true, null); 53 this(TYPE, elementType, length, true, null);
53 } 54 }
54 55
55 public DynamicNewArrayNode(ValueNode elementType, ValueNode length, boolean fillContents, Kind knownElementKind) { 56 public DynamicNewArrayNode(ValueNode elementType, ValueNode length, boolean fillContents, Kind knownElementKind) {
56 super(StampFactory.objectNonNull(), length, fillContents); 57 this(TYPE, elementType, length, fillContents, knownElementKind);
58 }
59
60 protected DynamicNewArrayNode(NodeClass c, ValueNode elementType, ValueNode length, boolean fillContents, Kind knownElementKind) {
61 super(c, StampFactory.objectNonNull(), length, fillContents);
57 this.elementType = elementType; 62 this.elementType = elementType;
58 this.knownElementKind = knownElementKind; 63 this.knownElementKind = knownElementKind;
59 } 64 }
60 65
61 public ValueNode getElementType() { 66 public ValueNode getElementType() {