Skip to content

Commit 536190a

Browse files
committed
Merge ExtLayout into LayoutImpl.
1 parent 8f181ea commit 536190a

File tree

5 files changed

+241
-310
lines changed

5 files changed

+241
-310
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ final class ExtAllocator extends BaseAllocator {
8282
super(shape);
8383
}
8484

85-
private ExtLayout getLayout() {
86-
return (ExtLayout) layout;
85+
private LayoutImpl getLayout() {
86+
return layout;
8787
}
8888

8989
@Override
@@ -122,7 +122,7 @@ public Location newObjectLocation() {
122122

123123
private Location newObjectLocation(boolean decorateFinal, Location oldLocation, Object value) {
124124
if (InObjectFields) {
125-
ExtLayout l = getLayout();
125+
LayoutImpl l = getLayout();
126126
int insertPos = objectFieldSize;
127127
if (insertPos + OBJECT_SLOT_SIZE <= l.getObjectFieldCount()) {
128128
FieldInfo fieldInfo = l.getObjectField(insertPos);
@@ -145,7 +145,7 @@ private Location newObjectArrayLocation(boolean decorateFinal, Location oldLocat
145145

146146
private Location newTypedObjectLocation(Class<?> type, boolean nonNull, boolean decorateFinal, Location oldLocation, Object value) {
147147
if (InObjectFields) {
148-
ExtLayout l = getLayout();
148+
LayoutImpl l = getLayout();
149149
int insertPos = objectFieldSize;
150150
if (insertPos + OBJECT_SLOT_SIZE <= l.getObjectFieldCount()) {
151151
FieldInfo fieldInfo = l.getObjectField(insertPos);
@@ -223,7 +223,7 @@ private static Assumption getFinalAssumption(Location oldLocation, boolean allow
223223
return Assumption.NEVER_VALID;
224224
}
225225

226-
private static int tryAllocatePrimitiveSlot(ExtLayout l, int startIndex, final int desiredBytes) {
226+
private static int tryAllocatePrimitiveSlot(LayoutImpl l, int startIndex, final int desiredBytes) {
227227
if (desiredBytes > l.getPrimitiveFieldMaxSize()) {
228228
// no primitive fields in this layout that are wide enough
229229
return -1;
@@ -253,7 +253,7 @@ private Location newIntLocation() {
253253

254254
private Location newIntLocation(boolean decorateFinal, Location oldLocation, Object value) {
255255
if (PrimitiveLocations && IntegerLocations) {
256-
ExtLayout l = getLayout();
256+
LayoutImpl l = getLayout();
257257
if (InObjectFields) {
258258
int fieldIndex = tryAllocatePrimitiveSlot(l, primitiveFieldSize, Integer.BYTES);
259259
if (fieldIndex >= 0) {
@@ -279,7 +279,7 @@ private Location newDoubleLocation() {
279279

280280
private Location newDoubleLocation(boolean decorateFinal, boolean allowIntToDouble, Location oldLocation, Object value) {
281281
if (PrimitiveLocations && DoubleLocations) {
282-
ExtLayout l = getLayout();
282+
LayoutImpl l = getLayout();
283283
if (InObjectFields) {
284284
int fieldIndex = tryAllocatePrimitiveSlot(l, primitiveFieldSize, Double.BYTES);
285285
if (fieldIndex >= 0) {
@@ -324,7 +324,7 @@ private Location newLongLocation() {
324324

325325
private Location newLongLocation(boolean decorateFinal, boolean allowIntToLong, Location oldLocation, Object value) {
326326
if (PrimitiveLocations && LongLocations) {
327-
ExtLayout l = getLayout();
327+
LayoutImpl l = getLayout();
328328
if (InObjectFields) {
329329
int fieldIndex = tryAllocatePrimitiveSlot(l, primitiveFieldSize, Long.BYTES);
330330
if (fieldIndex >= 0) {
@@ -351,7 +351,7 @@ private Location newBooleanLocation() {
351351

352352
private Location newBooleanLocation(boolean decorateFinal, Location oldLocation, Object value) {
353353
if (PrimitiveLocations && BooleanLocations && InObjectFields) {
354-
ExtLayout l = getLayout();
354+
LayoutImpl l = getLayout();
355355
int fieldIndex = tryAllocatePrimitiveSlot(l, primitiveFieldSize, Integer.BYTES);
356356
if (fieldIndex >= 0) {
357357
FieldInfo fieldInfo = l.getPrimitiveField(fieldIndex);

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

Lines changed: 0 additions & 284 deletions
This file was deleted.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@
5252
final class LayoutFactory {
5353

5454
void registerLayoutClass(Class<? extends DynamicObject> subclass, Lookup layoutLookup) {
55-
ExtLayout.registerLayoutClass(subclass, layoutLookup);
55+
LayoutImpl.registerLayoutClass(subclass, layoutLookup);
5656
}
5757

5858
LayoutImpl createLayout(Class<? extends DynamicObject> layoutClass, Lookup layoutLookup, int implicitCastFlags) {
59-
return ExtLayout.createLayoutImpl(layoutClass, layoutLookup, implicitCastFlags);
59+
return LayoutImpl.createLayoutImpl(layoutClass, layoutLookup, implicitCastFlags);
6060
}
6161

6262
Shape createShape(Class<? extends DynamicObject> layoutClass,

0 commit comments

Comments
 (0)