annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LoweringTool.java @ 19250:8ab925a6f724

made Assumptions be part of a StructuredGraph
author Doug Simon <doug.simon@oracle.com>
date Wed, 11 Feb 2015 10:13:08 +0100
parents 1eeef8016b86
children 48c1ebd24120
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 /*
18479
16e61bb57e90 Introduce StampProvider to support different stamps for metadata on different VMs.
Roland Schatz <roland.schatz@oracle.com>
parents: 15008
diff changeset
2 * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
3733
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 */
5720
46ad94a0574a moved everything from com.oracle.graal.nodes.cri into com.oracle.graal.nodes.spi
Doug Simon <doug.simon@oracle.com>
parents: 5718
diff changeset
23 package com.oracle.graal.nodes.spi;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
5507
dc71b06d09f8 Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5506
diff changeset
25 import com.oracle.graal.api.meta.*;
5425
0364a2a874b8 changes towards a canonical representation of comparisons:
Lukas Stadler <lukas.stadler@jku.at>
parents: 5379
diff changeset
26 import com.oracle.graal.nodes.*;
9646
183d33c76419 Removed ValueNode.dependencies
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 9376
diff changeset
27 import com.oracle.graal.nodes.extended.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
28
5718
10341299528c renamings: ExtendedRiRuntime -> GraalCodeCacheProvider, CiLoweringTool -> LoweringTool, RiGraphCache -> GraphCache
Doug Simon <doug.simon@oracle.com>
parents: 5547
diff changeset
29 public interface LoweringTool {
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6653
diff changeset
30
11959
23ccaa863eda made CodeCacheProvider independent of MetaAccessProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents: 11579
diff changeset
31 MetaAccessProvider getMetaAccess();
23ccaa863eda made CodeCacheProvider independent of MetaAccessProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents: 11579
diff changeset
32
12045
0fc653a9e019 made GraalCodeCacheProvider independent of CodeCacheProvider and renamed the former to LoweringProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents: 11959
diff changeset
33 LoweringProvider getLowerer();
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6653
diff changeset
34
12052
0afe7370260c refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents: 12045
diff changeset
35 ConstantReflectionProvider getConstantReflection();
0afe7370260c refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents: 12045
diff changeset
36
8638
8d6265614e13 added getReplacements() to LoweringTool
Doug Simon <doug.simon@oracle.com>
parents: 8178
diff changeset
37 Replacements getReplacements();
8d6265614e13 added getReplacements() to LoweringTool
Doug Simon <doug.simon@oracle.com>
parents: 8178
diff changeset
38
18479
16e61bb57e90 Introduce StampProvider to support different stamps for metadata on different VMs.
Roland Schatz <roland.schatz@oracle.com>
parents: 15008
diff changeset
39 StampProvider getStampProvider();
16e61bb57e90 Introduce StampProvider to support different stamps for metadata on different VMs.
Roland Schatz <roland.schatz@oracle.com>
parents: 15008
diff changeset
40
13283
17c9afa0bfcb Allow GuardLoweringPhase, FrameStateAssignementPhase and the different lowerings to work with graph at any valid guards stage
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13137
diff changeset
41 GuardingNode createGuard(FixedNode before, LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action);
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6653
diff changeset
42
13283
17c9afa0bfcb Allow GuardLoweringPhase, FrameStateAssignementPhase and the different lowerings to work with graph at any valid guards stage
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13137
diff changeset
43 GuardingNode createGuard(FixedNode before, LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, boolean negated);
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6653
diff changeset
44
6302
5d7d9a6953bd added InstanceOfSnippets which passes InstanceOfTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 5720
diff changeset
45 /**
5d7d9a6953bd added InstanceOfSnippets which passes InstanceOfTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 5720
diff changeset
46 * Gets the closest fixed node preceding the node currently being lowered.
5d7d9a6953bd added InstanceOfSnippets which passes InstanceOfTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 5720
diff changeset
47 */
5d7d9a6953bd added InstanceOfSnippets which passes InstanceOfTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 5720
diff changeset
48 FixedWithNextNode lastFixedNode();
12703
b6f66fb9f106 SnippetTemplate instantiation should replace snippet's start node with a valid anchor point not the caller's start node
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 12362
diff changeset
49
15008
01fdabd19cd5 new AnchoringNode interface
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14908
diff changeset
50 AnchoringNode getCurrentGuardAnchor();
13505
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
51
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
52 /**
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
53 * Marker interface lowering stages.
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
54 */
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
55 interface LoweringStage {
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
56 }
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
57
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
58 /**
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
59 * The lowering stages used in a standard Graal phase plan. Lowering is called 3 times, during
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
60 * every tier of compilation.
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
61 */
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
62 enum StandardLoweringStage implements LoweringStage {
14908
8db6e76cb658 Formatter: Keep one enum constant per line
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13632
diff changeset
63 HIGH_TIER,
8db6e76cb658 Formatter: Keep one enum constant per line
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13632
diff changeset
64 MID_TIER,
8db6e76cb658 Formatter: Keep one enum constant per line
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13632
diff changeset
65 LOW_TIER
13505
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
66 }
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
67
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
68 /**
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
69 * Returns current lowering stage.
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
70 */
75a67ebd50e8 Introduce a LoweringStage so that lowerings can be conditional on one of the three times that lowering is performed by default
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13283
diff changeset
71 LoweringStage getLoweringStage();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
72 }