Mercurial > hg > truffle
annotate graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Assumptions.java @ 16217:561070049e73
implement Canonicalizable.Binary in the BinaryNode hierarchy
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Wed, 25 Jun 2014 16:54:56 +0200 |
parents | 59a85df7a418 |
children | 92f75d104b4b |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
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 */ |
5510
426c605c9d3c
Move cri.ci to api.code.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5507
diff
changeset
|
23 package com.oracle.graal.api.code; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
7086
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
25 import static com.oracle.graal.api.meta.MetaUtil.*; |
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
26 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
27 import java.io.*; |
8947
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
28 import java.lang.invoke.*; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
29 import java.util.*; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
30 |
5507
dc71b06d09f8
Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5056
diff
changeset
|
31 import com.oracle.graal.api.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 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
34 * Class for recording optimistic assumptions made during compilation. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
35 */ |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5541
diff
changeset
|
36 public final class Assumptions implements Serializable, Iterable<Assumptions.Assumption> { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
37 |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
38 private static final long serialVersionUID = 5152062717588239131L; |
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
39 |
6329
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5711
diff
changeset
|
40 /** |
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5711
diff
changeset
|
41 * Abstract base class for assumptions. |
92bc58dc5b5e
More clean up and documentation in api.code and api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5711
diff
changeset
|
42 */ |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
43 public abstract static class Assumption implements Serializable { |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
44 |
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
45 private static final long serialVersionUID = -1936652569665112915L; |
3733
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 |
9012
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
48 public static final class NoFinalizableSubclass extends Assumption { |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
49 |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
50 private static final long serialVersionUID = 6451169735564055081L; |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
51 |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
52 private ResolvedJavaType receiverType; |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
53 |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
54 public NoFinalizableSubclass(ResolvedJavaType receiverType) { |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
55 this.receiverType = receiverType; |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
56 } |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
57 |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
58 @Override |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
59 public int hashCode() { |
9125
5b25562f8bd7
assumptions: simplify hashCode()
Bernhard Urban <bernhard.urban@jku.at>
parents:
9012
diff
changeset
|
60 return 31 + receiverType.hashCode(); |
9012
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
61 } |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
62 |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
63 @Override |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
64 public boolean equals(Object obj) { |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
65 if (obj instanceof NoFinalizableSubclass) { |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
66 NoFinalizableSubclass other = (NoFinalizableSubclass) obj; |
14160
fd7fcd2d2072
replaced == with .equals() for comparisons between JavaMethod/JavaField/JavaType values
Doug Simon <doug.simon@oracle.com>
parents:
14157
diff
changeset
|
67 return other.receiverType.equals(receiverType); |
9012
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
68 } |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
69 return false; |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
70 } |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
71 |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
72 @Override |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
73 public String toString() { |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
74 return "NoFinalizableSubclass[receiverType=" + toJavaName(receiverType) + "]"; |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
75 } |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
76 |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
77 } |
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
78 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
79 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
80 * An assumption about a unique subtype of a given type. |
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 public static final class ConcreteSubtype extends Assumption { |
4670
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
83 |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
84 private static final long serialVersionUID = -1457173265437676252L; |
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
85 |
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
86 /** |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
87 * Type the assumption is made about. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
88 */ |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
89 public final ResolvedJavaType context; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
90 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
91 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
92 * Assumed unique concrete sub-type of the context type. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
93 */ |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
94 public final ResolvedJavaType subtype; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
95 |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
96 public ConcreteSubtype(ResolvedJavaType context, ResolvedJavaType subtype) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
97 this.context = context; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
98 this.subtype = subtype; |
15729
59a85df7a418
Add some assertions and tests to TestResolvedJavaType.findUniqueConcreteSubtypeTest
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
14160
diff
changeset
|
99 assert !subtype.isAbstract() : subtype.toString() + " : " + context.toString(); |
59a85df7a418
Add some assertions and tests to TestResolvedJavaType.findUniqueConcreteSubtypeTest
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
14160
diff
changeset
|
100 assert !subtype.isArray() || getElementalType(subtype).isFinal() : subtype.toString() + " : " + context.toString(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
101 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
102 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
103 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
104 public int hashCode() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
105 final int prime = 31; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
106 int result = 1; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
107 result = prime * result + context.hashCode(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
108 result = prime * result + subtype.hashCode(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
109 return result; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
110 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
111 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
112 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
113 public boolean equals(Object obj) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
114 if (obj instanceof ConcreteSubtype) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
115 ConcreteSubtype other = (ConcreteSubtype) obj; |
14160
fd7fcd2d2072
replaced == with .equals() for comparisons between JavaMethod/JavaField/JavaType values
Doug Simon <doug.simon@oracle.com>
parents:
14157
diff
changeset
|
116 return other.context.equals(context) && other.subtype.equals(subtype); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
117 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
118 return false; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
119 } |
7086
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
120 |
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
121 @Override |
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
122 public String toString() { |
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
123 return "ConcreteSubtype[context=" + toJavaName(context) + ", subtype=" + toJavaName(subtype) + "]"; |
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
124 } |
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 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
128 * An assumption about a unique implementation of a virtual method. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
129 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
130 public static final class ConcreteMethod extends Assumption { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
131 |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
132 private static final long serialVersionUID = -7636746737947390059L; |
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
133 |
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
134 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7223
diff
changeset
|
135 * A virtual (or interface) method whose unique implementation for the receiver type in |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7223
diff
changeset
|
136 * {@link #context} is {@link #impl}. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
137 */ |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
138 public final ResolvedJavaMethod method; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
139 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
140 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
141 * A receiver type. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
142 */ |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
143 public final ResolvedJavaType context; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
144 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
145 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
146 * The unique implementation of {@link #method} for {@link #context}. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
147 */ |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
148 public final ResolvedJavaMethod impl; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
149 |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
150 public ConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType context, ResolvedJavaMethod impl) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
151 this.method = method; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
152 this.context = context; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
153 this.impl = impl; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
154 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
155 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
156 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
157 public int hashCode() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
158 final int prime = 31; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
159 int result = 1; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
160 result = prime * result + method.hashCode(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
161 result = prime * result + context.hashCode(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
162 result = prime * result + impl.hashCode(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
163 return result; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
164 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
165 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
166 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
167 public boolean equals(Object obj) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
168 if (obj instanceof ConcreteMethod) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
169 ConcreteMethod other = (ConcreteMethod) obj; |
14160
fd7fcd2d2072
replaced == with .equals() for comparisons between JavaMethod/JavaField/JavaType values
Doug Simon <doug.simon@oracle.com>
parents:
14157
diff
changeset
|
170 return other.method.equals(method) && other.context.equals(context) && other.impl.equals(impl); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
171 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
172 return false; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
173 } |
7086
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
174 |
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
175 @Override |
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
176 public String toString() { |
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
177 return "ConcreteMethod[method=" + format("%H.%n(%p)", method) + ", context=" + toJavaName(context) + ", impl=" + format("%H.%n(%p)", impl) + "]"; |
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
178 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
179 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
180 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
181 /** |
4670
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
182 * An assumption that specified that a method was used during the compilation. |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
183 */ |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
184 public static final class MethodContents extends Assumption { |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
185 |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
186 private static final long serialVersionUID = -4821594103928571659L; |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
187 |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
188 public final ResolvedJavaMethod method; |
4670
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
189 |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
190 public MethodContents(ResolvedJavaMethod method) { |
4670
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
191 this.method = method; |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
192 } |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
193 |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
194 @Override |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
195 public int hashCode() { |
9125
5b25562f8bd7
assumptions: simplify hashCode()
Bernhard Urban <bernhard.urban@jku.at>
parents:
9012
diff
changeset
|
196 return 31 + method.hashCode(); |
4670
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
197 } |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
198 |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
199 @Override |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
200 public boolean equals(Object obj) { |
14157 | 201 if (obj instanceof MethodContents) { |
202 MethodContents other = (MethodContents) obj; | |
14160
fd7fcd2d2072
replaced == with .equals() for comparisons between JavaMethod/JavaField/JavaType values
Doug Simon <doug.simon@oracle.com>
parents:
14157
diff
changeset
|
203 return other.method.equals(method); |
4670
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
204 } |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
205 return false; |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
206 } |
7086
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
207 |
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
208 @Override |
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
209 public String toString() { |
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
210 return "MethodContents[method=" + format("%H.%n(%p)", method) + "]"; |
902f60aa20cc
added toString() implementation to Assumption classes
Doug Simon <doug.simon@oracle.com>
parents:
7064
diff
changeset
|
211 } |
4670
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
212 } |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
213 |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
214 /** |
8947
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
215 * Assumption that a call site's method handle did not change. |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
216 */ |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
217 public static final class CallSiteTargetValue extends Assumption { |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
218 |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
219 private static final long serialVersionUID = 1732459941784550371L; |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
220 |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
221 public final CallSite callSite; |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
222 public final MethodHandle methodHandle; |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
223 |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
224 public CallSiteTargetValue(CallSite callSite, MethodHandle methodHandle) { |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
225 this.callSite = callSite; |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
226 this.methodHandle = methodHandle; |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
227 } |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
228 |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
229 @Override |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
230 public int hashCode() { |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
231 final int prime = 31; |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
232 int result = 1; |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
233 result = prime * result + callSite.hashCode(); |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
234 result = prime * result + methodHandle.hashCode(); |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
235 return result; |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
236 } |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
237 |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
238 @Override |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
239 public boolean equals(Object obj) { |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
240 if (obj instanceof CallSiteTargetValue) { |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
241 CallSiteTargetValue other = (CallSiteTargetValue) obj; |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
242 return other.callSite == callSite && other.methodHandle == methodHandle; |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
243 } |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
244 return false; |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
245 } |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
246 |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
247 @Override |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
248 public String toString() { |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
249 return "CallSiteTargetValue[callSite=" + callSite + ", methodHandle=" + methodHandle + "]"; |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
250 } |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
251 } |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
252 |
707b20dd9512
draft call site target value assumption
Andreas Woess <andreas.woess@jku.at>
parents:
7645
diff
changeset
|
253 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7223
diff
changeset
|
254 * Array with the assumptions. This field is directly accessed from C++ code in the |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7223
diff
changeset
|
255 * Graal/HotSpot implementation. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
256 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
257 private Assumption[] list; |
7064
8d16b9b2c51e
first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6329
diff
changeset
|
258 private boolean useOptimisticAssumptions; |
8d16b9b2c51e
first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6329
diff
changeset
|
259 private int count; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
260 |
7064
8d16b9b2c51e
first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6329
diff
changeset
|
261 public Assumptions(boolean useOptimisticAssumptions) { |
8d16b9b2c51e
first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6329
diff
changeset
|
262 this.useOptimisticAssumptions = useOptimisticAssumptions; |
9841
e9d8f135f203
Assumptions: initialize list in constructor and add getter
Bernhard Urban <bernhard.urban@jku.at>
parents:
9699
diff
changeset
|
263 list = new Assumption[4]; |
7064
8d16b9b2c51e
first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6329
diff
changeset
|
264 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
265 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
266 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
267 * Returns whether any assumptions have been registered. |
15729
59a85df7a418
Add some assertions and tests to TestResolvedJavaType.findUniqueConcreteSubtypeTest
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
14160
diff
changeset
|
268 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
269 * @return {@code true} if at least one assumption has been registered, {@code false} otherwise. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
270 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
271 public boolean isEmpty() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
272 return count == 0; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
273 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
274 |
7064
8d16b9b2c51e
first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6329
diff
changeset
|
275 public boolean useOptimisticAssumptions() { |
8d16b9b2c51e
first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6329
diff
changeset
|
276 return useOptimisticAssumptions; |
8d16b9b2c51e
first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6329
diff
changeset
|
277 } |
8d16b9b2c51e
first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6329
diff
changeset
|
278 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
279 @Override |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
280 public Iterator<Assumption> iterator() { |
5547
b6617d13ea44
Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5541
diff
changeset
|
281 return new Iterator<Assumptions.Assumption>() { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7223
diff
changeset
|
282 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
283 int index; |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7223
diff
changeset
|
284 |
10663 | 285 @Override |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
286 public void remove() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
287 throw new UnsupportedOperationException(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
288 } |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7223
diff
changeset
|
289 |
10663 | 290 @Override |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
291 public Assumption next() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
292 if (index >= count) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
293 throw new NoSuchElementException(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
294 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
295 return list[index++]; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
296 } |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7223
diff
changeset
|
297 |
10663 | 298 @Override |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
299 public boolean hasNext() { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
300 return index < count; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
301 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
302 }; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
303 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
304 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
305 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
306 * Records an assumption that the specified type has no finalizable subclasses. |
15729
59a85df7a418
Add some assertions and tests to TestResolvedJavaType.findUniqueConcreteSubtypeTest
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
14160
diff
changeset
|
307 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
308 * @param receiverType the type that is assumed to have no finalizable subclasses |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
309 */ |
9012
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
310 public void recordNoFinalizableSubclassAssumption(ResolvedJavaType receiverType) { |
7064
8d16b9b2c51e
first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6329
diff
changeset
|
311 assert useOptimisticAssumptions; |
9012
2979aaac95af
assumptions: enable NoFinalizableSubclass assumption
Bernhard Urban <bernhard.urban@jku.at>
parents:
8947
diff
changeset
|
312 record(new NoFinalizableSubclass(receiverType)); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
313 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
314 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
315 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7223
diff
changeset
|
316 * Records that {@code subtype} is the only concrete subtype in the class hierarchy below |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7223
diff
changeset
|
317 * {@code context}. |
15729
59a85df7a418
Add some assertions and tests to TestResolvedJavaType.findUniqueConcreteSubtypeTest
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
14160
diff
changeset
|
318 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
319 * @param context the root of the subtree of the class hierarchy that this assumptions is about |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
320 * @param subtype the one concrete subtype |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
321 */ |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
322 public void recordConcreteSubtype(ResolvedJavaType context, ResolvedJavaType subtype) { |
7064
8d16b9b2c51e
first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6329
diff
changeset
|
323 assert useOptimisticAssumptions; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
324 record(new ConcreteSubtype(context, subtype)); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
325 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
326 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
327 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
328 * Records that {@code impl} is the only possible concrete target for a virtual call to |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
329 * {@code method} with a receiver of type {@code context}. |
15729
59a85df7a418
Add some assertions and tests to TestResolvedJavaType.findUniqueConcreteSubtypeTest
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
14160
diff
changeset
|
330 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
331 * @param method a method that is the target of a virtual call |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
332 * @param context the receiver type of a call to {@code method} |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
333 * @param impl the concrete method that is the only possible target for the virtual call |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
334 */ |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
335 public void recordConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType context, ResolvedJavaMethod impl) { |
7064
8d16b9b2c51e
first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6329
diff
changeset
|
336 assert useOptimisticAssumptions; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
337 record(new ConcreteMethod(method, context, impl)); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
338 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
339 |
4670
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
340 /** |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
341 * Records that {@code method} was used during the compilation. |
15729
59a85df7a418
Add some assertions and tests to TestResolvedJavaType.findUniqueConcreteSubtypeTest
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
14160
diff
changeset
|
342 * |
4670
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
343 * @param method a method whose contents were used |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
344 */ |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5510
diff
changeset
|
345 public void recordMethodContents(ResolvedJavaMethod method) { |
4670
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
346 record(new MethodContents(method)); |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
347 } |
41034914e2ee
add MethodContents assumption to fix debbugging issue
Lukas Stadler <lukas.stadler@jku.at>
parents:
4199
diff
changeset
|
348 |
7223
e2ea829fafd9
use CHA more frequently for inlining
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7220
diff
changeset
|
349 public void record(Assumption assumption) { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
350 if (list == null) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
351 list = new Assumption[4]; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
352 } else { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
353 for (int i = 0; i < count; ++i) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
354 if (assumption.equals(list[i])) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
355 return; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
356 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
357 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
358 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
359 if (list.length == count) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
360 Assumption[] newList = new Assumption[list.length * 2]; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
361 for (int i = 0; i < list.length; ++i) { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
362 newList[i] = list[i]; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
363 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
364 list = newList; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
365 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
366 list[count] = assumption; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
367 count++; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
368 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
369 |
9841
e9d8f135f203
Assumptions: initialize list in constructor and add getter
Bernhard Urban <bernhard.urban@jku.at>
parents:
9699
diff
changeset
|
370 public Assumption[] getAssumptions() { |
e9d8f135f203
Assumptions: initialize list in constructor and add getter
Bernhard Urban <bernhard.urban@jku.at>
parents:
9699
diff
changeset
|
371 return list; |
e9d8f135f203
Assumptions: initialize list in constructor and add getter
Bernhard Urban <bernhard.urban@jku.at>
parents:
9699
diff
changeset
|
372 } |
e9d8f135f203
Assumptions: initialize list in constructor and add getter
Bernhard Urban <bernhard.urban@jku.at>
parents:
9699
diff
changeset
|
373 |
9699
9529ab567367
Drafted version of an inlining policy that uses the callee graph size as its metric.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9125
diff
changeset
|
374 public void record(Assumptions assumptions) { |
9529ab567367
Drafted version of an inlining policy that uses the callee graph size as its metric.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9125
diff
changeset
|
375 for (int i = 0; i < assumptions.count; i++) { |
9529ab567367
Drafted version of an inlining policy that uses the callee graph size as its metric.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9125
diff
changeset
|
376 record(assumptions.list[i]); |
9529ab567367
Drafted version of an inlining policy that uses the callee graph size as its metric.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9125
diff
changeset
|
377 } |
9529ab567367
Drafted version of an inlining policy that uses the callee graph size as its metric.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9125
diff
changeset
|
378 } |
10611
1546866ebb8d
First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9841
diff
changeset
|
379 |
1546866ebb8d
First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9841
diff
changeset
|
380 public void print(PrintStream out) { |
1546866ebb8d
First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9841
diff
changeset
|
381 List<Assumption> nonNullList = new ArrayList<>(); |
1546866ebb8d
First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9841
diff
changeset
|
382 if (list != null) { |
1546866ebb8d
First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9841
diff
changeset
|
383 for (int i = 0; i < list.length; ++i) { |
1546866ebb8d
First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9841
diff
changeset
|
384 Assumption a = list[i]; |
1546866ebb8d
First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9841
diff
changeset
|
385 if (a != null) { |
1546866ebb8d
First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9841
diff
changeset
|
386 nonNullList.add(a); |
1546866ebb8d
First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9841
diff
changeset
|
387 } |
1546866ebb8d
First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9841
diff
changeset
|
388 } |
1546866ebb8d
First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9841
diff
changeset
|
389 } |
1546866ebb8d
First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9841
diff
changeset
|
390 |
14157 | 391 out.printf("%d assumptions:%n", nonNullList.size()); |
10611
1546866ebb8d
First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9841
diff
changeset
|
392 for (Assumption a : nonNullList) { |
1546866ebb8d
First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9841
diff
changeset
|
393 out.println(a.toString()); |
1546866ebb8d
First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9841
diff
changeset
|
394 } |
1546866ebb8d
First draft of Truffle graph caching.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9841
diff
changeset
|
395 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
396 } |