Ignore:
Timestamp:
Jun 28, 2011, 1:21:37 PM (14 years ago)
Author:
[email protected]
Message:

2011-06-28 Oliver Hunt <[email protected]>

Reviewed by Gavin Barraclough.

Make constant array optimisation less strict about what constitutes a constant
https://bugs.webkit.org/show_bug.cgi?id=63554

Now allow string constants in array literals to actually be considered constant,
and so avoid codegen in array literals with strings in them.

  • bytecode/CodeBlock.h: (JSC::CodeBlock::addConstantBuffer): (JSC::CodeBlock::constantBuffer):
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::addConstantBuffer): (JSC::BytecodeGenerator::addStringConstant): (JSC::BytecodeGenerator::emitNewArray):
  • bytecompiler/BytecodeGenerator.h:
  • interpreter/Interpreter.cpp: (JSC::Interpreter::privateExecute):
  • jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r89885 r89954  
    478478        RegExp* regexp(int index) const { ASSERT(m_rareData); return m_rareData->m_regexps[index].get(); }
    479479
    480         unsigned addImmediateBuffer(unsigned length)
     480        unsigned addConstantBuffer(unsigned length)
    481481        {
    482482            createRareDataIfNecessary();
    483             unsigned size = m_rareData->m_immediateBuffers.size();
    484             m_rareData->m_immediateBuffers.append(Vector<JSValue>(length));
     483            unsigned size = m_rareData->m_constantBuffers.size();
     484            m_rareData->m_constantBuffers.append(Vector<JSValue>(length));
    485485            return size;
    486486        }
    487487
    488         JSValue* immediateBuffer(unsigned index)
     488        JSValue* constantBuffer(unsigned index)
    489489        {
    490490            ASSERT(m_rareData);
    491             return m_rareData->m_immediateBuffers[index].data();
     491            return m_rareData->m_constantBuffers[index].data();
    492492        }
    493493
     
    596596
    597597            // Buffers used for large array literals
    598             Vector<Vector<JSValue> > m_immediateBuffers;
     598            Vector<Vector<JSValue> > m_constantBuffers;
    599599           
    600600            // Jump Tables
Note: See TracChangeset for help on using the changeset viewer.