annotate graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/CompilationResult.java @ 21780:3d15183f3c93

Introduce Compiler interface in jvmci. Use it from jvmci.hotspot.CompilationTask
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Wed, 03 Jun 2015 15:47:54 +0200
parents b9f9b8af17ff
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
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.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
31 import com.oracle.jvmci.meta.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
32
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
33 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6996
diff changeset
34 * 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
35 * 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
36 */
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: 19800
diff changeset
37 public class CompilationResult {
4142
bc8527f3071c Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3733
diff changeset
38
bc8527f3071c Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3733
diff changeset
39 /**
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
40 * Represents a code position with associated additional information.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41 */
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: 19800
diff changeset
42 public abstract static class Site {
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6996
diff changeset
43
4142
bc8527f3071c Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3733
diff changeset
44 /**
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
45 * 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
46 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47 public final int pcOffset;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
48
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
49 public Site(int pos) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
50 this.pcOffset = pos;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
51 }
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
52
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
53 @Override
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
54 public final int hashCode() {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
55 throw new UnsupportedOperationException("hashCode");
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
56 }
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 @Override
18499
bd74da0a76f3 implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 18352
diff changeset
59 public String toString() {
bd74da0a76f3 implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 18352
diff changeset
60 return identityHashCodeString(this);
bd74da0a76f3 implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 18352
diff changeset
61 }
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 @Override
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
64 public abstract boolean equals(Object obj);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
65 }
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 /**
9003
a8fea2979e63 eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents: 7826
diff changeset
68 * 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
69 */
9003
a8fea2979e63 eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents: 7826
diff changeset
70 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
71
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5546
diff changeset
72 public final DebugInfo debugInfo;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
73
9003
a8fea2979e63 eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents: 7826
diff changeset
74 public final InfopointReason reason;
a8fea2979e63 eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents: 7826
diff changeset
75
a8fea2979e63 eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents: 7826
diff changeset
76 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
77 super(pcOffset);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
78 this.debugInfo = debugInfo;
9003
a8fea2979e63 eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents: 7826
diff changeset
79 this.reason = reason;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
80 }
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 @Override
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
83 public String toString() {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
84 StringBuilder sb = new StringBuilder();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
85 sb.append(pcOffset);
9003
a8fea2979e63 eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents: 7826
diff changeset
86 sb.append("[<infopoint>]");
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
87 appendDebugInfo(sb, debugInfo);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
88 return sb.toString();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
89 }
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 @Override
9003
a8fea2979e63 eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents: 7826
diff changeset
92 public int compareTo(Infopoint o) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
93 if (pcOffset < o.pcOffset) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
94 return -1;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
95 } else if (pcOffset > o.pcOffset) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
96 return 1;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
97 }
9003
a8fea2979e63 eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents: 7826
diff changeset
98 return this.reason.compareTo(o.reason);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
99 }
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
100
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
101 @Override
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
102 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
103 if (this == obj) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
104 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
105 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
106 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
107 Infopoint that = (Infopoint) obj;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
108 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
109 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
110 }
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 return false;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
113 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
114 }
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 * Represents a call in the code.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
118 */
9003
a8fea2979e63 eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents: 7826
diff changeset
119 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
120
4142
bc8527f3071c Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3733
diff changeset
121 /**
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
122 * The target of the call.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
123 */
7814
bab2a51f8dbe Introduce marker interface InvokeTarget. Remove method lookupRuntimeCall from CodeCacheProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7660
diff changeset
124 public final InvokeTarget target;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
125
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
126 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
127 * The size of the call instruction.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
128 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
129 public final int size;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
130
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
131 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6996
diff changeset
132 * 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
133 * 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
134 * 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
135 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
136 public final boolean direct;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
137
7814
bab2a51f8dbe Introduce marker interface InvokeTarget. Remove method lookupRuntimeCall from CodeCacheProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7660
diff changeset
138 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
139 super(pcOffset, debugInfo, InfopointReason.CALL);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
140 this.size = size;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
141 this.target = target;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
142 this.direct = direct;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
143 }
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 @Override
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
146 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
147 if (this == obj) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
148 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
149 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
150 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
151 Call that = (Call) obj;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
152 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
153 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
154 }
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 return false;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
157 }
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 @Override
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
160 public String toString() {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
161 StringBuilder sb = new StringBuilder();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
162 sb.append(pcOffset);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
163 sb.append('[');
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
164 sb.append(target);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
165 sb.append(']');
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
166
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
167 if (debugInfo != null) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
168 appendDebugInfo(sb, debugInfo);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
169 }
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 return sb.toString();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
172 }
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
13588
8aee7169dbe4 Improve documentation of data section building code.
Roland Schatz <roland.schatz@oracle.com>
parents: 13576
diff changeset
175 /**
8aee7169dbe4 Improve documentation of data section building code.
Roland Schatz <roland.schatz@oracle.com>
parents: 13576
diff changeset
176 * 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
177 */
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: 19800
diff changeset
178 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
179
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
180 @Override
18352
8904705ea4a8 implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents: 18342
diff changeset
181 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
182
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
183 @Override
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
184 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
185 }
4e679d50ba9a Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents: 12517
diff changeset
186
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
187 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
188
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
189 private final VMConstant constant;
14736
5ba874df3b2b Introduce base class ConstantData
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14562
diff changeset
190
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
191 public ConstantReference(VMConstant constant) {
14736
5ba874df3b2b Introduce base class ConstantData
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14562
diff changeset
192 this.constant = constant;
5ba874df3b2b Introduce base class ConstantData
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14562
diff changeset
193 }
5ba874df3b2b Introduce base class ConstantData
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14562
diff changeset
194
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
195 public VMConstant getConstant() {
14736
5ba874df3b2b Introduce base class ConstantData
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14562
diff changeset
196 return constant;
5ba874df3b2b Introduce base class ConstantData
Christian Wimmer <christian.wimmer@oracle.com>
parents: 14562
diff changeset
197 }
13576
4e679d50ba9a Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents: 12517
diff changeset
198
4e679d50ba9a Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents: 12517
diff changeset
199 @Override
4e679d50ba9a Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents: 12517
diff changeset
200 public String toString() {
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
201 return constant.toString();
13576
4e679d50ba9a Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents: 12517
diff changeset
202 }
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14559
diff changeset
203
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14559
diff changeset
204 @Override
18352
8904705ea4a8 implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents: 18342
diff changeset
205 public int hashCode() {
8904705ea4a8 implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents: 18342
diff changeset
206 return constant.hashCode();
8904705ea4a8 implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents: 18342
diff changeset
207 }
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 @Override
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14559
diff changeset
210 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
211 if (this == obj) {
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14559
diff changeset
212 return true;
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14559
diff changeset
213 }
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
214 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
215 ConstantReference that = (ConstantReference) obj;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
216 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
217 }
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
218 return false;
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14559
diff changeset
219 }
13576
4e679d50ba9a Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents: 12517
diff changeset
220 }
4e679d50ba9a Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents: 12517
diff changeset
221
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
222 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
223
18935
07f2a49f0bfb Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents: 18499
diff changeset
224 private boolean initialized;
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
225 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
226
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
227 public DataSectionReference() {
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
228 // 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
229 offset = 0xDEADDEAD;
13576
4e679d50ba9a Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents: 12517
diff changeset
230 }
4e679d50ba9a Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents: 12517
diff changeset
231
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
232 public int getOffset() {
18935
07f2a49f0bfb Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents: 18499
diff changeset
233 assert initialized;
07f2a49f0bfb Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents: 18499
diff changeset
234
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
235 return offset;
13576
4e679d50ba9a Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents: 12517
diff changeset
236 }
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14559
diff changeset
237
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
238 public void setOffset(int offset) {
18935
07f2a49f0bfb Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents: 18499
diff changeset
239 assert !initialized;
07f2a49f0bfb Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents: 18499
diff changeset
240 initialized = true;
07f2a49f0bfb Various adjustments to simplify future merges
Paul Woegerer <paul.woegerer@oracle.com>
parents: 18499
diff changeset
241
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
242 this.offset = offset;
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 14559
diff changeset
243 }
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
244
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
245 @Override
18352
8904705ea4a8 implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents: 18342
diff changeset
246 public int hashCode() {
8904705ea4a8 implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents: 18342
diff changeset
247 return offset;
8904705ea4a8 implemented hashCode() for CompilationResult.Reference subclasses
Doug Simon <doug.simon@oracle.com>
parents: 18342
diff changeset
248 }
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 @Override
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
251 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
252 if (this == obj) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
253 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
254 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
255 if (obj instanceof DataSectionReference) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
256 DataSectionReference that = (DataSectionReference) obj;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
257 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
258 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
259 return false;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
260 }
13576
4e679d50ba9a Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents: 12517
diff changeset
261 }
4e679d50ba9a Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents: 12517
diff changeset
262
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
263 /**
13588
8aee7169dbe4 Improve documentation of data section building code.
Roland Schatz <roland.schatz@oracle.com>
parents: 13576
diff changeset
264 * 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
265 * {@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
266 * {@link JavaConstant} that needs to be patched.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
267 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
268 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
269
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
270 public Reference reference;
10810
4e1db4c9d4c5 Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents: 9807
diff changeset
271
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
272 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
273 super(pcOffset);
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
274 this.reference = reference;
10861
6872c61c1d3e Fix null reference access when dumping raw data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 10834
diff changeset
275 }
6872c61c1d3e Fix null reference access when dumping raw data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 10834
diff changeset
276
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
277 @Override
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
278 public String toString() {
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
279 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
280 }
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
281
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
282 @Override
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
283 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
284 if (this == obj) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
285 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
286 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
287 if (obj instanceof DataPatch) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
288 DataPatch that = (DataPatch) obj;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
289 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
290 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
291 }
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 return false;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
294 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
295 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
296
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
297 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6996
diff changeset
298 * 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
299 * {@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
300 * enhance a disassembly of the code.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
301 */
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: 19800
diff changeset
302 public abstract static class CodeAnnotation {
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6996
diff changeset
303
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
304 public final int position;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
305
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
306 public CodeAnnotation(int position) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
307 this.position = position;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
308 }
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
309
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
310 @Override
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
311 public final int hashCode() {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
312 throw new UnsupportedOperationException("hashCode");
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
313 }
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 @Override
18499
bd74da0a76f3 implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 18352
diff changeset
316 public String toString() {
bd74da0a76f3 implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 18352
diff changeset
317 return identityHashCodeString(this);
bd74da0a76f3 implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 18352
diff changeset
318 }
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 @Override
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
321 public abstract boolean equals(Object obj);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
322 }
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 * 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
326 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
327 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
328
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
329 public final String value;
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6996
diff changeset
330
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
331 public CodeComment(int position, String comment) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
332 super(position);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
333 this.value = comment;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
334 }
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 @Override
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
337 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
338 if (this == obj) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
339 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
340 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
341 if (obj instanceof CodeComment) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
342 CodeComment that = (CodeComment) obj;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
343 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
344 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
345 }
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 return false;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
348 }
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 @Override
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
351 public String toString() {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
352 return getClass().getSimpleName() + "@" + position + ": " + value;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
353 }
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 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6996
diff changeset
357 * 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
358 * 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
359 * 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
360 * 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
361 *
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6996
diff changeset
362 * 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
363 * inclusive.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
364 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
365 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
366
4142
bc8527f3071c Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3733
diff changeset
367 /**
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
368 * The low value in the key range (inclusive).
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
369 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
370 public final int low;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
371
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 * The high value in the key range (inclusive).
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
374 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
375 public final int high;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
376
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 * The size (in bytes) of each table entry.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
379 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
380 public final int entrySize;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
381
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
382 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
383 super(position);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
384 this.low = low;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
385 this.high = high;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
386 this.entrySize = entrySize;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
387 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
388
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
389 @Override
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
390 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
391 if (this == obj) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
392 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
393 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
394 if (obj instanceof JumpTable) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
395 JumpTable that = (JumpTable) obj;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
396 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
397 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
398 }
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 return false;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
401 }
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 @Override
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
404 public String toString() {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
405 return getClass().getSimpleName() + "@" + position + ": [" + low + " .. " + high + "]";
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
406 }
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 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6996
diff changeset
410 * 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
411 * 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
412 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
413 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
414
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
415 public final int handlerPos;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
416
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
417 ExceptionHandler(int pcOffset, int handlerPos) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
418 super(pcOffset);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
419 this.handlerPos = handlerPos;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
420 }
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 @Override
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
423 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
424 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
425 }
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
426
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
427 @Override
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
428 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
429 if (this == obj) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
430 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
431 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
432 if (obj instanceof ExceptionHandler) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
433 ExceptionHandler that = (ExceptionHandler) obj;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
434 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
435 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
436 }
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 return false;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
439 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
440 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
441
6329
92bc58dc5b5e More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5719
diff changeset
442 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6996
diff changeset
443 * 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
444 * 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
445 */
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
446 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
447
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
448 public final Object id;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
449
15375
1b82cd9e72e9 Remove CompilationResult.Mark.references
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15180
diff changeset
450 public Mark(int pcOffset, Object id) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
451 super(pcOffset);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
452 this.id = id;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
453 }
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 @Override
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
456 public String toString() {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
457 if (id == null) {
15375
1b82cd9e72e9 Remove CompilationResult.Mark.references
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15180
diff changeset
458 return String.format("%d[<mar>]", pcOffset);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
459 } else if (id instanceof Integer) {
15375
1b82cd9e72e9 Remove CompilationResult.Mark.references
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15180
diff changeset
460 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
461 } else {
15375
1b82cd9e72e9 Remove CompilationResult.Mark.references
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15180
diff changeset
462 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
463 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
464 }
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
465
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
466 @Override
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
467 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
468 if (this == obj) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
469 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
470 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
471 if (obj instanceof Mark) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
472 Mark that = (Mark) obj;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
473 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
474 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
475 }
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 return false;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
478 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
479 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
480
13630
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
481 private int id = -1;
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
482 private int entryBCI = -1;
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
483
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
484 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
485
9003
a8fea2979e63 eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents: 7826
diff changeset
486 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
487 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
488 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
489 private final List<Mark> marks = new ArrayList<>();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
490
15180
7a9531f50cd8 renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents: 15176
diff changeset
491 private int totalFrameSize = -1;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
492 private int customStackAreaOffset = -1;
6698
f5715c5a106a Make CalleeSaveLayout available in CompilationResult
Christian Wimmer <christian.wimmer@oracle.com>
parents: 6658
diff changeset
493
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
494 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
495
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
496 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
497 * The buffer containing the emitted machine code.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
498 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
499 private byte[] targetCode;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
500
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 * 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
503 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
504 private int targetCodeSize;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
505
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
506 private ArrayList<CodeAnnotation> annotations;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
507
19251
063e8873bd14 changed type of assumptions field in CompilationResult from Assumptions to Assumption[]
Doug Simon <doug.simon@oracle.com>
parents: 19189
diff changeset
508 private Assumption[] assumptions;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
509
19306
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19257
diff changeset
510 /**
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
511 * 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
512 * {@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
513 * 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
514 */
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19257
diff changeset
515 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
516
21780
3d15183f3c93 Introduce Compiler interface in jvmci. Use it from jvmci.hotspot.CompilationTask
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents: 21730
diff changeset
517 private int bytecodeSize;
3d15183f3c93 Introduce Compiler interface in jvmci. Use it from jvmci.hotspot.CompilationTask
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents: 21730
diff changeset
518
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
519 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
520 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
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
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 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
524 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
525 }
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
526
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
527 @Override
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
528 public int hashCode() {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
529 // 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
530 throw new UnsupportedOperationException("hashCode");
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
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
533 @Override
18499
bd74da0a76f3 implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 18352
diff changeset
534 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
535 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
536 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
537 }
18499
bd74da0a76f3 implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 18352
diff changeset
538 return identityHashCodeString(this);
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
bd74da0a76f3 implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 18352
diff changeset
541 @Override
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
542 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
543 if (this == obj) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
544 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
545 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
546 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
547 CompilationResult that = (CompilationResult) obj;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
548 // @formatter:off
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
549 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
550 this.id == that.id &&
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
551 this.customStackAreaOffset == that.customStackAreaOffset &&
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
552 this.totalFrameSize == that.totalFrameSize &&
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
553 this.targetCodeSize == that.targetCodeSize &&
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
554 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
555 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
556 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
557 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
558 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
559 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
560 Objects.equals(this.marks, that.marks) &&
19257
1283cea95ff5 fixed findbugs issue
Doug Simon <doug.simon@oracle.com>
parents: 19255
diff changeset
561 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
562 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
563 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
564 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
565 // @formatter:on
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
566 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
567 return false;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
568 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 18252
diff changeset
569
13630
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
570 /**
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
571 * @return the compile id
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
572 */
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
573 public int getId() {
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
574 return id;
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 /**
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
578 * @param id the compile id to set
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
579 */
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
580 public void setId(int id) {
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
581 this.id = id;
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 /**
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
585 * @return the entryBCI
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
586 */
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
587 public int getEntryBCI() {
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
588 return entryBCI;
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 /**
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
592 * @param entryBCI the entryBCI to set
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
593 */
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
594 public void setEntryBCI(int entryBCI) {
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
595 this.entryBCI = entryBCI;
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
596 }
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13588
diff changeset
597
19306
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19257
diff changeset
598 /**
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19257
diff changeset
599 * 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
600 */
19255
131fb3dd493b removed unnecessary use of an Assumptions object
Doug Simon <doug.simon@oracle.com>
parents: 19251
diff changeset
601 public void setAssumptions(Assumption[] assumptions) {
131fb3dd493b removed unnecessary use of an Assumptions object
Doug Simon <doug.simon@oracle.com>
parents: 19251
diff changeset
602 this.assumptions = assumptions;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
603 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
604
19251
063e8873bd14 changed type of assumptions field in CompilationResult from Assumptions to Assumption[]
Doug Simon <doug.simon@oracle.com>
parents: 19189
diff changeset
605 /**
21506
5cbaf1e9ff2e Remove reference to CompilationResult from HotSpotCompiledCode.
Roland Schatz <roland.schatz@oracle.com>
parents: 21411
diff changeset
606 * 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
607 */
21506
5cbaf1e9ff2e Remove reference to CompilationResult from HotSpotCompiledCode.
Roland Schatz <roland.schatz@oracle.com>
parents: 21411
diff changeset
608 public Assumption[] getAssumptions() {
5cbaf1e9ff2e Remove reference to CompilationResult from HotSpotCompiledCode.
Roland Schatz <roland.schatz@oracle.com>
parents: 21411
diff changeset
609 return assumptions;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
610 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
611
19306
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19257
diff changeset
612 /**
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19257
diff changeset
613 * 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
614 *
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 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
616 * @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
617 */
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
618 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
619 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
620 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
621 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
622 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
623 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
624 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
625 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
626 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
627 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
628 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
629 }
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 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
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 }
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 } 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
634 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
635 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
636 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
637 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
638 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
639 }
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
640 }
19306
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
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19257
diff changeset
643 /**
21506
5cbaf1e9ff2e Remove reference to CompilationResult from HotSpotCompiledCode.
Roland Schatz <roland.schatz@oracle.com>
parents: 21411
diff changeset
644 * 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
645 *
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 * @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
647 * 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
648 * 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
649 */
21506
5cbaf1e9ff2e Remove reference to CompilationResult from HotSpotCompiledCode.
Roland Schatz <roland.schatz@oracle.com>
parents: 21411
diff changeset
650 public ResolvedJavaMethod[] getMethods() {
5cbaf1e9ff2e Remove reference to CompilationResult from HotSpotCompiledCode.
Roland Schatz <roland.schatz@oracle.com>
parents: 21411
diff changeset
651 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
652 }
a0a760b0fb5f pulled method evolution dependencies out of Assumptions and directly into StructuredGraph
Doug Simon <doug.simon@oracle.com>
parents: 19257
diff changeset
653
21780
3d15183f3c93 Introduce Compiler interface in jvmci. Use it from jvmci.hotspot.CompilationTask
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents: 21730
diff changeset
654 public void setBytecodeSize(int bytecodeSize) {
3d15183f3c93 Introduce Compiler interface in jvmci. Use it from jvmci.hotspot.CompilationTask
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents: 21730
diff changeset
655 this.bytecodeSize = bytecodeSize;
3d15183f3c93 Introduce Compiler interface in jvmci. Use it from jvmci.hotspot.CompilationTask
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents: 21730
diff changeset
656 }
3d15183f3c93 Introduce Compiler interface in jvmci. Use it from jvmci.hotspot.CompilationTask
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents: 21730
diff changeset
657
3d15183f3c93 Introduce Compiler interface in jvmci. Use it from jvmci.hotspot.CompilationTask
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents: 21730
diff changeset
658 public int getBytecodeSize() {
3d15183f3c93 Introduce Compiler interface in jvmci. Use it from jvmci.hotspot.CompilationTask
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents: 21730
diff changeset
659 return bytecodeSize;
3d15183f3c93 Introduce Compiler interface in jvmci. Use it from jvmci.hotspot.CompilationTask
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents: 21730
diff changeset
660 }
3d15183f3c93 Introduce Compiler interface in jvmci. Use it from jvmci.hotspot.CompilationTask
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents: 21730
diff changeset
661
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
662 public DataSection getDataSection() {
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
663 return dataSection;
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
664 }
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
665
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
666 /**
15180
7a9531f50cd8 renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents: 15176
diff changeset
667 * 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
668 * 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
669 *
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
670 * @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
671 */
15180
7a9531f50cd8 renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents: 15176
diff changeset
672 public int getTotalFrameSize() {
7a9531f50cd8 renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents: 15176
diff changeset
673 assert totalFrameSize != -1 : "frame size not yet initialized!";
7a9531f50cd8 renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents: 15176
diff changeset
674 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
675 }
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
676
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
677 /**
15180
7a9531f50cd8 renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents: 15176
diff changeset
678 * 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
679 * 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
680 *
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
681 * @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
682 */
15180
7a9531f50cd8 renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents: 15176
diff changeset
683 public void setTotalFrameSize(int size) {
7a9531f50cd8 renamed com.oracle.graal.api.code.CompilationResult.frameSize to totalFrameSize
twisti
parents: 15176
diff changeset
684 totalFrameSize = size;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
685 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
686
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 * 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
689 *
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
690 * @param code the machine code generated
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
691 * @param size the size of the machine code
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
692 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
693 public void setTargetCode(byte[] code, int size) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
694 targetCode = code;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
695 targetCodeSize = size;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
696 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
697
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
698 /**
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
699 * 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
700 * {@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
701 * 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
702 *
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
703 * @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
704 * @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
705 */
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
706 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
707 assert codePos >= 0 && ref != null;
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17207
diff changeset
708 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
709 }
4e1db4c9d4c5 Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents: 9807
diff changeset
710
4e1db4c9d4c5 Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents: 9807
diff changeset
711 /**
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
712 * 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
713 *
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
714 * @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
715 * @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
716 * @param target the being called
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
717 * @param debugInfo the debug info for the call
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
718 * @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
719 */
7814
bab2a51f8dbe Introduce marker interface InvokeTarget. Remove method lookupRuntimeCall from CodeCacheProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7660
diff changeset
720 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
721 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
722 addInfopoint(call);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
723 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
724
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 * 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
727 *
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6996
diff changeset
728 * @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
729 * @param handlerPos the position of the handler
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
730 */
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
731 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
732 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
733 exceptionHandlers.add(new ExceptionHandler(codePos, handlerPos));
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
734 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
735
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
736 /**
19189
7ebed83df427 [SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18935
diff changeset
737 * 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
738 *
7ebed83df427 [SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18935
diff changeset
739 * @param codePos
7ebed83df427 [SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18935
diff changeset
740 * @param handlerPos
7ebed83df427 [SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18935
diff changeset
741 * @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
742 */
7ebed83df427 [SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18935
diff changeset
743 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
744 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
745 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
746 }
7ebed83df427 [SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18935
diff changeset
747
7ebed83df427 [SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18935
diff changeset
748 /**
7ebed83df427 [SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18935
diff changeset
749 * 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
750 *
7ebed83df427 [SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18935
diff changeset
751 * @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
752 * @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
753 */
7ebed83df427 [SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18935
diff changeset
754 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
755 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
756 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
757 return h;
7ebed83df427 [SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18935
diff changeset
758 }
7ebed83df427 [SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18935
diff changeset
759 }
7ebed83df427 [SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18935
diff changeset
760 return null;
7ebed83df427 [SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18935
diff changeset
761 }
7ebed83df427 [SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18935
diff changeset
762
7ebed83df427 [SPARC] fixing (wrong) duplicate exception handler for a particular PC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 18935
diff changeset
763 /**
9003
a8fea2979e63 eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents: 7826
diff changeset
764 * 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
765 *
9003
a8fea2979e63 eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents: 7826
diff changeset
766 * @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
767 * @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
768 */
9003
a8fea2979e63 eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents: 7826
diff changeset
769 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
770 addInfopoint(new Infopoint(codePos, debugInfo, reason));
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
771 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
772
14758
c612c2742a4f extend graph builder and CompilationResult for substrateVM
Erik Eckstein <erik.eckstein@oracle.com>
parents: 14736
diff changeset
773 /**
c612c2742a4f extend graph builder and CompilationResult for substrateVM
Erik Eckstein <erik.eckstein@oracle.com>
parents: 14736
diff changeset
774 * 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
775 *
14758
c612c2742a4f extend graph builder and CompilationResult for substrateVM
Erik Eckstein <erik.eckstein@oracle.com>
parents: 14736
diff changeset
776 * 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
777 * 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
778 *
14758
c612c2742a4f extend graph builder and CompilationResult for substrateVM
Erik Eckstein <erik.eckstein@oracle.com>
parents: 14736
diff changeset
779 * @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
780 */
c612c2742a4f extend graph builder and CompilationResult for substrateVM
Erik Eckstein <erik.eckstein@oracle.com>
parents: 14736
diff changeset
781 public void addInfopoint(Infopoint infopoint) {
9003
a8fea2979e63 eager infopoint mode (fka debug mode)
Michael Haupt <michael.haupt@oracle.com>
parents: 7826
diff changeset
782 // 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
783 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
784 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
785 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
786 // 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
787 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
788 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
789 }
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 if (previousInfopoint.pcOffset == infopoint.pcOffset) {
18252
ae8e86212c77 spelling fix: omited -> omitted
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
791 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
792 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
793 }
18252
ae8e86212c77 spelling fix: omited -> omitted
Doug Simon <doug.simon@oracle.com>
parents: 18187
diff changeset
794 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
795 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
796 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
797 } 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
798 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
799 }
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
800 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
801 }
9300
d73ad771a602 return immutable collections from (some) CompilationResult getters
Doug Simon <doug.simon@oracle.com>
parents: 9003
diff changeset
802 infopoints.add(infopoint);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
803 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
804
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
805 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
806 * 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
807 *
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
808 * @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
809 * @param markId the identifier for this mark
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
810 */
15375
1b82cd9e72e9 Remove CompilationResult.Mark.references
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15180
diff changeset
811 public Mark recordMark(int codePos, Object markId) {
1b82cd9e72e9 Remove CompilationResult.Mark.references
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15180
diff changeset
812 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
813 marks.add(mark);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
814 return mark;
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 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
818 * 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
819 *
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
820 * @return the offset in bytes
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
821 */
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
822 public int getCustomStackAreaOffset() {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
823 return customStackAreaOffset;
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 /**
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
827 * @see #getCustomStackAreaOffset()
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
828 * @param offset
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
829 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
830 public void setCustomStackAreaOffset(int offset) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
831 customStackAreaOffset = offset;
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
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
834 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
835 * @return the machine code generated for this method
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
836 */
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
837 public byte[] getTargetCode() {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
838 return targetCode;
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
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
841 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
842 * @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
843 */
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
844 public int getTargetCodeSize() {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
845 return targetCodeSize;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
846 }
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 * @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
850 */
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
851 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
852 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
853 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
854 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
855 return annotations;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
856 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
857
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
858 public void addAnnotation(CodeAnnotation annotation) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
859 assert annotation != null;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
860 if (annotations == null) {
4142
bc8527f3071c Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3733
diff changeset
861 annotations = new ArrayList<>();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
862 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
863 annotations.add(annotation);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
864 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
865
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5546
diff changeset
866 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
867 if (info != null) {
13725
8d8732e14447 Refactor reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 13676
diff changeset
868 ReferenceMap refMap = info.getReferenceMap();
8d8732e14447 Refactor reference maps.
Roland Schatz <roland.schatz@oracle.com>
parents: 13676
diff changeset
869 if (refMap != null) {
21730
b9f9b8af17ff Simplify interface to reference map
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 21561
diff changeset
870 sb.append(refMap.toString());
b9f9b8af17ff Simplify interface to reference map
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 21561
diff changeset
871 sb.append(']');
13725
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 }