mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
remove distinction between thunks and bootThunks in compile.cpp
Now that the AOT-compiled code image is position-independent, there is no further need for this distinction. In fact, it was harmful, because we were still using runtime-generated thunks when we should have been using the ones in the code image. This resulted in EXC_BAD_ACCESS errors on non-jailbroken iOS devices.
This commit is contained in:
parent
b862f5f90a
commit
88d614eb25
@ -2255,9 +2255,6 @@ defaultThunk(MyThread* t);
|
|||||||
uintptr_t
|
uintptr_t
|
||||||
nativeThunk(MyThread* t);
|
nativeThunk(MyThread* t);
|
||||||
|
|
||||||
uintptr_t
|
|
||||||
bootNativeThunk(MyThread* t);
|
|
||||||
|
|
||||||
uintptr_t
|
uintptr_t
|
||||||
aioobThunk(MyThread* t);
|
aioobThunk(MyThread* t);
|
||||||
|
|
||||||
@ -8816,9 +8813,9 @@ class MyProcessor: public Processor {
|
|||||||
root(t, MethodTreeSentinal));
|
root(t, MethodTreeSentinal));
|
||||||
set(t, root(t, MethodTree), TreeNodeRight,
|
set(t, root(t, MethodTree), TreeNodeRight,
|
||||||
root(t, MethodTreeSentinal));
|
root(t, MethodTreeSentinal));
|
||||||
}
|
|
||||||
|
|
||||||
local::compileThunks(static_cast<MyThread*>(t), &codeAllocator);
|
local::compileThunks(static_cast<MyThread*>(t), &codeAllocator);
|
||||||
|
}
|
||||||
|
|
||||||
segFaultHandler.m = t->m;
|
segFaultHandler.m = t->m;
|
||||||
expect(t, t->m->system->success
|
expect(t, t->m->system->success
|
||||||
@ -8888,7 +8885,6 @@ class MyProcessor: public Processor {
|
|||||||
SignalHandler divideByZeroHandler;
|
SignalHandler divideByZeroHandler;
|
||||||
FixedAllocator codeAllocator;
|
FixedAllocator codeAllocator;
|
||||||
ThunkCollection thunks;
|
ThunkCollection thunks;
|
||||||
ThunkCollection bootThunks;
|
|
||||||
unsigned callTableSize;
|
unsigned callTableSize;
|
||||||
bool useNativeFeatures;
|
bool useNativeFeatures;
|
||||||
void* thunkTable[dummyIndex + 1];
|
void* thunkTable[dummyIndex + 1];
|
||||||
@ -8913,7 +8909,7 @@ compileMethod2(MyThread* t, void* ip)
|
|||||||
if ((methodFlags(t, target) & ACC_NATIVE)
|
if ((methodFlags(t, target) & ACC_NATIVE)
|
||||||
and useLongJump(t, reinterpret_cast<uintptr_t>(ip)))
|
and useLongJump(t, reinterpret_cast<uintptr_t>(ip)))
|
||||||
{
|
{
|
||||||
address = bootNativeThunk(t);
|
address = nativeThunk(t);
|
||||||
} else {
|
} else {
|
||||||
address = methodAddress(t, target);
|
address = methodAddress(t, target);
|
||||||
}
|
}
|
||||||
@ -8960,7 +8956,7 @@ isThunk(MyThread* t, void* ip)
|
|||||||
{
|
{
|
||||||
MyProcessor* p = processor(t);
|
MyProcessor* p = processor(t);
|
||||||
|
|
||||||
return isThunk(&(p->thunks), ip) or isThunk(&(p->bootThunks), ip);
|
return isThunk(&(p->thunks), ip);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@ -9024,9 +9020,7 @@ isThunkUnsafeStack(MyThread* t, void* ip)
|
|||||||
{
|
{
|
||||||
MyProcessor* p = processor(t);
|
MyProcessor* p = processor(t);
|
||||||
|
|
||||||
return isThunk(t, ip)
|
return isThunk(t, ip) and isThunkUnsafeStack(&(p->thunks), ip);
|
||||||
and (isThunkUnsafeStack(&(p->thunks), ip)
|
|
||||||
or isThunkUnsafeStack(&(p->bootThunks), ip));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
object
|
object
|
||||||
@ -9274,14 +9268,14 @@ findThunks(MyThread* t, BootImage* image, uint8_t* code)
|
|||||||
{
|
{
|
||||||
MyProcessor* p = processor(t);
|
MyProcessor* p = processor(t);
|
||||||
|
|
||||||
p->bootThunks.default_ = thunkToThunk(image->thunks.default_, code);
|
p->thunks.default_ = thunkToThunk(image->thunks.default_, code);
|
||||||
p->bootThunks.defaultVirtual
|
p->thunks.defaultVirtual
|
||||||
= thunkToThunk(image->thunks.defaultVirtual, code);
|
= thunkToThunk(image->thunks.defaultVirtual, code);
|
||||||
p->bootThunks.native = thunkToThunk(image->thunks.native, code);
|
p->thunks.native = thunkToThunk(image->thunks.native, code);
|
||||||
p->bootThunks.aioob = thunkToThunk(image->thunks.aioob, code);
|
p->thunks.aioob = thunkToThunk(image->thunks.aioob, code);
|
||||||
p->bootThunks.stackOverflow
|
p->thunks.stackOverflow
|
||||||
= thunkToThunk(image->thunks.stackOverflow, code);
|
= thunkToThunk(image->thunks.stackOverflow, code);
|
||||||
p->bootThunks.table = thunkToThunk(image->thunks.table, code);
|
p->thunks.table = thunkToThunk(image->thunks.table, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -9622,12 +9616,6 @@ defaultThunk(MyThread* t)
|
|||||||
return reinterpret_cast<uintptr_t>(processor(t)->thunks.default_.start);
|
return reinterpret_cast<uintptr_t>(processor(t)->thunks.default_.start);
|
||||||
}
|
}
|
||||||
|
|
||||||
uintptr_t
|
|
||||||
bootDefaultThunk(MyThread* t)
|
|
||||||
{
|
|
||||||
return reinterpret_cast<uintptr_t>(processor(t)->bootThunks.default_.start);
|
|
||||||
}
|
|
||||||
|
|
||||||
uintptr_t
|
uintptr_t
|
||||||
defaultVirtualThunk(MyThread* t)
|
defaultVirtualThunk(MyThread* t)
|
||||||
{
|
{
|
||||||
@ -9641,12 +9629,6 @@ nativeThunk(MyThread* t)
|
|||||||
return reinterpret_cast<uintptr_t>(processor(t)->thunks.native.start);
|
return reinterpret_cast<uintptr_t>(processor(t)->thunks.native.start);
|
||||||
}
|
}
|
||||||
|
|
||||||
uintptr_t
|
|
||||||
bootNativeThunk(MyThread* t)
|
|
||||||
{
|
|
||||||
return reinterpret_cast<uintptr_t>(processor(t)->bootThunks.native.start);
|
|
||||||
}
|
|
||||||
|
|
||||||
uintptr_t
|
uintptr_t
|
||||||
aioobThunk(MyThread* t)
|
aioobThunk(MyThread* t)
|
||||||
{
|
{
|
||||||
@ -9662,8 +9644,7 @@ stackOverflowThunk(MyThread* t)
|
|||||||
bool
|
bool
|
||||||
unresolved(MyThread* t, uintptr_t methodAddress)
|
unresolved(MyThread* t, uintptr_t methodAddress)
|
||||||
{
|
{
|
||||||
return methodAddress == defaultThunk(t)
|
return methodAddress == defaultThunk(t);
|
||||||
or methodAddress == bootDefaultThunk(t);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uintptr_t
|
uintptr_t
|
||||||
|
Loading…
Reference in New Issue
Block a user