mirror of
https://github.com/corda/corda.git
synced 2025-02-05 10:39:13 +00:00
handle methods ending with large blocks properly when generating constant pools
We can only omit the jump past a constant pool if it's placed at the end of a method, which is only true if the pool belongs to the last block of that method and that block is not so large that the pool must be placed inside the block instead of after it.
This commit is contained in:
parent
b76cbbfa56
commit
fa7d46c322
12
src/arm.cpp
12
src/arm.cpp
@ -664,13 +664,19 @@ appendPoolEvent(Context* c, MyBlock* b, unsigned offset, PoolOffset* head,
|
||||
b->poolEventTail = e;
|
||||
}
|
||||
|
||||
bool
|
||||
needJump(MyBlock* b)
|
||||
{
|
||||
return b->next or b->size != (b->size & PoolOffsetMask);
|
||||
}
|
||||
|
||||
unsigned
|
||||
padding(MyBlock* b, unsigned offset)
|
||||
{
|
||||
unsigned total = 0;
|
||||
for (PoolEvent* e = b->poolEventHead; e; e = e->next) {
|
||||
if (e->offset <= offset) {
|
||||
if (b->next) {
|
||||
if (needJump(b)) {
|
||||
total += BytesPerWord;
|
||||
}
|
||||
for (PoolOffset* o = e->poolOffsetHead; o; o = o->next) {
|
||||
@ -2363,7 +2369,7 @@ class MyAssembler: public Assembler {
|
||||
|
||||
unsigned entry = dstOffset + poolSize;
|
||||
|
||||
if (b->next) {
|
||||
if (needJump(b)) {
|
||||
entry += BytesPerWord;
|
||||
}
|
||||
|
||||
@ -2381,7 +2387,7 @@ class MyAssembler: public Assembler {
|
||||
poolSize += BytesPerWord;
|
||||
}
|
||||
|
||||
if (b->next) {
|
||||
if (needJump(b)) {
|
||||
write4(dst + dstOffset, ::b((poolSize + BytesPerWord - 8) >> 2));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user