Changeset 140619 in webkit


Ignore:
Timestamp:
Jan 23, 2013 5:40:37 PM (11 years ago)
Author:
oliver@apple.com
Message:

Harden JSC a bit with RELEASE_ASSERT
https://bugs.webkit.org/show_bug.cgi?id=107766

Reviewed by Mark Hahnenberg.

Went through and replaced a pile of ASSERTs that were covering
significantly important details (bounds checks, etc) where
having the checks did not impact release performance in any
measurable way.

  • API/JSContextRef.cpp:

(JSContextCreateBacktrace):

  • assembler/MacroAssembler.h:

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

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::handlerForBytecodeOffset):
(JSC::CodeBlock::lineNumberForBytecodeOffset):
(JSC::CodeBlock::bytecodeOffset):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::bytecodeOffsetForCallAtIndex):
(JSC::CodeBlock::bytecodeOffset):
(JSC::CodeBlock::exceptionHandler):
(JSC::CodeBlock::codeOrigin):
(JSC::CodeBlock::immediateSwitchJumpTable):
(JSC::CodeBlock::characterSwitchJumpTable):
(JSC::CodeBlock::stringSwitchJumpTable):
(JSC::CodeBlock::setIdentifiers):
(JSC::baselineCodeBlockForInlineCallFrame):
(JSC::ExecState::uncheckedR):

  • bytecode/CodeOrigin.cpp:

(JSC::CodeOrigin::inlineStack):

  • bytecode/CodeOrigin.h:

(JSC::CodeOrigin::CodeOrigin):

  • dfg/DFGCSEPhase.cpp:
  • dfg/DFGOSRExit.cpp:
  • dfg/DFGScratchRegisterAllocator.h:

(JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
(JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::allocate):
(JSC::DFG::SpeculativeJIT::spill):
(JSC::DFG::SpeculativeJIT::integerResult):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::fillInteger):
(JSC::DFG::SpeculativeJIT::fillDouble):
(JSC::DFG::SpeculativeJIT::fillJSValue):
(JSC::DFG::SpeculativeJIT::nonSpeculativeCompareNull):
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
(JSC::DFG::SpeculativeJIT::fillSpeculateIntStrict):
(JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
(JSC::DFG::SpeculativeJIT::fillSpeculateCell):
(JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGValueSource.h:

(JSC::DFG::dataFormatToValueSourceKind):
(JSC::DFG::ValueSource::ValueSource):

  • dfg/DFGVirtualRegisterAllocationPhase.cpp:
  • heap/BlockAllocator.cpp:

(JSC::BlockAllocator::BlockAllocator):
(JSC::BlockAllocator::releaseFreeRegions):
(JSC::BlockAllocator::blockFreeingThreadMain):

  • heap/Heap.cpp:

(JSC::Heap::lastChanceToFinalize):
(JSC::Heap::collect):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::throwException):
(JSC::Interpreter::execute):

  • jit/GCAwareJITStubRoutine.cpp:

(JSC::GCAwareJITStubRoutine::observeZeroRefCount):

  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):

  • jit/JITExceptions.cpp:

(JSC::genericThrow):

  • jit/JITInlines.h:

(JSC::JIT::emitLoad):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_end):
(JSC::JIT::emit_resolve_operations):

  • jit/JITStubRoutine.cpp:

(JSC::JITStubRoutine::observeZeroRefCount):

  • jit/JITStubs.cpp:

(JSC::returnToThrowTrampoline):

  • runtime/Arguments.cpp:

(JSC::Arguments::getOwnPropertySlot):
(JSC::Arguments::getOwnPropertyDescriptor):
(JSC::Arguments::deleteProperty):
(JSC::Arguments::defineOwnProperty):
(JSC::Arguments::didTearOffActivation):

  • runtime/ArrayPrototype.cpp:

(JSC::shift):
(JSC::unshift):
(JSC::arrayProtoFuncLastIndexOf):

  • runtime/ButterflyInlines.h:

(JSC::Butterfly::growPropertyStorage):

  • runtime/CodeCache.cpp:

(JSC::CodeCache::getFunctionExecutableFromGlobalCode):

  • runtime/CodeCache.h:

(JSC::CacheMap::add):

  • runtime/Completion.cpp:

(JSC::checkSyntax):
(JSC::evaluate):

  • runtime/Executable.cpp:

(JSC::FunctionExecutable::FunctionExecutable):
(JSC::EvalExecutable::unlinkCalls):
(JSC::ProgramExecutable::compileOptimized):
(JSC::ProgramExecutable::unlinkCalls):
(JSC::ProgramExecutable::initializeGlobalProperties):
(JSC::FunctionExecutable::baselineCodeBlockFor):
(JSC::FunctionExecutable::compileOptimizedForCall):
(JSC::FunctionExecutable::compileOptimizedForConstruct):
(JSC::FunctionExecutable::compileForCallInternal):
(JSC::FunctionExecutable::compileForConstructInternal):
(JSC::FunctionExecutable::unlinkCalls):
(JSC::NativeExecutable::hashFor):

  • runtime/Executable.h:

(JSC::EvalExecutable::compile):
(JSC::ProgramExecutable::compile):
(JSC::FunctionExecutable::compileForCall):
(JSC::FunctionExecutable::compileForConstruct):

  • runtime/IndexingHeader.h:

(JSC::IndexingHeader::setVectorLength):

  • runtime/JSArray.cpp:

(JSC::JSArray::pop):
(JSC::JSArray::shiftCountWithArrayStorage):
(JSC::JSArray::shiftCountWithAnyIndexingType):
(JSC::JSArray::unshiftCountWithArrayStorage):

  • runtime/JSGlobalObjectFunctions.cpp:

(JSC::jsStrDecimalLiteral):

  • runtime/JSObject.cpp:

(JSC::JSObject::copyButterfly):
(JSC::JSObject::defineOwnIndexedProperty):
(JSC::JSObject::putByIndexBeyondVectorLengthWithoutAttributes):

  • runtime/JSString.cpp:

(JSC::JSRopeString::getIndexSlowCase):

  • yarr/YarrInterpreter.cpp:

(JSC::Yarr::Interpreter::popParenthesesDisjunctionContext):

