mirror of
https://github.com/corda/corda.git
synced 2025-06-12 20:28:18 +00:00
more work on tail recursion
We now create a unique thunk for each vtable position so as to avoid relying on using the return address to determine what method is to be compiled and invoked, since we will not have the correct return address in the case of a tail call. This required refactoring how executable memory is allocated in order to keep AOT compilation working. Also, we must always use the same register to hold the class pointer when compiling virtual calls, and ensure that the pointer stays there until the call instruction is executed so we know where to find it in the thunk.
This commit is contained in:
@ -37,7 +37,7 @@ makeCodeImage(Thread* t, Zone* zone, BootImage* image, uint8_t* code,
|
||||
const char* methodName, const char* methodSpec)
|
||||
{
|
||||
unsigned size = 0;
|
||||
t->m->processor->compileThunks(t, image, code, &size, capacity);
|
||||
t->m->processor->initialize(t, image, code, &size, capacity);
|
||||
|
||||
object constants = 0;
|
||||
PROTECT(t, constants);
|
||||
@ -79,8 +79,7 @@ makeCodeImage(Thread* t, Zone* zone, BootImage* image, uint8_t* code,
|
||||
== 0)))
|
||||
{
|
||||
t->m->processor->compileMethod
|
||||
(t, zone, code, &size, capacity, &constants, &calls, &addresses,
|
||||
method);
|
||||
(t, zone, &constants, &calls, &addresses, method);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user