annotate graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGeneratorTool.java @ 19131:cd49455040c1

LIRGeneratorTool: change return type from Value to Variable for most emit methods.
author Josef Eisl <josef.eisl@jku.at>
date Wed, 04 Feb 2015 14:33:27 +0100
parents 76553fa0f02b
children 8073a99a1620
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15298
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
1 /*
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16092
diff changeset
2 * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
15298
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
4 *
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
7 * published by the Free Software Foundation.
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
8 *
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
13 * accompanied this code).
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
14 *
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
18 *
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
21 * questions.
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
22 */
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
23 package com.oracle.graal.lir.gen;
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
24
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
25 import com.oracle.graal.api.code.*;
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
26 import com.oracle.graal.api.meta.*;
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
27 import com.oracle.graal.compiler.common.*;
15331
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
28 import com.oracle.graal.compiler.common.calc.*;
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
29 import com.oracle.graal.compiler.common.cfg.*;
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
30 import com.oracle.graal.compiler.common.spi.*;
15301
468b2428c403 Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents: 15299
diff changeset
31 import com.oracle.graal.lir.*;
15298
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
32
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
33 public interface LIRGeneratorTool extends ArithmeticLIRGenerator {
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
34
15331
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
35 CodeGenProviders getProviders();
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
36
15298
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
37 TargetDescription target();
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
38
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
39 MetaAccessProvider getMetaAccess();
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
40
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
41 CodeCacheProvider getCodeCache();
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
42
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
43 ForeignCallsProvider getForeignCalls();
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
44
15331
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
45 AbstractBlock<?> getCurrentBlock();
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
46
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
47 LIRGenerationResult getResult();
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
48
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
49 boolean hasBlockEnd(AbstractBlock<?> block);
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
50
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
51 void doBlockStart(AbstractBlock<?> block);
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
52
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
53 void doBlockEnd(AbstractBlock<?> block);
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
54
18188
8652481a1110 Introduce new Constant interface for use in high-level graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 18187
diff changeset
55 Value emitLoadConstant(LIRKind kind, Constant constant);
17314
3b6759c384a9 Introduce emitLoadConstant in LIRGeneratorTool.
Roland Schatz <roland.schatz@oracle.com>
parents: 16347
diff changeset
56
19131
cd49455040c1 LIRGeneratorTool: change return type from Value to Variable for most emit methods.
Josef Eisl <josef.eisl@jku.at>
parents: 18933
diff changeset
57 Variable emitLoad(LIRKind kind, Value address, LIRFrameState state);
15298
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
58
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16092
diff changeset
59 void emitStore(LIRKind kind, Value address, Value input, LIRFrameState state);
15298
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
60
15554
cf994cc23b54 Move emitNullCheck from NodeLIRBuilderTool to LIRGeneratorTool.
Josef Eisl <josef.eisl@jku.at>
parents: 15331
diff changeset
61 void emitNullCheck(Value address, LIRFrameState state);
cf994cc23b54 Move emitNullCheck from NodeLIRBuilderTool to LIRGeneratorTool.
Josef Eisl <josef.eisl@jku.at>
parents: 15331
diff changeset
62
19131
cd49455040c1 LIRGeneratorTool: change return type from Value to Variable for most emit methods.
Josef Eisl <josef.eisl@jku.at>
parents: 18933
diff changeset
63 Variable emitCompareAndSwap(Value address, Value expectedValue, Value newValue, Value trueValue, Value falseValue);
15298
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
64
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
65 /**
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
66 * Emit an atomic read-and-add instruction.
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
67 *
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
68 * @param address address of the value to be read and written
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
69 * @param delta the value to be added
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
70 */
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
71 default Value emitAtomicReadAndAdd(Value address, Value delta) {
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
72 throw GraalInternalError.unimplemented();
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
73 }
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
74
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
75 /**
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
76 * Emit an atomic read-and-write instruction.
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
77 *
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
78 * @param address address of the value to be read and written
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
79 * @param newValue the new value to be written
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
80 */
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
81 default Value emitAtomicReadAndWrite(Value address, Value newValue) {
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
82 throw GraalInternalError.unimplemented();
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
83 }
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
84
15301
468b2428c403 Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents: 15299
diff changeset
85 void emitDeoptimize(Value actionAndReason, Value failedSpeculation, LIRFrameState state);
15298
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
86
15331
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
87 Variable emitForeignCall(ForeignCallLinkage linkage, LIRFrameState state, Value... args);
15298
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
88
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
89 RegisterAttributes attributes(Register register);
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
90
16347
c6a1215d025b Improve documentation of LIRKind.
Roland Schatz <roland.schatz@oracle.com>
parents: 16094
diff changeset
91 /**
c6a1215d025b Improve documentation of LIRKind.
Roland Schatz <roland.schatz@oracle.com>
parents: 16094
diff changeset
92 * Create a new {@link Variable}.
c6a1215d025b Improve documentation of LIRKind.
Roland Schatz <roland.schatz@oracle.com>
parents: 16094
diff changeset
93 *
c6a1215d025b Improve documentation of LIRKind.
Roland Schatz <roland.schatz@oracle.com>
parents: 16094
diff changeset
94 * @param kind The type of the value that will be stored in this {@link Variable}. See
c6a1215d025b Improve documentation of LIRKind.
Roland Schatz <roland.schatz@oracle.com>
parents: 16094
diff changeset
95 * {@link LIRKind} for documentation on what to pass here. Note that in most cases,
c6a1215d025b Improve documentation of LIRKind.
Roland Schatz <roland.schatz@oracle.com>
parents: 16094
diff changeset
96 * simply passing {@link Value#getLIRKind()} is wrong.
c6a1215d025b Improve documentation of LIRKind.
Roland Schatz <roland.schatz@oracle.com>
parents: 16094
diff changeset
97 * @return A new {@link Variable}.
c6a1215d025b Improve documentation of LIRKind.
Roland Schatz <roland.schatz@oracle.com>
parents: 16094
diff changeset
98 */
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16092
diff changeset
99 Variable newVariable(LIRKind kind);
15298
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
100
15331
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
101 Variable emitMove(Value input);
15298
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
102
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
103 void emitMove(AllocatableValue dst, Value src);
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
104
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
105 /**
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
106 * Emits an op that loads the address of some raw data.
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
107 *
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
108 * @param dst the variable into which the address is loaded
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
109 * @param data the data to be installed with the generated code
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
110 */
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
111 void emitData(AllocatableValue dst, byte[] data);
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
112
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
113 Value emitAddress(Value base, long displacement, Value index, int scale);
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
114
19131
cd49455040c1 LIRGeneratorTool: change return type from Value to Variable for most emit methods.
Josef Eisl <josef.eisl@jku.at>
parents: 18933
diff changeset
115 Variable emitAddress(StackSlotValue slot);
15298
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
116
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
117 void emitMembar(int barriers);
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
118
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
119 void emitUnwind(Value operand);
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
120
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
121 /**
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
122 * Called just before register allocation is performed on the LIR owned by this generator.
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
123 * Overriding implementations of this method must call the overridden method.
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
124 */
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
125 void beforeRegisterAllocation();
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
126
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
127 void emitIncomingValues(Value[] params);
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
128
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
129 /**
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
130 * Emits a return instruction. Implementations need to insert a move if the input is not in the
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
131 * correct location.
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
132 */
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
133 void emitReturn(Value input);
15331
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
134
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
135 AllocatableValue asAllocatable(Value value);
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
136
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
137 Variable load(Value value);
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
138
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
139 Value loadNonConst(Value value);
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
140
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
141 /**
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
142 * Returns true if the redundant move elimination optimization should be done after register
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
143 * allocation.
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
144 */
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
145 boolean canEliminateRedundantMoves();
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
146
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
147 /**
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
148 * Determines if only oop maps are required for the code generated from the LIR.
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
149 */
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
150 boolean needOnlyOopMaps();
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
151
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
152 /**
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
153 * Gets the ABI specific operand used to return a value of a given kind from a method.
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
154 *
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
155 * @param kind the kind of value being returned
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
156 * @return the operand representing the ABI defined location used return a value of kind
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
157 * {@code kind}
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
158 */
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 16092
diff changeset
159 AllocatableValue resultOperandFor(LIRKind kind);
15331
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
160
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
161 void append(LIRInstruction op);
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
162
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
163 void emitJump(LabelRef label);
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
164
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
165 void emitCompareBranch(PlatformKind cmpKind, Value left, Value right, Condition cond, boolean unorderedIsTrue, LabelRef trueDestination, LabelRef falseDestination,
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
166 double trueDestinationProbability);
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
167
18843
5e80dd2f1783 Extend emitMul, emitAdd and emitSub in ArithmeticLIRGenerator for explicitly requesting to set the flags register. (In AMD64 flags are set implicitly, but on SPARC it is not)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18425
diff changeset
168 void emitOverflowCheckBranch(LabelRef overflow, LabelRef noOverflow, LIRKind cmpKind, double overflowProbability);
15331
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
169
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
170 void emitIntegerTestBranch(Value left, Value right, LabelRef trueDestination, LabelRef falseDestination, double trueSuccessorProbability);
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
171
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
172 Variable emitConditionalMove(PlatformKind cmpKind, Value leftVal, Value right, Condition cond, boolean unorderedIsTrue, Value trueValue, Value falseValue);
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
173
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
174 Variable emitIntegerTestMove(Value leftVal, Value right, Value trueValue, Value falseValue);
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
175
18187
9619ba4daf4c Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents: 17417
diff changeset
176 void emitStrategySwitch(JavaConstant[] keyConstants, double[] keyProbabilities, LabelRef[] keyTargets, LabelRef defaultTarget, Variable value);
15331
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
177
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
178 void emitStrategySwitch(SwitchStrategy strategy, Variable key, LabelRef[] keyTargets, LabelRef defaultTarget);
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
179
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
180 CallingConvention getCallingConvention();
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
181
19131
cd49455040c1 LIRGeneratorTool: change return type from Value to Variable for most emit methods.
Josef Eisl <josef.eisl@jku.at>
parents: 18933
diff changeset
182 Variable emitBitCount(Value operand);
15331
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
183
19131
cd49455040c1 LIRGeneratorTool: change return type from Value to Variable for most emit methods.
Josef Eisl <josef.eisl@jku.at>
parents: 18933
diff changeset
184 Variable emitBitScanForward(Value operand);
15331
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
185
19131
cd49455040c1 LIRGeneratorTool: change return type from Value to Variable for most emit methods.
Josef Eisl <josef.eisl@jku.at>
parents: 18933
diff changeset
186 Variable emitBitScanReverse(Value operand);
15331
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
187
19131
cd49455040c1 LIRGeneratorTool: change return type from Value to Variable for most emit methods.
Josef Eisl <josef.eisl@jku.at>
parents: 18933
diff changeset
188 Variable emitByteSwap(Value operand);
15331
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
189
19131
cd49455040c1 LIRGeneratorTool: change return type from Value to Variable for most emit methods.
Josef Eisl <josef.eisl@jku.at>
parents: 18933
diff changeset
190 Variable emitArrayEquals(Kind kind, Value array1, Value array2, Value length);
15331
71cdf5518dab Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents: 15301
diff changeset
191
18933
76553fa0f02b Compiler intrinsic for JMH blackhole.
Roland Schatz <roland.schatz@oracle.com>
parents: 18843
diff changeset
192 void emitBlackhole(Value operand);
76553fa0f02b Compiler intrinsic for JMH blackhole.
Roland Schatz <roland.schatz@oracle.com>
parents: 18843
diff changeset
193
18415
6dc4f0be9a70 Add support of lzcnt and tzcnt
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 18188
diff changeset
194 @SuppressWarnings("unused")
6dc4f0be9a70 Add support of lzcnt and tzcnt
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 18188
diff changeset
195 default Value emitCountLeadingZeros(Value value) {
6dc4f0be9a70 Add support of lzcnt and tzcnt
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 18188
diff changeset
196 throw GraalInternalError.unimplemented();
6dc4f0be9a70 Add support of lzcnt and tzcnt
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 18188
diff changeset
197 }
6dc4f0be9a70 Add support of lzcnt and tzcnt
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 18188
diff changeset
198
6dc4f0be9a70 Add support of lzcnt and tzcnt
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 18188
diff changeset
199 @SuppressWarnings("unused")
6dc4f0be9a70 Add support of lzcnt and tzcnt
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 18188
diff changeset
200 default Value emitCountTrailingZeros(Value value) {
6dc4f0be9a70 Add support of lzcnt and tzcnt
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 18188
diff changeset
201 throw GraalInternalError.unimplemented();
6dc4f0be9a70 Add support of lzcnt and tzcnt
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 18188
diff changeset
202 }
6dc4f0be9a70 Add support of lzcnt and tzcnt
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 18188
diff changeset
203
15298
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff changeset
204 }