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/bytecode/CodeBlock.h

    r89630 r89885  
    9999        CallLinkInfo()
    100100            : hasSeenShouldRepatch(false)
     101            , isCall(false)
    101102        {
    102103        }
     
    106107        CodeLocationNearCall hotPathOther;
    107108        JITWriteBarrier<JSFunction> callee;
    108         bool hasSeenShouldRepatch;
     109        bool hasSeenShouldRepatch : 1;
     110        bool isCall : 1;
    109111
    110112        bool isLinked() { return callee; }
     113        void unlink()
     114        {
     115            hasSeenShouldRepatch = false;
     116            callee.clear();
     117        }
    111118
    112119        bool seenOnce()
     
    271278            return binarySearch<CallReturnOffsetToBytecodeOffset, unsigned, getCallReturnOffset>(callIndices.begin(), callIndices.size(), getJITCode().offsetOf(returnAddress.value()))->bytecodeOffset;
    272279        }
    273 #endif
     280
     281        void unlinkCalls();
     282#endif
     283
    274284#if ENABLE(INTERPRETER)
    275285        unsigned bytecodeOffset(Instruction* returnAddress)
     
    340350
    341351        void createActivation(CallFrame*);
     352
     353        void clearEvalCache();
    342354
    343355#if ENABLE(INTERPRETER)
Note: See TracChangeset for help on using the changeset viewer.