annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractDeoptimizeNode.java @ 19526:8fc336a04d77

Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 20 Feb 2015 22:22:55 +0100
parents 880717e44675
children 48c1ebd24120
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11836
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
1 /*
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
2 * Copyright (c) 2013, 2013, Oracle and/or its affiliates. All rights reserved.
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
4 *
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
7 * published by the Free Software Foundation.
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
8 *
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
13 * accompanied this code).
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
14 *
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
18 *
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
21 * questions.
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
22 */
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
23 package com.oracle.graal.nodes;
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
24
11839
0e2cceed1caf Temporarily move encodeDeoptActionAndReason to MetaAccessProvider
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11836
diff changeset
25 import com.oracle.graal.api.meta.*;
15261
882f4cb7cfcf Move Stamps to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents: 15001
diff changeset
26 import com.oracle.graal.compiler.common.type.*;
11836
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
27 import com.oracle.graal.graph.*;
16841
cbd42807a31f moved NodeInfo and friends into separate com.oracle.graal.nodeinfo project so that annotation processor can be applied to the base Node class
Doug Simon <doug.simon@oracle.com>
parents: 16822
diff changeset
28 import com.oracle.graal.nodeinfo.*;
11836
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
29
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
30 /**
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
31 * This node represents an unconditional explicit request for immediate deoptimization.
16251
aeaad00ddce0 new constructor (with stateBefore) for AbstractDeoptimizeNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15261
diff changeset
32 *
11836
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
33 * After this node, execution will continue using a fallback execution engine (such as an
14734
6ae9af961b7c Introduce separate interfaces for deoptimizing nodes that deopt to a state before, during or after their execution.
Roland Schatz <roland.schatz@oracle.com>
parents: 13641
diff changeset
34 * interpreter) at the position described by the {@link #stateBefore() deoptimization state}.
11836
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
35 */
16822
5d468add216f added @NodeInfo annotations to all Node classes
Doug Simon <doug.simon@oracle.com>
parents: 16332
diff changeset
36 @NodeInfo
14734
6ae9af961b7c Introduce separate interfaces for deoptimizing nodes that deopt to a state before, during or after their execution.
Roland Schatz <roland.schatz@oracle.com>
parents: 13641
diff changeset
37 public abstract class AbstractDeoptimizeNode extends ControlSinkNode implements IterableNodeType, DeoptimizingNode.DeoptBefore {
11836
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
38
19526
8fc336a04d77 Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 19471
diff changeset
39 public static final NodeClass<AbstractDeoptimizeNode> TYPE = NodeClass.create(AbstractDeoptimizeNode.class);
16897
f90dcdbbb75e switched to using new NodeFieldIterator and NodeFieldIterable for traversing Node inputs and successors
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
40 @OptionalInput(InputType.State) FrameState stateBefore;
11836
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
41
19471
880717e44675 Use typed NodeClass in node constructors.
Roland Schatz <roland.schatz@oracle.com>
parents: 19403
diff changeset
42 protected AbstractDeoptimizeNode(NodeClass<? extends AbstractDeoptimizeNode> c, FrameState stateBefore) {
19396
7e2c87dae93e Create static final NodeClass field named TYPE in Node subclasses.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 16897
diff changeset
43 super(c, StampFactory.forVoid());
16251
aeaad00ddce0 new constructor (with stateBefore) for AbstractDeoptimizeNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15261
diff changeset
44 this.stateBefore = stateBefore;
aeaad00ddce0 new constructor (with stateBefore) for AbstractDeoptimizeNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15261
diff changeset
45 }
aeaad00ddce0 new constructor (with stateBefore) for AbstractDeoptimizeNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15261
diff changeset
46
11836
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
47 @Override
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
48 public boolean canDeoptimize() {
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
49 return true;
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
50 }
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
51
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
52 @Override
14734
6ae9af961b7c Introduce separate interfaces for deoptimizing nodes that deopt to a state before, during or after their execution.
Roland Schatz <roland.schatz@oracle.com>
parents: 13641
diff changeset
53 public FrameState stateBefore() {
14783
01786db19f7d Rename deoptState fields to reflect whether they refer to a state before or during.
Roland Schatz <roland.schatz@oracle.com>
parents: 14734
diff changeset
54 return stateBefore;
11836
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
55 }
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
56
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
57 @Override
14734
6ae9af961b7c Introduce separate interfaces for deoptimizing nodes that deopt to a state before, during or after their execution.
Roland Schatz <roland.schatz@oracle.com>
parents: 13641
diff changeset
58 public void setStateBefore(FrameState f) {
14783
01786db19f7d Rename deoptState fields to reflect whether they refer to a state before or during.
Roland Schatz <roland.schatz@oracle.com>
parents: 14734
diff changeset
59 updateUsages(stateBefore, f);
01786db19f7d Rename deoptState fields to reflect whether they refer to a state before or during.
Roland Schatz <roland.schatz@oracle.com>
parents: 14734
diff changeset
60 stateBefore = f;
11836
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
61 }
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
62
11959
23ccaa863eda made CodeCacheProvider independent of MetaAccessProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents: 11947
diff changeset
63 public abstract ValueNode getActionAndReason(MetaAccessProvider metaAccess);
13641
5a9afbf72714 Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11959
diff changeset
64
5a9afbf72714 Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11959
diff changeset
65 public abstract ValueNode getSpeculation(MetaAccessProvider metaAccess);
11836
d72c314260dc Add a DynamicDeoptimizeNode where the action and reason is a input node.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff changeset
66 }