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