annotate graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java @ 16354:b6e70c59b32d

Introduce InstructionStateProcedure.
author Josef Eisl <josef.eisl@jku.at>
date Wed, 02 Jul 2014 15:26:28 +0200
parents d59e68286d60
children 0d47af538a92
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 /*
4181
319860ae697a Simplify FrameMap: make offsets of spill slots and outgoing parameters independent so that they can be allocated at the same time, eliminating the separate phases. This makes the separate StackBlock unnecesary. Change CiStackSlot to use byte offsets instead of spill slot index. This makes CiTarget.spillSlotSize unnecessary.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4169
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
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
25 import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*;
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
26 import static com.oracle.graal.lir.LIRInstruction.OperandMode.*;
4524
dcc8f5c6f394 Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4522
diff changeset
27
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
28 import java.lang.annotation.*;
4245
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
29 import java.util.*;
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
30
5510
426c605c9d3c Move cri.ci to api.code.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5507
diff changeset
31 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
32 import com.oracle.graal.api.meta.*;
15193
96bb07a5d667 Spit up and move GraalInternalError.
Josef Eisl <josef.eisl@jku.at>
parents: 13227
diff changeset
33 import com.oracle.graal.compiler.common.*;
11486
5d5bfb75dae0 added metrics for total number of Nodes, LIRInstructions and CompositeValues created (GRAAL-448)
Doug Simon <doug.simon@oracle.com>
parents: 9856
diff changeset
34 import com.oracle.graal.debug.*;
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
35 import com.oracle.graal.lir.asm.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
36
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 * The {@code LIRInstruction} class definition.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
39 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
40 public abstract class LIRInstruction {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41
5539
bc647d8b0080 Renaming RiValue => Value.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5510
diff changeset
42 public static final Value[] NO_OPERANDS = {};
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 /**
16279
69b9980ff5c2 Add ValuePositionProcedure and corresponding forEach methods.
Josef Eisl <josef.eisl@jku.at>
parents: 16277
diff changeset
45 * Iterator for iterating over a list of {@linkplain ValuePosition value positions}.
69b9980ff5c2 Add ValuePositionProcedure and corresponding forEach methods.
Josef Eisl <josef.eisl@jku.at>
parents: 16277
diff changeset
46 */
69b9980ff5c2 Add ValuePositionProcedure and corresponding forEach methods.
Josef Eisl <josef.eisl@jku.at>
parents: 16277
diff changeset
47 public abstract static class ValuePositionProcedure {
69b9980ff5c2 Add ValuePositionProcedure and corresponding forEach methods.
Josef Eisl <josef.eisl@jku.at>
parents: 16277
diff changeset
48
69b9980ff5c2 Add ValuePositionProcedure and corresponding forEach methods.
Josef Eisl <josef.eisl@jku.at>
parents: 16277
diff changeset
49 /**
69b9980ff5c2 Add ValuePositionProcedure and corresponding forEach methods.
Josef Eisl <josef.eisl@jku.at>
parents: 16277
diff changeset
50 * Iterator method to be overwritten. This version of the iterator does not take additional
69b9980ff5c2 Add ValuePositionProcedure and corresponding forEach methods.
Josef Eisl <josef.eisl@jku.at>
parents: 16277
diff changeset
51 * parameters to keep the signature short.
69b9980ff5c2 Add ValuePositionProcedure and corresponding forEach methods.
Josef Eisl <josef.eisl@jku.at>
parents: 16277
diff changeset
52 *
69b9980ff5c2 Add ValuePositionProcedure and corresponding forEach methods.
Josef Eisl <josef.eisl@jku.at>
parents: 16277
diff changeset
53 * @param instruction The current instruction.
69b9980ff5c2 Add ValuePositionProcedure and corresponding forEach methods.
Josef Eisl <josef.eisl@jku.at>
parents: 16277
diff changeset
54 * @param position The position of the value that is iterated.
69b9980ff5c2 Add ValuePositionProcedure and corresponding forEach methods.
Josef Eisl <josef.eisl@jku.at>
parents: 16277
diff changeset
55 */
69b9980ff5c2 Add ValuePositionProcedure and corresponding forEach methods.
Josef Eisl <josef.eisl@jku.at>
parents: 16277
diff changeset
56
69b9980ff5c2 Add ValuePositionProcedure and corresponding forEach methods.
Josef Eisl <josef.eisl@jku.at>
parents: 16277
diff changeset
57 public abstract void doValue(LIRInstruction instruction, ValuePosition position);
69b9980ff5c2 Add ValuePositionProcedure and corresponding forEach methods.
Josef Eisl <josef.eisl@jku.at>
parents: 16277
diff changeset
58 }
69b9980ff5c2 Add ValuePositionProcedure and corresponding forEach methods.
Josef Eisl <josef.eisl@jku.at>
parents: 16277
diff changeset
59
69b9980ff5c2 Add ValuePositionProcedure and corresponding forEach methods.
Josef Eisl <josef.eisl@jku.at>
parents: 16277
diff changeset
60 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
61 * Iterator for iterating over a list of values. Subclasses must overwrite one of the doValue
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
62 * methods. Clients of the class must only call the doValue method that takes additional
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
63 * parameters.
4169
f5328dda9714 Initial commit of SSA-based spill-all register assignment
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4142
diff changeset
64 */
16138
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
65 public abstract static class InstructionValueProcedure {
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
66
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
67 /**
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
68 * Iterator method to be overwritten. This version of the iterator does not take additional
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
69 * parameters to keep the signature short.
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
70 *
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
71 * @param instruction The current instruction.
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
72 * @param value The value that is iterated.
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
73 * @return The new value to replace the value that was passed in.
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
74 */
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
75 protected Value doValue(LIRInstruction instruction, Value value) {
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
76 throw GraalInternalError.shouldNotReachHere("One of the doValue() methods must be overwritten");
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
77 }
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
78
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
79 /**
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
80 * Iterator method to be overwritten. This version of the iterator gets additional
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
81 * parameters about the processed value.
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
82 *
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
83 * @param instruction The current instruction.
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
84 * @param value The value that is iterated.
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
85 * @param mode The operand mode for the value.
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
86 * @param flags A set of flags for the value.
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
87 * @return The new value to replace the value that was passed in.
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
88 */
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
89 public Value doValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
90 return doValue(instruction, value);
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
91 }
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
92 }
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
93
16214
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
94 /**
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
95 * Similar to {@link InstructionValueProcedure} but without an {@link LIRInstruction} parameter.
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
96 */
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
97 public abstract static class ValueProcedure extends InstructionValueProcedure {
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
98
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
99 /**
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
100 * Iterator method to be overwritten. This version of the iterator does not take additional
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
101 * parameters to keep the signature short.
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
102 *
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
103 * @param value The value that is iterated.
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
104 * @return The new value to replace the value that was passed in.
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
105 */
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
106 protected Value doValue(Value value) {
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
107 throw GraalInternalError.shouldNotReachHere("One of the doValue() methods must be overwritten");
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
108 }
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
109
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
110 /**
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
111 * Iterator method to be overwritten. This version of the iterator gets additional
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
112 * parameters about the processed value.
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
113 *
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
114 * @param value The value that is iterated.
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
115 * @param mode The operand mode for the value.
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
116 * @param flags A set of flags for the value.
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
117 * @return The new value to replace the value that was passed in.
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
118 */
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
119 protected Value doValue(Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
120 return doValue(value);
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
121 }
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
122
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
123 @Override
16354
b6e70c59b32d Introduce InstructionStateProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 16283
diff changeset
124 protected final Value doValue(LIRInstruction instruction, Value value) {
16214
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
125 throw GraalInternalError.shouldNotReachHere("This doValue() methods should never be called");
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
126 }
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
127
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
128 @Override
16354
b6e70c59b32d Introduce InstructionStateProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 16283
diff changeset
129 public final Value doValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
16214
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
130 return doValue(value, mode, flags);
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
131 }
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
132 }
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
133
16354
b6e70c59b32d Introduce InstructionStateProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 16283
diff changeset
134 public abstract static class InstructionStateProcedure {
b6e70c59b32d Introduce InstructionStateProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 16283
diff changeset
135
b6e70c59b32d Introduce InstructionStateProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 16283
diff changeset
136 protected abstract void doState(LIRInstruction instruction, LIRFrameState state);
b6e70c59b32d Introduce InstructionStateProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 16283
diff changeset
137 }
b6e70c59b32d Introduce InstructionStateProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 16283
diff changeset
138
b6e70c59b32d Introduce InstructionStateProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 16283
diff changeset
139 public abstract static class StateProcedure extends InstructionStateProcedure {
4169
f5328dda9714 Initial commit of SSA-based spill-all register assignment
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4142
diff changeset
140
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
141 protected abstract void doState(LIRFrameState state);
16354
b6e70c59b32d Introduce InstructionStateProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 16283
diff changeset
142
b6e70c59b32d Introduce InstructionStateProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 16283
diff changeset
143 @Override
b6e70c59b32d Introduce InstructionStateProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 16283
diff changeset
144 protected final void doState(LIRInstruction instruction, LIRFrameState state) {
b6e70c59b32d Introduce InstructionStateProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 16283
diff changeset
145 doState(state);
b6e70c59b32d Introduce InstructionStateProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 16283
diff changeset
146 }
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
147 }
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
148
4169
f5328dda9714 Initial commit of SSA-based spill-all register assignment
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4142
diff changeset
149 /**
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
150 * Constants denoting how a LIR instruction uses an operand.
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 public enum OperandMode {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
153 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
154 * The value must have been defined before. It is alive before the instruction until the
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
155 * beginning of the instruction, but not necessarily throughout the instruction. A register
9580
c59beafffb29 added use of javadoc links
Doug Simon <doug.simon@oracle.com>
parents: 9454
diff changeset
156 * assigned to it can also be assigned to a {@link #TEMP} or {@link #DEF} operand. The value
c59beafffb29 added use of javadoc links
Doug Simon <doug.simon@oracle.com>
parents: 9454
diff changeset
157 * can be used again after the instruction, so the instruction must not modify the register.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
158 */
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
159 USE,
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
160
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
161 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
162 * The value must have been defined before. It is alive before the instruction and
9580
c59beafffb29 added use of javadoc links
Doug Simon <doug.simon@oracle.com>
parents: 9454
diff changeset
163 * throughout the instruction. A register assigned to it cannot be assigned to a
c59beafffb29 added use of javadoc links
Doug Simon <doug.simon@oracle.com>
parents: 9454
diff changeset
164 * {@link #TEMP} or {@link #DEF} operand. The value can be used again after the instruction,
c59beafffb29 added use of javadoc links
Doug Simon <doug.simon@oracle.com>
parents: 9454
diff changeset
165 * so the instruction must not modify the register.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
166 */
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
167 ALIVE,
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
168
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
169 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
170 * The value must not have been defined before, and must not be used after the instruction.
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
171 * The instruction can do whatever it wants with the register assigned to it (or not use it
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
172 * at all).
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
173 */
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
174 TEMP,
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
175
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
176 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
177 * The value must not have been defined before. The instruction has to assign a value to the
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
178 * register. The value can (and most likely will) be used after the instruction.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
179 */
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
180 DEF,
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
181 }
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
182
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
183 @Retention(RetentionPolicy.RUNTIME)
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
184 @Target(ElementType.FIELD)
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
185 public static @interface Use {
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
186
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
187 OperandFlag[] value() default REG;
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
188 }
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
189
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
190 @Retention(RetentionPolicy.RUNTIME)
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
191 @Target(ElementType.FIELD)
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
192 public static @interface Alive {
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
193
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
194 OperandFlag[] value() default REG;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
195 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
196
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
197 @Retention(RetentionPolicy.RUNTIME)
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
198 @Target(ElementType.FIELD)
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
199 public static @interface Temp {
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
200
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
201 OperandFlag[] value() default REG;
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
202 }
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
203
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
204 @Retention(RetentionPolicy.RUNTIME)
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
205 @Target(ElementType.FIELD)
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
206 public static @interface Def {
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
207
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
208 OperandFlag[] value() default REG;
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
209 }
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
210
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
211 @Retention(RetentionPolicy.RUNTIME)
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
212 @Target(ElementType.FIELD)
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
213 public static @interface State {
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
214 }
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
215
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
216 /**
4245
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
217 * Flags for an operand.
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
218 */
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
219 public enum OperandFlag {
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
220 /**
5572
8f9c9d372e31 small renaming and doc fixes
Lukas Stadler <lukas.stadler@jku.at>
parents: 5552
diff changeset
221 * The value can be a {@link RegisterValue}.
4245
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
222 */
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
223 REG,
4245
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
224
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
225 /**
5572
8f9c9d372e31 small renaming and doc fixes
Lukas Stadler <lukas.stadler@jku.at>
parents: 5552
diff changeset
226 * The value can be a {@link StackSlot}.
4245
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
227 */
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
228 STACK,
4245
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
229
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
230 /**
8165
a85ef330ffe7 Composite value.
Roland Schatz <roland.schatz@oracle.com>
parents: 7907
diff changeset
231 * The value can be a {@link CompositeValue}.
a85ef330ffe7 Composite value.
Roland Schatz <roland.schatz@oracle.com>
parents: 7907
diff changeset
232 */
a85ef330ffe7 Composite value.
Roland Schatz <roland.schatz@oracle.com>
parents: 7907
diff changeset
233 COMPOSITE,
a85ef330ffe7 Composite value.
Roland Schatz <roland.schatz@oracle.com>
parents: 7907
diff changeset
234
a85ef330ffe7 Composite value.
Roland Schatz <roland.schatz@oracle.com>
parents: 7907
diff changeset
235 /**
5572
8f9c9d372e31 small renaming and doc fixes
Lukas Stadler <lukas.stadler@jku.at>
parents: 5552
diff changeset
236 * The value can be a {@link Constant}.
4245
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
237 */
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
238 CONST,
4245
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
239
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
240 /**
6539
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5733
diff changeset
241 * The value can be {@link Value#ILLEGAL}.
4245
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
242 */
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
243 ILLEGAL,
4245
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
244
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
245 /**
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
246 * The register allocator should try to assign a certain register to improve code quality.
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
247 * Use {@link LIRInstruction#forEachRegisterHint} to access the register hints.
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
248 */
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
249 HINT,
4314
9ce8594bedaf Allow CiAddress as Input and Alive operands of LIR instructions.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4245
diff changeset
250
9ce8594bedaf Allow CiAddress as Input and Alive operands of LIR instructions.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4245
diff changeset
251 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
252 * The value can be uninitialized, e.g., a stack slot that has not written to before. This
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
253 * is only used to avoid false positives in verification code.
4314
9ce8594bedaf Allow CiAddress as Input and Alive operands of LIR instructions.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4245
diff changeset
254 */
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
255 UNINITIALIZED,
4314
9ce8594bedaf Allow CiAddress as Input and Alive operands of LIR instructions.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4245
diff changeset
256 }
9ce8594bedaf Allow CiAddress as Input and Alive operands of LIR instructions.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4245
diff changeset
257
9ce8594bedaf Allow CiAddress as Input and Alive operands of LIR instructions.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4245
diff changeset
258 /**
9ce8594bedaf Allow CiAddress as Input and Alive operands of LIR instructions.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4245
diff changeset
259 * For validity checking of the operand flags defined by instruction subclasses.
9ce8594bedaf Allow CiAddress as Input and Alive operands of LIR instructions.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4245
diff changeset
260 */
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
261 protected static final EnumMap<OperandMode, EnumSet<OperandFlag>> ALLOWED_FLAGS;
4314
9ce8594bedaf Allow CiAddress as Input and Alive operands of LIR instructions.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4245
diff changeset
262
9ce8594bedaf Allow CiAddress as Input and Alive operands of LIR instructions.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4245
diff changeset
263 static {
9ce8594bedaf Allow CiAddress as Input and Alive operands of LIR instructions.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4245
diff changeset
264 ALLOWED_FLAGS = new EnumMap<>(OperandMode.class);
9294
899295127bc4 Get rid of the distinction between UNUSED and ILLEGAL value.
Roland Schatz <roland.schatz@oracle.com>
parents: 8969
diff changeset
265 ALLOWED_FLAGS.put(USE, EnumSet.of(REG, STACK, COMPOSITE, CONST, ILLEGAL, HINT, UNINITIALIZED));
899295127bc4 Get rid of the distinction between UNUSED and ILLEGAL value.
Roland Schatz <roland.schatz@oracle.com>
parents: 8969
diff changeset
266 ALLOWED_FLAGS.put(ALIVE, EnumSet.of(REG, STACK, COMPOSITE, CONST, ILLEGAL, HINT, UNINITIALIZED));
899295127bc4 Get rid of the distinction between UNUSED and ILLEGAL value.
Roland Schatz <roland.schatz@oracle.com>
parents: 8969
diff changeset
267 ALLOWED_FLAGS.put(TEMP, EnumSet.of(REG, COMPOSITE, CONST, ILLEGAL, HINT));
899295127bc4 Get rid of the distinction between UNUSED and ILLEGAL value.
Roland Schatz <roland.schatz@oracle.com>
parents: 8969
diff changeset
268 ALLOWED_FLAGS.put(DEF, EnumSet.of(REG, STACK, COMPOSITE, ILLEGAL, HINT));
4245
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
269 }
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
270
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
271 /**
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
272 * The flags of the base and index value of an address.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
273 */
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
274 protected static final EnumSet<OperandFlag> ADDRESS_FLAGS = EnumSet.of(REG, ILLEGAL);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
275
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
276 private final LIRInstructionClass instructionClass;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
277
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
278 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
279 * Instruction id for register allocation.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
280 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
281 private int id;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
282
11486
5d5bfb75dae0 added metrics for total number of Nodes, LIRInstructions and CompositeValues created (GRAAL-448)
Doug Simon <doug.simon@oracle.com>
parents: 9856
diff changeset
283 private static final DebugMetric LIR_NODE_COUNT = Debug.metric("LIRNodes");
5d5bfb75dae0 added metrics for total number of Nodes, LIRInstructions and CompositeValues created (GRAAL-448)
Doug Simon <doug.simon@oracle.com>
parents: 9856
diff changeset
284
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
285 /**
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
286 * Constructs a new LIR instruction.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
287 */
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
288 public LIRInstruction() {
11486
5d5bfb75dae0 added metrics for total number of Nodes, LIRInstructions and CompositeValues created (GRAAL-448)
Doug Simon <doug.simon@oracle.com>
parents: 9856
diff changeset
289 LIR_NODE_COUNT.increment();
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
290 instructionClass = LIRInstructionClass.get(getClass());
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
291 id = -1;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
292 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
293
13227
1a66453f73db renamed TargetMethodAssembler to CompilationResultBuilder
Doug Simon <doug.simon@oracle.com>
parents: 11486
diff changeset
294 public abstract void emitCode(CompilationResultBuilder crb);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
295
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
296 public final int id() {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
297 return id;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
298 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
299
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
300 public final void setId(int id) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
301 this.id = id;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
302 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
303
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
304 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
305 * Gets the instruction name.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
306 */
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
307 public final String name() {
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
308 return instructionClass.getOpcode(this);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
309 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
310
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
311 public final boolean hasOperands() {
9454
85a836bcd796 renaming for improved clarity: hasCall -> destroysCallerSavedRegisters
Doug Simon <doug.simon@oracle.com>
parents: 9294
diff changeset
312 return instructionClass.hasOperands() || hasState() || destroysCallerSavedRegisters();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
313 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
314
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
315 public final boolean hasState() {
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
316 return instructionClass.hasState(this);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
317 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
318
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
319 /**
9454
85a836bcd796 renaming for improved clarity: hasCall -> destroysCallerSavedRegisters
Doug Simon <doug.simon@oracle.com>
parents: 9294
diff changeset
320 * Determines if this instruction destroys all caller-saved registers..
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
321 */
9454
85a836bcd796 renaming for improved clarity: hasCall -> destroysCallerSavedRegisters
Doug Simon <doug.simon@oracle.com>
parents: 9294
diff changeset
322 public boolean destroysCallerSavedRegisters() {
8969
1fa6536416db Runtime calls that do not destroy the caller's registers need no spilling at the call site.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 8169
diff changeset
323 return false;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
324 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
325
16280
266db8cf4dc6 Add LIRInstruction.forEach*(ValuePositionProcedure proc).
Josef Eisl <josef.eisl@jku.at>
parents: 16279
diff changeset
326 public final void forEachInput(ValuePositionProcedure proc) {
266db8cf4dc6 Add LIRInstruction.forEach*(ValuePositionProcedure proc).
Josef Eisl <josef.eisl@jku.at>
parents: 16279
diff changeset
327 instructionClass.forEachUse(this, proc);
266db8cf4dc6 Add LIRInstruction.forEach*(ValuePositionProcedure proc).
Josef Eisl <josef.eisl@jku.at>
parents: 16279
diff changeset
328 }
266db8cf4dc6 Add LIRInstruction.forEach*(ValuePositionProcedure proc).
Josef Eisl <josef.eisl@jku.at>
parents: 16279
diff changeset
329
266db8cf4dc6 Add LIRInstruction.forEach*(ValuePositionProcedure proc).
Josef Eisl <josef.eisl@jku.at>
parents: 16279
diff changeset
330 public final void forEachAlive(ValuePositionProcedure proc) {
266db8cf4dc6 Add LIRInstruction.forEach*(ValuePositionProcedure proc).
Josef Eisl <josef.eisl@jku.at>
parents: 16279
diff changeset
331 instructionClass.forEachAlive(this, proc);
266db8cf4dc6 Add LIRInstruction.forEach*(ValuePositionProcedure proc).
Josef Eisl <josef.eisl@jku.at>
parents: 16279
diff changeset
332 }
266db8cf4dc6 Add LIRInstruction.forEach*(ValuePositionProcedure proc).
Josef Eisl <josef.eisl@jku.at>
parents: 16279
diff changeset
333
266db8cf4dc6 Add LIRInstruction.forEach*(ValuePositionProcedure proc).
Josef Eisl <josef.eisl@jku.at>
parents: 16279
diff changeset
334 public final void forEachTemp(ValuePositionProcedure proc) {
266db8cf4dc6 Add LIRInstruction.forEach*(ValuePositionProcedure proc).
Josef Eisl <josef.eisl@jku.at>
parents: 16279
diff changeset
335 instructionClass.forEachTemp(this, proc);
266db8cf4dc6 Add LIRInstruction.forEach*(ValuePositionProcedure proc).
Josef Eisl <josef.eisl@jku.at>
parents: 16279
diff changeset
336 }
266db8cf4dc6 Add LIRInstruction.forEach*(ValuePositionProcedure proc).
Josef Eisl <josef.eisl@jku.at>
parents: 16279
diff changeset
337
266db8cf4dc6 Add LIRInstruction.forEach*(ValuePositionProcedure proc).
Josef Eisl <josef.eisl@jku.at>
parents: 16279
diff changeset
338 public final void forEachOutput(ValuePositionProcedure proc) {
266db8cf4dc6 Add LIRInstruction.forEach*(ValuePositionProcedure proc).
Josef Eisl <josef.eisl@jku.at>
parents: 16279
diff changeset
339 instructionClass.forEachDef(this, proc);
266db8cf4dc6 Add LIRInstruction.forEach*(ValuePositionProcedure proc).
Josef Eisl <josef.eisl@jku.at>
parents: 16279
diff changeset
340 }
266db8cf4dc6 Add LIRInstruction.forEach*(ValuePositionProcedure proc).
Josef Eisl <josef.eisl@jku.at>
parents: 16279
diff changeset
341
16138
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
342 public final void forEachInput(InstructionValueProcedure proc) {
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
343 instructionClass.forEachUse(this, proc);
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
344 }
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
345
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
346 public final void forEachAlive(InstructionValueProcedure proc) {
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
347 instructionClass.forEachAlive(this, proc);
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
348 }
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
349
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
350 public final void forEachTemp(InstructionValueProcedure proc) {
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
351 instructionClass.forEachTemp(this, proc);
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
352 }
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
353
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
354 public final void forEachOutput(InstructionValueProcedure proc) {
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
355 instructionClass.forEachDef(this, proc);
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
356 }
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
357
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
358 public final void forEachState(InstructionValueProcedure proc) {
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
359 instructionClass.forEachState(this, proc);
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
360 }
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
361
16354
b6e70c59b32d Introduce InstructionStateProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 16283
diff changeset
362 public final void forEachState(InstructionStateProcedure proc) {
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
363 instructionClass.forEachState(this, proc);
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
364 }
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
365
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
366 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
367 * Iterates all register hints for the specified value, i.e., all preferred candidates for the
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
368 * register to be assigned to the value.
7521
d4bc143c575a replaced use of <br> in javadoc with <p>
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
369 * <p>
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
370 * Subclasses can override this method. The default implementation processes all Input operands
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
371 * as the hints for an Output operand, and all Output operands as the hints for an Input
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
372 * operand.
16138
f315b1c0a590 Introduce InstructionValueProcedure.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
373 *
4245
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
374 * @param value The value the hints are needed for.
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
375 * @param mode The operand mode of the value.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
376 * @param proc The procedure invoked for all the hints. If the procedure returns a non-null
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
377 * value, the iteration is stopped and the value is returned by this method, i.e.,
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7521
diff changeset
378 * clients can stop the iteration once a suitable hint has been found.
4245
75c620f90ab9 Support stack-operands and register hints in new register allocator API
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4210
diff changeset
379 * @return The non-null value returned by the procedure, or null.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
380 */
16214
dcaf26339f7c Make ValueProcedure a subclass of InstructionValueProcedure and remove redundancies.
Josef Eisl <josef.eisl@jku.at>
parents: 16138
diff changeset
381 public Value forEachRegisterHint(Value value, OperandMode mode, InstructionValueProcedure proc) {
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
382 return instructionClass.forEachRegisterHint(this, mode, proc);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
383 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
384
4323
df5547057954 Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4314
diff changeset
385 protected void verify() {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
386 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
387
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
388 public final String toStringWithIdPrefix() {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
389 if (id != -1) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
390 return String.format("%4d %s", id, toString());
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
391 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
392 return " " + toString();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
393 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
394
4169
f5328dda9714 Initial commit of SSA-based spill-all register assignment
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4142
diff changeset
395 @Override
f5328dda9714 Initial commit of SSA-based spill-all register assignment
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4142
diff changeset
396 public String toString() {
5733
141b15521a39 use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents: 5711
diff changeset
397 return instructionClass.toString(this);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
398 }
16277
2bcba15fa725 Introduce LIRInstructionClass.Position.
Josef Eisl <josef.eisl@jku.at>
parents: 16214
diff changeset
399
2bcba15fa725 Introduce LIRInstructionClass.Position.
Josef Eisl <josef.eisl@jku.at>
parents: 16214
diff changeset
400 public LIRInstructionClass getLIRInstructionClass() {
2bcba15fa725 Introduce LIRInstructionClass.Position.
Josef Eisl <josef.eisl@jku.at>
parents: 16214
diff changeset
401 return instructionClass;
2bcba15fa725 Introduce LIRInstructionClass.Position.
Josef Eisl <josef.eisl@jku.at>
parents: 16214
diff changeset
402 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
403 }