Use the Fixnum factory instead of creating new Fixnums all over the place.

Patch by: Douglas Miles (logicmoo at gmail.com)
parent 5a9259e2
......@@ -85,7 +85,7 @@ public abstract class AbstractVector extends AbstractArray
@Override
public final LispObject getDimensions()
{
return new Cons(new Fixnum(capacity()));
return new Cons(Fixnum.getInstance(capacity()));
}
@Override
......@@ -166,10 +166,10 @@ public abstract class AbstractVector extends AbstractArray
sb.append(").");
}
error(new TypeError(sb.toString(),
new Fixnum(index),
Fixnum.getInstance(index),
list(Symbol.INTEGER,
Fixnum.ZERO,
new Fixnum(limit - 1))));
Fixnum.getInstance(limit - 1))));
}
......
......@@ -104,7 +104,7 @@ public class Autoload extends Function
final LispThread thread = LispThread.currentThread();
final SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
int loadDepth = Fixnum.getValue(_LOAD_DEPTH_.symbolValue());
thread.bindSpecial(_LOAD_DEPTH_, new Fixnum(++loadDepth));
thread.bindSpecial(_LOAD_DEPTH_, Fixnum.getInstance(++loadDepth));
try {
if (_AUTOLOAD_VERBOSE_.symbolValue(thread) != NIL) {
final String prefix = Load.getLoadVerbosePrefix(loadDepth);
......
......@@ -59,7 +59,7 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
public LispObject typeOf()
{
return list(Symbol.SIMPLE_ARRAY, UNSIGNED_BYTE_16,
new Cons(new Fixnum(capacity)));
new Cons(Fixnum.getInstance(capacity)));
}
@Override
......@@ -118,7 +118,7 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
public LispObject elt(int index) throws ConditionThrowable
{
try {
return new Fixnum(elements[index]);
return Fixnum.getInstance(elements[index]);
}
catch (ArrayIndexOutOfBoundsException e) {
badIndex(index, capacity);
......@@ -145,7 +145,7 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
public LispObject AREF(int index) throws ConditionThrowable
{
try {
return new Fixnum(elements[index]);
return Fixnum.getInstance(elements[index]);
}
catch (ArrayIndexOutOfBoundsException e) {
badIndex(index, elements.length);
......@@ -158,7 +158,7 @@ public final class BasicVector_UnsignedByte16 extends AbstractVector
public LispObject AREF(LispObject index) throws ConditionThrowable
{
try {
return new Fixnum(elements[((Fixnum)index).value]);
return Fixnum.getInstance(elements[((Fixnum)index).value]);
}
catch (ClassCastException e) {
return error(new TypeError(index, Symbol.FIXNUM));
......
......@@ -60,7 +60,7 @@ public final class BasicVector_UnsignedByte32 extends AbstractVector
public LispObject typeOf()
{
return list(Symbol.SIMPLE_ARRAY, UNSIGNED_BYTE_32,
new Cons(new Fixnum(capacity)));
new Cons(Fixnum.getInstance(capacity)));
}
@Override
......
......@@ -58,7 +58,7 @@ public final class BasicVector_UnsignedByte8 extends AbstractVector
@Override
public LispObject typeOf()
{
return list(Symbol.SIMPLE_ARRAY, UNSIGNED_BYTE_8, new Cons(new Fixnum(capacity)));
return list(Symbol.SIMPLE_ARRAY, UNSIGNED_BYTE_8, new Cons(Fixnum.getInstance(capacity)));
}
@Override
......
......@@ -668,7 +668,7 @@ public final class Bignum extends LispInteger
public LispObject LOGAND(int n) throws ConditionThrowable
{
if (n >= 0)
return new Fixnum(value.intValue() & n);
return Fixnum.getInstance(value.intValue() & n);
else
return number(value.and(BigInteger.valueOf(n)));
}
......@@ -680,7 +680,7 @@ public final class Bignum extends LispInteger
{
int n = ((Fixnum)obj).value;
if (n >= 0)
return new Fixnum(value.intValue() & n);
return Fixnum.getInstance(value.intValue() & n);
else
return number(value.and(BigInteger.valueOf(n)));
}
......
......@@ -148,7 +148,7 @@ public final class ComplexArray extends AbstractArray
{
LispObject result = NIL;
for (int i = dimv.length; i-- > 0;)
result = new Cons(new Fixnum(dimv[i]), result);
result = new Cons(Fixnum.getInstance(dimv[i]), result);
return result;
}
......@@ -182,7 +182,7 @@ public final class ComplexArray extends AbstractArray
LispObject value1, value2;
if (array != null) {
value1 = array;
value2 = new Fixnum(displacement);
value2 = Fixnum.getInstance(displacement);
} else {
value1 = NIL;
value2 = Fixnum.ZERO;
......
......@@ -144,7 +144,7 @@ public final class ComplexArray_UnsignedByte32 extends AbstractArray
{
LispObject result = NIL;
for (int i = dimv.length; i-- > 0;)
result = new Cons(new Fixnum(dimv[i]), result);
result = new Cons(Fixnum.getInstance(dimv[i]), result);
return result;
}
......@@ -178,7 +178,7 @@ public final class ComplexArray_UnsignedByte32 extends AbstractArray
LispObject value1, value2;
if (array != null) {
value1 = array;
value2 = new Fixnum(displacement);
value2 = Fixnum.getInstance(displacement);
} else {
value1 = NIL;
value2 = Fixnum.ZERO;
......
......@@ -140,7 +140,7 @@ public final class ComplexArray_UnsignedByte8 extends AbstractArray
{
LispObject result = NIL;
for (int i = dimv.length; i-- > 0;)
result = new Cons(new Fixnum(dimv[i]), result);
result = new Cons(Fixnum.getInstance(dimv[i]), result);
return result;
}
......@@ -174,7 +174,7 @@ public final class ComplexArray_UnsignedByte8 extends AbstractArray
LispObject value1, value2;
if (array != null) {
value1 = array;
value2 = new Fixnum(displacement);
value2 = Fixnum.getInstance(displacement);
} else {
value1 = NIL;
value2 = Fixnum.ZERO;
......
......@@ -62,7 +62,7 @@ public final class ComplexBitVector extends AbstractBitVector
@Override
public LispObject typeOf()
{
return list(Symbol.BIT_VECTOR, new Fixnum(capacity));
return list(Symbol.BIT_VECTOR, Fixnum.getInstance(capacity));
}
@Override
......@@ -113,7 +113,7 @@ public final class ComplexBitVector extends AbstractBitVector
LispObject value1, value2;
if (array != null) {
value1 = array;
value2 = new Fixnum(displacement);
value2 = Fixnum.getInstance(displacement);
} else {
value1 = NIL;
value2 = Fixnum.ZERO;
......@@ -257,7 +257,7 @@ public final class ComplexBitVector extends AbstractBitVector
throws ConditionThrowable
{
vectorPushExtend(element);
return new Fixnum(getFillPointer() - 1);
return Fixnum.getInstance(getFillPointer() - 1);
}
// FIXME
......@@ -276,7 +276,7 @@ public final class ComplexBitVector extends AbstractBitVector
}
aset(fp, element);
setFillPointer(fp + 1);
return new Fixnum(fp);
return Fixnum.getInstance(fp);
}
private final void ensureCapacity(int minCapacity) throws ConditionThrowable
......
......@@ -133,7 +133,7 @@ public final class ComplexString extends AbstractString
if (array != null)
{
value1 = array;
value2 = new Fixnum(displacement);
value2 = Fixnum.getInstance(displacement);
}
else
{
......@@ -468,7 +468,7 @@ public final class ComplexString extends AbstractString
throws ConditionThrowable
{
vectorPushExtend(element);
return new Fixnum(fillPointer - 1);
return Fixnum.getInstance(fillPointer - 1);
}
@Override
......@@ -497,7 +497,7 @@ public final class ComplexString extends AbstractString
}
else
array.aset(fillPointer + displacement, element);
return new Fixnum(fillPointer++);
return Fixnum.getInstance(fillPointer++);
}
public final void ensureCapacity(int minCapacity) throws ConditionThrowable
......
......@@ -67,7 +67,7 @@ public final class ComplexVector extends AbstractVector
@Override
public LispObject typeOf()
{
return list(Symbol.VECTOR, T, new Fixnum(capacity));
return list(Symbol.VECTOR, T, Fixnum.getInstance(capacity));
}
@Override
......@@ -130,7 +130,7 @@ public final class ComplexVector extends AbstractVector
LispObject value1, value2;
if (array != null) {
value1 = array;
value2 = new Fixnum(displacement);
value2 = Fixnum.getInstance(displacement);
} else {
value1 = NIL;
value2 = Fixnum.ZERO;
......@@ -316,7 +316,7 @@ public final class ComplexVector extends AbstractVector
throws ConditionThrowable
{
vectorPushExtend(element);
return new Fixnum(fillPointer - 1);
return Fixnum.getInstance(fillPointer - 1);
}
@Override
......@@ -332,7 +332,7 @@ public final class ComplexVector extends AbstractVector
ensureCapacity(capacity + ext);
}
aset(fillPointer, element);
return new Fixnum(fillPointer++);
return Fixnum.getInstance(fillPointer++);
}
private final void ensureCapacity(int minCapacity) throws ConditionThrowable
......
......@@ -68,7 +68,7 @@ public final class ComplexVector_UnsignedByte32 extends AbstractVector
@Override
public LispObject typeOf()
{
return list(Symbol.VECTOR, UNSIGNED_BYTE_32, new Fixnum(capacity));
return list(Symbol.VECTOR, UNSIGNED_BYTE_32, Fixnum.getInstance(capacity));
}
@Override
......@@ -131,7 +131,7 @@ public final class ComplexVector_UnsignedByte32 extends AbstractVector
LispObject value1, value2;
if (array != null) {
value1 = array;
value2 = new Fixnum(displacement);
value2 = Fixnum.getInstance(displacement);
} else {
value1 = NIL;
value2 = Fixnum.ZERO;
......@@ -318,7 +318,7 @@ public final class ComplexVector_UnsignedByte32 extends AbstractVector
throws ConditionThrowable
{
vectorPushExtend(element);
return new Fixnum(fillPointer - 1);
return Fixnum.getInstance(fillPointer - 1);
}
@Override
......@@ -334,7 +334,7 @@ public final class ComplexVector_UnsignedByte32 extends AbstractVector
ensureCapacity(capacity + ext);
}
aset(fillPointer, element);
return new Fixnum(fillPointer++);
return Fixnum.getInstance(fillPointer++);
}
private final void ensureCapacity(int minCapacity) throws ConditionThrowable
......
......@@ -66,7 +66,7 @@ public final class ComplexVector_UnsignedByte8 extends AbstractVector
@Override
public LispObject typeOf()
{
return list(Symbol.VECTOR, UNSIGNED_BYTE_8, new Fixnum(capacity));
return list(Symbol.VECTOR, UNSIGNED_BYTE_8, Fixnum.getInstance(capacity));
}
@Override
......@@ -129,7 +129,7 @@ public final class ComplexVector_UnsignedByte8 extends AbstractVector
LispObject value1, value2;
if (array != null) {
value1 = array;
value2 = new Fixnum(displacement);
value2 = Fixnum.getInstance(displacement);
} else {
value1 = NIL;
value2 = Fixnum.ZERO;
......@@ -330,7 +330,7 @@ public final class ComplexVector_UnsignedByte8 extends AbstractVector
throws ConditionThrowable
{
vectorPushExtend(element);
return new Fixnum(fillPointer - 1);
return Fixnum.getInstance(fillPointer - 1);
}
@Override
......@@ -346,7 +346,7 @@ public final class ComplexVector_UnsignedByte8 extends AbstractVector
ensureCapacity(capacity + ext);
}
aset(fillPointer, element);
return new Fixnum(fillPointer++);
return Fixnum.getInstance(fillPointer++);
}
private final void ensureCapacity(int minCapacity) throws ConditionThrowable
......
......@@ -183,7 +183,7 @@ public final class Cons extends LispObject
public LispObject nthcdr(int n) throws ConditionThrowable
{
if (n < 0)
return type_error(new Fixnum(n),
return type_error(Fixnum.getInstance(n),
list(Symbol.INTEGER, Fixnum.ZERO));
LispObject result = this;
for (int i = n; i-- > 0;)
......@@ -302,7 +302,7 @@ public final class Cons extends LispObject
public LispObject NTH(int index) throws ConditionThrowable
{
if (index < 0)
type_error(new Fixnum(index), Symbol.UNSIGNED_BYTE);
type_error(Fixnum.getInstance(index), Symbol.UNSIGNED_BYTE);
int i = 0;
LispObject obj = this;
while (true)
......@@ -354,7 +354,7 @@ public final class Cons extends LispObject
public LispObject elt(int index) throws ConditionThrowable
{
if (index < 0)
type_error(new Fixnum(index), Symbol.UNSIGNED_BYTE);
type_error(Fixnum.getInstance(index), Symbol.UNSIGNED_BYTE);
int i = 0;
Cons cons = this;
while (true)
......@@ -370,9 +370,9 @@ public final class Cons extends LispObject
if (cons.cdr == NIL)
{
// Index too large.
type_error(new Fixnum(index),
type_error(Fixnum.getInstance(index),
list(Symbol.INTEGER, Fixnum.ZERO,
new Fixnum(length() - 1)));
Fixnum.getInstance(length() - 1)));
}
else
{
......
......@@ -489,7 +489,7 @@ public final class DoubleFloat extends LispObject
double quotient = value / divisor;
if (quotient >= Integer.MIN_VALUE && quotient <= Integer.MAX_VALUE) {
int q = (int) quotient;
return thread.setValues(new Fixnum(q),
return thread.setValues(Fixnum.getInstance(q),
new DoubleFloat(value - q * divisor));
}
// We need to convert the quotient to a bignum.
......@@ -502,8 +502,8 @@ public final class DoubleFloat extends LispObject
else
m = (bits & 0xfffffffffffffL) | 0x10000000000000L;
LispObject significand = number(m);
Fixnum exponent = new Fixnum(e - 1075);
Fixnum sign = new Fixnum(s);
Fixnum exponent = Fixnum.getInstance(e - 1075);
Fixnum sign = Fixnum.getInstance(s);
LispObject result = significand;
result =
result.multiplyBy(MathFunctions.EXPT.execute(Fixnum.TWO, exponent));
......@@ -522,7 +522,7 @@ public final class DoubleFloat extends LispObject
// Debug.trace("quotient = " + quotient);
if (quotient >= Integer.MIN_VALUE && quotient <= Integer.MAX_VALUE) {
int q = (int) quotient;
return thread.setValues(new Fixnum(q),
return thread.setValues(Fixnum.getInstance(q),
new DoubleFloat(value - q * divisor));
}
// We need to convert the quotient to a bignum.
......@@ -536,9 +536,9 @@ public final class DoubleFloat extends LispObject
m = (bits & 0xfffffffffffffL) | 0x10000000000000L;
LispObject significand = number(m);
// Debug.trace("significand = " + significand.writeToString());
Fixnum exponent = new Fixnum(e - 1075);
Fixnum exponent = Fixnum.getInstance(e - 1075);
// Debug.trace("exponent = " + exponent.writeToString());
Fixnum sign = new Fixnum(s);
Fixnum sign = Fixnum.getInstance(s);
// Debug.trace("sign = " + sign.writeToString());
LispObject result = significand;
// Debug.trace("result = " + result.writeToString());
......
......@@ -37,10 +37,11 @@ import java.math.BigInteger;
public final class Fixnum extends LispInteger
{
public static final Fixnum[] constants = new Fixnum[256];
public static final int MAX_POS_CACHE = 256;//just like before - however never set this to less than 256
public static final Fixnum[] constants = new Fixnum[MAX_POS_CACHE];
static
{
for (int i = 0; i < 256; i++)
for (int i = 0; i < MAX_POS_CACHE; i++)
constants[i] = new Fixnum(i);
}
......@@ -49,16 +50,17 @@ public final class Fixnum extends LispInteger
public static final Fixnum TWO = constants[2];
public static final Fixnum THREE = constants[3];
public static final Fixnum MINUS_ONE = new Fixnum(-1);
public static final Fixnum MINUS_ONE = Fixnum.getInstance(-1);
public static Fixnum getInstance(int n)
{
return (n >= 0 && n < 256) ? constants[n] : new Fixnum(n);
return (n >= 0 && n < MAX_POS_CACHE) ? constants[n] : new Fixnum(n);
}
public final int value;
public Fixnum(int value)
// set to private to hunt down sneaky creators
private Fixnum(int value)
{
this.value = value;
}
......@@ -88,7 +90,7 @@ public final class Fixnum extends LispInteger
if (value == 0 || value == 1)
return Symbol.BIT;
if (value > 1)
return list(Symbol.INTEGER, ZERO, new Fixnum(Integer.MAX_VALUE));
return list(Symbol.INTEGER, ZERO, Fixnum.getInstance(Integer.MAX_VALUE));
return Symbol.FIXNUM;
}
......@@ -251,7 +253,7 @@ public final class Fixnum extends LispInteger
if (value >= 0)
return this;
if (value > Integer.MIN_VALUE)
return new Fixnum(-value);
return Fixnum.getInstance(-value);
return new Bignum(-((long)Integer.MIN_VALUE));
}
......@@ -370,7 +372,7 @@ public final class Fixnum extends LispInteger
public final LispObject incr()
{
if (value < Integer.MAX_VALUE)
return new Fixnum(value + 1);
return Fixnum.getInstance(value + 1);
return new Bignum((long) value + 1);
}
......@@ -378,7 +380,7 @@ public final class Fixnum extends LispInteger
public final LispObject decr()
{
if (value > Integer.MIN_VALUE)
return new Fixnum(value - 1);
return Fixnum.getInstance(value - 1);
return new Bignum((long) value - 1);
}
......@@ -387,7 +389,7 @@ public final class Fixnum extends LispInteger
{
long result = 0L - value;
if (result >= Integer.MIN_VALUE && result <= Integer.MAX_VALUE)
return new Fixnum((int)result);
return Fixnum.getInstance((int)result);
else
return new Bignum(result);
}
......@@ -397,7 +399,7 @@ public final class Fixnum extends LispInteger
{
long result = (long) value + n;
if (result >= Integer.MIN_VALUE && result <= Integer.MAX_VALUE)
return new Fixnum((int)result);
return Fixnum.getInstance((int)result);
else
return new Bignum(result);
}
......@@ -409,7 +411,7 @@ public final class Fixnum extends LispInteger
{
long result = (long) value + ((Fixnum)obj).value;
if (result >= Integer.MIN_VALUE && result <= Integer.MAX_VALUE)
return new Fixnum((int)result);
return Fixnum.getInstance((int)result);
else
return new Bignum(result);
}
......@@ -439,7 +441,7 @@ public final class Fixnum extends LispInteger
{
long result = (long) value - n;
if (result >= Integer.MIN_VALUE && result <= Integer.MAX_VALUE)
return new Fixnum((int)result);
return Fixnum.getInstance((int)result);
else
return new Bignum(result);
}
......@@ -477,7 +479,7 @@ public final class Fixnum extends LispInteger
{
long result = (long) value * n;
if (result >= Integer.MIN_VALUE && result <= Integer.MAX_VALUE)
return new Fixnum((int)result);
return Fixnum.getInstance((int)result);
else
return new Bignum(result);
}
......@@ -489,7 +491,7 @@ public final class Fixnum extends LispInteger
{
long result = (long) value * ((Fixnum)obj).value;
if (result >= Integer.MIN_VALUE && result <= Integer.MAX_VALUE)
return new Fixnum((int)result);
return Fixnum.getInstance((int)result);
else
return new Bignum(result);
}
......@@ -527,7 +529,7 @@ public final class Fixnum extends LispInteger
// (/ MOST-NEGATIVE-FIXNUM -1) is a bignum.
if (value > Integer.MIN_VALUE)
if (value % divisor == 0)
return new Fixnum(value / divisor);
return Fixnum.getInstance(value / divisor);
return number(BigInteger.valueOf(value),
BigInteger.valueOf(divisor));
}
......@@ -733,8 +735,8 @@ public final class Fixnum extends LispInteger
int divisor = ((Fixnum)obj).value;
int quotient = value / divisor;
int remainder = value % divisor;
value1 = new Fixnum(quotient);
value2 = remainder == 0 ? Fixnum.ZERO : new Fixnum(remainder);
value1 = Fixnum.getInstance(quotient);
value2 = remainder == 0 ? Fixnum.ZERO : Fixnum.getInstance(remainder);
}
else if (obj instanceof Bignum)
{
......@@ -808,14 +810,14 @@ public final class Fixnum extends LispInteger
if (divisor < 0)
{
if (value > 0)
return new Fixnum(r + divisor);
return Fixnum.getInstance(r + divisor);
}
else
{
if (value < 0)
return new Fixnum(r + divisor);
return Fixnum.getInstance(r + divisor);
}
return new Fixnum(r);
return Fixnum.getInstance(r);
}
@Override
......@@ -832,12 +834,12 @@ public final class Fixnum extends LispInteger
return n >= 0 ? Fixnum.ZERO : Fixnum.MINUS_ONE;
}
if (shift < 0)
return new Fixnum((int)(n >> -shift));
return Fixnum.getInstance((int)(n >> -shift));
if (shift <= 32)
{
n = n << shift;
if (n >= Integer.MIN_VALUE && n <= Integer.MAX_VALUE)
return new Fixnum((int)n);
return Fixnum.getInstance((int)n);
else
return new Bignum(n);
}
......@@ -871,26 +873,26 @@ public final class Fixnum extends LispInteger
@Override
public LispObject LOGNOT()
{
return new Fixnum(~value);
return Fixnum.getInstance(~value);
}
@Override
public LispObject LOGAND(int n) throws ConditionThrowable
{
return new Fixnum(value & n);
return Fixnum.getInstance(value & n);
}
@Override
public LispObject LOGAND(LispObject obj) throws ConditionThrowable
{
if (obj instanceof Fixnum)
return new Fixnum(value & ((Fixnum)obj).value);
return Fixnum.getInstance(value & ((Fixnum)obj).value);
if (obj instanceof Bignum)
{
if (value >= 0)
{
int n2 = (((Bignum)obj).value).intValue();
return new Fixnum(value & n2);
return Fixnum.getInstance(value & n2);
}
else
{
......@@ -905,14 +907,14 @@ public final class Fixnum extends LispInteger
@Override
public LispObject LOGIOR(int n) throws ConditionThrowable
{
return new Fixnum(value | n);
return Fixnum.getInstance(value | n);
}
@Override
public LispObject LOGIOR(LispObject obj) throws ConditionThrowable
{
if (obj instanceof Fixnum)
return new Fixnum(value | ((Fixnum)obj).value);
return Fixnum.getInstance(value | ((Fixnum)obj).value);
if (obj instanceof Bignum)
{
BigInteger n1 = getBigInteger();
......@@ -925,14 +927,14 @@ public final class Fixnum extends LispInteger
@Override
public LispObject LOGXOR(int n) throws ConditionThrowable
{
return new Fixnum(value ^ n);
return Fixnum.getInstance(value ^ n);
}
@Override
public LispObject LOGXOR(LispObject obj) throws ConditionThrowable
{
if (obj instanceof Fixnum)
return new Fixnum(value ^ ((Fixnum)obj).value);
return Fixnum.getInstance(value ^ ((Fixnum)obj).value);
if (obj instanceof Bignum)
{
BigInteger n1 = getBigInteger();
......@@ -959,19 +961,19 @@ public final class Fixnum extends LispInteger
BigInteger y = Bignum.getValue(obj);
if (y.compareTo (BigInteger.ZERO) < 0)
return (new Fixnum(1)).divideBy(this.pow(new Bignum(y.negate())));
return (Fixnum.getInstance(1)).divideBy(this.pow(new Bignum(y.negate())));
if (y.compareTo(BigInteger.ZERO) == 0)
// No need to test base here; CLHS says 0^0 == 1.
return new Fixnum(1);
return Fixnum.getInstance(1);
int x = this.value;
if (x == 0)
return new Fixnum(0);
return Fixnum.getInstance(0);
if (x == 1)
return new Fixnum(1);
return Fixnum.getInstance(1);
BigInteger xy = BigInteger.ONE;
BigInteger term = BigInteger.valueOf((long) x);
......
......@@ -117,8 +117,8 @@ public final class FloatFunctions extends Lisp
else
m = (bits & 0x7fffff) | 0x800000;
LispObject significand = number(m);
Fixnum exponent = new Fixnum(e - 150);
Fixnum sign = new Fixnum(s);
Fixnum exponent = Fixnum.getInstance(e - 150);
Fixnum sign = Fixnum.getInstance(s);
return LispThread.currentThread().setValues(significand,
exponent,
sign);
......@@ -134,8 +134,8 @@ public final class FloatFunctions extends Lisp
else
m = (bits & 0xfffffffffffffL) | 0x10000000000000L;
LispObject significand = number(m);
Fixnum exponent = new Fixnum(e - 1075);
Fixnum sign = new Fixnum(s);
Fixnum exponent = Fixnum.getInstance(e - 1075);
Fixnum sign = Fixnum.getInstance(s);
return LispThread.currentThread().setValues(significand,
exponent,
sign);
......@@ -196,8 +196,8 @@ public final class FloatFunctions extends Lisp
}