Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java @ 10861:6872c61c1d3e
Fix null reference access when dumping raw data patches.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Tue, 23 Jul 2013 18:23:52 +0200 |
parents | 4e1db4c9d4c5 |
children | 23ccaa863eda |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8281
diff
changeset
|
2 * Copyright (c) 2011, 2013, 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.asm; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5546
diff
changeset
|
25 import static com.oracle.graal.api.code.ValueUtil.*; |
4183
9e0c1b4cfef5
Move all isXxx and asXxx out of CiValue and into their own util class.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4181
diff
changeset
|
26 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
27 import java.util.*; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
28 |
5510
426c605c9d3c
Move cri.ci to api.code.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5507
diff
changeset
|
29 import com.oracle.graal.api.code.*; |
9124
5f66acd13e41
CompilationResult: record more metrics for DataPatches
Bernhard Urban <bernhard.urban@jku.at>
parents:
9004
diff
changeset
|
30 import com.oracle.graal.api.code.CompilationResult.*; |
5507
dc71b06d09f8
Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5506
diff
changeset
|
31 import com.oracle.graal.api.meta.*; |
6531
4afe23aa0a00
renamed packages: com.oracle.max.asm... -> com.oracle.graal.asm...
Doug Simon <doug.simon@oracle.com>
parents:
6476
diff
changeset
|
32 import com.oracle.graal.asm.*; |
5273
7689999f0ea6
improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents:
5251
diff
changeset
|
33 import com.oracle.graal.debug.*; |
7689999f0ea6
improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents:
5251
diff
changeset
|
34 import com.oracle.graal.graph.*; |
7689999f0ea6
improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents:
5251
diff
changeset
|
35 import com.oracle.graal.lir.*; |
9615
1089d63ef168
removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents:
9338
diff
changeset
|
36 import com.oracle.graal.nodes.*; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
37 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
38 public class TargetMethodAssembler { |
4262
744dade427b8
another batch of work towards GraalCompilation removal:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
39 |
4524
dcc8f5c6f394
Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4405
diff
changeset
|
40 private static class ExceptionInfo { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
41 |
4524
dcc8f5c6f394
Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4405
diff
changeset
|
42 public final int codeOffset; |
dcc8f5c6f394
Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4405
diff
changeset
|
43 public final LabelRef exceptionEdge; |
dcc8f5c6f394
Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4405
diff
changeset
|
44 |
dcc8f5c6f394
Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4405
diff
changeset
|
45 public ExceptionInfo(int pcOffset, LabelRef exceptionEdge) { |
dcc8f5c6f394
Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4405
diff
changeset
|
46 this.codeOffset = pcOffset; |
dcc8f5c6f394
Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4405
diff
changeset
|
47 this.exceptionEdge = exceptionEdge; |
dcc8f5c6f394
Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4405
diff
changeset
|
48 } |
dcc8f5c6f394
Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4405
diff
changeset
|
49 } |
dcc8f5c6f394
Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4405
diff
changeset
|
50 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
51 public final AbstractAssembler asm; |
7809
0fb4d10bd256
Small clean up of assembler and LIR.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7530
diff
changeset
|
52 public final CompilationResult compilationResult; |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5546
diff
changeset
|
53 public final TargetDescription target; |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5540
diff
changeset
|
54 public final CodeCacheProvider runtime; |
4262
744dade427b8
another batch of work towards GraalCompilation removal:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
55 public final FrameMap frameMap; |
5273
7689999f0ea6
improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents:
5251
diff
changeset
|
56 |
7689999f0ea6
improved disassembly comments for out-of-line stubs
Doug Simon <doug.simon@oracle.com>
parents:
5251
diff
changeset
|
57 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
58 * The object that emits code for managing a method's frame. If null, no frame is used by the |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
59 * method. |
5251
467de393651a
optimization: frame prologue & epilogue ommitted for methods with no spills, no callee-saved registers, no incoming stack args and no debug info
Doug Simon <doug.simon@oracle.com>
parents:
5233
diff
changeset
|
60 */ |
5233
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5061
diff
changeset
|
61 public final FrameContext frameContext; |
4262
744dade427b8
another batch of work towards GraalCompilation removal:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
62 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
63 private List<ExceptionInfo> exceptionInfoList; |
4524
dcc8f5c6f394
Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4405
diff
changeset
|
64 |
8281
8fde1be81b2d
LIRGenerator is transmitted across backend passes instead of just the LIR so that backend-specific, per-compilation information can be attached to the backend-specific LIRGenerator object
Doug Simon <doug.simon@oracle.com>
parents:
8205
diff
changeset
|
65 public TargetMethodAssembler(TargetDescription target, CodeCacheProvider runtime, FrameMap frameMap, AbstractAssembler asm, FrameContext frameContext, CompilationResult compilationResult) { |
4262
744dade427b8
another batch of work towards GraalCompilation removal:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
66 this.target = target; |
744dade427b8
another batch of work towards GraalCompilation removal:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
67 this.runtime = runtime; |
744dade427b8
another batch of work towards GraalCompilation removal:
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
68 this.frameMap = frameMap; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
69 this.asm = asm; |
8281
8fde1be81b2d
LIRGenerator is transmitted across backend passes instead of just the LIR so that backend-specific, per-compilation information can be attached to the backend-specific LIRGenerator object
Doug Simon <doug.simon@oracle.com>
parents:
8205
diff
changeset
|
70 this.compilationResult = compilationResult; |
5233
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5061
diff
changeset
|
71 this.frameContext = frameContext; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
72 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
73 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
74 public void setFrameSize(int frameSize) { |
7809
0fb4d10bd256
Small clean up of assembler and LIR.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7530
diff
changeset
|
75 compilationResult.setFrameSize(frameSize); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
76 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
77 |
5798
2585af1e26ac
implemented non-XIR lowering of invokes (todo: inline virtual dispatch and null checking of receivers)
Doug Simon <doug.simon@oracle.com>
parents:
5774
diff
changeset
|
78 private static final CompilationResult.Mark[] NO_REFS = {}; |
2585af1e26ac
implemented non-XIR lowering of invokes (todo: inline virtual dispatch and null checking of receivers)
Doug Simon <doug.simon@oracle.com>
parents:
5774
diff
changeset
|
79 |
5546
e42c0df7212a
Rename CiTargetMethod => CompilationResult.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5541
diff
changeset
|
80 public CompilationResult.Mark recordMark(Object id) { |
7809
0fb4d10bd256
Small clean up of assembler and LIR.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7530
diff
changeset
|
81 return compilationResult.recordMark(asm.codeBuffer.position(), id, NO_REFS); |
5233
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5061
diff
changeset
|
82 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
5061
diff
changeset
|
83 |
5798
2585af1e26ac
implemented non-XIR lowering of invokes (todo: inline virtual dispatch and null checking of receivers)
Doug Simon <doug.simon@oracle.com>
parents:
5774
diff
changeset
|
84 public CompilationResult.Mark recordMark(Object id, CompilationResult.Mark... references) { |
7809
0fb4d10bd256
Small clean up of assembler and LIR.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7530
diff
changeset
|
85 return compilationResult.recordMark(asm.codeBuffer.position(), id, references); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
86 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
87 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
88 public void blockComment(String s) { |
7809
0fb4d10bd256
Small clean up of assembler and LIR.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7530
diff
changeset
|
89 compilationResult.addAnnotation(new CompilationResult.CodeComment(asm.codeBuffer.position(), s)); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
90 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
91 |
9615
1089d63ef168
removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents:
9338
diff
changeset
|
92 public CompilationResult finishTargetMethod(StructuredGraph graph) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
93 // Install code, data and frame size |
7809
0fb4d10bd256
Small clean up of assembler and LIR.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7530
diff
changeset
|
94 compilationResult.setTargetCode(asm.codeBuffer.close(false), asm.codeBuffer.position()); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
95 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
96 // Record exception handlers if they exist |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
97 if (exceptionInfoList != null) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
98 for (ExceptionInfo ei : exceptionInfoList) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
99 int codeOffset = ei.codeOffset; |
7809
0fb4d10bd256
Small clean up of assembler and LIR.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7530
diff
changeset
|
100 compilationResult.recordExceptionHandler(codeOffset, ei.exceptionEdge.label().position()); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
101 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
102 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
103 |
9131
b2c5cdd6d8a1
TargetMethodAssembler: guard metric processing
Bernhard Urban <bernhard.urban@jku.at>
parents:
9124
diff
changeset
|
104 if (Debug.isMeterEnabled()) { |
b2c5cdd6d8a1
TargetMethodAssembler: guard metric processing
Bernhard Urban <bernhard.urban@jku.at>
parents:
9124
diff
changeset
|
105 List<DataPatch> ldp = compilationResult.getDataReferences(); |
b2c5cdd6d8a1
TargetMethodAssembler: guard metric processing
Bernhard Urban <bernhard.urban@jku.at>
parents:
9124
diff
changeset
|
106 DebugMetric[] dms = new DebugMetric[Kind.values().length]; |
b2c5cdd6d8a1
TargetMethodAssembler: guard metric processing
Bernhard Urban <bernhard.urban@jku.at>
parents:
9124
diff
changeset
|
107 for (int i = 0; i < dms.length; i++) { |
b2c5cdd6d8a1
TargetMethodAssembler: guard metric processing
Bernhard Urban <bernhard.urban@jku.at>
parents:
9124
diff
changeset
|
108 dms[i] = Debug.metric("DataPatches-" + Kind.values()[i].toString()); |
b2c5cdd6d8a1
TargetMethodAssembler: guard metric processing
Bernhard Urban <bernhard.urban@jku.at>
parents:
9124
diff
changeset
|
109 } |
10861
6872c61c1d3e
Fix null reference access when dumping raw data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
10810
diff
changeset
|
110 DebugMetric dmRaw = Debug.metric("DataPatches-raw"); |
9124
5f66acd13e41
CompilationResult: record more metrics for DataPatches
Bernhard Urban <bernhard.urban@jku.at>
parents:
9004
diff
changeset
|
111 |
9131
b2c5cdd6d8a1
TargetMethodAssembler: guard metric processing
Bernhard Urban <bernhard.urban@jku.at>
parents:
9124
diff
changeset
|
112 for (DataPatch dp : ldp) { |
10861
6872c61c1d3e
Fix null reference access when dumping raw data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
10810
diff
changeset
|
113 if (dp.constant != null) { |
6872c61c1d3e
Fix null reference access when dumping raw data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
10810
diff
changeset
|
114 dms[dp.constant.getKind().ordinal()].add(1); |
6872c61c1d3e
Fix null reference access when dumping raw data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
10810
diff
changeset
|
115 } else { |
6872c61c1d3e
Fix null reference access when dumping raw data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
10810
diff
changeset
|
116 dmRaw.add(1); |
6872c61c1d3e
Fix null reference access when dumping raw data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
10810
diff
changeset
|
117 } |
9131
b2c5cdd6d8a1
TargetMethodAssembler: guard metric processing
Bernhard Urban <bernhard.urban@jku.at>
parents:
9124
diff
changeset
|
118 } |
9124
5f66acd13e41
CompilationResult: record more metrics for DataPatches
Bernhard Urban <bernhard.urban@jku.at>
parents:
9004
diff
changeset
|
119 |
9131
b2c5cdd6d8a1
TargetMethodAssembler: guard metric processing
Bernhard Urban <bernhard.urban@jku.at>
parents:
9124
diff
changeset
|
120 Debug.metric("TargetMethods").increment(); |
b2c5cdd6d8a1
TargetMethodAssembler: guard metric processing
Bernhard Urban <bernhard.urban@jku.at>
parents:
9124
diff
changeset
|
121 Debug.metric("CodeBytesEmitted").add(compilationResult.getTargetCodeSize()); |
9338
0266549ff6e0
added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9131
diff
changeset
|
122 Debug.metric("InfopointsEmitted").add(compilationResult.getInfopoints().size()); |
9131
b2c5cdd6d8a1
TargetMethodAssembler: guard metric processing
Bernhard Urban <bernhard.urban@jku.at>
parents:
9124
diff
changeset
|
123 Debug.metric("DataPatches").add(ldp.size()); |
b2c5cdd6d8a1
TargetMethodAssembler: guard metric processing
Bernhard Urban <bernhard.urban@jku.at>
parents:
9124
diff
changeset
|
124 Debug.metric("ExceptionHandlersEmitted").add(compilationResult.getExceptionHandlers().size()); |
b2c5cdd6d8a1
TargetMethodAssembler: guard metric processing
Bernhard Urban <bernhard.urban@jku.at>
parents:
9124
diff
changeset
|
125 } |
9615
1089d63ef168
removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents:
9338
diff
changeset
|
126 Debug.log("Finished compiling %s", graph); |
7809
0fb4d10bd256
Small clean up of assembler and LIR.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7530
diff
changeset
|
127 return compilationResult; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
128 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
129 |
5733
141b15521a39
use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents:
5552
diff
changeset
|
130 public void recordExceptionHandlers(int pcOffset, LIRFrameState info) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
131 if (info != null) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
132 if (info.exceptionEdge != null) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
133 if (exceptionInfoList == null) { |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
134 exceptionInfoList = new ArrayList<>(4); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
135 } |
4524
dcc8f5c6f394
Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4405
diff
changeset
|
136 exceptionInfoList.add(new ExceptionInfo(pcOffset, info.exceptionEdge)); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
137 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
138 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
139 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
140 |
5733
141b15521a39
use annotated fields for operands of LIR instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents:
5552
diff
changeset
|
141 public void recordImplicitException(int pcOffset, LIRFrameState info) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
142 // record an implicit exception point |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
143 if (info != null) { |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8281
diff
changeset
|
144 compilationResult.recordInfopoint(pcOffset, info.debugInfo(), InfopointReason.IMPLICIT_EXCEPTION); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
145 assert info.exceptionEdge == null; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
146 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
147 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
148 |
7814
bab2a51f8dbe
Introduce marker interface InvokeTarget. Remove method lookupRuntimeCall from CodeCacheProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7809
diff
changeset
|
149 public void recordDirectCall(int posBefore, int posAfter, InvokeTarget callTarget, LIRFrameState info) { |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5546
diff
changeset
|
150 DebugInfo debugInfo = info != null ? info.debugInfo() : null; |
7809
0fb4d10bd256
Small clean up of assembler and LIR.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7530
diff
changeset
|
151 compilationResult.recordCall(posBefore, posAfter - posBefore, callTarget, debugInfo, true); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
152 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
153 |
7814
bab2a51f8dbe
Introduce marker interface InvokeTarget. Remove method lookupRuntimeCall from CodeCacheProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7809
diff
changeset
|
154 public void recordIndirectCall(int posBefore, int posAfter, InvokeTarget callTarget, LIRFrameState info) { |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5546
diff
changeset
|
155 DebugInfo debugInfo = info != null ? info.debugInfo() : null; |
7809
0fb4d10bd256
Small clean up of assembler and LIR.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7530
diff
changeset
|
156 compilationResult.recordCall(posBefore, posAfter - posBefore, callTarget, debugInfo, false); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
157 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
158 |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8281
diff
changeset
|
159 public void recordInfopoint(int pos, LIRFrameState info, InfopointReason reason) { |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8281
diff
changeset
|
160 // infopoints always need debug info |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5546
diff
changeset
|
161 DebugInfo debugInfo = info.debugInfo(); |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
8281
diff
changeset
|
162 compilationResult.recordInfopoint(pos, debugInfo, reason); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
163 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
164 |
8167
7f57c30575c8
Make AMD64Address a low-level representation for use by the assembler only.
Roland Schatz <roland.schatz@oracle.com>
parents:
7839
diff
changeset
|
165 public AbstractAddress recordDataReferenceInCode(Constant data, int alignment, boolean inlined) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
166 assert data != null; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
167 int pos = asm.codeBuffer.position(); |
4405
aa867c7c1d1e
Remove TraceRelocation flag.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4365
diff
changeset
|
168 Debug.log("Data reference in code: pos = %d, data = %s", pos, data.toString()); |
7809
0fb4d10bd256
Small clean up of assembler and LIR.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7530
diff
changeset
|
169 compilationResult.recordDataReference(pos, data, alignment, inlined); |
7839
838293a77af7
Make Address class platform specific.
Roland Schatz <roland.schatz@oracle.com>
parents:
7826
diff
changeset
|
170 return asm.getPlaceholder(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
171 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
172 |
10810
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
10792
diff
changeset
|
173 public AbstractAddress recordDataReferenceInCode(byte[] data, int alignment) { |
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
10792
diff
changeset
|
174 assert data != null; |
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
10792
diff
changeset
|
175 int pos = asm.codeBuffer.position(); |
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
10792
diff
changeset
|
176 Debug.log("Raw data reference in code: pos = %d, data = %s", pos, data.toString()); |
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
10792
diff
changeset
|
177 compilationResult.recordDataReference(pos, data, alignment); |
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
10792
diff
changeset
|
178 return asm.getPlaceholder(); |
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
10792
diff
changeset
|
179 } |
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
10792
diff
changeset
|
180 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
181 /** |
6996
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6698
diff
changeset
|
182 * Returns the integer value of any constant that can be represented by a 32-bit integer value, |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
183 * including long constants that fit into the 32-bit range. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
184 */ |
5539
bc647d8b0080
Renaming RiValue => Value.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5538
diff
changeset
|
185 public int asIntConst(Value value) { |
7816
4e1278443941
Remove Kind.Jsr.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7814
diff
changeset
|
186 assert (value.getKind().getStackKind() == Kind.Int || value.getKind() == Kind.Long) && isConstant(value); |
6996
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6698
diff
changeset
|
187 Constant constant = (Constant) value; |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6698
diff
changeset
|
188 assert !runtime.needsDataPatch(constant) : constant + " should be in a DataPatch"; |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6698
diff
changeset
|
189 long c = constant.asLong(); |
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6698
diff
changeset
|
190 if (!NumUtil.isInt(c)) { |
4524
dcc8f5c6f394
Refactorings to prepare for LIR project splitting
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4405
diff
changeset
|
191 throw GraalInternalError.shouldNotReachHere(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
192 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
193 return (int) c; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
194 } |
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 /** |
8995
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
197 * Returns the float value of any constant that can be represented by a 32-bit float value. |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
198 */ |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
199 public float asFloatConst(Value value) { |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
200 assert (value.getKind().getStackKind() == Kind.Float && isConstant(value)); |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
201 Constant constant = (Constant) value; |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
202 assert !runtime.needsDataPatch(constant) : constant + " should be in a DataPatch"; |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
203 return constant.asFloat(); |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
204 } |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
205 |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
206 /** |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
207 * Returns the long value of any constant that can be represented by a 64-bit long value. |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
208 */ |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
209 public long asLongConst(Value value) { |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
210 assert (value.getKind().getStackKind() == Kind.Long && isConstant(value)); |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
211 Constant constant = (Constant) value; |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
212 assert !runtime.needsDataPatch(constant) : constant + " should be in a DataPatch"; |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
213 return constant.asLong(); |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
214 } |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
215 |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
216 /** |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
217 * Returns the double value of any constant that can be represented by a 64-bit float value. |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
218 */ |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
219 public double asDoubleConst(Value value) { |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
220 assert (value.getKind().getStackKind() == Kind.Double && isConstant(value)); |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
221 Constant constant = (Constant) value; |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
222 assert !runtime.needsDataPatch(constant) : constant + " should be in a DataPatch"; |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
223 return constant.asDouble(); |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
224 } |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
225 |
585cc62fcdc5
PTX enhancements - arithmetic, control, float, integer math, control and basic switch
Morris Meyer <morris.meyer@oracle.com>
parents:
8281
diff
changeset
|
226 /** |
10792 | 227 * Returns the address of a float constant that is embedded as a data reference into the code. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
228 */ |
8167
7f57c30575c8
Make AMD64Address a low-level representation for use by the assembler only.
Roland Schatz <roland.schatz@oracle.com>
parents:
7839
diff
changeset
|
229 public AbstractAddress asFloatConstRef(Value value) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
230 return asFloatConstRef(value, 4); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
231 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
232 |
8167
7f57c30575c8
Make AMD64Address a low-level representation for use by the assembler only.
Roland Schatz <roland.schatz@oracle.com>
parents:
7839
diff
changeset
|
233 public AbstractAddress asFloatConstRef(Value value, int alignment) { |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5798
diff
changeset
|
234 assert value.getKind() == Kind.Float && isConstant(value); |
6996
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6698
diff
changeset
|
235 return recordDataReferenceInCode((Constant) value, alignment, false); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
236 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
237 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
238 /** |
10792 | 239 * Returns the address of a double constant that is embedded as a data reference into the code. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
240 */ |
8167
7f57c30575c8
Make AMD64Address a low-level representation for use by the assembler only.
Roland Schatz <roland.schatz@oracle.com>
parents:
7839
diff
changeset
|
241 public AbstractAddress asDoubleConstRef(Value value) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
242 return asDoubleConstRef(value, 8); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
243 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
244 |
8167
7f57c30575c8
Make AMD64Address a low-level representation for use by the assembler only.
Roland Schatz <roland.schatz@oracle.com>
parents:
7839
diff
changeset
|
245 public AbstractAddress asDoubleConstRef(Value value, int alignment) { |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5798
diff
changeset
|
246 assert value.getKind() == Kind.Double && isConstant(value); |
6996
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6698
diff
changeset
|
247 return recordDataReferenceInCode((Constant) value, alignment, false); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
248 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
249 |
4277
9a3a0cdb6e34
Remove asAddress from FrameMap, I don't like it there.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4265
diff
changeset
|
250 /** |
10792 | 251 * Returns the address of a long constant that is embedded as a data reference into the code. |
4277
9a3a0cdb6e34
Remove asAddress from FrameMap, I don't like it there.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4265
diff
changeset
|
252 */ |
8167
7f57c30575c8
Make AMD64Address a low-level representation for use by the assembler only.
Roland Schatz <roland.schatz@oracle.com>
parents:
7839
diff
changeset
|
253 public AbstractAddress asLongConstRef(Value value) { |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5798
diff
changeset
|
254 assert value.getKind() == Kind.Long && isConstant(value); |
6996
eec373d34caf
added support for annotated Constants and used it to track Klass* values in Graal and register them in the metadata section of a nmethod during code installation
Doug Simon <doug.simon@oracle.com>
parents:
6698
diff
changeset
|
255 return recordDataReferenceInCode((Constant) value, 8, false); |
4277
9a3a0cdb6e34
Remove asAddress from FrameMap, I don't like it there.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4265
diff
changeset
|
256 } |
9a3a0cdb6e34
Remove asAddress from FrameMap, I don't like it there.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4265
diff
changeset
|
257 |
10792 | 258 /** |
259 * Returns the address of an object constant that is embedded as a data reference into the code. | |
260 */ | |
261 public AbstractAddress asObjectConstRef(Value value) { | |
262 assert value.getKind() == Kind.Object && isConstant(value); | |
263 return recordDataReferenceInCode((Constant) value, 8, false); | |
264 } | |
265 | |
8167
7f57c30575c8
Make AMD64Address a low-level representation for use by the assembler only.
Roland Schatz <roland.schatz@oracle.com>
parents:
7839
diff
changeset
|
266 public AbstractAddress asIntAddr(Value value) { |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5798
diff
changeset
|
267 assert value.getKind() == Kind.Int; |
4323
df5547057954
Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4277
diff
changeset
|
268 return asAddress(value); |
df5547057954
Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4277
diff
changeset
|
269 } |
df5547057954
Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4277
diff
changeset
|
270 |
8167
7f57c30575c8
Make AMD64Address a low-level representation for use by the assembler only.
Roland Schatz <roland.schatz@oracle.com>
parents:
7839
diff
changeset
|
271 public AbstractAddress asLongAddr(Value value) { |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5798
diff
changeset
|
272 assert value.getKind() == Kind.Long; |
4323
df5547057954
Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4277
diff
changeset
|
273 return asAddress(value); |
df5547057954
Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4277
diff
changeset
|
274 } |
df5547057954
Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4277
diff
changeset
|
275 |
8167
7f57c30575c8
Make AMD64Address a low-level representation for use by the assembler only.
Roland Schatz <roland.schatz@oracle.com>
parents:
7839
diff
changeset
|
276 public AbstractAddress asObjectAddr(Value value) { |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5798
diff
changeset
|
277 assert value.getKind() == Kind.Object; |
4323
df5547057954
Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4277
diff
changeset
|
278 return asAddress(value); |
df5547057954
Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4277
diff
changeset
|
279 } |
df5547057954
Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4277
diff
changeset
|
280 |
8167
7f57c30575c8
Make AMD64Address a low-level representation for use by the assembler only.
Roland Schatz <roland.schatz@oracle.com>
parents:
7839
diff
changeset
|
281 public AbstractAddress asFloatAddr(Value value) { |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5798
diff
changeset
|
282 assert value.getKind() == Kind.Float; |
4323
df5547057954
Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4277
diff
changeset
|
283 return asAddress(value); |
df5547057954
Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4277
diff
changeset
|
284 } |
df5547057954
Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4277
diff
changeset
|
285 |
8167
7f57c30575c8
Make AMD64Address a low-level representation for use by the assembler only.
Roland Schatz <roland.schatz@oracle.com>
parents:
7839
diff
changeset
|
286 public AbstractAddress asDoubleAddr(Value value) { |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5798
diff
changeset
|
287 assert value.getKind() == Kind.Double; |
4323
df5547057954
Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4277
diff
changeset
|
288 return asAddress(value); |
df5547057954
Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4277
diff
changeset
|
289 } |
df5547057954
Remove LIROpcode and use non-anonymous subclasses of LIRInstruction
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents:
4277
diff
changeset
|
290 |
8167
7f57c30575c8
Make AMD64Address a low-level representation for use by the assembler only.
Roland Schatz <roland.schatz@oracle.com>
parents:
7839
diff
changeset
|
291 public AbstractAddress asAddress(Value value) { |
8169
0fdbde04cca3
Remove unused Address class.
Roland Schatz <roland.schatz@oracle.com>
parents:
8167
diff
changeset
|
292 assert isStackSlot(value); |
0fdbde04cca3
Remove unused Address class.
Roland Schatz <roland.schatz@oracle.com>
parents:
8167
diff
changeset
|
293 StackSlot slot = asStackSlot(value); |
8170
537f03d2bdf7
Removed unused parameter from AbstractAssembler.makeAddress().
Roland Schatz <roland.schatz@oracle.com>
parents:
8169
diff
changeset
|
294 return asm.makeAddress(frameMap.registerConfig.getFrameRegister(), frameMap.offsetForStackSlot(slot)); |
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 } |