annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/AllocaNode.java @ 16811:5d468add216f

added @NodeInfo annotations to all Node classes
author Doug Simon <doug.simon@oracle.com>
date Wed, 13 Aug 2014 18:25:45 +0200
parents c260582ba074
children cbd42807a31f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13595
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
1 /*
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
4 *
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
8 *
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
13 * accompanied this code).
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
14 *
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
18 *
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
21 * questions.
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
22 */
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
23 package com.oracle.graal.hotspot.nodes;
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
25 import java.util.*;
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
26
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
27 import com.oracle.graal.api.code.*;
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
28 import com.oracle.graal.api.meta.*;
15261
882f4cb7cfcf Move Stamps to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents: 14950
diff changeset
29 import com.oracle.graal.compiler.common.type.*;
16811
5d468add216f added @NodeInfo annotations to all Node classes
Doug Simon <doug.simon@oracle.com>
parents: 15336
diff changeset
30 import com.oracle.graal.graph.*;
13595
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
31 import com.oracle.graal.hotspot.*;
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
32 import com.oracle.graal.nodes.*;
14841
47e4d2e01c6e Split LIRGenerator and fix AMD64 backend.
Josef Eisl <josef.eisl@jku.at>
parents: 14810
diff changeset
33 import com.oracle.graal.nodes.spi.*;
13595
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
34
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
35 /**
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
36 * Reserves a block of memory in the stack frame of a method. The block is reserved in the frame for
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
37 * the entire execution of the associated method.
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
38 */
16811
5d468add216f added @NodeInfo annotations to all Node classes
Doug Simon <doug.simon@oracle.com>
parents: 15336
diff changeset
39 @NodeInfo
5d468add216f added @NodeInfo annotations to all Node classes
Doug Simon <doug.simon@oracle.com>
parents: 15336
diff changeset
40 public class AllocaNode extends FixedWithNextNode implements LIRLowerable {
13595
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
41
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
42 /**
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
43 * The number of slots in block.
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
44 */
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
45 private final int slots;
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
46
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
47 /**
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
48 * The indexes of the object pointer slots in the block. Each such object pointer slot must be
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
49 * initialized before any safepoint in the method otherwise the garbage collector will see
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
50 * garbage values when processing these slots.
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
51 */
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
52 private final BitSet objects;
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
53
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
54 public AllocaNode(int slots, BitSet objects) {
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
55 super(StampFactory.forKind(HotSpotGraalRuntime.getHostWordKind()));
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
56 this.slots = slots;
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
57 this.objects = objects;
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
58 }
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
59
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
60 @Override
15336
c260582ba074 Remove obsolete LIRGenResLowerable interface.
Josef Eisl <josef.eisl@jku.at>
parents: 15292
diff changeset
61 public void generate(NodeLIRBuilderTool gen) {
c260582ba074 Remove obsolete LIRGenResLowerable interface.
Josef Eisl <josef.eisl@jku.at>
parents: 15292
diff changeset
62 StackSlot array = gen.getLIRGeneratorTool().getResult().getFrameMap().allocateStackSlots(slots, objects, null);
14841
47e4d2e01c6e Split LIRGenerator and fix AMD64 backend.
Josef Eisl <josef.eisl@jku.at>
parents: 14810
diff changeset
63 Value result = gen.getLIRGeneratorTool().emitAddress(array);
13595
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
64 gen.setResult(this, result);
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
65 }
7acbe6efed0d added AllocaNode for reserving a block of memory in the stack frame of a method
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
66 }