annotate graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/nodes/MaterializedObjectState.java @ 17450:45b45f902bed

removed Node generation (GRAAL-857)
author Doug Simon <doug.simon@oracle.com>
date Wed, 15 Oct 2014 15:35:33 +0200
parents 0fe4732e5181
children f57d86eb036f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6286
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
1 /*
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
2 * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
4 *
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
7 * published by the Free Software Foundation.
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
8 *
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
13 * accompanied this code).
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
14 *
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
18 *
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
21 * questions.
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
22 */
6524
a206e077ffc8 rename packages in graal.virtual to match project name
Doug Simon <doug.simon@oracle.com>
parents: 6522
diff changeset
23 package com.oracle.graal.virtual.nodes;
6286
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
24
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
25 import com.oracle.graal.graph.*;
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: 16811
diff changeset
26 import com.oracle.graal.nodeinfo.*;
6286
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
27 import com.oracle.graal.nodes.*;
6524
a206e077ffc8 rename packages in graal.virtual to match project name
Doug Simon <doug.simon@oracle.com>
parents: 6522
diff changeset
28 import com.oracle.graal.nodes.virtual.*;
6286
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
29
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
30 /**
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
31 * This class encapsulated the materialized state of an escape analyzed object.
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
32 */
16811
5d468add216f added @NodeInfo annotations to all Node classes
Doug Simon <doug.simon@oracle.com>
parents: 12428
diff changeset
33 @NodeInfo
5d468add216f added @NodeInfo annotations to all Node classes
Doug Simon <doug.simon@oracle.com>
parents: 12428
diff changeset
34 public class MaterializedObjectState extends EscapeObjectState implements Node.ValueNumberable {
6286
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
35
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
36 @Input ValueNode materializedValue;
6286
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
37
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
38 public ValueNode materializedValue() {
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
39 return materializedValue;
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
40 }
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
41
16895
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
42 public static MaterializedObjectState create(VirtualObjectNode object, ValueNode materializedValue) {
17450
45b45f902bed removed Node generation (GRAAL-857)
Doug Simon <doug.simon@oracle.com>
parents: 16919
diff changeset
43 return new MaterializedObjectState(object, materializedValue);
16895
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
44 }
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
45
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
46 protected MaterializedObjectState(VirtualObjectNode object, ValueNode materializedValue) {
6286
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
47 super(object);
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
48 this.materializedValue = materializedValue;
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
49 }
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
50
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
51 @Override
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
52 public MaterializedObjectState duplicateWithVirtualState() {
16895
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
53 return graph().addWithoutUnique(MaterializedObjectState.create(object(), materializedValue));
6286
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
54 }
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
55
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
56 @Override
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6707
diff changeset
57 public void applyToNonVirtual(NodeClosure<? super ValueNode> closure) {
6286
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
58 closure.apply(this, materializedValue);
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
59 }
67a357e3e42a infrastructure changes in preparation of partial escape analysis
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff changeset
60 }