Ignore:
Timestamp:
Jun 27, 2011, 6:32:01 PM (14 years ago)
Author:
[email protected]
Message:

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

Reviewed by Geoffrey Garen.

Support throwing away non-running code even while other code is running
https://bugs.webkit.org/show_bug.cgi?id=63485

Add a function to CodeBlock to support unlinking direct linked callsites,
and then with that in place add logic to discard code from any function
that is not currently on the stack.

The unlinking completely reverts any optimized call sites, such that they
may be relinked again in future.

  • JavaScriptCore.exp:
  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::unlinkCalls): (JSC::CodeBlock::clearEvalCache):
  • bytecode/CodeBlock.h: (JSC::CallLinkInfo::CallLinkInfo): (JSC::CallLinkInfo::unlink):
  • bytecode/EvalCodeCache.h: (JSC::EvalCodeCache::clear):
  • heap/Heap.cpp: (JSC::Heap::getConservativeRegisterRoots):
  • heap/Heap.h:
  • jit/JIT.cpp: (JSC::JIT::privateCompile):
  • jit/JIT.h:
  • jit/JITCall.cpp: (JSC::JIT::compileOpCall):
  • jit/JITWriteBarrier.h: (JSC::JITWriteBarrierBase::clear):
  • jsc.cpp: (GlobalObject::GlobalObject): (functionReleaseExecutableMemory):
  • runtime/Executable.cpp: (JSC::EvalExecutable::unlinkCalls): (JSC::ProgramExecutable::unlinkCalls): (JSC::FunctionExecutable::discardCode): (JSC::FunctionExecutable::unlinkCalls):
  • runtime/Executable.h:
  • runtime/JSGlobalData.cpp: (JSC::SafeRecompiler::returnValue): (JSC::SafeRecompiler::operator()): (JSC::JSGlobalData::releaseExecutableMemory):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITWriteBarrier.h

    r89630 r89885  
    6969    }
    7070   
     71    void clear() { clear(0); }
     72
    7173protected:
    7274    JITWriteBarrierBase()
     
    9597
    9698private:
     99    void clear(void* clearedValue)
     100    {
     101        if (!m_location)
     102            return;
     103        if (m_location.executableAddress() != JITWriteBarrierFlag)
     104            MacroAssembler::repatchPointer(m_location, clearedValue);
     105    }
     106
    97107    CodeLocationDataLabelPtr m_location;
    98108};
Note: See TracChangeset for help on using the changeset viewer.