Ignore:
Timestamp:
Dec 17, 2008, 1:25:40 PM (16 years ago)
Author:
[email protected]
Message:

2008-12-17 Sam Weinig <[email protected]>

Reviewed by Darin Adler.

Fix for https://bugs.webkit.org/show_bug.cgi?id=22897
<rdar://problem/6428342>
Look into feasibility of discarding bytecode after native codegen

Clear the bytecode Instruction vector at the end JIT generation.

Saves 4.8 MB on Membuster head.

  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): Add logging for the case that someone tries to dump the instructions of a CodeBlock that has had its bytecode vector cleared. (JSC::CodeBlock::CodeBlock): Initialize the instructionCount (JSC::CodeBlock::handlerForBytecodeOffset): Use instructionCount instead of the size of the instruction vector in the assertion. (JSC::CodeBlock::lineNumberForBytecodeOffset): Ditto. (JSC::CodeBlock::expressionRangeForBytecodeOffset): Ditto. (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): Ditto. (JSC::CodeBlock::functionRegisterForBytecodeOffset): Ditto.
  • bytecode/CodeBlock.h: (JSC::CodeBlock::setInstructionCount): Store the instruction vector size in debug builds for assertions.
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::generate):
  • jit/JIT.cpp: (JSC::JIT::privateCompile): Clear the bytecode vector unless we have compiled with Opcode sampling where we will continue to require it
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r39354 r39366  
    128128}
    129129
     130bool BytecodeGenerator::dumpsGeneratedCode()
     131{
     132#ifndef NDEBUG
     133    return s_dumpsGeneratedCode;
     134#else
     135    return false;
     136#endif
     137}
     138
    130139void BytecodeGenerator::generate()
    131140{
     
    135144
    136145#ifndef NDEBUG
     146    m_codeBlock->setInstructionCount(m_codeBlock->instructions().size());
     147
    137148    if (s_dumpsGeneratedCode) {
    138149        JSGlobalObject* globalObject = m_scopeChain->globalObject();
Note: See TracChangeset for help on using the changeset viewer.