Mercurial > hg > truffle
annotate graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/CompilationResult.java @ 21624:dcf65e8b9fd9
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Mon, 01 Jun 2015 00:44:38 +0200 |
parents | ce2113326bc8 |
children | b9f9b8af17ff |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
2 * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
4 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
8 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
14 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
18 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
21 * questions. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
22 */ |
21556
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
23 package com.oracle.jvmci.code; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
21556
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
25 import static com.oracle.jvmci.meta.MetaUtil.*; |
9300
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
26 import static java.util.Collections.*; |
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
27 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
28 import java.util.*; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
29 |
21556
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
30 import com.oracle.jvmci.code.CodeUtil.RefMapFormatter; |
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
31 import com.oracle.jvmci.meta.Assumptions.Assumption; |
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21411
diff
changeset
|
32 import com.oracle.jvmci.meta.*; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
33 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
34 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
35 * Represents the output from compiling a method, including the compiled machine code, associated |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
36 * data and references, relocation information, deoptimization information, etc. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
37 */ |
21411
082417ac43e4
removed com.oracle.graal.hotspot.server and uses of Serializable it depended upon (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
19795
diff
changeset
|
38 public class CompilationResult { |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
39 |
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
40 /** |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
41 * Represents a code position with associated additional information. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
42 */ |
21411
082417ac43e4
removed com.oracle.graal.hotspot.server and uses of Serializable it depended upon (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
19795
diff
changeset
|
43 public abstract static class Site { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
44 |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
45 /** |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
46 * The position (or offset) of this site with respect to the start of the target method. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
47 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
48 public final int pcOffset; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
49 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
50 public Site(int pos) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
51 this.pcOffset = pos; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
52 } |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
53 |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
54 @Override |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
55 public final int hashCode() { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
56 throw new UnsupportedOperationException("hashCode"); |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
57 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
58 |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
59 @Override |
18499
bd74da0a76f3
implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18352
diff
changeset
|
60 public String toString() { |
bd74da0a76f3
implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18352
diff
changeset
|
61 return identityHashCodeString(this); |
bd74da0a76f3
implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18352
diff
changeset
|
62 } |
bd74da0a76f3
implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18352
diff
changeset
|
63 |
bd74da0a76f3
implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18352
diff
changeset
|
64 @Override |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
65 public abstract boolean equals(Object obj); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
66 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
67 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
68 /** |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
69 * Represents an infopoint with associated debug info. Note that safepoints are also infopoints. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
70 */ |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
71 public static class Infopoint extends Site implements Comparable<Infopoint> { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
72 |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5546
diff
changeset
|
73 public final DebugInfo debugInfo; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
74 |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
75 public final InfopointReason reason; |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
76 |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
77 public Infopoint(int pcOffset, DebugInfo debugInfo, InfopointReason reason) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
78 super(pcOffset); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
79 this.debugInfo = debugInfo; |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
80 this.reason = reason; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
81 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
82 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
83 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
84 public String toString() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
85 StringBuilder sb = new StringBuilder(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
86 sb.append(pcOffset); |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
87 sb.append("[<infopoint>]"); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
88 appendDebugInfo(sb, debugInfo); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
89 return sb.toString(); |
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 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
92 @Override |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
93 public int compareTo(Infopoint o) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
94 if (pcOffset < o.pcOffset) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
95 return -1; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
96 } else if (pcOffset > o.pcOffset) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
97 return 1; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
98 } |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
99 return this.reason.compareTo(o.reason); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
100 } |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
101 |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
102 @Override |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
103 public boolean equals(Object obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
104 if (this == obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
105 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
106 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
107 if (obj != null && obj.getClass() == getClass()) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
108 Infopoint that = (Infopoint) obj; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
109 if (this.pcOffset == that.pcOffset && Objects.equals(this.debugInfo, that.debugInfo) && Objects.equals(this.reason, that.reason)) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
110 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
111 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
112 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
113 return false; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
114 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
115 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
116 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
117 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
118 * Represents a call in the code. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
119 */ |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
120 public static final class Call extends Infopoint { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
121 |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
122 /** |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
123 * The target of the call. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
124 */ |
7814
bab2a51f8dbe
Introduce marker interface InvokeTarget. Remove method lookupRuntimeCall from CodeCacheProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7660
diff
changeset
|
125 public final InvokeTarget target; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
126 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
127 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
128 * The size of the call instruction. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
129 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
130 public final int size; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
131 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
132 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
133 * Specifies if this call is direct or indirect. A direct call has an immediate operand |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
134 * encoding the absolute or relative (to the call itself) address of the target. An indirect |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
135 * call has a register or memory operand specifying the target address of the call. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
136 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
137 public final boolean direct; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
138 |
7814
bab2a51f8dbe
Introduce marker interface InvokeTarget. Remove method lookupRuntimeCall from CodeCacheProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7660
diff
changeset
|
139 public Call(InvokeTarget target, int pcOffset, int size, boolean direct, DebugInfo debugInfo) { |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
140 super(pcOffset, debugInfo, InfopointReason.CALL); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
141 this.size = size; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
142 this.target = target; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
143 this.direct = direct; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
144 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
145 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
146 @Override |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
147 public boolean equals(Object obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
148 if (this == obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
149 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
150 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
151 if (obj instanceof Call && super.equals(obj)) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
152 Call that = (Call) obj; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
153 if (this.size == that.size && this.direct == that.direct && Objects.equals(this.target, that.target)) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
154 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
155 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
156 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
157 return false; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
158 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
159 |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
160 @Override |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
161 public String toString() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
162 StringBuilder sb = new StringBuilder(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
163 sb.append(pcOffset); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
164 sb.append('['); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
165 sb.append(target); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
166 sb.append(']'); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
167 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
168 if (debugInfo != null) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
169 appendDebugInfo(sb, debugInfo); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
170 } |
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 return sb.toString(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
173 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
174 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
175 |
13588
8aee7169dbe4
Improve documentation of data section building code.
Roland Schatz <roland.schatz@oracle.com>
parents:
13576
diff
changeset
|
176 /** |
8aee7169dbe4
Improve documentation of data section building code.
Roland Schatz <roland.schatz@oracle.com>
parents:
13576
diff
changeset
|
177 * Represents some external data that is referenced by the code. |
8aee7169dbe4
Improve documentation of data section building code.
Roland Schatz <roland.schatz@oracle.com>
parents:
13576
diff
changeset
|
178 */ |
21411
082417ac43e4
removed com.oracle.graal.hotspot.server and uses of Serializable it depended upon (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
19795
diff
changeset
|
179 public abstract static class Reference { |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
180 |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
181 @Override |
18352
8904705ea4a8
implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents:
18342
diff
changeset
|
182 public abstract int hashCode(); |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
183 |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
184 @Override |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
185 public abstract boolean equals(Object obj); |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
12517
diff
changeset
|
186 } |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
12517
diff
changeset
|
187 |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
188 public static final class ConstantReference extends Reference { |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
189 |
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
190 private final VMConstant constant; |
14736
5ba874df3b2b
Introduce base class ConstantData
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14562
diff
changeset
|
191 |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
192 public ConstantReference(VMConstant constant) { |
14736
5ba874df3b2b
Introduce base class ConstantData
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14562
diff
changeset
|
193 this.constant = constant; |
5ba874df3b2b
Introduce base class ConstantData
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14562
diff
changeset
|
194 } |
5ba874df3b2b
Introduce base class ConstantData
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14562
diff
changeset
|
195 |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
196 public VMConstant getConstant() { |
14736
5ba874df3b2b
Introduce base class ConstantData
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14562
diff
changeset
|
197 return constant; |
5ba874df3b2b
Introduce base class ConstantData
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14562
diff
changeset
|
198 } |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
12517
diff
changeset
|
199 |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
12517
diff
changeset
|
200 @Override |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
12517
diff
changeset
|
201 public String toString() { |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
202 return constant.toString(); |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
12517
diff
changeset
|
203 } |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14559
diff
changeset
|
204 |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14559
diff
changeset
|
205 @Override |
18352
8904705ea4a8
implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents:
18342
diff
changeset
|
206 public int hashCode() { |
8904705ea4a8
implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents:
18342
diff
changeset
|
207 return constant.hashCode(); |
8904705ea4a8
implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents:
18342
diff
changeset
|
208 } |
8904705ea4a8
implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents:
18342
diff
changeset
|
209 |
8904705ea4a8
implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents:
18342
diff
changeset
|
210 @Override |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14559
diff
changeset
|
211 public boolean equals(Object obj) { |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14559
diff
changeset
|
212 if (this == obj) { |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14559
diff
changeset
|
213 return true; |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14559
diff
changeset
|
214 } |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
215 if (obj instanceof ConstantReference) { |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
216 ConstantReference that = (ConstantReference) obj; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
217 return Objects.equals(this.constant, that.constant); |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14559
diff
changeset
|
218 } |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
219 return false; |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14559
diff
changeset
|
220 } |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
12517
diff
changeset
|
221 } |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
12517
diff
changeset
|
222 |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
223 public static final class DataSectionReference extends Reference { |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
12517
diff
changeset
|
224 |
18935
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18499
diff
changeset
|
225 private boolean initialized; |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
226 private int offset; |
13676
f30814642122
Tightly pack data references that are smaller than 8 bytes.
Roland Schatz <roland.schatz@oracle.com>
parents:
13630
diff
changeset
|
227 |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
228 public DataSectionReference() { |
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
229 // will be set after the data section layout is fixed |
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
230 offset = 0xDEADDEAD; |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
12517
diff
changeset
|
231 } |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
12517
diff
changeset
|
232 |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
233 public int getOffset() { |
18935
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18499
diff
changeset
|
234 assert initialized; |
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18499
diff
changeset
|
235 |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
236 return offset; |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
12517
diff
changeset
|
237 } |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14559
diff
changeset
|
238 |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
239 public void setOffset(int offset) { |
18935
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18499
diff
changeset
|
240 assert !initialized; |
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18499
diff
changeset
|
241 initialized = true; |
07f2a49f0bfb
Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18499
diff
changeset
|
242 |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
243 this.offset = offset; |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14559
diff
changeset
|
244 } |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
245 |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
246 @Override |
18352
8904705ea4a8
implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents:
18342
diff
changeset
|
247 public int hashCode() { |
8904705ea4a8
implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents:
18342
diff
changeset
|
248 return offset; |
8904705ea4a8
implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents:
18342
diff
changeset
|
249 } |
8904705ea4a8
implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents:
18342
diff
changeset
|
250 |
8904705ea4a8
implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents:
18342
diff
changeset
|
251 @Override |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
252 public boolean equals(Object obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
253 if (this == obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
254 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
255 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
256 if (obj instanceof DataSectionReference) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
257 DataSectionReference that = (DataSectionReference) obj; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
258 return this.offset == that.offset; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
259 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
260 return false; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
261 } |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
12517
diff
changeset
|
262 } |
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
12517
diff
changeset
|
263 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
264 /** |
13588
8aee7169dbe4
Improve documentation of data section building code.
Roland Schatz <roland.schatz@oracle.com>
parents:
13576
diff
changeset
|
265 * Represents a code site that references some data. The associated data can be either a |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
266 * {@link DataSectionReference reference} to the data section, or it may be an inlined |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18176
diff
changeset
|
267 * {@link JavaConstant} that needs to be patched. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
268 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
269 public static final class DataPatch extends Site { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
270 |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
271 public Reference reference; |
10810
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
9807
diff
changeset
|
272 |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
273 public DataPatch(int pcOffset, Reference reference) { |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
14559
diff
changeset
|
274 super(pcOffset); |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
275 this.reference = reference; |
10861
6872c61c1d3e
Fix null reference access when dumping raw data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
10834
diff
changeset
|
276 } |
6872c61c1d3e
Fix null reference access when dumping raw data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
10834
diff
changeset
|
277 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
278 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
279 public String toString() { |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
280 return String.format("%d[<data patch referring to %s>]", pcOffset, reference.toString()); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
281 } |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
282 |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
283 @Override |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
284 public boolean equals(Object obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
285 if (this == obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
286 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
287 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
288 if (obj instanceof DataPatch) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
289 DataPatch that = (DataPatch) obj; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
290 if (this.pcOffset == that.pcOffset && Objects.equals(this.reference, that.reference)) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
291 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
292 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
293 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
294 return false; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
295 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
296 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
297 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
298 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
299 * Provides extra information about instructions or data at specific positions in |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
300 * {@link CompilationResult#getTargetCode()}. This is optional information that can be used to |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
301 * enhance a disassembly of the code. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
302 */ |
21411
082417ac43e4
removed com.oracle.graal.hotspot.server and uses of Serializable it depended upon (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
19795
diff
changeset
|
303 public abstract static class CodeAnnotation { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
304 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
305 public final int position; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
306 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
307 public CodeAnnotation(int position) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
308 this.position = position; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
309 } |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
310 |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
311 @Override |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
312 public final int hashCode() { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
313 throw new UnsupportedOperationException("hashCode"); |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
314 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
315 |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
316 @Override |
18499
bd74da0a76f3
implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18352
diff
changeset
|
317 public String toString() { |
bd74da0a76f3
implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18352
diff
changeset
|
318 return identityHashCodeString(this); |
bd74da0a76f3
implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18352
diff
changeset
|
319 } |
bd74da0a76f3
implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18352
diff
changeset
|
320 |
bd74da0a76f3
implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18352
diff
changeset
|
321 @Override |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
322 public abstract boolean equals(Object obj); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
323 } |
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 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
326 * A string comment about one or more instructions at a specific position in the code. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
327 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
328 public static final class CodeComment extends CodeAnnotation { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
329 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
330 public final String value; |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
331 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
332 public CodeComment(int position, String comment) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
333 super(position); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
334 this.value = comment; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
335 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
336 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
337 @Override |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
338 public boolean equals(Object obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
339 if (this == obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
340 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
341 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
342 if (obj instanceof CodeComment) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
343 CodeComment that = (CodeComment) obj; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
344 if (this.position == that.position && this.value.equals(that.value)) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
345 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
346 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
347 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
348 return false; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
349 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
350 |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
351 @Override |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
352 public String toString() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
353 return getClass().getSimpleName() + "@" + position + ": " + value; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
354 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
355 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
356 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
357 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
358 * Describes a table of signed offsets embedded in the code. The offsets are relative to the |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
359 * starting address of the table. This type of table maybe generated when translating a |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
360 * multi-way branch based on a key value from a dense value set (e.g. the {@code tableswitch} |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
361 * JVM instruction). |
15176
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
362 * |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
363 * The table is indexed by the contiguous range of integers from {@link #low} to {@link #high} |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
364 * inclusive. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
365 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
366 public static final class JumpTable extends CodeAnnotation { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
367 |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
368 /** |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
369 * The low value in the key range (inclusive). |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
370 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
371 public final int low; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
372 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
373 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
374 * The high value in the key range (inclusive). |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
375 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
376 public final int high; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
377 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
378 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
379 * The size (in bytes) of each table entry. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
380 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
381 public final int entrySize; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
382 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
383 public JumpTable(int position, int low, int high, int entrySize) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
384 super(position); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
385 this.low = low; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
386 this.high = high; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
387 this.entrySize = entrySize; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
388 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
389 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
390 @Override |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
391 public boolean equals(Object obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
392 if (this == obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
393 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
394 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
395 if (obj instanceof JumpTable) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
396 JumpTable that = (JumpTable) obj; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
397 if (this.position == that.position && this.entrySize == that.entrySize && this.low == that.low && this.high == that.high) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
398 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
399 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
400 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
401 return false; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
402 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
403 |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
404 @Override |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
405 public String toString() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
406 return getClass().getSimpleName() + "@" + position + ": [" + low + " .. " + high + "]"; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
407 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
408 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
409 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
410 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
411 * Represents exception handler information for a specific code position. It includes the catch |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
412 * code position as well as the caught exception type. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
413 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
414 public static final class ExceptionHandler extends Site { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
415 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
416 public final int handlerPos; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
417 |
4693
07bcee8b70a4
Simplify exception debug information and exception handler table creation based on Graal's simplified model of exception handler information (i.e. the dispatch is done in compiled code).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4199
diff
changeset
|
418 ExceptionHandler(int pcOffset, int handlerPos) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
419 super(pcOffset); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
420 this.handlerPos = handlerPos; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
421 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
422 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
423 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
424 public String toString() { |
4693
07bcee8b70a4
Simplify exception debug information and exception handler table creation based on Graal's simplified model of exception handler information (i.e. the dispatch is done in compiled code).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4199
diff
changeset
|
425 return String.format("%d[<exception edge to %d>]", pcOffset, handlerPos); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
426 } |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
427 |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
428 @Override |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
429 public boolean equals(Object obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
430 if (this == obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
431 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
432 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
433 if (obj instanceof ExceptionHandler) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
434 ExceptionHandler that = (ExceptionHandler) obj; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
435 if (this.pcOffset == that.pcOffset && this.handlerPos == that.handlerPos) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
436 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
437 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
438 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
439 return false; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
440 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
441 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
442 |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5719
diff
changeset
|
443 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
444 * Represents a mark in the machine code that can be used by the runtime for its own purposes. A |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
445 * mark can reference other marks. |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5719
diff
changeset
|
446 */ |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
447 public static final class Mark extends Site { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
448 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
449 public final Object id; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
450 |
15375
1b82cd9e72e9
Remove CompilationResult.Mark.references
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15180
diff
changeset
|
451 public Mark(int pcOffset, Object id) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
452 super(pcOffset); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
453 this.id = id; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
454 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
455 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
456 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
457 public String toString() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
458 if (id == null) { |
15375
1b82cd9e72e9
Remove CompilationResult.Mark.references
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15180
diff
changeset
|
459 return String.format("%d[<mar>]", pcOffset); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
460 } else if (id instanceof Integer) { |
15375
1b82cd9e72e9
Remove CompilationResult.Mark.references
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15180
diff
changeset
|
461 return String.format("%d[<mark with id %s>]", pcOffset, Integer.toHexString((Integer) id)); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
462 } else { |
15375
1b82cd9e72e9
Remove CompilationResult.Mark.references
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15180
diff
changeset
|
463 return String.format("%d[<mark with id %s>]", pcOffset, id.toString()); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
464 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
465 } |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
466 |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
467 @Override |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
468 public boolean equals(Object obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
469 if (this == obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
470 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
471 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
472 if (obj instanceof Mark) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
473 Mark that = (Mark) obj; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
474 if (this.pcOffset == that.pcOffset && Objects.equals(this.id, that.id)) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
475 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
476 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
477 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
478 return false; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
479 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
480 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
481 |
13630
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
482 private int id = -1; |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
483 private int entryBCI = -1; |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
484 |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
485 private final DataSection dataSection = new DataSection(); |
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
486 |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
487 private final List<Infopoint> infopoints = new ArrayList<>(); |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
488 private final List<DataPatch> dataPatches = new ArrayList<>(); |
5552
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
489 private final List<ExceptionHandler> exceptionHandlers = new ArrayList<>(); |
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
490 private final List<Mark> marks = new ArrayList<>(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
491 |
15180
7a9531f50cd8
renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents:
15176
diff
changeset
|
492 private int totalFrameSize = -1; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
493 private int customStackAreaOffset = -1; |
6698
f5715c5a106a
Make CalleeSaveLayout available in CompilationResult
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6658
diff
changeset
|
494 |
12517
b2882f4ab612
Add an optional name to HotSpotNmethod. Print it during deopt. Use it when installing a Truffle compilation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10861
diff
changeset
|
495 private final String name; |
b2882f4ab612
Add an optional name to HotSpotNmethod. Print it during deopt. Use it when installing a Truffle compilation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10861
diff
changeset
|
496 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
497 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
498 * The buffer containing the emitted machine code. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
499 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
500 private byte[] targetCode; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
501 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
502 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
503 * The leading number of bytes in {@link #targetCode} containing the emitted machine code. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
504 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
505 private int targetCodeSize; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
506 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
507 private ArrayList<CodeAnnotation> annotations; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
508 |
19251
063e8873bd14
changed type of assumptions field in CompilationResult from Assumptions to Assumption[]
Doug Simon <doug.simon@oracle.com>
parents:
19189
diff
changeset
|
509 private Assumption[] assumptions; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
510 |
19306
a0a760b0fb5f
pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
19257
diff
changeset
|
511 /** |
19346
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
512 * The list of the methods whose bytecodes were used as input to the compilation. If |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
513 * {@code null}, then the compilation did not record method dependencies. Otherwise, the first |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
514 * element of this array is the root method of the compilation. |
19306
a0a760b0fb5f
pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
19257
diff
changeset
|
515 */ |
a0a760b0fb5f
pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
19257
diff
changeset
|
516 private ResolvedJavaMethod[] methods; |
a0a760b0fb5f
pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
19257
diff
changeset
|
517 |
12517
b2882f4ab612
Add an optional name to HotSpotNmethod. Print it during deopt. Use it when installing a Truffle compilation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10861
diff
changeset
|
518 public CompilationResult() { |
b2882f4ab612
Add an optional name to HotSpotNmethod. Print it during deopt. Use it when installing a Truffle compilation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10861
diff
changeset
|
519 this(null); |
b2882f4ab612
Add an optional name to HotSpotNmethod. Print it during deopt. Use it when installing a Truffle compilation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10861
diff
changeset
|
520 } |
b2882f4ab612
Add an optional name to HotSpotNmethod. Print it during deopt. Use it when installing a Truffle compilation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10861
diff
changeset
|
521 |
b2882f4ab612
Add an optional name to HotSpotNmethod. Print it during deopt. Use it when installing a Truffle compilation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10861
diff
changeset
|
522 public CompilationResult(String name) { |
b2882f4ab612
Add an optional name to HotSpotNmethod. Print it during deopt. Use it when installing a Truffle compilation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10861
diff
changeset
|
523 this.name = name; |
b2882f4ab612
Add an optional name to HotSpotNmethod. Print it during deopt. Use it when installing a Truffle compilation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10861
diff
changeset
|
524 } |
b2882f4ab612
Add an optional name to HotSpotNmethod. Print it during deopt. Use it when installing a Truffle compilation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10861
diff
changeset
|
525 |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
526 @Override |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
527 public int hashCode() { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
528 // CompilationResult instances should not be used as hash map keys |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
529 throw new UnsupportedOperationException("hashCode"); |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
530 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
531 |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
532 @Override |
18499
bd74da0a76f3
implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18352
diff
changeset
|
533 public String toString() { |
19346
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
534 if (methods != null) { |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
535 return getClass().getName() + "[" + methods[0].format("%H.%n(%p)%r") + "]"; |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
536 } |
18499
bd74da0a76f3
implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18352
diff
changeset
|
537 return identityHashCodeString(this); |
bd74da0a76f3
implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18352
diff
changeset
|
538 } |
bd74da0a76f3
implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18352
diff
changeset
|
539 |
bd74da0a76f3
implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18352
diff
changeset
|
540 @Override |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
541 public boolean equals(Object obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
542 if (this == obj) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
543 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
544 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
545 if (obj != null && obj.getClass() == getClass()) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
546 CompilationResult that = (CompilationResult) obj; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
547 // @formatter:off |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
548 if (this.entryBCI == that.entryBCI && |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
549 this.id == that.id && |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
550 this.customStackAreaOffset == that.customStackAreaOffset && |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
551 this.totalFrameSize == that.totalFrameSize && |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
552 this.targetCodeSize == that.targetCodeSize && |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
553 Objects.equals(this.name, that.name) && |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
554 Objects.equals(this.annotations, that.annotations) && |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
555 Objects.equals(this.dataSection, that.dataSection) && |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
556 Objects.equals(this.exceptionHandlers, that.exceptionHandlers) && |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
557 Objects.equals(this.dataPatches, that.dataPatches) && |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
558 Objects.equals(this.infopoints, that.infopoints) && |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
559 Objects.equals(this.marks, that.marks) && |
19257 | 560 Arrays.equals(this.assumptions, that.assumptions) && |
18342
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
561 Arrays.equals(targetCode, that.targetCode)) { |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
562 return true; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
563 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
564 // @formatter:on |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
565 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
566 return false; |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
567 } |
d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents:
18252
diff
changeset
|
568 |
13630
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
569 /** |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
570 * @return the compile id |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
571 */ |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
572 public int getId() { |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
573 return id; |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
574 } |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
575 |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
576 /** |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
577 * @param id the compile id to set |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
578 */ |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
579 public void setId(int id) { |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
580 this.id = id; |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
581 } |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
582 |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
583 /** |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
584 * @return the entryBCI |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
585 */ |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
586 public int getEntryBCI() { |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
587 return entryBCI; |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
588 } |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
589 |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
590 /** |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
591 * @param entryBCI the entryBCI to set |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
592 */ |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
593 public void setEntryBCI(int entryBCI) { |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
594 this.entryBCI = entryBCI; |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
595 } |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
596 |
19306
a0a760b0fb5f
pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
19257
diff
changeset
|
597 /** |
a0a760b0fb5f
pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
19257
diff
changeset
|
598 * Sets the assumptions made during compilation. |
a0a760b0fb5f
pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
19257
diff
changeset
|
599 */ |
19255
131fb3dd493b
removed unnecessary use of an Assumptions object
Doug Simon <doug.simon@oracle.com>
parents:
19251
diff
changeset
|
600 public void setAssumptions(Assumption[] assumptions) { |
131fb3dd493b
removed unnecessary use of an Assumptions object
Doug Simon <doug.simon@oracle.com>
parents:
19251
diff
changeset
|
601 this.assumptions = assumptions; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
602 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
603 |
19251
063e8873bd14
changed type of assumptions field in CompilationResult from Assumptions to Assumption[]
Doug Simon <doug.simon@oracle.com>
parents:
19189
diff
changeset
|
604 /** |
21506
5cbaf1e9ff2e
Remove reference to CompilationResult from HotSpotCompiledCode.
Roland Schatz <roland.schatz@oracle.com>
parents:
21411
diff
changeset
|
605 * Gets the assumptions made during compilation. |
19251
063e8873bd14
changed type of assumptions field in CompilationResult from Assumptions to Assumption[]
Doug Simon <doug.simon@oracle.com>
parents:
19189
diff
changeset
|
606 */ |
21506
5cbaf1e9ff2e
Remove reference to CompilationResult from HotSpotCompiledCode.
Roland Schatz <roland.schatz@oracle.com>
parents:
21411
diff
changeset
|
607 public Assumption[] getAssumptions() { |
5cbaf1e9ff2e
Remove reference to CompilationResult from HotSpotCompiledCode.
Roland Schatz <roland.schatz@oracle.com>
parents:
21411
diff
changeset
|
608 return assumptions; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
609 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
610 |
19306
a0a760b0fb5f
pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
19257
diff
changeset
|
611 /** |
a0a760b0fb5f
pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
19257
diff
changeset
|
612 * Sets the methods whose bytecodes were used as input to the compilation. |
19346
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
613 * |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
614 * @param rootMethod the root method of the compilation |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
615 * @param inlinedMethods the methods inlined during compilation |
19306
a0a760b0fb5f
pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
19257
diff
changeset
|
616 */ |
19346
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
617 public void setMethods(ResolvedJavaMethod rootMethod, Collection<ResolvedJavaMethod> inlinedMethods) { |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
618 assert rootMethod != null; |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
619 assert inlinedMethods != null; |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
620 if (inlinedMethods.contains(rootMethod)) { |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
621 methods = inlinedMethods.toArray(new ResolvedJavaMethod[inlinedMethods.size()]); |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
622 for (int i = 0; i < methods.length; i++) { |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
623 if (methods[i].equals(rootMethod)) { |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
624 if (i != 0) { |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
625 ResolvedJavaMethod tmp = methods[0]; |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
626 methods[0] = methods[i]; |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
627 methods[i] = tmp; |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
628 } |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
629 break; |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
630 } |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
631 } |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
632 } else { |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
633 methods = new ResolvedJavaMethod[1 + inlinedMethods.size()]; |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
634 methods[0] = rootMethod; |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
635 int i = 1; |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
636 for (ResolvedJavaMethod m : inlinedMethods) { |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
637 methods[i++] = m; |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
638 } |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
639 } |
19306
a0a760b0fb5f
pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
19257
diff
changeset
|
640 } |
a0a760b0fb5f
pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
19257
diff
changeset
|
641 |
a0a760b0fb5f
pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
19257
diff
changeset
|
642 /** |
21506
5cbaf1e9ff2e
Remove reference to CompilationResult from HotSpotCompiledCode.
Roland Schatz <roland.schatz@oracle.com>
parents:
21411
diff
changeset
|
643 * Gets the methods whose bytecodes were used as input to the compilation. |
19346
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
644 * |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
645 * @return {@code null} if the compilation did not record method dependencies otherwise the |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
646 * methods whose bytecodes were used as input to the compilation with the first element |
2b392a92e27b
made it explicit that a StructuredGraph only records method dependencies for inlined methods - the root method is not recorded as it is already available in the 'method' field
Doug Simon <doug.simon@oracle.com>
parents:
19306
diff
changeset
|
647 * being the root method of the compilation |
19306
a0a760b0fb5f
pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
19257
diff
changeset
|
648 */ |
21506
5cbaf1e9ff2e
Remove reference to CompilationResult from HotSpotCompiledCode.
Roland Schatz <roland.schatz@oracle.com>
parents:
21411
diff
changeset
|
649 public ResolvedJavaMethod[] getMethods() { |
5cbaf1e9ff2e
Remove reference to CompilationResult from HotSpotCompiledCode.
Roland Schatz <roland.schatz@oracle.com>
parents:
21411
diff
changeset
|
650 return methods; |
19306
a0a760b0fb5f
pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
19257
diff
changeset
|
651 } |
a0a760b0fb5f
pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents:
19257
diff
changeset
|
652 |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
653 public DataSection getDataSection() { |
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
654 return dataSection; |
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
655 } |
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
656 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
657 /** |
15180
7a9531f50cd8
renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents:
15176
diff
changeset
|
658 * The total frame size of the method in bytes. This includes the return address pushed onto the |
15176
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
659 * stack, if any. |
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
660 * |
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
661 * @return the frame size |
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
662 */ |
15180
7a9531f50cd8
renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents:
15176
diff
changeset
|
663 public int getTotalFrameSize() { |
7a9531f50cd8
renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents:
15176
diff
changeset
|
664 assert totalFrameSize != -1 : "frame size not yet initialized!"; |
7a9531f50cd8
renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents:
15176
diff
changeset
|
665 return totalFrameSize; |
15176
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
666 } |
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
667 |
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
668 /** |
15180
7a9531f50cd8
renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents:
15176
diff
changeset
|
669 * Sets the total frame size in bytes. This includes the return address pushed onto the stack, |
7a9531f50cd8
renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents:
15176
diff
changeset
|
670 * if any. |
15176
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
671 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
672 * @param size the size of the frame in bytes |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
673 */ |
15180
7a9531f50cd8
renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents:
15176
diff
changeset
|
674 public void setTotalFrameSize(int size) { |
7a9531f50cd8
renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents:
15176
diff
changeset
|
675 totalFrameSize = size; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
676 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
677 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
678 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
679 * Sets the machine that has been generated by the compiler. |
15176
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
680 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
681 * @param code the machine code generated |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
682 * @param size the size of the machine code |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
683 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
684 public void setTargetCode(byte[] code, int size) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
685 targetCode = code; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
686 targetCodeSize = size; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
687 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
688 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
689 /** |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
690 * Records a data patch in the code section. The data patch can refer to something in the |
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
691 * {@link DataSectionReference data section} or directly to an {@link ConstantReference inlined |
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
692 * constant}. |
15176
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
693 * |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
694 * @param codePos The position in the code that needs to be patched. |
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
695 * @param ref The reference that should be inserted in the code. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
696 */ |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
697 public void recordDataPatch(int codePos, Reference ref) { |
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
698 assert codePos >= 0 && ref != null; |
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
699 dataPatches.add(new DataPatch(codePos, ref)); |
10810
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
9807
diff
changeset
|
700 } |
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
9807
diff
changeset
|
701 |
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
9807
diff
changeset
|
702 /** |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
703 * Records a call in the code array. |
15176
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
704 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
705 * @param codePos the position of the call in the code array |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
706 * @param size the size of the call instruction |
7814
bab2a51f8dbe
Introduce marker interface InvokeTarget. Remove method lookupRuntimeCall from CodeCacheProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7660
diff
changeset
|
707 * @param target the being called |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
708 * @param debugInfo the debug info for the call |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
709 * @param direct specifies if this is a {@linkplain Call#direct direct} call |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
710 */ |
7814
bab2a51f8dbe
Introduce marker interface InvokeTarget. Remove method lookupRuntimeCall from CodeCacheProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7660
diff
changeset
|
711 public void recordCall(int codePos, int size, InvokeTarget target, DebugInfo debugInfo, boolean direct) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
712 final Call call = new Call(target, codePos, size, direct, debugInfo); |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
713 addInfopoint(call); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
714 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
715 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
716 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
717 * Records an exception handler for this method. |
15176
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
718 * |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
719 * @param codePos the position in the code that is covered by the handler |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6996
diff
changeset
|
720 * @param handlerPos the position of the handler |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
721 */ |
4693
07bcee8b70a4
Simplify exception debug information and exception handler table creation based on Graal's simplified model of exception handler information (i.e. the dispatch is done in compiled code).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4199
diff
changeset
|
722 public void recordExceptionHandler(int codePos, int handlerPos) { |
19189
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
723 assert validateExceptionHandlerAdd(codePos, handlerPos) : String.format("Duplicate exception handler for pc 0x%x handlerPos 0x%x", codePos, handlerPos); |
9300
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
724 exceptionHandlers.add(new ExceptionHandler(codePos, handlerPos)); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
725 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
726 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
727 /** |
19189
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
728 * Validate if the exception handler for codePos already exists and handlerPos is different. |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
729 * |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
730 * @param codePos |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
731 * @param handlerPos |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
732 * @return true if the validation is successful |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
733 */ |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
734 private boolean validateExceptionHandlerAdd(int codePos, int handlerPos) { |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
735 ExceptionHandler exHandler = getExceptionHandlerForCodePos(codePos); |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
736 return exHandler == null || exHandler.handlerPos == handlerPos; |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
737 } |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
738 |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
739 /** |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
740 * Returns the first ExceptionHandler which matches codePos. |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
741 * |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
742 * @param codePos position to search for |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
743 * @return first matching ExceptionHandler |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
744 */ |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
745 private ExceptionHandler getExceptionHandlerForCodePos(int codePos) { |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
746 for (ExceptionHandler h : exceptionHandlers) { |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
747 if (h.pcOffset == codePos) { |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
748 return h; |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
749 } |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
750 } |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
751 return null; |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
752 } |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
753 |
7ebed83df427
[SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18935
diff
changeset
|
754 /** |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
755 * Records an infopoint in the code array. |
15176
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
756 * |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
757 * @param codePos the position of the infopoint in the code array |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
758 * @param debugInfo the debug info for the infopoint |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
759 */ |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
760 public void recordInfopoint(int codePos, DebugInfo debugInfo, InfopointReason reason) { |
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
761 addInfopoint(new Infopoint(codePos, debugInfo, reason)); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
762 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
763 |
14758
c612c2742a4f
extend graph builder and CompilationResult for substrateVM
Erik Eckstein <erik.eckstein@oracle.com>
parents:
14736
diff
changeset
|
764 /** |
c612c2742a4f
extend graph builder and CompilationResult for substrateVM
Erik Eckstein <erik.eckstein@oracle.com>
parents:
14736
diff
changeset
|
765 * Records a custom infopoint in the code section. |
15176
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
766 * |
14758
c612c2742a4f
extend graph builder and CompilationResult for substrateVM
Erik Eckstein <erik.eckstein@oracle.com>
parents:
14736
diff
changeset
|
767 * Compiler implementations can use this method to record non-standard infopoints, which are not |
c612c2742a4f
extend graph builder and CompilationResult for substrateVM
Erik Eckstein <erik.eckstein@oracle.com>
parents:
14736
diff
changeset
|
768 * handled by the dedicated methods like {@link #recordCall}. |
15176
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
769 * |
14758
c612c2742a4f
extend graph builder and CompilationResult for substrateVM
Erik Eckstein <erik.eckstein@oracle.com>
parents:
14736
diff
changeset
|
770 * @param infopoint the infopoint to record, usually a derived class from {@link Infopoint} |
c612c2742a4f
extend graph builder and CompilationResult for substrateVM
Erik Eckstein <erik.eckstein@oracle.com>
parents:
14736
diff
changeset
|
771 */ |
c612c2742a4f
extend graph builder and CompilationResult for substrateVM
Erik Eckstein <erik.eckstein@oracle.com>
parents:
14736
diff
changeset
|
772 public void addInfopoint(Infopoint infopoint) { |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
773 // The infopoints list must always be sorted |
16573
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15838
diff
changeset
|
774 if (!infopoints.isEmpty()) { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15838
diff
changeset
|
775 Infopoint previousInfopoint = infopoints.get(infopoints.size() - 1); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15838
diff
changeset
|
776 if (previousInfopoint.pcOffset > infopoint.pcOffset) { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15838
diff
changeset
|
777 // This re-sorting should be very rare |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15838
diff
changeset
|
778 Collections.sort(infopoints); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15838
diff
changeset
|
779 previousInfopoint = infopoints.get(infopoints.size() - 1); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15838
diff
changeset
|
780 } |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15838
diff
changeset
|
781 if (previousInfopoint.pcOffset == infopoint.pcOffset) { |
18252
ae8e86212c77
spelling fix: omited -> omitted
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
782 if (infopoint.reason.canBeOmitted()) { |
16573
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15838
diff
changeset
|
783 return; |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15838
diff
changeset
|
784 } |
18252
ae8e86212c77
spelling fix: omited -> omitted
Doug Simon <doug.simon@oracle.com>
parents:
18187
diff
changeset
|
785 if (previousInfopoint.reason.canBeOmitted()) { |
16573
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15838
diff
changeset
|
786 Infopoint removed = infopoints.remove(infopoints.size() - 1); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15838
diff
changeset
|
787 assert removed == previousInfopoint; |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15838
diff
changeset
|
788 } else { |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15838
diff
changeset
|
789 throw new RuntimeException("Infopoints that can not be omited should have distinct PCs"); |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15838
diff
changeset
|
790 } |
a2ec1ac769e4
Add simple infopoint nodes which do not contain debugging informations for values. Use them when shouldDebugNonSafepoints is true.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15838
diff
changeset
|
791 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
792 } |
9300
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
793 infopoints.add(infopoint); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
794 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
795 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
796 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
797 * Records an instruction mark within this method. |
15176
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
798 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
799 * @param codePos the position in the code that is covered by the handler |
13630
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13588
diff
changeset
|
800 * @param markId the identifier for this mark |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
801 */ |
15375
1b82cd9e72e9
Remove CompilationResult.Mark.references
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15180
diff
changeset
|
802 public Mark recordMark(int codePos, Object markId) { |
1b82cd9e72e9
Remove CompilationResult.Mark.references
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15180
diff
changeset
|
803 Mark mark = new Mark(codePos, markId); |
9300
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
804 marks.add(mark); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
805 return mark; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
806 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
807 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
808 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
809 * Offset in bytes for the custom stack area (relative to sp). |
15176
f24d578e63a9
changed com.oracle.graal.api.code.CompilationResult.getFrameSize() to include the return address size if return address is puhsed onto the stack
twisti
parents:
14991
diff
changeset
|
810 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
811 * @return the offset in bytes |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
812 */ |
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:
6329
diff
changeset
|
813 public int getCustomStackAreaOffset() { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
814 return customStackAreaOffset; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
815 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
816 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
817 /** |
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:
6329
diff
changeset
|
818 * @see #getCustomStackAreaOffset() |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
819 * @param offset |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
820 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
821 public void setCustomStackAreaOffset(int offset) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
822 customStackAreaOffset = offset; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
823 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
824 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
825 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
826 * @return the machine code generated for this method |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
827 */ |
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:
6329
diff
changeset
|
828 public byte[] getTargetCode() { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
829 return targetCode; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
830 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
831 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
832 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
833 * @return the size of the machine code generated for this method |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
834 */ |
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:
6329
diff
changeset
|
835 public int getTargetCodeSize() { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
836 return targetCodeSize; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
837 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
838 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
839 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
840 * @return the code annotations or {@code null} if there are none |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
841 */ |
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:
6329
diff
changeset
|
842 public List<CodeAnnotation> getAnnotations() { |
9807
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9336
diff
changeset
|
843 if (annotations == null) { |
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9336
diff
changeset
|
844 return Collections.emptyList(); |
d552919fbb05
Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents:
9336
diff
changeset
|
845 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
846 return annotations; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
847 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
848 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
849 public void addAnnotation(CodeAnnotation annotation) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
850 assert annotation != null; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
851 if (annotations == null) { |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
852 annotations = new ArrayList<>(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
853 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
854 annotations.add(annotation); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
855 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
856 |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5546
diff
changeset
|
857 private static void appendDebugInfo(StringBuilder sb, DebugInfo info) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
858 if (info != null) { |
13725
8d8732e14447
Refactor reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
13676
diff
changeset
|
859 ReferenceMap refMap = info.getReferenceMap(); |
8d8732e14447
Refactor reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
13676
diff
changeset
|
860 if (refMap != null) { |
14562
45812e05cdb3
Move narrow oop handling in reference maps to hotspot specific code.
Roland Schatz <roland.schatz@oracle.com>
parents:
14561
diff
changeset
|
861 RefMapFormatter formatter = new CodeUtil.NumberedRefMapFormatter(); |
13725
8d8732e14447
Refactor reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
13676
diff
changeset
|
862 if (refMap.hasFrameRefMap()) { |
8d8732e14447
Refactor reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
13676
diff
changeset
|
863 sb.append(" stackMap["); |
14562
45812e05cdb3
Move narrow oop handling in reference maps to hotspot specific code.
Roland Schatz <roland.schatz@oracle.com>
parents:
14561
diff
changeset
|
864 refMap.appendFrameMap(sb, formatter); |
13725
8d8732e14447
Refactor reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
13676
diff
changeset
|
865 sb.append(']'); |
8d8732e14447
Refactor reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
13676
diff
changeset
|
866 } |
8d8732e14447
Refactor reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
13676
diff
changeset
|
867 if (refMap.hasRegisterRefMap()) { |
8d8732e14447
Refactor reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
13676
diff
changeset
|
868 sb.append(" registerMap["); |
14562
45812e05cdb3
Move narrow oop handling in reference maps to hotspot specific code.
Roland Schatz <roland.schatz@oracle.com>
parents:
14561
diff
changeset
|
869 refMap.appendRegisterMap(sb, formatter); |
13725
8d8732e14447
Refactor reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
13676
diff
changeset
|
870 sb.append(']'); |
8d8732e14447
Refactor reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
13676
diff
changeset
|
871 } |
8d8732e14447
Refactor reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents:
13676
diff
changeset
|
872 } |
9336
47e7933283f1
added support for adding callee save information to a DebugInfo (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9300
diff
changeset
|
873 RegisterSaveLayout calleeSaveInfo = info.getCalleeSaveInfo(); |
47e7933283f1
added support for adding callee save information to a DebugInfo (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9300
diff
changeset
|
874 if (calleeSaveInfo != null) { |
47e7933283f1
added support for adding callee save information to a DebugInfo (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9300
diff
changeset
|
875 sb.append(" callee-save-info["); |
47e7933283f1
added support for adding callee save information to a DebugInfo (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9300
diff
changeset
|
876 String sep = ""; |
47e7933283f1
added support for adding callee save information to a DebugInfo (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9300
diff
changeset
|
877 for (Map.Entry<Register, Integer> e : calleeSaveInfo.registersToSlots(true).entrySet()) { |
47e7933283f1
added support for adding callee save information to a DebugInfo (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9300
diff
changeset
|
878 sb.append(sep).append(e.getKey()).append("->").append(e.getValue()); |
47e7933283f1
added support for adding callee save information to a DebugInfo (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9300
diff
changeset
|
879 sep = ", "; |
47e7933283f1
added support for adding callee save information to a DebugInfo (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9300
diff
changeset
|
880 } |
47e7933283f1
added support for adding callee save information to a DebugInfo (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9300
diff
changeset
|
881 sb.append(']'); |
47e7933283f1
added support for adding callee save information to a DebugInfo (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9300
diff
changeset
|
882 } |
5552
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
883 BytecodePosition codePos = info.getBytecodePosition(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
884 if (codePos != null) { |
5719
429accae15aa
moved some methods from CodeUtil to MetaUtil
Doug Simon <doug.simon@oracle.com>
parents:
5711
diff
changeset
|
885 MetaUtil.appendLocation(sb.append(" "), codePos.getMethod(), codePos.getBCI()); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
886 if (info.hasFrame()) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
887 sb.append(" #locals=").append(info.frame().numLocals).append(" #expr=").append(info.frame().numStack); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
888 if (info.frame().numLocks > 0) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
889 sb.append(" #locks=").append(info.frame().numLocks); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
890 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
891 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
892 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
893 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
894 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
895 |
5552
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
896 /** |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
897 * @return the list of infopoints, sorted by {@link Site#pcOffset} |
5552
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
898 */ |
9003
a8fea2979e63
eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents:
7826
diff
changeset
|
899 public List<Infopoint> getInfopoints() { |
9300
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
900 if (infopoints.isEmpty()) { |
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
901 return emptyList(); |
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
902 } |
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
903 return unmodifiableList(infopoints); |
5552
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
904 } |
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
905 |
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
906 /** |
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
907 * @return the list of data references |
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
908 */ |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
909 public List<DataPatch> getDataPatches() { |
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
910 if (dataPatches.isEmpty()) { |
9300
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
911 return emptyList(); |
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
912 } |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
913 return unmodifiableList(dataPatches); |
5552
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
914 } |
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
915 |
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
916 /** |
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
917 * @return the list of exception handlers |
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
918 */ |
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
919 public List<ExceptionHandler> getExceptionHandlers() { |
9300
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
920 if (exceptionHandlers.isEmpty()) { |
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
921 return emptyList(); |
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
922 } |
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
923 return unmodifiableList(exceptionHandlers); |
5552
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
924 } |
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
925 |
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
926 /** |
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
927 * @return the list of marks |
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
928 */ |
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
929 public List<Mark> getMarks() { |
9300
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
930 if (marks.isEmpty()) { |
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
931 return emptyList(); |
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
932 } |
d73ad771a602
return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents:
9003
diff
changeset
|
933 return unmodifiableList(marks); |
5552
69a8969dbf40
Reduce public fields in api.code project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5547
diff
changeset
|
934 } |
12517
b2882f4ab612
Add an optional name to HotSpotNmethod. Print it during deopt. Use it when installing a Truffle compilation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10861
diff
changeset
|
935 |
b2882f4ab612
Add an optional name to HotSpotNmethod. Print it during deopt. Use it when installing a Truffle compilation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10861
diff
changeset
|
936 public String getName() { |
b2882f4ab612
Add an optional name to HotSpotNmethod. Print it during deopt. Use it when installing a Truffle compilation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10861
diff
changeset
|
937 return name; |
b2882f4ab612
Add an optional name to HotSpotNmethod. Print it during deopt. Use it when installing a Truffle compilation
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10861
diff
changeset
|
938 } |
17207
5a7b82c1514e
[SPARC] Add functionality to be able to do assembly in two passes (knowing offsets of forward branches)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
16573
diff
changeset
|
939 |
5a7b82c1514e
[SPARC] Add functionality to be able to do assembly in two passes (knowing offsets of forward branches)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
16573
diff
changeset
|
940 public void reset() { |
5a7b82c1514e
[SPARC] Add functionality to be able to do assembly in two passes (knowing offsets of forward branches)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
16573
diff
changeset
|
941 infopoints.clear(); |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17207
diff
changeset
|
942 dataPatches.clear(); |
17207
5a7b82c1514e
[SPARC] Add functionality to be able to do assembly in two passes (knowing offsets of forward branches)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
16573
diff
changeset
|
943 exceptionHandlers.clear(); |
5a7b82c1514e
[SPARC] Add functionality to be able to do assembly in two passes (knowing offsets of forward branches)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
16573
diff
changeset
|
944 marks.clear(); |
5a7b82c1514e
[SPARC] Add functionality to be able to do assembly in two passes (knowing offsets of forward branches)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
16573
diff
changeset
|
945 if (annotations != null) { |
5a7b82c1514e
[SPARC] Add functionality to be able to do assembly in two passes (knowing offsets of forward branches)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
16573
diff
changeset
|
946 annotations.clear(); |
5a7b82c1514e
[SPARC] Add functionality to be able to do assembly in two passes (knowing offsets of forward branches)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
16573
diff
changeset
|
947 } |
5a7b82c1514e
[SPARC] Add functionality to be able to do assembly in two passes (knowing offsets of forward branches)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
16573
diff
changeset
|
948 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
949 } |