File tree Expand file tree Collapse file tree 4 files changed +8
-30
lines changed
com.oracle.graal.pointsto/src/com/oracle/graal/pointsto
com.oracle.svm.hosted/src/com/oracle/svm/hosted Expand file tree Collapse file tree 4 files changed +8
-30
lines changed Original file line number Diff line number Diff line change @@ -313,10 +313,6 @@ public boolean platformSupported(AnnotatedElement element) {
313
313
return true ;
314
314
}
315
315
316
- public boolean sortFields () {
317
- return false ;
318
- }
319
-
320
316
public void clearInThread () {
321
317
}
322
318
Original file line number Diff line number Diff line change 28
28
import java .util .ArrayList ;
29
29
import java .util .Arrays ;
30
30
import java .util .Collection ;
31
- import java .util .Comparator ;
32
31
import java .util .HashSet ;
33
32
import java .util .List ;
34
33
import java .util .Objects ;
@@ -1197,22 +1196,8 @@ private ResolvedJavaField[] initializeInstanceFields(boolean includeSuperclasses
1197
1196
return result ;
1198
1197
}
1199
1198
1200
- /**
1201
- * Sort fields by the field's name *and* type. Note that sorting by name is not enough as the
1202
- * class file format doesn't disallow duplicated names with differing types in the same class.
1203
- * Even though you cannot declare duplicated names in source code the class file can be
1204
- * manipulated such that two fields will have the same name.
1205
- */
1206
- static final Comparator <ResolvedJavaField > FIELD_COMPARATOR = Comparator .comparing (ResolvedJavaField ::getName ).thenComparing (f -> f .getType ().toJavaName ());
1207
-
1208
1199
private ResolvedJavaField [] convertFields (ResolvedJavaField [] originals , List <ResolvedJavaField > list , boolean listIncludesSuperClassesFields ) {
1209
- ResolvedJavaField [] localOriginals = originals ;
1210
- if (universe .hostVM .sortFields ()) {
1211
- /* Clone the originals; it is a reference to the wrapped type's instanceFields array. */
1212
- localOriginals = originals .clone ();
1213
- Arrays .sort (localOriginals , FIELD_COMPARATOR );
1214
- }
1215
- for (ResolvedJavaField original : localOriginals ) {
1200
+ for (ResolvedJavaField original : originals ) {
1216
1201
if (!original .isInternal () && universe .hostVM .platformSupported (original )) {
1217
1202
try {
1218
1203
AnalysisField aField = universe .lookup (original );
Original file line number Diff line number Diff line change @@ -1001,15 +1001,6 @@ private void initializeSharedLayerExcludedFields() {
1001
1001
sharedLayerExcludedFields .add (lookupOriginalDeclaredField (NativeLibraries .class , "nativeLibraryLockMap" ));
1002
1002
}
1003
1003
1004
- @ Override
1005
- public boolean sortFields () {
1006
- /*
1007
- * If building layered images sort the fields by kind and name to ensure stable order.
1008
- * Sorting fields in general may lead to some issues. (GR-62599)
1009
- */
1010
- return buildingImageLayer ;
1011
- }
1012
-
1013
1004
/** If it's not one of the known builder types it must be an original VM type. */
1014
1005
private static boolean isOriginalType (ResolvedJavaType type ) {
1015
1006
return !(type instanceof OriginalClassProvider );
Original file line number Diff line number Diff line change 51
51
import java .util .function .Supplier ;
52
52
import java .util .stream .IntStream ;
53
53
54
- import com .oracle .svm .hosted .substitute .SubstitutionMethod ;
55
54
import org .graalvm .collections .EconomicMap ;
56
55
import org .graalvm .nativeimage .AnnotationAccess ;
57
56
import org .graalvm .nativeimage .ImageSingletons ;
121
120
import com .oracle .svm .hosted .meta .PatchedWordConstant ;
122
121
import com .oracle .svm .hosted .reflect .ReflectionFeature ;
123
122
import com .oracle .svm .hosted .reflect .serialize .SerializationFeature ;
123
+ import com .oracle .svm .hosted .substitute .SubstitutionMethod ;
124
124
import com .oracle .svm .hosted .util .IdentityHashCodeUtil ;
125
125
import com .oracle .svm .shaded .org .capnproto .PrimitiveList ;
126
126
import com .oracle .svm .shaded .org .capnproto .StructList ;
@@ -1318,6 +1318,12 @@ public void initializeBaseLayerField(AnalysisField analysisField) {
1318
1318
});
1319
1319
registerFlag (fieldData .getIsFolded (), debug -> analysisField .registerAsFolded (PERSISTED ));
1320
1320
registerFlag (fieldData .getIsUnsafeAccessed (), debug -> analysisField .registerAsUnsafeAccessed (PERSISTED ));
1321
+
1322
+ /*
1323
+ * Inject the base layer position. If the position computed for this layer, either before
1324
+ * this step or later, is different this will result in a failed guarantee.
1325
+ */
1326
+ analysisField .setPosition (fieldData .getPosition ());
1321
1327
}
1322
1328
1323
1329
private PersistedAnalysisField .Reader getFieldData (AnalysisField analysisField ) {
You can’t perform that action at this time.
0 commit comments