Mercurial > hg > graal-jvmci-8
annotate graal/GraalCompiler/src/com/sun/c1x/ir/LoopBegin.java @ 2851:14708c03abba
Remove isNonNull
author | Gilles Duboscq <gilles.duboscq@oracle.com> |
---|---|
date | Tue, 07 Jun 2011 11:36:32 +0200 |
parents | 7596ae867a7b |
children |
rev | line source |
---|---|
2799
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
1 /* |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
4 * |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
8 * |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
13 * accompanied this code). |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
14 * |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
18 * |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
21 * questions. |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
22 */ |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
23 package com.sun.c1x.ir; |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
24 |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
25 import com.oracle.graal.graph.*; |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
26 import com.sun.c1x.debug.*; |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
27 |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
28 public class LoopBegin extends Merge { |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
29 |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
30 private static final int INPUT_COUNT = 0; |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
31 private static final int SUCCESSOR_COUNT = 0; |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
32 |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
33 public LoopBegin(Graph graph) { |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
34 super(INPUT_COUNT, SUCCESSOR_COUNT, graph); |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
35 } |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
36 |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
37 public LoopEnd loopEnd() { |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
38 for (Node usage : usages()) { |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
39 if (usage instanceof LoopEnd) { |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
40 LoopEnd end = (LoopEnd) usage; |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
41 if (end.loopBegin() == this) { |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
42 return end; |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
43 } |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
44 } |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
45 } |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
46 assert false : "Begin should always have a LoopEnd"; |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
47 return null; |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
48 } |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
49 |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
50 @Override |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
51 public void accept(ValueVisitor v) { |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
52 v.visitLoopBegin(this); |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
53 } |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
54 |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
55 @Override |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
56 public void print(LogStream out) { |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
57 out.print("loopBegin"); |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
58 } |
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
59 |
2827
bd17ac598c6e
Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents:
2799
diff
changeset
|
60 @Override |
2842
7596ae867a7b
basic inlining passes all tests, including optimistic inlining
Lukas Stadler <lukas.stadler@jku.at>
parents:
2827
diff
changeset
|
61 public String shortName() { |
7596ae867a7b
basic inlining passes all tests, including optimistic inlining
Lukas Stadler <lukas.stadler@jku.at>
parents:
2827
diff
changeset
|
62 return "LoopBegin"; |
7596ae867a7b
basic inlining passes all tests, including optimistic inlining
Lukas Stadler <lukas.stadler@jku.at>
parents:
2827
diff
changeset
|
63 } |
7596ae867a7b
basic inlining passes all tests, including optimistic inlining
Lukas Stadler <lukas.stadler@jku.at>
parents:
2827
diff
changeset
|
64 |
7596ae867a7b
basic inlining passes all tests, including optimistic inlining
Lukas Stadler <lukas.stadler@jku.at>
parents:
2827
diff
changeset
|
65 @Override |
2827
bd17ac598c6e
Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents:
2799
diff
changeset
|
66 public Node copy(Graph into) { |
bd17ac598c6e
Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents:
2799
diff
changeset
|
67 LoopBegin x = new LoopBegin(into); |
bd17ac598c6e
Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents:
2799
diff
changeset
|
68 return x; |
bd17ac598c6e
Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents:
2799
diff
changeset
|
69 } |
2799
e1dad0edd57a
first part of loop reworking
Lukas Stadler <lukas.stadler@jku.at>
parents:
diff
changeset
|
70 } |