Skip to content

Commit 6fcd97c

Browse files
committed
Throw UnexpectedResultException for boxed values, too.
1 parent a749280 commit 6fcd97c

File tree

1 file changed

+0
-45
lines changed
  • truffle/src/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object

1 file changed

+0
-45
lines changed

truffle/src/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Location.java

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -271,21 +271,6 @@ final int getIntInternal(DynamicObject store, Shape expectedShape, boolean guard
271271
}
272272
return (int) longValue;
273273
}
274-
} else if (this instanceof ObjectLocation objectLocation) {
275-
Object value;
276-
if (field == null) {
277-
Object array = getObjectArray(store, guard);
278-
long offset = getObjectArrayOffset();
279-
value = UnsafeAccess.unsafeGetObject(array, offset, guard, this);
280-
} else {
281-
if (UseVarHandle) {
282-
value = field.varHandle().get(store);
283-
} else {
284-
field.receiverCheck(store);
285-
value = UnsafeAccess.unsafeGetObject(store, getFieldOffset(), guard, this);
286-
}
287-
}
288-
return expectInteger(CompilerDirectives.inInterpreter() ? value : objectLocation.assumedTypeCast(value, guard));
289274
}
290275
return getIntUnexpected(store, expectedShape, guard);
291276
}
@@ -318,21 +303,6 @@ final long getLongInternal(DynamicObject store, Shape expectedShape, boolean gua
318303
}
319304
return longValue;
320305
}
321-
} else if (this instanceof ObjectLocation objectLocation) {
322-
Object value;
323-
if (field == null) {
324-
Object array = getObjectArray(store, guard);
325-
long offset = getObjectArrayOffset();
326-
value = UnsafeAccess.unsafeGetObject(array, offset, guard, this);
327-
} else {
328-
if (UseVarHandle) {
329-
value = field.varHandle().get(store);
330-
} else {
331-
field.receiverCheck(store);
332-
value = UnsafeAccess.unsafeGetObject(store, getFieldOffset(), guard, this);
333-
}
334-
}
335-
return expectLong(CompilerDirectives.inInterpreter() ? value : objectLocation.assumedTypeCast(value, guard));
336306
}
337307
return getLongUnexpected(store, expectedShape, guard);
338308
}
@@ -365,21 +335,6 @@ final double getDoubleInternal(DynamicObject store, Shape expectedShape, boolean
365335
}
366336
return Double.longBitsToDouble(longValue);
367337
}
368-
} else if (this instanceof ObjectLocation objectLocation) {
369-
Object value;
370-
if (field == null) {
371-
Object array = getObjectArray(store, guard);
372-
long offset = getObjectArrayOffset();
373-
value = UnsafeAccess.unsafeGetObject(array, offset, guard, this);
374-
} else {
375-
if (UseVarHandle) {
376-
value = field.varHandle().get(store);
377-
} else {
378-
field.receiverCheck(store);
379-
value = UnsafeAccess.unsafeGetObject(store, getFieldOffset(), guard, this);
380-
}
381-
}
382-
return expectDouble(CompilerDirectives.inInterpreter() ? value : objectLocation.assumedTypeCast(value, guard));
383338
}
384339
return getDoubleUnexpected(store, expectedShape, guard);
385340
}

0 commit comments

Comments
 (0)