annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java @ 9251:435bb9425124

added enum to Lowerable interface (before/after guard lowering)
author Lukas Stadler <lukas.stadler@jku.at>
date Tue, 23 Apr 2013 15:19:53 +0200
parents 60b9fe7034e6
children 7f92277c3a37
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
5814
d241f8b2e6f9 Adapt the coloring filter for binary dumped graphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5547
diff changeset
31 @NodeInfo(shortName = "Deopt", nameTemplate = "Deopt {p#reason/s}")
9016
60b9fe7034e6 Allow lowering of DeoptimizeNode
Christian Wimmer <christian.wimmer@oracle.com>
parents: 8955
diff changeset
32 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
33
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
34 @Input private FrameState deoptState;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
35
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5541
diff changeset
36 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
37 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
38
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5541
diff changeset
39 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
40 super(StampFactory.forVoid());
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41 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
42 this.reason = reason;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
43 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
44
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5541
diff changeset
45 public DeoptimizationAction action() {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
46 return action;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
48
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
49 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
50 return reason;
6766253384bf more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents: 5105
diff changeset
51 }
6766253384bf more preparations for disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents: 5105
diff changeset
52
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
53 @Override
9251
435bb9425124 added enum to Lowerable interface (before/after guard lowering)
Lukas Stadler <lukas.stadler@jku.at>
parents: 9016
diff changeset
54 public void lower(LoweringTool tool, LoweringType loweringType) {
9016
60b9fe7034e6 Allow lowering of DeoptimizeNode
Christian Wimmer <christian.wimmer@oracle.com>
parents: 8955
diff changeset
55 tool.getRuntime().lower(this, tool);
60b9fe7034e6 Allow lowering of DeoptimizeNode
Christian Wimmer <christian.wimmer@oracle.com>
parents: 8955
diff changeset
56 }
60b9fe7034e6 Allow lowering of DeoptimizeNode
Christian Wimmer <christian.wimmer@oracle.com>
parents: 8955
diff changeset
57
60b9fe7034e6 Allow lowering of DeoptimizeNode
Christian Wimmer <christian.wimmer@oracle.com>
parents: 8955
diff changeset
58 @Override
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
59 public void generate(LIRGeneratorTool gen) {
8892
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
60 gen.emitDeoptimize(action, this);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
61 }
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
62
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
63 @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
64 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
65
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
66 @Override
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
67 public boolean canDeoptimize() {
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
68 return true;
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
69 }
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
70
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
71 @Override
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
72 public FrameState getDeoptimizationState() {
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
73 return deoptState;
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
74 }
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
75
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
76 @Override
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
77 public void setDeoptimizationState(FrameState f) {
8955
f84f5112869e Add missing updateUsages calls
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8892
diff changeset
78 updateUsages(deoptState, f);
8892
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
79 deoptState = f;
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
80 }
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
81
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
82 @Override
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
83 public DeoptimizationReason getDeoptimizationReason() {
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
84 return reason;
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
85 }
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
86
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
87 @Override
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
88 public boolean isCallSiteDeoptimization() {
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
89 return false;
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8385
diff changeset
90 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
91 }