Mercurial > hg > graal-jvmci-8
annotate graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/PushThroughPiPhase.java @ 21327:b8dcf353b822
LinearScan: encapsulate intervals.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Tue, 12 May 2015 12:03:55 +0200 |
parents | 61d3cb8e1280 |
children | b1530a6cce8c |
rev | line source |
---|---|
8896
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
1 /* |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
4 * |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
8 * |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
13 * accompanied this code). |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
14 * |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
18 * |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
21 * questions. |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
22 */ |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
23 package com.oracle.graal.phases.common; |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
24 |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
25 import com.oracle.graal.debug.*; |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
26 import com.oracle.graal.graph.*; |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
27 import com.oracle.graal.nodes.*; |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
28 import com.oracle.graal.nodes.spi.*; |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
29 import com.oracle.graal.phases.*; |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
30 |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
31 public class PushThroughPiPhase extends Phase { |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
32 |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
33 public static final DebugMetric PUSHED_NODES = Debug.metric("NodesPushedThroughPi"); |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
34 |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
35 @Override |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
36 protected void run(StructuredGraph graph) { |
19410
61d3cb8e1280
Add generic parameter to NodeClass. Change Graph#getNodes(Class) to Graph#getNodes(NodeClass).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
8896
diff
changeset
|
37 for (PiNode pi : graph.getNodes(PiNode.TYPE)) { |
8896
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
38 for (Node n : pi.usages().snapshot()) { |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
39 if (n instanceof PiPushable) { |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
40 PiPushable pip = (PiPushable) n; |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
41 if (pip.push(pi)) { |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
42 PUSHED_NODES.add(1); |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
43 } |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
44 } |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
45 } |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
46 } |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
47 } |
aa291d601ee8
rename: s/PushNodesThroughPi/PushThroughPiPhase/
Bernhard Urban <bernhard.urban@jku.at>
parents:
diff
changeset
|
48 } |