@@ -111,10 +111,6 @@ protected Location moveLocation(Location oldLocation) {
111
111
return advance (oldLocation );
112
112
}
113
113
114
- public Location newObjectLocation () {
115
- return newObjectLocation (false , null , NO_VALUE );
116
- }
117
-
118
114
private Location newObjectLocation (boolean decorateFinal , Location oldLocation , Object value ) {
119
115
if (InObjectFields ) {
120
116
LayoutImpl l = getLayout ();
@@ -138,33 +134,6 @@ private Location newObjectArrayLocation(boolean decorateFinal, Location oldLocat
138
134
return advance (location );
139
135
}
140
136
141
- private Location newTypedObjectLocation (Class <?> type , boolean nonNull , boolean decorateFinal , Location oldLocation , Object value ) {
142
- if (InObjectFields ) {
143
- LayoutImpl l = getLayout ();
144
- int insertPos = objectFieldSize ;
145
- if (insertPos + OBJECT_SLOT_SIZE <= l .getObjectFieldCount ()) {
146
- FieldInfo fieldInfo = l .getObjectField (insertPos );
147
- TypeAssumption initialTypeAssumption = getTypeAssumptionForTypeOrValue (type , nonNull , oldLocation , value );
148
- Assumption initialFinalAssumption = getFinalAssumption (oldLocation , decorateFinal );
149
- LocationImpl location = newObjectFieldLocationWithAssumption (insertPos , fieldInfo , initialTypeAssumption , initialFinalAssumption );
150
- return advance (location );
151
- }
152
- }
153
- return newTypedObjectArrayLocation (type , nonNull , decorateFinal , oldLocation , value );
154
- }
155
-
156
- private Location newTypedObjectArrayLocation (Class <?> type , boolean nonNull , boolean decorateFinal , Location oldLocation , Object value ) {
157
- if (type != Object .class ) {
158
- int index = objectArraySize ;
159
- TypeAssumption initialTypeAssumption = getTypeAssumptionForTypeOrValue (type , nonNull , oldLocation , value );
160
- Assumption initialFinalAssumption = getFinalAssumption (oldLocation , decorateFinal );
161
- LocationImpl location = newObjectArrayLocationWithAssumption (index , initialTypeAssumption , initialFinalAssumption );
162
- return advance (location );
163
- } else {
164
- return newObjectArrayLocation (decorateFinal , oldLocation , value );
165
- }
166
- }
167
-
168
137
private static ObjectFieldLocation newObjectFieldLocationWithAssumption (int index , FieldInfo fieldInfo ,
169
138
TypeAssumption initialTypeAssumption , Assumption initialFinalAssumption ) {
170
139
return new ObjectFieldLocation (index , fieldInfo , initialFinalAssumption , initialTypeAssumption );
@@ -193,17 +162,6 @@ private static TypeAssumption getTypeAssumption(Location oldLocation, Object val
193
162
return TypeAssumption .ANY ;
194
163
}
195
164
196
- private static TypeAssumption getTypeAssumptionForTypeOrValue (Class <?> type , boolean nonNull , Location oldLocation , Object value ) {
197
- if (!NewTypeSpeculation && !NewFinalSpeculation && value == NO_VALUE ) {
198
- if (oldLocation instanceof AbstractObjectLocation ) {
199
- return ((AbstractObjectLocation ) oldLocation ).getTypeAssumption ();
200
- }
201
- return AbstractObjectLocation .createTypeAssumption (type , nonNull );
202
- } else {
203
- return getTypeAssumption (oldLocation , value );
204
- }
205
- }
206
-
207
165
private static Assumption getFinalAssumption (Location oldLocation , boolean allowFinalSpeculation ) {
208
166
if (NewFinalSpeculation && allowFinalSpeculation ) {
209
167
if (oldLocation == null ) {
@@ -223,10 +181,6 @@ private static int tryAllocatePrimitiveSlot(LayoutImpl l, int startIndex, final
223
181
return startIndex < l .getPrimitiveFieldCount () ? startIndex : -1 ;
224
182
}
225
183
226
- private Location newIntLocation () {
227
- return newIntLocation (false , null , NO_VALUE );
228
- }
229
-
230
184
private Location newIntLocation (boolean decorateFinal , Location oldLocation , Object value ) {
231
185
if (PrimitiveLocations && IntegerLocations ) {
232
186
LayoutImpl l = getLayout ();
@@ -249,10 +203,6 @@ private Location newIntLocation(boolean decorateFinal, Location oldLocation, Obj
249
203
return newObjectLocation (decorateFinal , oldLocation , value );
250
204
}
251
205
252
- private Location newDoubleLocation () {
253
- return newDoubleLocation (false , getLayout ().isAllowedIntToDouble (), null , NO_VALUE );
254
- }
255
-
256
206
private Location newDoubleLocation (boolean decorateFinal , boolean allowIntToDouble , Location oldLocation , Object value ) {
257
207
if (PrimitiveLocations && DoubleLocations ) {
258
208
LayoutImpl l = getLayout ();
@@ -293,10 +243,6 @@ private static int alignArrayIndex(int index, int slotSize) {
293
243
}
294
244
}
295
245
296
- private Location newLongLocation () {
297
- return newLongLocation (false , getLayout ().isAllowedIntToLong (), null , NO_VALUE );
298
- }
299
-
300
246
private Location newLongLocation (boolean decorateFinal , boolean allowIntToLong , Location oldLocation , Object value ) {
301
247
if (PrimitiveLocations && LongLocations ) {
302
248
LayoutImpl l = getLayout ();
@@ -371,23 +317,6 @@ Location locationForValue(Object value, int putFlags) {
371
317
return newObjectLocation (decorateFinal , null , value );
372
318
}
373
319
374
- @ Override
375
- public Location locationForType (Class <?> type ) {
376
- if (type == int .class ) {
377
- return newIntLocation ();
378
- } else if (type == double .class ) {
379
- return newDoubleLocation ();
380
- } else if (type == long .class ) {
381
- return newLongLocation ();
382
- } else if (type == boolean .class ) {
383
- return locationForValue (true );
384
- } else if (type != null && type != Object .class ) {
385
- assert !type .isPrimitive () : "unsupported primitive type" ;
386
- return newTypedObjectLocation (type , false , false , null , NO_VALUE );
387
- }
388
- return newObjectLocation ();
389
- }
390
-
391
320
static Class <?> getCommonSuperclass (Class <?> a , Class <?> b ) {
392
321
Class <?> type = a ;
393
322
while (type != Object .class ) {
0 commit comments