annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ComputeAddressNode.java @ 18845:f57d86eb036f

removed Node factory methods
author Doug Simon <doug.simon@oracle.com>
date Mon, 12 Jan 2015 20:39:04 +0100
parents 45b45f902bed
children ec0733b5a90a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8507
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
1 /*
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
4 *
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
8 *
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
13 * accompanied this code).
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
14 *
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
18 *
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
21 * questions.
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
22 */
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
23 package com.oracle.graal.nodes.extended;
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
24
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
25 import com.oracle.graal.api.meta.*;
15198
2c0cfbf454b5 Move LIRTypeTool and Stamp to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents: 15132
diff changeset
26 import com.oracle.graal.compiler.common.type.*;
16841
cbd42807a31f moved NodeInfo and friends into separate com.oracle.graal.nodeinfo project so that annotation processor can be applied to the base Node class
Doug Simon <doug.simon@oracle.com>
parents: 16822
diff changeset
27 import com.oracle.graal.nodeinfo.*;
8507
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
28 import com.oracle.graal.nodes.*;
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
29 import com.oracle.graal.nodes.calc.*;
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
30 import com.oracle.graal.nodes.spi.*;
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
31
16822
5d468add216f added @NodeInfo annotations to all Node classes
Doug Simon <doug.simon@oracle.com>
parents: 15198
diff changeset
32 @NodeInfo
8517
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8507
diff changeset
33 public class ComputeAddressNode extends FloatingNode implements LIRLowerable {
8507
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
34
16897
f90dcdbbb75e switched to using new NodeFieldIterator and NodeFieldIterable for traversing Node inputs and successors
Doug Simon <doug.simon@oracle.com>
parents: 16895
diff changeset
35 @Input ValueNode object;
f90dcdbbb75e switched to using new NodeFieldIterator and NodeFieldIterable for traversing Node inputs and successors
Doug Simon <doug.simon@oracle.com>
parents: 16895
diff changeset
36 @Input(InputType.Association) ValueNode location;
8507
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
37
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
38 public ValueNode getObject() {
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
39 return object;
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
40 }
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
41
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
42 public LocationNode getLocation() {
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
43 return (LocationNode) location;
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
44 }
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
45
18845
f57d86eb036f removed Node factory methods
Doug Simon <doug.simon@oracle.com>
parents: 17450
diff changeset
46 public ComputeAddressNode(ValueNode object, ValueNode location, Stamp stamp) {
8507
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
47 super(stamp);
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
48 this.object = object;
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
49 this.location = location;
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
50 }
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
51
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
52 @Override
14950
d5a1206e1923 NodeLIRBuilderTool: fix typo in interface name.
Josef Eisl <josef.eisl@jku.at>
parents: 14888
diff changeset
53 public void generate(NodeLIRBuilderTool gen) {
15130
ec22234bde0d Pass more restricted interfaces to ArithmeticLIRLowerable and LocationNode in LIR generation.
Roland Schatz <roland.schatz@oracle.com>
parents: 14950
diff changeset
54 Value addr = getLocation().generateAddress(gen, gen.getLIRGeneratorTool(), gen.operand(getObject()));
8507
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
55 gen.setResult(this, addr);
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
56 }
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
57 }