mirror of
https://github.com/corda/corda.git
synced 2025-01-21 03:55:00 +00:00
GC safety and sign extension fixes
This commit is contained in:
parent
2e33856d6b
commit
6895ffaa99
@ -2888,6 +2888,8 @@ object
|
|||||||
finish(MyThread* t, Compiler* c, object method, Vector* objectPool,
|
finish(MyThread* t, Compiler* c, object method, Vector* objectPool,
|
||||||
Vector* traceLog)
|
Vector* traceLog)
|
||||||
{
|
{
|
||||||
|
PROTECT(t, method);
|
||||||
|
|
||||||
unsigned count = ceiling(c->codeSize() + c->poolSize(), BytesPerWord);
|
unsigned count = ceiling(c->codeSize() + c->poolSize(), BytesPerWord);
|
||||||
unsigned size = count + singletonMaskSize(count);
|
unsigned size = count + singletonMaskSize(count);
|
||||||
object result = allocate2
|
object result = allocate2
|
||||||
@ -2900,7 +2902,6 @@ finish(MyThread* t, Compiler* c, object method, Vector* objectPool,
|
|||||||
c->writeTo(start);
|
c->writeTo(start);
|
||||||
|
|
||||||
if (method) {
|
if (method) {
|
||||||
PROTECT(t, method);
|
|
||||||
PROTECT(t, result);
|
PROTECT(t, result);
|
||||||
|
|
||||||
for (unsigned i = 0; i < objectPool->length(); i += sizeof(PoolElement)) {
|
for (unsigned i = 0; i < objectPool->length(); i += sizeof(PoolElement)) {
|
||||||
@ -2999,10 +3000,10 @@ finish(MyThread* t, Compiler* c, object method, Vector* objectPool,
|
|||||||
if (false and
|
if (false and
|
||||||
strcmp(reinterpret_cast<const char*>
|
strcmp(reinterpret_cast<const char*>
|
||||||
(&byteArrayBody(t, className(t, methodClass(t, method)), 0)),
|
(&byteArrayBody(t, className(t, methodClass(t, method)), 0)),
|
||||||
"org/eclipse/swt/widgets/Display") == 0 and
|
"java/util/Properties$Parser") == 0 and
|
||||||
strcmp(reinterpret_cast<const char*>
|
strcmp(reinterpret_cast<const char*>
|
||||||
(&byteArrayBody(t, methodName(t, method), 0)),
|
(&byteArrayBody(t, methodName(t, method), 0)),
|
||||||
"init") == 0)
|
"parse") == 0)
|
||||||
{
|
{
|
||||||
asm("int3");
|
asm("int3");
|
||||||
}
|
}
|
||||||
@ -3172,11 +3173,7 @@ invokeNative2(MyThread* t, object method)
|
|||||||
case INT64_TYPE:
|
case INT64_TYPE:
|
||||||
case DOUBLE_TYPE: {
|
case DOUBLE_TYPE: {
|
||||||
memcpy(args + argOffset, sp, 8);
|
memcpy(args + argOffset, sp, 8);
|
||||||
if (BytesPerWord == 8) {
|
argOffset += (8 / BytesPerWord);
|
||||||
++argOffset;
|
|
||||||
} else {
|
|
||||||
argOffset += 2;
|
|
||||||
}
|
|
||||||
sp -= 2;
|
sp -= 2;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
@ -3217,6 +3214,16 @@ invokeNative2(MyThread* t, object method)
|
|||||||
|
|
||||||
if (LIKELY(t->exception == 0) and returnType == POINTER_TYPE) {
|
if (LIKELY(t->exception == 0) and returnType == POINTER_TYPE) {
|
||||||
return result ? *reinterpret_cast<uintptr_t*>(result) : 0;
|
return result ? *reinterpret_cast<uintptr_t*>(result) : 0;
|
||||||
|
} else if (BytesPerWord == 8) {
|
||||||
|
switch (returnType) {
|
||||||
|
case INT8_TYPE:
|
||||||
|
case INT16_TYPE:
|
||||||
|
case INT32_TYPE:
|
||||||
|
// force sign extension
|
||||||
|
return static_cast<int32_t>(result);
|
||||||
|
|
||||||
|
default: return result;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user