|
|
|
@ -149,12 +149,12 @@ public final class JIT {
@@ -149,12 +149,12 @@ public final class JIT {
|
|
|
|
|
throw new IllegalArgumentException("Invalid data section offset."); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TODO: Currently we just use maximum size so that the address is predictable.
|
|
|
|
|
long size = MAX_CODE_SIZE; |
|
|
|
|
// TODO: Currently we hardcode the size so that the address is predictable.
|
|
|
|
|
long size = 1 * 1024 * 1024; |
|
|
|
|
// long size = file.length() + 0x88 + ALIGNMENT - 1;
|
|
|
|
|
// if (size >= MAX_CODE_SIZE) {
|
|
|
|
|
// throw new IllegalArgumentException("Payload is too big.");
|
|
|
|
|
// }
|
|
|
|
|
if (size >= MAX_CODE_SIZE) { |
|
|
|
|
throw new IllegalArgumentException("Payload is too big."); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Allocate JIT memory.
|
|
|
|
|
long name = api.malloc(4); |
|
|
|
|