Location:
trunk/Source/JavaScriptCore
Files:
38 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSContextRef.cpp

    r139541 r140619  
    182182    }
    183183    while (true) {
    184         ASSERT(callFrame);
     184        RELEASE_ASSERT(callFrame);
    185185        int signedLineNumber;
    186186        intptr_t sourceID;
  • trunk/Source/JavaScriptCore/ChangeLog

    r140608 r140619  
     12013-01-23  Oliver Hunt  <oliver@apple.com>
     2
     3        Harden JSC a bit with RELEASE_ASSERT
     4        https://bugs.webkit.org/show_bug.cgi?id=107766
     5
     6        Reviewed by Mark Hahnenberg.
     7
     8        Went through and replaced a pile of ASSERTs that were covering
     9        significantly important details (bounds checks, etc) where
     10        having the checks did not impact release performance in any
     11        measurable way.
     12
     13        * API/JSContextRef.cpp:
     14        (JSContextCreateBacktrace):
     15        * assembler/MacroAssembler.h:
     16        (JSC::MacroAssembler::branchAdd32):
     17        (JSC::MacroAssembler::branchMul32):
     18        * bytecode/CodeBlock.cpp:
     19        (JSC::CodeBlock::dumpBytecode):
     20        (JSC::CodeBlock::handlerForBytecodeOffset):
     21        (JSC::CodeBlock::lineNumberForBytecodeOffset):
     22        (JSC::CodeBlock::bytecodeOffset):
     23        * bytecode/CodeBlock.h:
     24        (JSC::CodeBlock::bytecodeOffsetForCallAtIndex):
     25        (JSC::CodeBlock::bytecodeOffset):
     26        (JSC::CodeBlock::exceptionHandler):
     27        (JSC::CodeBlock::codeOrigin):
     28        (JSC::CodeBlock::immediateSwitchJumpTable):
     29        (JSC::CodeBlock::characterSwitchJumpTable):
     30        (JSC::CodeBlock::stringSwitchJumpTable):
     31        (JSC::CodeBlock::setIdentifiers):
     32        (JSC::baselineCodeBlockForInlineCallFrame):
     33        (JSC::ExecState::uncheckedR):
     34        * bytecode/CodeOrigin.cpp:
     35        (JSC::CodeOrigin::inlineStack):
     36        * bytecode/CodeOrigin.h:
     37        (JSC::CodeOrigin::CodeOrigin):
     38        * dfg/DFGCSEPhase.cpp:
     39        * dfg/DFGOSRExit.cpp:
     40        * dfg/DFGScratchRegisterAllocator.h:
     41        (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
     42        (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
     43        * dfg/DFGSpeculativeJIT.h:
     44        (JSC::DFG::SpeculativeJIT::allocate):
     45        (JSC::DFG::SpeculativeJIT::spill):
     46        (JSC::DFG::SpeculativeJIT::integerResult):
     47        * dfg/DFGSpeculativeJIT64.cpp:
     48        (JSC::DFG::SpeculativeJIT::fillInteger):
     49        (JSC::DFG::SpeculativeJIT::fillDouble):
     50        (JSC::DFG::SpeculativeJIT::fillJSValue):
     51        (JSC::DFG::SpeculativeJIT::nonSpeculativeCompareNull):
     52        (JSC::DFG::SpeculativeJIT::emitCall):
     53        (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
     54        (JSC::DFG::SpeculativeJIT::fillSpeculateIntStrict):
     55        (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
     56        (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
     57        (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
     58        (JSC::DFG::SpeculativeJIT::compile):
     59        * dfg/DFGValueSource.h:
     60        (JSC::DFG::dataFormatToValueSourceKind):
     61        (JSC::DFG::ValueSource::ValueSource):
     62        * dfg/DFGVirtualRegisterAllocationPhase.cpp:
     63        * heap/BlockAllocator.cpp:
     64        (JSC::BlockAllocator::BlockAllocator):
     65        (JSC::BlockAllocator::releaseFreeRegions):
     66        (JSC::BlockAllocator::blockFreeingThreadMain):
     67        * heap/Heap.cpp:
     68        (JSC::Heap::lastChanceToFinalize):
     69        (JSC::Heap::collect):
     70        * interpreter/Interpreter.cpp:
     71        (JSC::Interpreter::throwException):
     72        (JSC::Interpreter::execute):
     73        * jit/GCAwareJITStubRoutine.cpp:
     74        (JSC::GCAwareJITStubRoutine::observeZeroRefCount):
     75        * jit/JIT.cpp:
     76        (JSC::JIT::privateCompileMainPass):
     77        (JSC::JIT::privateCompileSlowCases):
     78        * jit/JITExceptions.cpp:
     79        (JSC::genericThrow):
     80        * jit/JITInlines.h:
     81        (JSC::JIT::emitLoad):
     82        * jit/JITOpcodes.cpp:
     83        (JSC::JIT::emit_op_end):
     84        (JSC::JIT::emit_resolve_operations):
     85        * jit/JITStubRoutine.cpp:
     86        (JSC::JITStubRoutine::observeZeroRefCount):
     87        * jit/JITStubs.cpp:
     88        (JSC::returnToThrowTrampoline):
     89        * runtime/Arguments.cpp:
     90        (JSC::Arguments::getOwnPropertySlot):
     91        (JSC::Arguments::getOwnPropertyDescriptor):
     92        (JSC::Arguments::deleteProperty):
     93        (JSC::Arguments::defineOwnProperty):
     94        (JSC::Arguments::didTearOffActivation):
     95        * runtime/ArrayPrototype.cpp:
     96        (JSC::shift):
     97        (JSC::unshift):
     98        (JSC::arrayProtoFuncLastIndexOf):
     99        * runtime/ButterflyInlines.h:
     100        (JSC::Butterfly::growPropertyStorage):
     101        * runtime/CodeCache.cpp:
     102        (JSC::CodeCache::getFunctionExecutableFromGlobalCode):
     103        * runtime/CodeCache.h:
     104        (JSC::CacheMap::add):
     105        * runtime/Completion.cpp:
     106        (JSC::checkSyntax):
     107        (JSC::evaluate):
     108        * runtime/Executable.cpp:
     109        (JSC::FunctionExecutable::FunctionExecutable):
     110        (JSC::EvalExecutable::unlinkCalls):
     111        (JSC::ProgramExecutable::compileOptimized):
     112        (JSC::ProgramExecutable::unlinkCalls):
     113        (JSC::ProgramExecutable::initializeGlobalProperties):
     114        (JSC::FunctionExecutable::baselineCodeBlockFor):
     115        (JSC::FunctionExecutable::compileOptimizedForCall):
     116        (JSC::FunctionExecutable::compileOptimizedForConstruct):
     117        (JSC::FunctionExecutable::compileForCallInternal):
     118        (JSC::FunctionExecutable::compileForConstructInternal):
     119        (JSC::FunctionExecutable::unlinkCalls):
     120        (JSC::NativeExecutable::hashFor):
     121        * runtime/Executable.h:
     122        (JSC::EvalExecutable::compile):
     123        (JSC::ProgramExecutable::compile):
     124        (JSC::FunctionExecutable::compileForCall):
     125        (JSC::FunctionExecutable::compileForConstruct):
     126        * runtime/IndexingHeader.h:
     127        (JSC::IndexingHeader::setVectorLength):
     128        * runtime/JSArray.cpp:
     129        (JSC::JSArray::pop):
     130        (JSC::JSArray::shiftCountWithArrayStorage):
     131        (JSC::JSArray::shiftCountWithAnyIndexingType):
     132        (JSC::JSArray::unshiftCountWithArrayStorage):
     133        * runtime/JSGlobalObjectFunctions.cpp:
     134        (JSC::jsStrDecimalLiteral):
     135        * runtime/JSObject.cpp:
     136        (JSC::JSObject::copyButterfly):
     137        (JSC::JSObject::defineOwnIndexedProperty):
     138        (JSC::JSObject::putByIndexBeyondVectorLengthWithoutAttributes):
     139        * runtime/JSString.cpp:
     140        (JSC::JSRopeString::getIndexSlowCase):
     141        * yarr/YarrInterpreter.cpp:
     142        (JSC::Yarr::Interpreter::popParenthesesDisjunctionContext):
     143
    11442013-01-23  Filip Pizlo  <fpizlo@apple.com>
    2145
  • trunk/Source/JavaScriptCore/assembler/MacroAssembler.h

    r140594 r140619  
    13521352    {
    13531353        if (src == dest)
    1354             RELEASE_ASSERT(scratchRegisterForBlinding());
     1354            ASSERT(scratchRegisterForBlinding());
    13551355
    13561356        if (shouldBlind(imm)) {
     
    13701370    {
    13711371        if (src == dest)
    1372             RELEASE_ASSERT(scratchRegisterForBlinding());
     1372            ASSERT(scratchRegisterForBlinding());
    13731373
    13741374        if (shouldBlind(imm)) {
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r140594 r140619  
    14951495#if ENABLE(LLINT_C_LOOP)
    14961496        default:
    1497             ASSERT(false); // We should never get here.
     1497            RELEASE_ASSERT_NOT_REACHED();
    14981498#endif
    14991499    }
     
    24932493HandlerInfo* CodeBlock::handlerForBytecodeOffset(unsigned bytecodeOffset)
    24942494{
    2495     ASSERT(bytecodeOffset < instructions().size());
     2495    RELEASE_ASSERT(bytecodeOffset < instructions().size());
    24962496
    24972497    if (!m_rareData)
     
    25112511int CodeBlock::lineNumberForBytecodeOffset(unsigned bytecodeOffset)
    25122512{
    2513     ASSERT(bytecodeOffset < instructions().size());
     2513    RELEASE_ASSERT(bytecodeOffset < instructions().size());
    25142514    return m_ownerExecutable->lineNo() + m_unlinkedCode->lineNumberForBytecodeOffset(bytecodeOffset);
    25152515}
     
    27312731#endif
    27322732    {
    2733         ASSERT(exec->codeBlock());
    2734         ASSERT(exec->codeBlock() == this);
    2735         ASSERT(JITCode::isBaselineCode(getJITType()));
     2733        RELEASE_ASSERT(exec->codeBlock());
     2734        RELEASE_ASSERT(exec->codeBlock() == this);
     2735        RELEASE_ASSERT(JITCode::isBaselineCode(getJITType()));
    27362736        Instruction* instruction = exec->currentVPC();
    2737         ASSERT(instruction);
     2737        RELEASE_ASSERT(instruction);
    27382738
    27392739        instruction = adjustPCIfAtCallSite(instruction);
     
    27542754            binarySearch<CallReturnOffsetToBytecodeOffset, unsigned>(
    27552755                callIndices, callIndices.size(), callReturnOffset, getCallReturnOffset);
    2756         ASSERT(result->callReturnOffset == callReturnOffset);
     2756        RELEASE_ASSERT(result->callReturnOffset == callReturnOffset);
    27572757        return result->bytecodeOffset;
    27582758    }
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r139136 r140619  
    279279            if (!callIndices.size())
    280280                return 1;
    281             ASSERT(index < m_rareData->m_callReturnIndexVector.size());
     281            RELEASE_ASSERT(index < m_rareData->m_callReturnIndexVector.size());
    282282            return m_rareData->m_callReturnIndexVector[index].bytecodeOffset;
    283283        }
     
    458458        unsigned bytecodeOffset(Instruction* returnAddress)
    459459        {
    460             ASSERT(returnAddress >= instructions().begin() && returnAddress < instructions().end());
     460            RELEASE_ASSERT(returnAddress >= instructions().begin() && returnAddress < instructions().end());
    461461            return static_cast<Instruction*>(returnAddress) - instructions().begin();
    462462        }
     
    815815
    816816        }
    817         HandlerInfo& exceptionHandler(int index) { ASSERT(m_rareData); return m_rareData->m_exceptionHandlers[index]; }
     817        HandlerInfo& exceptionHandler(int index) { RELEASE_ASSERT(m_rareData); return m_rareData->m_exceptionHandlers[index]; }
    818818
    819819        bool hasExpressionInfo() { return m_unlinkedCode->hasExpressionInfo(); }
     
    850850        CodeOrigin codeOrigin(unsigned index)
    851851        {
    852             ASSERT(m_rareData);
     852            RELEASE_ASSERT(m_rareData);
    853853            return m_rareData->m_codeOrigins[index].codeOrigin;
    854854        }
     
    941941        size_t numberOfImmediateSwitchJumpTables() const { return m_rareData ? m_rareData->m_immediateSwitchJumpTables.size() : 0; }
    942942        SimpleJumpTable& addImmediateSwitchJumpTable() { createRareDataIfNecessary(); m_rareData->m_immediateSwitchJumpTables.append(SimpleJumpTable()); return m_rareData->m_immediateSwitchJumpTables.last(); }
    943         SimpleJumpTable& immediateSwitchJumpTable(int tableIndex) { ASSERT(m_rareData); return m_rareData->m_immediateSwitchJumpTables[tableIndex]; }
     943        SimpleJumpTable& immediateSwitchJumpTable(int tableIndex) { RELEASE_ASSERT(m_rareData); return m_rareData->m_immediateSwitchJumpTables[tableIndex]; }
    944944
    945945        size_t numberOfCharacterSwitchJumpTables() const { return m_rareData ? m_rareData->m_characterSwitchJumpTables.size() : 0; }
    946946        SimpleJumpTable& addCharacterSwitchJumpTable() { createRareDataIfNecessary(); m_rareData->m_characterSwitchJumpTables.append(SimpleJumpTable()); return m_rareData->m_characterSwitchJumpTables.last(); }
    947         SimpleJumpTable& characterSwitchJumpTable(int tableIndex) { ASSERT(m_rareData); return m_rareData->m_characterSwitchJumpTables[tableIndex]; }
     947        SimpleJumpTable& characterSwitchJumpTable(int tableIndex) { RELEASE_ASSERT(m_rareData); return m_rareData->m_characterSwitchJumpTables[tableIndex]; }
    948948
    949949        size_t numberOfStringSwitchJumpTables() const { return m_rareData ? m_rareData->m_stringSwitchJumpTables.size() : 0; }
    950950        StringJumpTable& addStringSwitchJumpTable() { createRareDataIfNecessary(); m_rareData->m_stringSwitchJumpTables.append(StringJumpTable()); return m_rareData->m_stringSwitchJumpTables.last(); }
    951         StringJumpTable& stringSwitchJumpTable(int tableIndex) { ASSERT(m_rareData); return m_rareData->m_stringSwitchJumpTables[tableIndex]; }
     951        StringJumpTable& stringSwitchJumpTable(int tableIndex) { RELEASE_ASSERT(m_rareData); return m_rareData->m_stringSwitchJumpTables[tableIndex]; }
    952952
    953953
     
    11591159        void setIdentifiers(const Vector<Identifier>& identifiers)
    11601160        {
    1161             ASSERT(m_identifiers.isEmpty());
     1161            RELEASE_ASSERT(m_identifiers.isEmpty());
    11621162            m_identifiers.appendVector(identifiers);
    11631163        }
     
    14601460    inline CodeBlock* baselineCodeBlockForInlineCallFrame(InlineCallFrame* inlineCallFrame)
    14611461    {
    1462         ASSERT(inlineCallFrame);
     1462        RELEASE_ASSERT(inlineCallFrame);
    14631463        ExecutableBase* executable = inlineCallFrame->executable.get();
    1464         ASSERT(executable->structure()->classInfo() == &FunctionExecutable::s_info);
     1464        RELEASE_ASSERT(executable->structure()->classInfo() == &FunctionExecutable::s_info);
    14651465        return static_cast<FunctionExecutable*>(executable)->baselineCodeBlockFor(inlineCallFrame->isCall ? CodeForCall : CodeForConstruct);
    14661466    }
     
    14961496    inline Register& ExecState::uncheckedR(int index)
    14971497    {
    1498         ASSERT(index < FirstConstantRegisterIndex);
     1498        RELEASE_ASSERT(index < FirstConstantRegisterIndex);
    14991499        return this[index];
    15001500    }
  • trunk/Source/JavaScriptCore/bytecode/CodeOrigin.cpp

    r139541 r140619  
    5454    for (InlineCallFrame* current = inlineCallFrame; current; current = current->caller.inlineCallFrame)
    5555        result[index--] = current->caller;
    56     ASSERT(!result[0].inlineCallFrame);
     56    RELEASE_ASSERT(!result[0].inlineCallFrame);
    5757    return result;
    5858}
  • trunk/Source/JavaScriptCore/bytecode/CodeOrigin.h

    r139109 r140619  
    6666        , inlineCallFrame(inlineCallFrame)
    6767    {
    68         ASSERT(bytecodeIndex <= maximumBytecodeIndex);
    69         ASSERT(valueProfileOffset < (1u << 3));
     68        RELEASE_ASSERT(bytecodeIndex <= maximumBytecodeIndex);
     69        RELEASE_ASSERT(valueProfileOffset < (1u << 3));
    7070    }
    7171   
  • trunk/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp

    r140594 r140619  
    3131#include "DFGGraph.h"
    3232#include "DFGPhase.h"
     33#include "JSCellInlines.h"
    3334#include <wtf/FastBitVector.h>
    3435
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp

    r137976 r140619  
    3131#include "DFGAssemblyHelpers.h"
    3232#include "DFGSpeculativeJIT.h"
     33#include "JSCellInlines.h"
    3334
    3435namespace JSC { namespace DFG {
  • trunk/Source/JavaScriptCore/dfg/DFGScratchRegisterAllocator.h

    r131858 r140619  
    138138                scratchGPR = GPRInfo::toRegister(i);
    139139        }
    140         ASSERT(scratchGPR != InvalidGPRReg);
     140        RELEASE_ASSERT(scratchGPR != InvalidGPRReg);
    141141        for (unsigned i = FPRInfo::numberOfRegisters; i--;) {
    142142            if (m_usedRegisters.getFPRByIndex(i)) {
     
    145145            }
    146146        }
    147         ASSERT(count * sizeof(JSValue) == desiredScratchBufferSize());
     147        RELEASE_ASSERT(count * sizeof(JSValue) == desiredScratchBufferSize());
    148148       
    149149        jit.move(MacroAssembler::TrustedImmPtr(&scratchBuffer->m_activeLength), scratchGPR);
     
    162162            }
    163163        }
    164         ASSERT(scratchGPR != InvalidGPRReg);
     164        RELEASE_ASSERT(scratchGPR != InvalidGPRReg);
    165165       
    166166        jit.move(MacroAssembler::TrustedImmPtr(&scratchBuffer->m_activeLength), scratchGPR);
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h

    r140594 r140619  
    190190#if USE(JSVALUE32_64)
    191191            GenerationInfo& info = m_generationInfo[spillMe];
    192             ASSERT(info.registerFormat() != DataFormatJSDouble);
     192            RELEASE_ASSERT(info.registerFormat() != DataFormatJSDouble);
    193193            if ((info.registerFormat() & DataFormatJS))
    194194                m_gprs.release(info.tagGPR() == gpr ? info.payloadGPR() : info.tagGPR());
     
    204204#if USE(JSVALUE32_64)
    205205            GenerationInfo& info = m_generationInfo[spillMe];
    206             ASSERT(info.registerFormat() != DataFormatJSDouble);
     206            RELEASE_ASSERT(info.registerFormat() != DataFormatJSDouble);
    207207            if ((info.registerFormat() & DataFormatJS))
    208208                m_gprs.release(info.tagGPR() == specific ? info.payloadGPR() : info.tagGPR());
     
    498498        default:
    499499            // The following code handles JSValues, int32s, and cells.
    500             ASSERT(spillFormat == DataFormatCell || spillFormat & DataFormatJS);
     500            RELEASE_ASSERT(spillFormat == DataFormatCell || spillFormat & DataFormatJS);
    501501           
    502502            GPRReg reg = info.gpr();
     
    528528        default:
    529529            // The following code handles JSValues.
    530             ASSERT(spillFormat & DataFormatJS);
     530            RELEASE_ASSERT(spillFormat & DataFormatJS);
    531531            m_jit.store32(info.tagGPR(), JITCompiler::tagFor(spillMe));
    532532            m_jit.store32(info.payloadGPR(), JITCompiler::payloadFor(spillMe));
     
    800800        } else {
    801801#if USE(JSVALUE64)
    802             ASSERT(format == DataFormatJSInteger);
     802            RELEASE_ASSERT(format == DataFormatJSInteger);
    803803            m_jit.jitAssertIsJSInt32(reg);
    804804            m_gprs.retain(reg, virtualRegister, SpillOrderJS);
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp

    r140594 r140619  
    7171            m_jit.or64(GPRInfo::tagTypeNumberRegister, gpr);
    7272        } else {
    73             ASSERT(info.spillFormat() == DataFormatJS || info.spillFormat() == DataFormatJSInteger);
     73            RELEASE_ASSERT(info.spillFormat() == DataFormatJS || info.spillFormat() == DataFormatJSInteger);
    7474            m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
    7575            m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
     
    177177                GPRReg gpr = allocate();
    178178       
    179                 ASSERT(spillFormat & DataFormatJS);
     179                RELEASE_ASSERT(spillFormat & DataFormatJS);
    180180                m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
    181181                m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
     
    310310                    spillFormat = DataFormatJSDouble;
    311311                } else
    312                     ASSERT(spillFormat & DataFormatJS);
     312                    RELEASE_ASSERT(spillFormat & DataFormatJS);
    313313            }
    314314            info.fillJSValue(*m_stream, gpr, spillFormat);
     
    693693        NodeIndex branchNodeIndex = m_jit.graph().m_blocks[m_block]->at(branchIndexInBlock);
    694694
    695         ASSERT(node.adjustedRefCount() == 1);
     695        RELEASE_ASSERT(node.adjustedRefCount() == 1);
    696696       
    697697        nonSpeculativePeepholeBranchNull(operand, branchNodeIndex, invert);
     
    993993{
    994994    if (node.op() != Call)
    995         ASSERT(node.op() == Construct);
     995        RELEASE_ASSERT(node.op() == Construct);
    996996
    997997    // For constructors, the this argument is not passed but we have to make space
     
    10951095        DataFormat spillFormat = info.spillFormat();
    10961096       
    1097         ASSERT((spillFormat & DataFormatJS) || spillFormat == DataFormatInteger);
     1097        RELEASE_ASSERT((spillFormat & DataFormatJS) || spillFormat == DataFormatInteger);
    10981098       
    10991099        m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
     
    12081208    DataFormat mustBeDataFormatInteger;
    12091209    GPRReg result = fillSpeculateIntInternal<true>(nodeIndex, mustBeDataFormatInteger, BackwardSpeculation);
    1210     ASSERT(mustBeDataFormatInteger == DataFormatInteger);
     1210    RELEASE_ASSERT(mustBeDataFormatInteger == DataFormatInteger);
    12111211    return result;
    12121212}
     
    12731273            GPRReg gpr = allocate();
    12741274
    1275             ASSERT(spillFormat & DataFormatJS);
     1275            RELEASE_ASSERT(spillFormat & DataFormatJS);
    12761276            m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
    12771277            m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
     
    13961396            return gpr;
    13971397        }
    1398         ASSERT(info.spillFormat() & DataFormatJS);
     1398        RELEASE_ASSERT(info.spillFormat() & DataFormatJS);
    13991399        m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
    14001400        m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
     
    14721472            return gpr;
    14731473        }
    1474         ASSERT(info.spillFormat() & DataFormatJS);
     1474        RELEASE_ASSERT(info.spillFormat() & DataFormatJS);
    14751475        m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
    14761476        m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
     
    28062806            break;
    28072807        case Array::Generic: {
    2808             ASSERT(node.op() == PutByVal);
     2808            RELEASE_ASSERT(node.op() == PutByVal);
    28092809           
    28102810            JSValueOperand arg1(this, child1);
     
    34643464           
    34653465            Structure* structure = globalObject->arrayStructureForIndexingTypeDuringAllocation(node.indexingType());
    3466             ASSERT(structure->indexingType() == node.indexingType());
     3466            RELEASE_ASSERT(structure->indexingType() == node.indexingType());
    34673467            ASSERT(
    34683468                hasUndecided(structure->indexingType())
     
    37703770            emitAllocateJSArray(globalObject->arrayStructureForIndexingTypeDuringAllocation(indexingType), resultGPR, storageGPR, numElements);
    37713771           
    3772             ASSERT(indexingType & IsArray);
     3772            RELEASE_ASSERT(indexingType & IsArray);
    37733773            JSValue* data = m_jit.codeBlock()->constantBuffer(node.startConstant());
    37743774            if (indexingType == ArrayWithDouble) {
     
    46564656       
    46574657    case CreateActivation: {
    4658         ASSERT(!node.codeOrigin.inlineCallFrame);
     4658        RELEASE_ASSERT(!node.codeOrigin.inlineCallFrame);
    46594659       
    46604660        JSValueOperand value(this, node.child1());
     
    47014701
    47024702    case TearOffActivation: {
    4703         ASSERT(!node.codeOrigin.inlineCallFrame);
     4703        RELEASE_ASSERT(!node.codeOrigin.inlineCallFrame);
    47044704
    47054705        JSValueOperand activationValue(this, node.child1());
     
    47684768        }
    47694769       
    4770         ASSERT(!node.codeOrigin.inlineCallFrame);
     4770        RELEASE_ASSERT(!node.codeOrigin.inlineCallFrame);
    47714771        m_jit.load32(JITCompiler::payloadFor(JSStack::ArgumentCount), resultGPR);
    47724772        m_jit.sub32(TrustedImm32(1), resultGPR);
  • trunk/Source/JavaScriptCore/dfg/DFGValueSource.h

    r140594 r140619  
    6666        return ArgumentsSource;
    6767    default:
    68         ASSERT(dataFormat & DataFormatJS);
     68        RELEASE_ASSERT(dataFormat & DataFormatJS);
    6969        return ValueInJSStack;
    7070    }
     
    123123        : m_nodeIndex(nodeIndex)
    124124    {
    125         ASSERT(nodeIndex != NoNode);
     125        RELEASE_ASSERT(nodeIndex != NoNode);
    126126        ASSERT(kind() == HaveNode);
    127127    }
  • trunk/Source/JavaScriptCore/dfg/DFGVirtualRegisterAllocationPhase.cpp

    r135469 r140619  
    3131#include "DFGGraph.h"
    3232#include "DFGScoreBoard.h"
     33#include "JSCellInlines.h"
    3334
    3435namespace JSC { namespace DFG {
  • trunk/Source/JavaScriptCore/heap/BlockAllocator.cpp

    r136077 r140619  
    4545    , m_blockFreeingThread(createThread(blockFreeingThreadStartFunc, this, "JavaScriptCore::BlockFree"))
    4646{
    47     ASSERT(m_blockFreeingThread);
     47    RELEASE_ASSERT(m_blockFreeingThread);
    4848    m_regionLock.Init();
    4949}
     
    7070            else {
    7171                region = m_emptyRegions.removeHead();
    72                 ASSERT(region);
     72                RELEASE_ASSERT(region);
    7373                m_numberOfEmptyRegions--;
    7474            }
     
    142142                else {
    143143                    region = m_emptyRegions.removeHead();
    144                     ASSERT(region);
     144                    RELEASE_ASSERT(region);
    145145                    m_numberOfEmptyRegions--;
    146146                }
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r140584 r140619  
    281281void Heap::lastChanceToFinalize()
    282282{
    283     ASSERT(!m_globalData->dynamicGlobalObject);
    284     ASSERT(m_operationInProgress == NoOperation);
     283    RELEASE_ASSERT(!m_globalData->dynamicGlobalObject);
     284    RELEASE_ASSERT(m_operationInProgress == NoOperation);
    285285
    286286    m_objectSpace.lastChanceToFinalize();
     
    719719    GCPHASE(Collect);
    720720    ASSERT(globalData()->apiLock().currentThreadIsHoldingLock());
    721     ASSERT(globalData()->identifierTable == wtfThreadData().currentIdentifierTable());
     721    RELEASE_ASSERT(globalData()->identifierTable == wtfThreadData().currentIdentifierTable());
    722722    ASSERT(m_isSafeToCollect);
    723723    JAVASCRIPTCORE_GC_BEGIN();
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r140594 r140619  
    791791        int targetDepth = handler->scopeDepth;
    792792        scopeDelta = currentDepth - targetDepth;
    793         ASSERT(scopeDelta >= 0);
     793        RELEASE_ASSERT(scopeDelta >= 0);
    794794    }
    795795    while (scopeDelta--)
     
    836836    ASSERT(isValidThisObject(thisObj, callFrame));
    837837    ASSERT(!globalData.exception);
    838     RELEASE_ASSERT(!globalData.isCollectorBusy());
     838    ASSERT(!globalData.isCollectorBusy());
     839    if (globalData.isCollectorBusy())
     840        return jsNull();
    839841
    840842    StackStats::CheckPoint stackCheckPoint;
     
    12651267    JSObject* variableObject;
    12661268    for (JSScope* node = scope; ; node = node->next()) {
    1267         ASSERT(node);
     1269        RELEASE_ASSERT(node);
    12681270        if (node->isVariableObject() && !node->isNameScopeObject()) {
    12691271            variableObject = node;
  • trunk/Source/JavaScriptCore/jit/GCAwareJITStubRoutine.cpp

    r139541 r140619  
    6161    }
    6262   
    63     ASSERT(!m_refCount);
     63    RELEASE_ASSERT(!m_refCount);
    6464
    6565    m_isJettisoned = true;
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r140594 r140619  
    409409    }
    410410
    411     ASSERT(m_callLinkInfoIndex == m_callStructureStubCompilationInfo.size());
     411    RELEASE_ASSERT(m_callLinkInfoIndex == m_callStructureStubCompilationInfo.size());
    412412
    413413#ifndef NDEBUG
     
    434434    m_callLinkInfoIndex = 0;
    435435   
    436 #if !ASSERT_DISABLED && ENABLE(VALUE_PROFILER)
     436#if ENABLE(VALUE_PROFILER)
    437437    // Use this to assert that slow-path code associates new profiling sites with existing
    438438    // ValueProfiles rather than creating new ones. This ensures that for a given instruction
     
    450450
    451451        m_bytecodeOffset = iter->to;
    452 #ifndef NDEBUG
     452
    453453        unsigned firstTo = m_bytecodeOffset;
    454 #endif
     454
    455455        Instruction* currentInstruction = instructionsBegin + m_bytecodeOffset;
    456456       
     
    555555        }
    556556
    557         ASSERT_WITH_MESSAGE(iter == m_slowCases.end() || firstTo != iter->to,"Not enough jumps linked in slow case codegen.");
    558         ASSERT_WITH_MESSAGE(firstTo == (iter - 1)->to, "Too many jumps linked in slow case codegen.");
     557        RELEASE_ASSERT_WITH_MESSAGE(iter == m_slowCases.end() || firstTo != iter->to, "Not enough jumps linked in slow case codegen.");
     558        RELEASE_ASSERT_WITH_MESSAGE(firstTo == (iter - 1)->to, "Too many jumps linked in slow case codegen.");
    559559       
    560560#if ENABLE(VALUE_PROFILER)
     
    566566    }
    567567
    568     ASSERT(m_propertyAccessInstructionIndex == m_propertyAccessCompilationInfo.size());
    569     ASSERT(m_callLinkInfoIndex == m_callStructureStubCompilationInfo.size());
     568    RELEASE_ASSERT(m_propertyAccessInstructionIndex == m_propertyAccessCompilationInfo.size());
     569    RELEASE_ASSERT(m_callLinkInfoIndex == m_callStructureStubCompilationInfo.size());
    570570#if ENABLE(VALUE_PROFILER)
    571     ASSERT(numberOfValueProfiles == m_codeBlock->numberOfValueProfiles());
     571    RELEASE_ASSERT(numberOfValueProfiles == m_codeBlock->numberOfValueProfiles());
    572572#endif
    573573
  • trunk/Source/JavaScriptCore/jit/JITExceptions.cpp

    r139541 r140619  
    4040ExceptionHandler genericThrow(JSGlobalData* globalData, ExecState* callFrame, JSValue exceptionValue, unsigned vPCIndex)
    4141{
    42     ASSERT(exceptionValue);
     42    RELEASE_ASSERT(exceptionValue);
    4343   
    4444    globalData->exception = JSValue();
     
    5858    globalData->targetInterpreterPCForThrow = catchPCForInterpreter;
    5959   
    60     ASSERT(catchRoutine);
     60    RELEASE_ASSERT(catchRoutine);
    6161    ExceptionHandler exceptionHandler = { catchRoutine, callFrame };
    6262    return exceptionHandler;
  • trunk/Source/JavaScriptCore/jit/JITInlines.h

    r138516 r140619  
    510510inline void JIT::emitLoad(int index, RegisterID tag, RegisterID payload, RegisterID base)
    511511{
    512     ASSERT(tag != payload);
     512    RELEASE_ASSERT(tag != payload);
    513513
    514514    if (base == callFrameRegister) {
    515         ASSERT(payload != base);
     515        RELEASE_ASSERT(payload != base);
    516516        emitLoadPayload(index, payload);
    517517        emitLoadTag(index, tag);
  • trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp

    r138516 r140619  
    8282void JIT::emit_op_end(Instruction* currentInstruction)
    8383{
    84     ASSERT(returnValueRegister != callFrameRegister);
     84    RELEASE_ASSERT(returnValueRegister != callFrameRegister);
    8585    emitGetVirtualRegister(currentInstruction[1].u.operand, returnValueRegister);
    8686    restoreReturnAddressBeforeReturn(Address(callFrameRegister, JSStack::ReturnPC * static_cast<int>(sizeof(Register))));
     
    13071307            return;
    13081308        case ResolveOperation::SetBaseToGlobal:
    1309             ASSERT(baseVR);
     1309            RELEASE_ASSERT(baseVR);
    13101310            setBase = true;
    13111311            move(TrustedImmPtr(globalObject), scratch);
     
    13151315            break;
    13161316        case ResolveOperation::SetBaseToUndefined: {
    1317             ASSERT(baseVR);
     1317            RELEASE_ASSERT(baseVR);
    13181318            setBase = true;
    13191319#if USE(JSVALUE64)
     
    13281328        }
    13291329        case ResolveOperation::SetBaseToScope:
    1330             ASSERT(baseVR);
     1330            RELEASE_ASSERT(baseVR);
    13311331            setBase = true;
    13321332            emitStoreCell(*baseVR, scope);
     
    13361336        case ResolveOperation::ReturnScopeAsBase:
    13371337            emitStoreCell(*baseVR, scope);
    1338             ASSERT(value == regT0);
     1338            RELEASE_ASSERT(value == regT0);
    13391339            move(scope, value);
    13401340#if USE(JSVALUE32_64)
     
    13861386        emitStoreCell(*baseVR, scope);
    13871387
    1388     ASSERT(valueVR);
     1388    RELEASE_ASSERT(valueVR);
    13891389    ResolveOperation* resolveValueOperation = pc;
    13901390    switch (resolveValueOperation->m_operation) {
  • trunk/Source/JavaScriptCore/jit/JITStubRoutine.cpp

    r127202 r140619  
    3939void JITStubRoutine::observeZeroRefCount()
    4040{
    41     ASSERT(!m_refCount);
     41    RELEASE_ASSERT(!m_refCount);
    4242    delete this;
    4343}
  • trunk/Source/JavaScriptCore/jit/JITStubs.cpp

    r140594 r140619  
    10371037static NEVER_INLINE void returnToThrowTrampoline(JSGlobalData* globalData, ReturnAddressPtr exceptionLocation, ReturnAddressPtr& returnAddressSlot)
    10381038{
    1039     ASSERT(globalData->exception);
     1039    RELEASE_ASSERT(globalData->exception);
    10401040    globalData->exceptionLocation = exceptionLocation;
    10411041    returnAddressSlot = ReturnAddressPtr(FunctionPtr(ctiVMThrowTrampoline));
  • trunk/Source/JavaScriptCore/runtime/Arguments.cpp

    r140594 r140619  
    128128    unsigned i = propertyName.asIndex();
    129129    if (JSValue value = thisObject->tryGetArgument(i)) {
    130         ASSERT(i < PropertyName::NotAnIndex);
     130        RELEASE_ASSERT(i < PropertyName::NotAnIndex);
    131131        slot.setValue(value);
    132132        return true;
     
    157157    unsigned i = propertyName.asIndex();
    158158    if (JSValue value = thisObject->tryGetArgument(i)) {
    159         ASSERT(i < PropertyName::NotAnIndex);
     159        RELEASE_ASSERT(i < PropertyName::NotAnIndex);
    160160        descriptor.setDescriptor(value, None);
    161161        return true;
     
    254254    unsigned i = propertyName.asIndex();
    255255    if (i < thisObject->m_numArguments) {
    256         ASSERT(i < PropertyName::NotAnIndex);
     256        RELEASE_ASSERT(i < PropertyName::NotAnIndex);
    257257        if (!Base::deleteProperty(cell, exec, propertyName))
    258258            return false;
     
    285285    unsigned i = propertyName.asIndex();
    286286    if (i < thisObject->m_numArguments) {
    287         ASSERT(i < PropertyName::NotAnIndex);
     287        RELEASE_ASSERT(i < PropertyName::NotAnIndex);
    288288        // If the property is not yet present on the object, and is not yet marked as deleted, then add it now.
    289289        PropertySlot slot;
     
    367367void Arguments::didTearOffActivation(ExecState* exec, JSActivation* activation)
    368368{
    369     ASSERT(activation);
     369    RELEASE_ASSERT(activation);
    370370    if (isTornOff())
    371371        return;
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp

    r140259 r140619  
    195195void shift(ExecState* exec, JSObject* thisObj, unsigned header, unsigned currentCount, unsigned resultCount, unsigned length)
    196196{
    197     ASSERT(currentCount > resultCount);
     197    RELEASE_ASSERT(currentCount > resultCount);
    198198    unsigned count = currentCount - resultCount;
    199199
    200     ASSERT(header <= length);
    201     ASSERT(currentCount <= (length - header));
     200    RELEASE_ASSERT(header <= length);
     201    RELEASE_ASSERT(currentCount <= (length - header));
    202202
    203203    if (isJSArray(thisObj)) {
     
    233233void unshift(ExecState* exec, JSObject* thisObj, unsigned header, unsigned currentCount, unsigned resultCount, unsigned length)
    234234{
    235     ASSERT(resultCount > currentCount);
     235    RELEASE_ASSERT(resultCount > currentCount);
    236236    unsigned count = resultCount - currentCount;
    237237
    238     ASSERT(header <= length);
    239     ASSERT(currentCount <= (length - header));
     238    RELEASE_ASSERT(header <= length);
     239    RELEASE_ASSERT(currentCount <= (length - header));
    240240
    241241    // Guard against overflow.
     
    12911291    JSValue searchElement = exec->argument(0);
    12921292    do {
    1293         ASSERT(index < length);
     1293        RELEASE_ASSERT(index < length);
    12941294        JSValue e = getProperty(exec, thisObj, index);
    12951295        if (exec->hadException())
  • trunk/Source/JavaScriptCore/runtime/ButterflyInlines.h

    r140584 r140619  
    7575inline Butterfly* Butterfly::growPropertyStorage(JSGlobalData& globalData, size_t preCapacity, size_t oldPropertyCapacity, bool hasIndexingHeader, size_t indexingPayloadSizeInBytes, size_t newPropertyCapacity)
    7676{
    77     ASSERT(newPropertyCapacity > oldPropertyCapacity);
     77    RELEASE_ASSERT(newPropertyCapacity > oldPropertyCapacity);
    7878    Butterfly* result = createUninitialized(
    7979        globalData, preCapacity, newPropertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes);
  • trunk/Source/JavaScriptCore/runtime/CodeCache.cpp

    r139541 r140619  
    161161    ExpressionNode* funcExpr = static_cast<ExprStatementNode*>(exprStatement)->expr();
    162162    ASSERT(funcExpr);
    163     ASSERT(funcExpr->isFuncExprNode());
     163    RELEASE_ASSERT(funcExpr->isFuncExprNode());
    164164    FunctionBodyNode* body = static_cast<FuncExprNode*>(funcExpr)->body();
    165165    ASSERT(body);
  • trunk/Source/JavaScriptCore/runtime/CodeCache.h

    r138675 r140619  
    8181        m_data[newIndex].first = key;
    8282        m_data[newIndex].second = value;
    83         ASSERT(m_map.size() <= CacheSize);
     83        RELEASE_ASSERT(m_map.size() <= CacheSize);
    8484    }
    8585
  • trunk/Source/JavaScriptCore/runtime/Completion.cpp

    r140584 r140619  
    4040{
    4141    JSLockHolder lock(exec);
    42     ASSERT(exec->globalData().identifierTable == wtfThreadData().currentIdentifierTable());
     42    RELEASE_ASSERT(exec->globalData().identifierTable == wtfThreadData().currentIdentifierTable());
    4343
    4444    ProgramExecutable* program = ProgramExecutable::create(exec, source);
     
    8383    }
    8484
    85     ASSERT(result);
     85    RELEASE_ASSERT(result);
    8686    return result;
    8787}
  • trunk/Source/JavaScriptCore/runtime/Executable.cpp

    r140594 r140619  
    145145    , m_unlinkedExecutable(globalData, this, unlinkedExecutable)
    146146{
    147     ASSERT(!source.isNull());
     147    RELEASE_ASSERT(!source.isNull());
    148148    ASSERT(source.length());
    149149    m_firstLine = firstLine;
     
    263263    if (!m_jitCodeForCall)
    264264        return;
    265     ASSERT(m_evalCodeBlock);
     265    RELEASE_ASSERT(m_evalCodeBlock);
    266266    m_evalCodeBlock->unlinkCalls();
    267267#endif
     
    289289JSObject* ProgramExecutable::compileOptimized(ExecState* exec, JSScope* scope, unsigned bytecodeIndex)
    290290{
    291     ASSERT(exec->globalData().dynamicGlobalObject);
     291    RELEASE_ASSERT(exec->globalData().dynamicGlobalObject);
    292292    ASSERT(!!m_programCodeBlock);
    293293    JSObject* error = 0;
     
    352352    if (!m_jitCodeForCall)
    353353        return;
    354     ASSERT(m_programCodeBlock);
     354    RELEASE_ASSERT(m_programCodeBlock);
    355355    m_programCodeBlock->unlinkCalls();
    356356#endif
     
    376376JSObject* ProgramExecutable::initializeGlobalProperties(JSGlobalData& globalData, CallFrame* callFrame, JSScope* scope)
    377377{
    378     ASSERT(scope);
     378    RELEASE_ASSERT(scope);
    379379    JSGlobalObject* globalObject = scope->globalObject();
    380     ASSERT(globalObject);
     380    RELEASE_ASSERT(globalObject);
    381381    ASSERT(&globalObject->globalData() == &globalData);
    382382
     
    443443        result = m_codeBlockForCall.get();
    444444    else {
    445         ASSERT(kind == CodeForConstruct);
     445        RELEASE_ASSERT(kind == CodeForConstruct);
    446446        result = m_codeBlockForConstruct.get();
    447447    }
     
    450450    while (result->alternative())
    451451        result = static_cast<FunctionCodeBlock*>(result->alternative());
    452     ASSERT(result);
     452    RELEASE_ASSERT(result);
    453453    ASSERT(JITCode::isBaselineCode(result->getJITType()));
    454454    return result;
     
    457457JSObject* FunctionExecutable::compileOptimizedForCall(ExecState* exec, JSScope* scope, unsigned bytecodeIndex)
    458458{
    459     ASSERT(exec->globalData().dynamicGlobalObject);
     459    RELEASE_ASSERT(exec->globalData().dynamicGlobalObject);
    460460    ASSERT(!!m_codeBlockForCall);
    461461    JSObject* error = 0;
     
    468468JSObject* FunctionExecutable::compileOptimizedForConstruct(ExecState* exec, JSScope* scope, unsigned bytecodeIndex)
    469469{
    470     ASSERT(exec->globalData().dynamicGlobalObject);
     470    RELEASE_ASSERT(exec->globalData().dynamicGlobalObject);
    471471    ASSERT(!!m_codeBlockForConstruct);
    472472    JSObject* error = 0;
     
    533533   
    534534    m_numParametersForCall = m_codeBlockForCall->numParameters();
    535     ASSERT(m_numParametersForCall);
     535    RELEASE_ASSERT(m_numParametersForCall);
    536536
    537537#if ENABLE(JIT)
     
    569569   
    570570    m_numParametersForConstruct = m_codeBlockForConstruct->numParameters();
    571     ASSERT(m_numParametersForConstruct);
     571    RELEASE_ASSERT(m_numParametersForConstruct);
    572572
    573573#if ENABLE(JIT)
     
    640640#if ENABLE(JIT)
    641641    if (!!m_jitCodeForCall) {
    642         ASSERT(m_codeBlockForCall);
     642        RELEASE_ASSERT(m_codeBlockForCall);
    643643        m_codeBlockForCall->unlinkCalls();
    644644    }
    645645    if (!!m_jitCodeForConstruct) {
    646         ASSERT(m_codeBlockForConstruct);
     646        RELEASE_ASSERT(m_codeBlockForConstruct);
    647647        m_codeBlockForConstruct->unlinkCalls();
    648648    }
     
    680680        return CodeBlockHash(static_cast<unsigned>(bitwise_cast<size_t>(m_function)));
    681681   
    682     ASSERT(kind == CodeForConstruct);
     682    RELEASE_ASSERT(kind == CodeForConstruct);
    683683    return CodeBlockHash(static_cast<unsigned>(bitwise_cast<size_t>(m_constructor)));
    684684}
  • trunk/Source/JavaScriptCore/runtime/Executable.h

    r140594 r140619  
    430430        JSObject* compile(ExecState* exec, JSScope* scope)
    431431        {
    432             ASSERT(exec->globalData().dynamicGlobalObject);
     432            RELEASE_ASSERT(exec->globalData().dynamicGlobalObject);
    433433            JSObject* error = 0;
    434434            if (!m_evalCodeBlock)
     
    507507        JSObject* compile(ExecState* exec, JSScope* scope)
    508508        {
    509             ASSERT(exec->globalData().dynamicGlobalObject);
     509            RELEASE_ASSERT(exec->globalData().dynamicGlobalObject);
    510510            JSObject* error = 0;
    511511            if (!m_programCodeBlock)
     
    602602        JSObject* compileForCall(ExecState* exec, JSScope* scope)
    603603        {
    604             ASSERT(exec->globalData().dynamicGlobalObject);
     604            RELEASE_ASSERT(exec->globalData().dynamicGlobalObject);
    605605            JSObject* error = 0;
    606606            if (!m_codeBlockForCall)
     
    630630        JSObject* compileForConstruct(ExecState* exec, JSScope* scope)
    631631        {
    632             ASSERT(exec->globalData().dynamicGlobalObject);
     632            RELEASE_ASSERT(exec->globalData().dynamicGlobalObject);
    633633            JSObject* error = 0;
    634634            if (!m_codeBlockForConstruct)
  • trunk/Source/JavaScriptCore/runtime/IndexingHeader.h

    r128400 r140619  
    5858    void setVectorLength(uint32_t length)
    5959    {
    60         ASSERT(length <= maximumLength);
     60        RELEASE_ASSERT(length <= maximumLength);
    6161        m_vectorLength = length;
    6262    }
  • trunk/Source/JavaScriptCore/runtime/JSArray.cpp

    r140594 r140619  
    470470            return jsUndefined();
    471471       
    472         ASSERT(length < m_butterfly->vectorLength());
     472        RELEASE_ASSERT(length < m_butterfly->vectorLength());
    473473        JSValue value = m_butterfly->contiguous()[length].get();
    474474        if (value) {
     
    486486            return jsUndefined();
    487487       
    488         ASSERT(length < m_butterfly->vectorLength());
     488        RELEASE_ASSERT(length < m_butterfly->vectorLength());
    489489        double value = m_butterfly->contiguousDouble()[length];
    490490        if (value == value) {
     
    514514                valueSlot.clear();
    515515           
    516                 ASSERT(isLengthWritable());
     516                RELEASE_ASSERT(isLengthWritable());
    517517                storage->setLength(index);
    518518                return element;
     
    682682{
    683683    unsigned oldLength = storage->length();
    684     ASSERT(count <= oldLength);
     684    RELEASE_ASSERT(count <= oldLength);
    685685   
    686686    // If the array contains holes or is otherwise in an abnormal state,
     
    737737bool JSArray::shiftCountWithAnyIndexingType(ExecState* exec, unsigned startIndex, unsigned count)
    738738{
    739     ASSERT(count > 0);
     739    RELEASE_ASSERT(count > 0);
    740740   
    741741    switch (structure()->indexingType()) {
     
    750750    case ArrayWithContiguous: {
    751751        unsigned oldLength = m_butterfly->publicLength();
    752         ASSERT(count <= oldLength);
     752        RELEASE_ASSERT(count <= oldLength);
    753753       
    754754        // We may have to walk the entire array to do the shift. We're willing to do
     
    785785    case ArrayWithDouble: {
    786786        unsigned oldLength = m_butterfly->publicLength();
    787         ASSERT(count <= oldLength);
     787        RELEASE_ASSERT(count <= oldLength);
    788788       
    789789        // We may have to walk the entire array to do the shift. We're willing to do
     
    833833    unsigned length = storage->length();
    834834
    835     ASSERT(startIndex <= length);
     835    RELEASE_ASSERT(startIndex <= length);
    836836
    837837    // If the array contains holes or is otherwise in an abnormal state,
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp

    r139541 r140619  
    365365static double jsStrDecimalLiteral(const CharType*& data, const CharType* end)
    366366{
    367     ASSERT(data < end);
     367    RELEASE_ASSERT(data < end);
    368368
    369369    size_t parsedLength;
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r140594 r140619  
    136136                currentTarget = newButterfly->contiguous();
    137137                currentSource = butterfly->contiguous();
    138                 ASSERT(newButterfly->publicLength() <= newButterfly->vectorLength());
     138                RELEASE_ASSERT(newButterfly->publicLength() <= newButterfly->vectorLength());
    139139                count = newButterfly->vectorLength();
    140140                break;
     
    17011701
    17021702    SparseArrayValueMap* map = m_butterfly->arrayStorage()->m_sparseMap.get();
    1703     ASSERT(map);
     1703    RELEASE_ASSERT(map);
    17041704
    17051705    // 1. Let current be the result of calling the [[GetOwnProperty]] internal method of O with property name P.
     
    18741874    ensureLength(globalData, i + 1);
    18751875
    1876     ASSERT(i < m_butterfly->vectorLength());
     1876    RELEASE_ASSERT(i < m_butterfly->vectorLength());
    18771877    switch (indexingShape) {
    18781878    case Int32Shape:
  • trunk/Source/JavaScriptCore/runtime/JSString.cpp

    r127809 r140619  
    234234        return jsEmptyString(exec);
    235235    ASSERT(!isRope());
    236     ASSERT(i < m_value.length());
     236    RELEASE_ASSERT(i < m_value.length());
    237237    return jsSingleCharacterSubstring(exec, m_value, i);
    238238}
  • trunk/Source/JavaScriptCore/yarr/YarrInterpreter.cpp

    r140594 r140619  
    8484    static inline void popParenthesesDisjunctionContext(BackTrackInfoParentheses* backTrack)
    8585    {
    86         ASSERT(backTrack->matchAmount);
    87         ASSERT(backTrack->lastContext);
     86        RELEASE_ASSERT(backTrack->matchAmount);
     87        RELEASE_ASSERT(backTrack->lastContext);
    8888        backTrack->lastContext = backTrack->lastContext->next;
    8989        --backTrack->matchAmount;
Note: See TracChangeset for help on using the changeset viewer.