Mercurial > hg > graal-jvmci-8
annotate graal/GraalCompiler/src/com/sun/c1x/ir/Or.java @ 2868:6d24c27902a2
turned inlining into a phase, some node cloning fixes, added NodeWorklist
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Tue, 07 Jun 2011 19:19:14 +0200 |
parents | b20f0a48fec3 |
children | fc75fd3fa5e4 |
rev | line source |
---|---|
2853
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
1 /* |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
4 * |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
8 * |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
14 * |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
18 * |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
21 * questions. |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
22 */ |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
23 package com.sun.c1x.ir; |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
24 |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
25 import com.oracle.graal.graph.*; |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
26 import com.sun.cri.bytecode.*; |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
27 import com.sun.cri.ci.*; |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
28 |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
29 |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
30 /** |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
31 * |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
32 */ |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
33 public final class Or extends Logic { |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
34 |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
35 /** |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
36 * @param opcode |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
37 * @param kind |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
38 * @param x |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
39 * @param y |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
40 * @param graph |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
41 */ |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
42 public Or(CiKind kind, Value x, Value y, Graph graph) { |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
43 super(kind, kind == CiKind.Int ? Bytecodes.IOR : Bytecodes.LOR, x, y, graph); |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
44 } |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
45 |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
46 @Override |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
47 public String shortName() { |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
48 return "|"; |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
49 } |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
50 |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
51 @Override |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
52 public Node copy(Graph into) { |
2868
6d24c27902a2
turned inlining into a phase, some node cloning fixes, added NodeWorklist
Lukas Stadler <lukas.stadler@jku.at>
parents:
2855
diff
changeset
|
53 Or x = new Or(kind, null, null, into); |
2853
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
54 return x; |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
55 } |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
56 |
0635ba16afe4
Reintroduce Logic subclasses, creating some Canonicalization related classes
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
57 } |