diff --git a/src/avian/machine.h b/src/avian/machine.h index 814354bf10..c22f888b5b 100644 --- a/src/avian/machine.h +++ b/src/avian/machine.h @@ -3627,7 +3627,7 @@ inline GcClass* resolveClassInPool(Thread* t, object loader, GcMethod* method, unsigned index, bool throw_ = true) { - object o = singletonObject(t, cast(t, codePool(t, method->code())), index); + object o = singletonObject(t, codePool(t, method->code()), index); loadMemoryBarrier(); @@ -3639,7 +3639,7 @@ resolveClassInPool(Thread* t, object loader, GcMethod* method, unsigned index, if (c) { storeStoreMemoryBarrier(); - set(t, codePool(t, method->code()), + set(t, reinterpret_cast(codePool(t, method->code())), SingletonBody + (index * BytesPerWord), reinterpret_cast(c)); } return c; @@ -3660,7 +3660,7 @@ resolve(Thread* t, object loader, GcMethod* method, unsigned index, object (*find)(vm::Thread*, GcClass*, object, object), Gc::Type errorType, bool throw_ = true) { - object o = singletonObject(t, cast(t, codePool(t, method->code())), index); + object o = singletonObject(t, codePool(t, method->code()), index); loadMemoryBarrier(); @@ -3680,7 +3680,7 @@ resolve(Thread* t, object loader, GcMethod* method, unsigned index, if (o) { storeStoreMemoryBarrier(); - set(t, codePool(t, method->code()), + set(t, reinterpret_cast(codePool(t, method->code())), SingletonBody + (index * BytesPerWord), o); } } else { diff --git a/src/compile.cpp b/src/compile.cpp index 9fe0873fd6..3c54bc2327 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -4105,7 +4105,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, uint16_t index = codeReadInt16(t, code, ip); object reference = singletonObject - (t, cast(t, codePool(t, context->method->code())), index - 1); + (t, codePool(t, context->method->code()), index - 1); PROTECT(t, reference); @@ -4191,7 +4191,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, uint16_t index = codeReadInt16(t, code, ip); object reference = singletonObject - (t, cast(t, codePool(t, context->method->code())), index - 1); + (t, codePool(t, context->method->code()), index - 1); PROTECT(t, reference); @@ -4422,7 +4422,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, uint16_t index = codeReadInt16(t, code, ip); object reference = singletonObject - (t, cast(t, codePool(t, context->method->code())), index - 1); + (t, codePool(t, context->method->code()), index - 1); PROTECT(t, reference); @@ -4869,7 +4869,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, uint16_t index = codeReadInt16(t, code, ip); object reference = singletonObject - (t, cast(t, codePool(t, context->method->code())), index - 1); + (t, codePool(t, context->method->code()), index - 1); PROTECT(t, reference); @@ -4905,7 +4905,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, ip += 2; object reference = singletonObject - (t, cast(t, codePool(t, context->method->code())), index - 1); + (t, codePool(t, context->method->code()), index - 1); PROTECT(t, reference); @@ -4963,7 +4963,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, uint16_t index = codeReadInt16(t, code, ip); object reference = singletonObject - (t, cast(t, codePool(t, context->method->code())), index - 1); + (t, codePool(t, context->method->code()), index - 1); PROTECT(t, reference); @@ -4998,7 +4998,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, uint16_t index = codeReadInt16(t, code, ip); object reference = singletonObject - (t, cast(t, codePool(t, context->method->code())), index - 1); + (t, codePool(t, context->method->code()), index - 1); PROTECT(t, reference); @@ -5024,7 +5024,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, uint16_t index = codeReadInt16(t, code, ip); object reference = singletonObject - (t, cast(t, codePool(t, context->method->code())), index - 1); + (t, codePool(t, context->method->code()), index - 1); PROTECT(t, reference); @@ -5238,7 +5238,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, index = codeReadInt16(t, code, ip); } - GcSingleton* pool = cast(t, codePool(t, code)); + GcSingleton* pool = codePool(t, code); if (singletonIsObject(t, pool, index - 1)) { object v = singletonObject(t, pool, index - 1); @@ -5293,7 +5293,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, case ldc2_w: { uint16_t index = codeReadInt16(t, code, ip); - GcSingleton* pool = cast(t, codePool(t, code)); + GcSingleton* pool = codePool(t, code); uint64_t v; memcpy(&v, &singletonValue(t, pool, index - 1), 8); @@ -5522,7 +5522,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, uint8_t dimensions = codeBody(t, code, ip++); object reference = singletonObject - (t, cast(t, codePool(t, context->method->code())), index - 1); + (t, codePool(t, context->method->code()), index - 1); PROTECT(t, reference); @@ -5562,7 +5562,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, uint16_t index = codeReadInt16(t, code, ip); object reference = singletonObject - (t, cast(t, codePool(t, context->method->code())), index - 1); + (t, codePool(t, context->method->code()), index - 1); PROTECT(t, reference); @@ -5624,7 +5624,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, uint16_t index = codeReadInt16(t, code, ip); object reference = singletonObject - (t, cast(t, codePool(t, context->method->code())), index - 1); + (t, codePool(t, context->method->code()), index - 1); PROTECT(t, reference); diff --git a/src/interpret.cpp b/src/interpret.cpp index b6c6283884..9be7343d87 100644 --- a/src/interpret.cpp +++ b/src/interpret.cpp @@ -2106,7 +2106,7 @@ interpret3(Thread* t, const int base) index = codeReadInt16(t, code, ip); } - GcSingleton* pool = cast(t, codePool(t, code)); + GcSingleton* pool = codePool(t, code); if (singletonIsObject(t, pool, index - 1)) { object v = singletonObject(t, pool, index - 1); @@ -2128,7 +2128,7 @@ interpret3(Thread* t, const int base) case ldc2_w: { uint16_t index = codeReadInt16(t, code, ip); - GcSingleton* pool = cast(t, codePool(t, code)); + GcSingleton* pool = codePool(t, code); uint64_t v; memcpy(&v, &singletonValue(t, pool, index - 1), 8); diff --git a/src/machine.cpp b/src/machine.cpp index d7c3464314..5ba2b32acf 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -1914,7 +1914,7 @@ parseCode(Thread* t, Stream& s, GcSingleton* pool) fprintf(stderr, " code: maxStack %d maxLocals %d length %d\n", maxStack, maxLocals, length); } - object code = reinterpret_cast(makeCode(t, reinterpret_cast(pool), 0, 0, 0, 0, 0, maxStack, maxLocals, length)); + object code = reinterpret_cast(makeCode(t, pool, 0, 0, 0, 0, 0, maxStack, maxLocals, length)); s.read(&codeBody(t, code, 0), length); PROTECT(t, code); diff --git a/src/types.def b/src/types.def index 1287048a42..40b2f34791 100644 --- a/src/types.def +++ b/src/types.def @@ -327,7 +327,7 @@ (array int32_t body)) (type code avian/Code - (object pool) + (singleton pool) (intArray stackMap) (object exceptionHandlerTable) (lineNumberTable lineNumberTable)