From ab3929d411673116570e9108b7304a55a890ccc1 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sun, 20 Feb 2011 05:59:36 +0000 Subject: [PATCH] fix PowerPC and ARM bootimage builds This requires reducing HeapCapacity and CodeCapacity back to 128MB and 30MB respectively. I had set them to larger values to test non-ProGuard'ed OpenJDK bootimage builds, which naturally needed a lot more space. However, such builds aren't really useful in the real world, and the compiler currently can't handle jumps or calls spanning more than the maximum size of an immediate branch offset on ARM or PowerPC, so I'm lowering them back down to more realistic values. --- src/bootimage.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/bootimage.cpp b/src/bootimage.cpp index 13a278ea8b..e7f0d9510c 100644 --- a/src/bootimage.cpp +++ b/src/bootimage.cpp @@ -23,7 +23,7 @@ using namespace vm; namespace { -const unsigned HeapCapacity = 768 * 1024 * 1024; +const unsigned HeapCapacity = 128 * 1024 * 1024; // Notes on immutable references in the heap image: // @@ -560,9 +560,15 @@ main(int ac, const char** av) Finder* f = makeFinder(s, h, av[1], 0); Processor* p = makeProcessor(s, h, false); - BootImage image; - const unsigned CodeCapacity = 128 * 1024 * 1024; + // todo: currently, the compiler cannot compile code with jumps or + // calls spanning more than the maximum size of an immediate value + // in a branch instruction for the target architecture (~32MB on + // PowerPC and ARM). When that limitation is removed, we'll be able + // to specify a capacity as large as we like here: + const unsigned CodeCapacity = 30 * 1024 * 1024; + uint8_t* code = static_cast(h->allocate(CodeCapacity)); + BootImage image; p->initialize(&image, code, CodeCapacity); Machine* m = new (h->allocate(sizeof(Machine))) Machine