annotate graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIR.java @ 5711:4d7175cf3526

enabled Eclipse/JDT javadoc checking and fixed resulting warnings
author Doug Simon <doug.simon@oracle.com>
date Thu, 28 Jun 2012 11:11:12 +0200
parents d52edd1af4c4
children 141b15521a39
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 /*
4206
430b5db3e6f8 Remove CiVariable from the CRI
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4142
diff changeset
2 * Copyright (c) 2009, 2012, 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 */
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
23 package com.oracle.graal.lir;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
25 import java.util.*;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
26
5507
dc71b06d09f8 Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5506
diff changeset
27 import com.oracle.graal.api.meta.*;
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
28 import com.oracle.graal.debug.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
29 import com.oracle.graal.graph.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
30 import com.oracle.graal.lir.asm.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
31 import com.oracle.graal.lir.cfg.*;
5591
d52edd1af4c4 SchedulePhase doesn't schedule FrameStates, added documentation, cleanups
Lukas Stadler <lukas.stadler@jku.at>
parents: 5539
diff changeset
32 import com.oracle.graal.nodes.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
33
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
34 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
35 * This class implements the overall container for the LIR graph
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
36 * and directs its construction, optimization, and finalization.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
37 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
38 public class LIR {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
39
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
40 public final ControlFlowGraph cfg;
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
41
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
42 /**
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
43 * The nodes for the blocks.
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
44 * TODO: This should go away, we want all nodes connected with a next-pointer.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
45 */
5591
d52edd1af4c4 SchedulePhase doesn't schedule FrameStates, added documentation, cleanups
Lukas Stadler <lukas.stadler@jku.at>
parents: 5539
diff changeset
46 private final BlockMap<List<ScheduledNode>> blockToNodesMap;
3733
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 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
49 * The linear-scan ordered list of blocks.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
50 */
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
51 private final List<Block> linearScanOrder;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
52
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
53 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
54 * The order in which the code is emitted.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
55 */
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
56 private final List<Block> codeEmittingOrder;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
57
5273
7689999f0ea6 improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents: 5251
diff changeset
58 /**
7689999f0ea6 improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents: 5251
diff changeset
59 * Various out-of-line stubs to be emitted near the end of the method
7689999f0ea6 improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents: 5251
diff changeset
60 * after all other LIR code has been emitted.
7689999f0ea6 improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents: 5251
diff changeset
61 */
7689999f0ea6 improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents: 5251
diff changeset
62 public final List<Code> stubs;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
63
4206
430b5db3e6f8 Remove CiVariable from the CRI
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4142
diff changeset
64 private int numVariables;
4262
744dade427b8 another batch of work towards GraalCompilation removal:
Lukas Stadler <lukas.stadler@jku.at>
parents: 4206
diff changeset
65
4323
df5547057954 Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4291
diff changeset
66 public SpillMoveFactory spillMoveFactory;
df5547057954 Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4291
diff changeset
67
df5547057954 Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4291
diff changeset
68 public interface SpillMoveFactory {
5539
bc647d8b0080 Renaming RiValue => Value.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5507
diff changeset
69 LIRInstruction createMove(Value result, Value input);
bc647d8b0080 Renaming RiValue => Value.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5507
diff changeset
70 LIRInstruction createExchange(Value input1, Value input2);
4323
df5547057954 Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4291
diff changeset
71 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
72
5251
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
73 private boolean hasArgInCallerFrame;
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
74
5233
efbb1e33e2f3 removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
75 /**
efbb1e33e2f3 removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
76 * An opaque chunk of machine code.
efbb1e33e2f3 removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
77 */
efbb1e33e2f3 removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
78 public interface Code {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
79 void emitCode(TargetMethodAssembler tasm);
5273
7689999f0ea6 improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents: 5251
diff changeset
80 /**
7689999f0ea6 improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents: 5251
diff changeset
81 * A description of this code stub useful for commenting the code in a disassembly.
7689999f0ea6 improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents: 5251
diff changeset
82 */
7689999f0ea6 improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents: 5251
diff changeset
83 String description();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
84 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
85
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
86 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
87 * Creates a new LIR instance for the specified compilation.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
88 */
5591
d52edd1af4c4 SchedulePhase doesn't schedule FrameStates, added documentation, cleanups
Lukas Stadler <lukas.stadler@jku.at>
parents: 5539
diff changeset
89 public LIR(ControlFlowGraph cfg, BlockMap<List<ScheduledNode>> blockToNodesMap, List<Block> linearScanOrder, List<Block> codeEmittingOrder) {
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
90 this.cfg = cfg;
5248
066f1687ba24 rename: nodesFor -> blockToNodesMap
Doug Simon <doug.simon@oracle.com>
parents: 5233
diff changeset
91 this.blockToNodesMap = blockToNodesMap;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
92 this.codeEmittingOrder = codeEmittingOrder;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
93 this.linearScanOrder = linearScanOrder;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
94
5273
7689999f0ea6 improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents: 5251
diff changeset
95 stubs = new ArrayList<>();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
96 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
97
5248
066f1687ba24 rename: nodesFor -> blockToNodesMap
Doug Simon <doug.simon@oracle.com>
parents: 5233
diff changeset
98 /**
066f1687ba24 rename: nodesFor -> blockToNodesMap
Doug Simon <doug.simon@oracle.com>
parents: 5233
diff changeset
99 * Gets the nodes in a given block.
066f1687ba24 rename: nodesFor -> blockToNodesMap
Doug Simon <doug.simon@oracle.com>
parents: 5233
diff changeset
100 */
5591
d52edd1af4c4 SchedulePhase doesn't schedule FrameStates, added documentation, cleanups
Lukas Stadler <lukas.stadler@jku.at>
parents: 5539
diff changeset
101 public List<ScheduledNode> nodesFor(Block block) {
5248
066f1687ba24 rename: nodesFor -> blockToNodesMap
Doug Simon <doug.simon@oracle.com>
parents: 5233
diff changeset
102 return blockToNodesMap.get(block);
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
103 }
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
104
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
105 /**
5251
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
106 * Determines if any instruction in the LIR has any debug info associated with it.
5233
efbb1e33e2f3 removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
107 */
5251
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
108 public boolean hasDebugInfo() {
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
109 for (Block b : linearScanOrder()) {
5233
efbb1e33e2f3 removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
110 for (LIRInstruction op : b.lir) {
5251
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
111 if (op.info != null) {
5233
efbb1e33e2f3 removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
112 return true;
efbb1e33e2f3 removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
113 }
efbb1e33e2f3 removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
114 }
efbb1e33e2f3 removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
115 }
efbb1e33e2f3 removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
116 return false;
efbb1e33e2f3 removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
117 }
efbb1e33e2f3 removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
118
efbb1e33e2f3 removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
119 /**
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
120 * Gets the linear scan ordering of blocks as a list.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
121 * @return the blocks in linear scan order
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
122 */
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
123 public List<Block> linearScanOrder() {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
124 return linearScanOrder;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
125 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
126
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
127 public List<Block> codeEmittingOrder() {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
128 return codeEmittingOrder;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
129 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
130
4206
430b5db3e6f8 Remove CiVariable from the CRI
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4142
diff changeset
131 public int numVariables() {
430b5db3e6f8 Remove CiVariable from the CRI
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4142
diff changeset
132 return numVariables;
430b5db3e6f8 Remove CiVariable from the CRI
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4142
diff changeset
133 }
430b5db3e6f8 Remove CiVariable from the CRI
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4142
diff changeset
134
430b5db3e6f8 Remove CiVariable from the CRI
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4142
diff changeset
135 public int nextVariable() {
430b5db3e6f8 Remove CiVariable from the CRI
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4142
diff changeset
136 return numVariables++;
430b5db3e6f8 Remove CiVariable from the CRI
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4142
diff changeset
137 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
138
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
139 public void emitCode(TargetMethodAssembler tasm) {
5251
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
140 if (tasm.frameContext != null) {
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
141 tasm.frameContext.enter(tasm);
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
142 }
5233
efbb1e33e2f3 removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
143
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
144 for (Block b : codeEmittingOrder()) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
145 emitBlock(tasm, b);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
146 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
147
5273
7689999f0ea6 improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents: 5251
diff changeset
148 // generate code stubs
7689999f0ea6 improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents: 5251
diff changeset
149 for (Code c : stubs) {
7689999f0ea6 improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents: 5251
diff changeset
150 emitCodeStub(tasm, c);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
151 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
152 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
153
4524
dcc8f5c6f394 Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4435
diff changeset
154 private static void emitBlock(TargetMethodAssembler tasm, Block block) {
dcc8f5c6f394 Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4435
diff changeset
155 if (Debug.isDumpEnabled()) {
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
156 tasm.blockComment(String.format("block B%d %s", block.getId(), block.getLoop()));
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
157 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
158
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
159 for (LIRInstruction op : block.lir) {
4524
dcc8f5c6f394 Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4435
diff changeset
160 if (Debug.isDumpEnabled()) {
4291
015c53fefd3a Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4262
diff changeset
161 tasm.blockComment(String.format("%d %s", op.id(), op));
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
162 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
163
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
164 emitOp(tasm, op);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
165 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
166 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
167
4142
bc8527f3071c Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3733
diff changeset
168 private static void emitOp(TargetMethodAssembler tasm, LIRInstruction op) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
169 try {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
170 try {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
171 op.emitCode(tasm);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
172 } catch (AssertionError t) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
173 throw new GraalInternalError(t);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
174 } catch (RuntimeException t) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
175 throw new GraalInternalError(t);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
176 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
177 } catch (GraalInternalError e) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
178 throw e.addContext("lir instruction", op);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
179 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
180 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
181
5273
7689999f0ea6 improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents: 5251
diff changeset
182 private static void emitCodeStub(TargetMethodAssembler tasm, Code code) {
4524
dcc8f5c6f394 Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4435
diff changeset
183 if (Debug.isDumpEnabled()) {
5273
7689999f0ea6 improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents: 5251
diff changeset
184 tasm.blockComment(String.format("code stub: %s", code.description()));
4291
015c53fefd3a Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4262
diff changeset
185 }
5273
7689999f0ea6 improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents: 5251
diff changeset
186 code.emitCode(tasm);
4291
015c53fefd3a Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4262
diff changeset
187 }
015c53fefd3a Use HexCodeFile for disassembly to avoid loading slow disassembler.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4262
diff changeset
188
5251
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
189 public void setHasArgInCallerFrame() {
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
190 hasArgInCallerFrame = true;
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
191 }
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
192
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
193 /**
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
194 * Determines if any of the parameters to the method are passed via the stack
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
195 * where the parameters are located in the caller's frame.
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
196 */
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
197 public boolean hasArgInCallerFrame() {
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
198 return hasArgInCallerFrame;
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
199 }
467de393651a optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents: 5248
diff changeset
200
4524
dcc8f5c6f394 Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4435
diff changeset
201 /*
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
202 private int lastDecodeStart;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
203
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
204 private void printAssembly(TargetMethodAssembler tasm) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
205 byte[] currentBytes = tasm.asm.codeBuffer.copyData(lastDecodeStart, tasm.asm.codeBuffer.position());
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
206 if (currentBytes.length > 0) {
4262
744dade427b8 another batch of work towards GraalCompilation removal:
Lukas Stadler <lukas.stadler@jku.at>
parents: 4206
diff changeset
207 String disasm = tasm.runtime.disassemble(currentBytes, lastDecodeStart);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
208 if (disasm.length() != 0) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
209 TTY.println(disasm);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
210 } else {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
211 TTY.println("Code [+%d]: %d bytes", lastDecodeStart, currentBytes.length);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
212 Util.printBytes(lastDecodeStart, currentBytes, GraalOptions.PrintAssemblyBytesPerLine);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
213 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
214 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
215 lastDecodeStart = tasm.asm.codeBuffer.position();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
216 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
217
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
218
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
219 public static void printBlock(Block x) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
220 // print block id
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
221 TTY.print("B%d ", x.getId());
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
222
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
223 // print flags
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
224 if (x.isLoopHeader()) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
225 TTY.print("lh ");
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
226 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
227 if (x.isLoopEnd()) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
228 TTY.print("le ");
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
229 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
230
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
231 // print block bci range
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
232 TTY.print("[%d, %d] ", -1, -1);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
233
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
234 // print predecessors and successors
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
235 if (x.numberOfPreds() > 0) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
236 TTY.print("preds: ");
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
237 for (int i = 0; i < x.numberOfPreds(); i++) {
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
238 TTY.print("B%d ", x.predAt(i).getId());
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
239 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
240 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
241
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
242 if (x.numberOfSux() > 0) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
243 TTY.print("sux: ");
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
244 for (int i = 0; i < x.numberOfSux(); i++) {
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
245 TTY.print("B%d ", x.suxAt(i).getId());
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
246 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
247 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
248
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
249 TTY.println();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
250 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
251
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
252 public static void printLIR(List<Block> blocks) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
253 if (TTY.isSuppressed()) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
254 return;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
255 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
256 TTY.println("LIR:");
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
257 int i;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
258 for (i = 0; i < blocks.size(); i++) {
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
259 Block bb = blocks.get(i);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
260 printBlock(bb);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
261 TTY.println("__id_Instruction___________________________________________");
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4365
diff changeset
262 for (LIRInstruction op : bb.lir) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
263 TTY.println(op.toStringWithIdPrefix());
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
264 TTY.println();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
265 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
266 TTY.println();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
267 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
268 }
4524
dcc8f5c6f394 Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4435
diff changeset
269 */
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
270 }