Ignore:
Timestamp:
Jan 23, 2013, 1:44:29 PM (12 years ago)
Author:
[email protected]
Message:

Replace numerous manual CRASH's in JSC with RELEASE_ASSERT
https://bugs.webkit.org/show_bug.cgi?id=107726

Reviewed by Filip Pizlo.

Fairly manual change from if (foo) CRASH(); to RELEASE_ASSERT(!foo);

  • assembler/MacroAssembler.h:

(JSC::MacroAssembler::branchAdd32):
(JSC::MacroAssembler::branchMul32):

  • bytecode/CodeBlockHash.cpp:

(JSC::CodeBlockHash::CodeBlockHash):

  • heap/BlockAllocator.h:

(JSC::Region::create):
(JSC::Region::createCustomSize):

  • heap/GCAssertions.h:
  • heap/HandleSet.cpp:

(JSC::HandleSet::visitStrongHandles):
(JSC::HandleSet::writeBarrier):

  • heap/HandleSet.h:

(JSC::HandleSet::allocate):

  • heap/Heap.cpp:

(JSC::Heap::collect):

  • heap/SlotVisitor.cpp:

(JSC::SlotVisitor::validate):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::execute):

  • jit/ExecutableAllocator.cpp:

(JSC::DemandExecutableAllocator::allocateNewSpace):
(JSC::ExecutableAllocator::allocate):

  • jit/ExecutableAllocator.h:

(JSC::roundUpAllocationSize):

  • jit/ExecutableAllocatorFixedVMPool.cpp:

(JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
(JSC::ExecutableAllocator::allocate):

  • runtime/ButterflyInlines.h:

(JSC::Butterfly::createUninitialized):

  • runtime/Completion.cpp:

(JSC::evaluate):

  • runtime/JSArray.h:

(JSC::constructArray):

  • runtime/JSGlobalObject.cpp:

(JSC::slowValidateCell):

  • runtime/JSObject.cpp:

(JSC::JSObject::enterDictionaryIndexingModeWhenArrayStorageAlreadyExists):
(JSC::JSObject::createArrayStorage):

  • tools/TieredMMapArray.h:

(JSC::TieredMMapArray::append):

  • yarr/YarrInterpreter.cpp:

(JSC::Yarr::Interpreter::allocDisjunctionContext):
(JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
(JSC::Yarr::Interpreter::InputStream::readChecked):
(JSC::Yarr::Interpreter::InputStream::uncheckInput):
(JSC::Yarr::Interpreter::InputStream::atEnd):
(JSC::Yarr::Interpreter::interpret):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/yarr/YarrInterpreter.cpp

    r135469 r140584  
    112112        size_t size = sizeof(DisjunctionContext) - sizeof(uintptr_t) + disjunction->m_frameSize * sizeof(uintptr_t);
    113113        allocatorPool = allocatorPool->ensureCapacity(size);
    114         if (!allocatorPool)
    115             CRASH();
     114        RELEASE_ASSERT(allocatorPool);
    116115        return new (allocatorPool->alloc(size)) DisjunctionContext();
    117116    }
     
    162161        size_t size = sizeof(ParenthesesDisjunctionContext) - sizeof(unsigned) + (term.atom.parenthesesDisjunction->m_numSubpatterns << 1) * sizeof(unsigned) + sizeof(DisjunctionContext) - sizeof(uintptr_t) + disjunction->m_frameSize * sizeof(uintptr_t);
    163162        allocatorPool = allocatorPool->ensureCapacity(size);
    164         if (!allocatorPool)
    165             CRASH();
     163        RELEASE_ASSERT(allocatorPool);
    166164        return new (allocatorPool->alloc(size)) ParenthesesDisjunctionContext(output, term);
    167165    }
     
    208206        int readChecked(unsigned negativePositionOffest)
    209207        {
    210             if (pos < negativePositionOffest)
    211                 CRASH();
     208            RELEASE_ASSERT(pos >= negativePositionOffest);
    212209            unsigned p = pos - negativePositionOffest;
    213210            ASSERT(p < length);
     
    265262        void uncheckInput(unsigned count)
    266263        {
    267             if (pos < count)
    268                 CRASH();
     264            RELEASE_ASSERT(pos >= count);
    269265            pos -= count;
    270266        }
     
    277273        bool atEnd(unsigned negativePositionOffest)
    278274        {
    279             if (pos < negativePositionOffest)
    280                 CRASH();
     275            RELEASE_ASSERT(pos >= negativePositionOffest);
    281276            return (pos - negativePositionOffest) == length;
    282277        }
     
    14261421
    14271422        allocatorPool = pattern->m_allocator->startAllocator();
    1428         if (!allocatorPool)
    1429             CRASH();
     1423        RELEASE_ASSERT(allocatorPool);
    14301424
    14311425        DisjunctionContext* context = allocDisjunctionContext(pattern->m_body.get());
Note: See TracChangeset for help on using the changeset viewer.