47 * Intrinsic for allocating an on-stack array of integers to hold the dimensions of a multianewarray
48 * instruction.
49 */
50 @NodeInfo(cycles = CYCLES_2, size = SIZE_1)
51 public final class DimensionsNode extends FixedWithNextNode implements LIRLowerable {
52
53 public static final NodeClass<DimensionsNode> TYPE = NodeClass.create(DimensionsNode.class);
54 protected final int rank;
55
56 public DimensionsNode(@InjectedNodeParameter WordTypes wordTypes, int rank) {
57 super(TYPE, StampFactory.forKind(wordTypes.getWordKind()));
58 this.rank = rank;
59 }
60
61 @Override
62 public void generate(NodeLIRBuilderTool gen) {
63 LIRGeneratorTool lirGen = gen.getLIRGeneratorTool();
64 int size = rank * 4;
65 int wordSize = lirGen.target().wordSize;
66 int slots = roundUp(size, wordSize) / wordSize;
67 VirtualStackSlot array = lirGen.getResult().getFrameMapBuilder().allocateStackSlots(slots, new BitSet(0), null);
68 Value result = lirGen.emitAddress(array);
69 gen.setResult(this, result);
70 }
71
72 @NodeIntrinsic
73 public static native Word allocaDimsArray(@ConstantNodeParameter int rank);
74 }
|
47 * Intrinsic for allocating an on-stack array of integers to hold the dimensions of a multianewarray
48 * instruction.
49 */
50 @NodeInfo(cycles = CYCLES_2, size = SIZE_1)
51 public final class DimensionsNode extends FixedWithNextNode implements LIRLowerable {
52
53 public static final NodeClass<DimensionsNode> TYPE = NodeClass.create(DimensionsNode.class);
54 protected final int rank;
55
56 public DimensionsNode(@InjectedNodeParameter WordTypes wordTypes, int rank) {
57 super(TYPE, StampFactory.forKind(wordTypes.getWordKind()));
58 this.rank = rank;
59 }
60
61 @Override
62 public void generate(NodeLIRBuilderTool gen) {
63 LIRGeneratorTool lirGen = gen.getLIRGeneratorTool();
64 int size = rank * 4;
65 int wordSize = lirGen.target().wordSize;
66 int slots = roundUp(size, wordSize) / wordSize;
67 VirtualStackSlot array = lirGen.allocateStackSlots(slots, new BitSet(0), null);
68 Value result = lirGen.emitAddress(array);
69 gen.setResult(this, result);
70 }
71
72 @NodeIntrinsic
73 public static native Word allocaDimsArray(@ConstantNodeParameter int rank);
74 }
|