From 619154066705144089bc30ec947288a8b34b69d4 Mon Sep 17 00:00:00 2001 From: Ed Morley Date: Mon, 3 Dec 2012 11:17:49 +0000 Subject: [PATCH] Backout a592d7dfb470 for Android crashes --- js/src/ion/IonLinker.h | 2 -- js/src/ion/IonMacroAssembler.h | 2 +- js/src/ion/arm/Assembler-arm.cpp | 4 ---- js/src/ion/shared/IonAssemblerBuffer.h | 11 ++--------- .../ion/shared/IonAssemblerBufferWithConstantPools.h | 5 +---- 5 files changed, 4 insertions(+), 20 deletions(-) diff --git a/js/src/ion/IonLinker.h b/js/src/ion/IonLinker.h index e8665b9514aa..0f0805087244 100644 --- a/js/src/ion/IonLinker.h +++ b/js/src/ion/IonLinker.h @@ -55,8 +55,6 @@ class Linker bytesNeeded - headerSize, pool); if (!code) return NULL; - if (masm.oom()) - return fail(cx); code->copyFrom(masm); masm.link(code); return code; diff --git a/js/src/ion/IonMacroAssembler.h b/js/src/ion/IonMacroAssembler.h index d5572c5e41cd..a0e79d8b5e6c 100644 --- a/js/src/ion/IonMacroAssembler.h +++ b/js/src/ion/IonMacroAssembler.h @@ -504,7 +504,7 @@ class MacroAssembler : public MacroAssemblerSpecific } void link(IonCode *code) { - JS_ASSERT(!oom()); + // If this code can transition to C++ code and witness a GC, then we need to store // the IonCode onto the stack in order to GC it correctly. exitCodePatch should // be unset if the code never needed to push its IonCode*. diff --git a/js/src/ion/arm/Assembler-arm.cpp b/js/src/ion/arm/Assembler-arm.cpp index c151012940ee..29424b27e825 100644 --- a/js/src/ion/arm/Assembler-arm.cpp +++ b/js/src/ion/arm/Assembler-arm.cpp @@ -1637,10 +1637,6 @@ Assembler::as_b(BOffImm off, Condition c, bool isPatchable) BufferOffset Assembler::as_b(Label *l, Condition c, bool isPatchable) { - if (m_buffer.oom()) { - BufferOffset ret; - return ret; - } m_buffer.markNextAsBranch(); if (l->bound()) { BufferOffset ret = as_nop(); diff --git a/js/src/ion/shared/IonAssemblerBuffer.h b/js/src/ion/shared/IonAssemblerBuffer.h index 38ace6a65d9e..a148c86d2a76 100644 --- a/js/src/ion/shared/IonAssemblerBuffer.h +++ b/js/src/ion/shared/IonAssemblerBuffer.h @@ -77,7 +77,7 @@ struct BufferSlice : public InlineForwardListNode > { template struct AssemblerBuffer { public: - AssemblerBuffer() : head(NULL), tail(NULL), m_bail(false), m_oom(false), bufferSize(0) {} + AssemblerBuffer() : head(NULL), tail(NULL), m_oom(false), bufferSize(0) {} protected: typedef BufferSlice Slice; typedef AssemblerBuffer AssemblerBuffer_; @@ -85,7 +85,6 @@ struct AssemblerBuffer { Slice *tail; public: bool m_oom; - bool m_bail; // How much data has been added to the buffer thusfar. uint32 bufferSize; uint32 lastInstSize; @@ -149,17 +148,11 @@ struct AssemblerBuffer { return size(); } bool oom() const { - return m_oom || m_bail; - } - bool bail() const { - return m_bail; + return m_oom; } void fail_oom() { m_oom = true; } - void fail_bail() { - m_bail = true; - } Inst *getInst(BufferOffset off) { unsigned int local_off = off.getOffset(); Slice *cur = NULL; diff --git a/js/src/ion/shared/IonAssemblerBufferWithConstantPools.h b/js/src/ion/shared/IonAssemblerBufferWithConstantPools.h index 020129343c0e..5ca4c26e9dda 100644 --- a/js/src/ion/shared/IonAssemblerBufferWithConstantPools.h +++ b/js/src/ion/shared/IonAssemblerBufferWithConstantPools.h @@ -431,7 +431,7 @@ struct AssemblerBufferWithConstantPool : public AssemblerBuffer } BufferOffset insertEntry(uint32 instSize, uint8 *inst, Pool *p, uint8 *data, PoolEntry *pe = NULL) { - if (this->oom() && !this->bail()) + if (this->oom()) return BufferOffset(); int token; if (p != NULL) { @@ -726,12 +726,9 @@ struct AssemblerBufferWithConstantPool : public AssemblerBuffer // the last pool, which means it cannot affect the alignment of any other // Sub Pools. IonSpew(IonSpew_Pools, "[%d]***Offset was still out of range!***", id, codeOffset - magicAlign); - IonSpew(IonSpew_Pools, "[%d] Too complicated; bailingp", id); - this->fail_bail(); outcasts[poolIdx].append(iter->getOffset()); memcpy(&outcastEntries[poolIdx][numSkips * p->immSize], &p->poolData[idx * p->immSize], p->immSize); numSkips++; - return; } else { preservedEntries[idx] = true; }