@Override public Object get(DynamicObject store, boolean condition) { if (type == Object.class) { return objectLocation.get(store, condition); } else { long rawValue = primitiveLocation.getLong(store, condition); if (type == int.class) { return (int) rawValue; } else if (type == long.class) { return rawValue; } else if (type == double.class) { return Double.longBitsToDouble(rawValue); } else if (type == boolean.class) { return rawValue != 0; } else { CompilerDirectives.transferToInterpreter(); throw new IllegalStateException(); } } }
@Override public void setInternal(DynamicObject store, Object value) throws IncompatibleLocationException { if (type == Object.class) { ((LocationImpl) objectLocation).setInternal(store, value); } else { long rawValue; if (type == int.class && value instanceof Integer) { rawValue = (int) value; } else if (type == long.class && value instanceof Long) { rawValue = (long) value; } else if (type == long.class && layout.isAllowedIntToLong() && value instanceof Integer) { rawValue = (int) value; } else if (type == double.class && value instanceof Double) { rawValue = Double.doubleToRawLongBits((double) value); } else if (type == double.class && layout.isAllowedIntToDouble() && value instanceof Integer) { rawValue = Double.doubleToRawLongBits((int) value); } else if (type == boolean.class && value instanceof Boolean) { rawValue = (boolean) value ? 1 : 0; } else { throw incompatibleLocation(); } primitiveLocation.setLongInternal(store, rawValue); } }
public final void setLong(DynamicObject store, long value, Shape shape) throws FinalLocationException { longLocation.setLong(store, value, shape); }
public final void setLongInternal(DynamicObject store, long value) { longLocation.setLongInternal(store, value); }
public final void setLong(DynamicObject store, long value) throws FinalLocationException { longLocation.setLong(store, value); }
public final long getLong(DynamicObject store, Shape shape) { return longLocation.getLong(store, shape); }
public final void setLong(DynamicObject store, long value) throws FinalLocationException { longLocation.setLong(store, value); }
public final void setLongInternal(DynamicObject store, long value) { longLocation.setLongInternal(store, value); }
public final void setLong(DynamicObject store, long value, Shape shape) throws FinalLocationException { longLocation.setLong(store, value, shape); }
public final void setLong(DynamicObject store, long value, Shape shape) throws FinalLocationException { longLocation.setLong(store, value, shape); }
public final long getLong(DynamicObject store, boolean condition) { return longLocation.getLong(store, condition); }
public final long getLong(DynamicObject store, boolean condition) { return longLocation.getLong(store, condition); }
public final long getLong(DynamicObject store, boolean condition) { return longLocation.getLong(store, condition); }
public final void setLong(DynamicObject store, long value) throws FinalLocationException { longLocation.setLong(store, value); }
@Override public String getWhereString() { return longLocation.getWhereString(); }
@Override public String getWhereString() { return longLocation.getWhereString(); }
public final long getLong(DynamicObject store, Shape shape) { return longLocation.getLong(store, shape); }
public final long getLong(DynamicObject store, Shape shape) { return longLocation.getLong(store, shape); }
public final void setLongInternal(DynamicObject store, long value) { longLocation.setLongInternal(store, value); }