From 59a16eaf0fa7c633569464853205d8f9f7cecb2c Mon Sep 17 00:00:00 2001 From: Douglas Crosher Date: Sun, 10 Nov 2013 04:20:22 +1100 Subject: [PATCH] Bug 906964 - ARM: leave some head-room in the double pools to help avoid bailing out which causes compilation failure for asm.js code. r=mjrosenb --- js/src/jit/arm/Assembler-arm.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/src/jit/arm/Assembler-arm.h b/js/src/jit/arm/Assembler-arm.h index db3ecc32503b..beb995085f6c 100644 --- a/js/src/jit/arm/Assembler-arm.h +++ b/js/src/jit/arm/Assembler-arm.h @@ -1303,12 +1303,17 @@ class Assembler void initWithAllocator() { m_buffer.initWithAllocator(); + // Note that the sizes for the double pools are set to 1020 rather than 1024 to + // work around a rare edge case that would otherwise bail out - which is not + // possible for Asm.js code and causes a compilation failure. See the comment at + // the fail_bail call within IonAssemberBufferWithConstantPools.h: finishPool(). + // Set up the backwards double region - new (&pools_[2]) Pool (1024, 8, 4, 8, 8, m_buffer.LifoAlloc_, true); + new (&pools_[2]) Pool (1020, 8, 4, 8, 8, m_buffer.LifoAlloc_, true); // Set up the backwards 32 bit region new (&pools_[3]) Pool (4096, 4, 4, 8, 4, m_buffer.LifoAlloc_, true, true); // Set up the forwards double region - new (doublePool) Pool (1024, 8, 4, 8, 8, m_buffer.LifoAlloc_, false, false, &pools_[2]); + new (doublePool) Pool (1020, 8, 4, 8, 8, m_buffer.LifoAlloc_, false, false, &pools_[2]); // Set up the forwards 32 bit region new (int32Pool) Pool (4096, 4, 4, 8, 4, m_buffer.LifoAlloc_, false, true, &pools_[3]); for (int i = 0; i < 4; i++) {