Mercurial > hg > truffle
annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java @ 11396:a268b0de65d6
Add some javadoc for GuardLoweringPhase, ConvertDeoptimizeToGuardPhase and DeoptimizeNode
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Thu, 22 Aug 2013 15:22:26 +0200 |
parents | 7f92277c3a37 |
children | ae619d70bf4b |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
4 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
8 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
14 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
18 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
21 * questions. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
22 */ |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
23 package com.oracle.graal.nodes; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
5510
426c605c9d3c
Move cri.ci to api.code.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5507
diff
changeset
|
25 import com.oracle.graal.api.code.*; |
5507
dc71b06d09f8
Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5506
diff
changeset
|
26 import com.oracle.graal.api.meta.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
27 import com.oracle.graal.graph.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
28 import com.oracle.graal.nodes.spi.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
29 import com.oracle.graal.nodes.type.*; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
30 |
11396
a268b0de65d6
Add some javadoc for GuardLoweringPhase, ConvertDeoptimizeToGuardPhase and DeoptimizeNode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9794
diff
changeset
|
31 /** |
a268b0de65d6
Add some javadoc for GuardLoweringPhase, ConvertDeoptimizeToGuardPhase and DeoptimizeNode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9794
diff
changeset
|
32 * This node represents an unconditional explicit request for immediate deoptimization. |
a268b0de65d6
Add some javadoc for GuardLoweringPhase, ConvertDeoptimizeToGuardPhase and DeoptimizeNode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9794
diff
changeset
|
33 * |
a268b0de65d6
Add some javadoc for GuardLoweringPhase, ConvertDeoptimizeToGuardPhase and DeoptimizeNode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9794
diff
changeset
|
34 * After this node, execution will continue using a fallback execution engine (such as an |
a268b0de65d6
Add some javadoc for GuardLoweringPhase, ConvertDeoptimizeToGuardPhase and DeoptimizeNode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9794
diff
changeset
|
35 * interpreter) at the position described by the {@link #getDeoptimizationState() deoptimization |
a268b0de65d6
Add some javadoc for GuardLoweringPhase, ConvertDeoptimizeToGuardPhase and DeoptimizeNode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9794
diff
changeset
|
36 * state}. |
a268b0de65d6
Add some javadoc for GuardLoweringPhase, ConvertDeoptimizeToGuardPhase and DeoptimizeNode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9794
diff
changeset
|
37 * |
a268b0de65d6
Add some javadoc for GuardLoweringPhase, ConvertDeoptimizeToGuardPhase and DeoptimizeNode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9794
diff
changeset
|
38 */ |
5814
d241f8b2e6f9
Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5547
diff
changeset
|
39 @NodeInfo(shortName = "Deopt", nameTemplate = "Deopt {p#reason/s}") |
9016
60b9fe7034e6
Allow lowering of DeoptimizeNode
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8955
diff
changeset
|
40 public class DeoptimizeNode extends ControlSinkNode implements Node.IterableNodeType, Lowerable, LIRLowerable, DeoptimizingNode { |
8892
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
41 |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
42 @Input private FrameState deoptState; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
43 |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5541
diff
changeset
|
44 private final DeoptimizationAction action; |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
45 private final DeoptimizationReason reason; |
5105
95b8a32a7cc3
preparations to avoid endless recompilations because of not updated profiling information
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5061
diff
changeset
|
46 |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5541
diff
changeset
|
47 public DeoptimizeNode(DeoptimizationAction action, DeoptimizationReason reason) { |
5443
141817e206d4
changes to the dependencies and stamp system:
Lukas Stadler <lukas.stadler@jku.at>
parents:
5299
diff
changeset
|
48 super(StampFactory.forVoid()); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
49 this.action = action; |
5109
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5105
diff
changeset
|
50 this.reason = reason; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
51 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
52 |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5541
diff
changeset
|
53 public DeoptimizationAction action() { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
54 return action; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
55 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
56 |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
57 public DeoptimizationReason reason() { |
5109
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5105
diff
changeset
|
58 return reason; |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5105
diff
changeset
|
59 } |
6766253384bf
more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5105
diff
changeset
|
60 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
61 @Override |
9251
435bb9425124
added enum to Lowerable interface (before/after guard lowering)
Lukas Stadler <lukas.stadler@jku.at>
parents:
9016
diff
changeset
|
62 public void lower(LoweringTool tool, LoweringType loweringType) { |
9016
60b9fe7034e6
Allow lowering of DeoptimizeNode
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8955
diff
changeset
|
63 tool.getRuntime().lower(this, tool); |
60b9fe7034e6
Allow lowering of DeoptimizeNode
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8955
diff
changeset
|
64 } |
60b9fe7034e6
Allow lowering of DeoptimizeNode
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8955
diff
changeset
|
65 |
60b9fe7034e6
Allow lowering of DeoptimizeNode
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8955
diff
changeset
|
66 @Override |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
67 public void generate(LIRGeneratorTool gen) { |
8892
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
68 gen.emitDeoptimize(action, this); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
69 } |
4547
a3cdfa2be94e
Allow to intrinsify an invoke with a deoptimize node. Make debug output more relaxed wrt to null in FrameMap.method
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
70 |
a3cdfa2be94e
Allow to intrinsify an invoke with a deoptimize node. Make debug output more relaxed wrt to null in FrameMap.method
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
71 @NodeIntrinsic |
7556
630ea5001e33
Modified formatter settings to not insert line break after annotation on parameters.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7530
diff
changeset
|
72 public static native void deopt(@ConstantNodeParameter DeoptimizationAction action, @ConstantNodeParameter DeoptimizationReason reason); |
8892
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
73 |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
74 @Override |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
75 public boolean canDeoptimize() { |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
76 return true; |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
77 } |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
78 |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
79 @Override |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
80 public FrameState getDeoptimizationState() { |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
81 return deoptState; |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
82 } |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
83 |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
84 @Override |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
85 public void setDeoptimizationState(FrameState f) { |
8955
f84f5112869e
Add missing updateUsages calls
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8892
diff
changeset
|
86 updateUsages(deoptState, f); |
8892
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
87 deoptState = f; |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
88 } |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
89 |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
90 @Override |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
91 public DeoptimizationReason getDeoptimizationReason() { |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
92 return reason; |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8385
diff
changeset
|
93 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
94 } |