Ignore:
Timestamp:
Aug 24, 2015, 2:43:13 PM (10 years ago)
Author:
[email protected]
Message:

Some renaming to clarify CodeBlock and UnlinkedCodeBlock
https://bugs.webkit.org/show_bug.cgi?id=148391

Reviewed by Saam Barati.

  • bytecode/UnlinkedFunctionExecutable.cpp:

(JSC::generateUnlinkedFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::visitChildren):
(JSC::UnlinkedFunctionExecutable::fromGlobalCode):
(JSC::UnlinkedFunctionExecutable::unlinkedCodeBlockFor):
(JSC::generateFunctionCodeBlock): Deleted.
(JSC::UnlinkedFunctionExecutable::codeBlockFor): Deleted.

  • bytecode/UnlinkedFunctionExecutable.h: Call our CodeBlocks "unlinked"

in the name for clarity, since we are unlinked.

  • heap/Heap.cpp:

(JSC::Heap::objectTypeCounts):
(JSC::Heap::deleteAllCodeBlocks):
(JSC::Heap::deleteAllUnlinkedCodeBlocks):
(JSC::Heap::clearUnmarkedExecutables):
(JSC::Heap::deleteOldCode):
(JSC::Heap::FinalizerOwner::finalize):
(JSC::Heap::addExecutable):
(JSC::Heap::collectAllGarbageIfNotDoneRecently):
(JSC::Heap::deleteAllCompiledCode): Deleted.
(JSC::Heap::deleteAllUnlinkedFunctionCode): Deleted.
(JSC::Heap::addCompiledCode): Deleted.

  • heap/Heap.h:

(JSC::Heap::notifyIsSafeToCollect):
(JSC::Heap::isSafeToCollect):
(JSC::Heap::sizeBeforeLastFullCollection):
(JSC::Heap::sizeAfterLastFullCollection):
(JSC::Heap::compiledCode): Deleted.

deleteAllCompiledCode => deleteAllCodeBlocks because "compiled"
is a broad phrase these days.

m_compiledCode => m_executables for the same reason.

addCompiledCode => addExecutable for the same reason.

deleteAllUnlinkedFunctionCode => deleteAllUnlinkedCodeBlocks
for consistency.

  • jsc.cpp:

(functionDeleteAllCompiledCode):

  • runtime/Executable.cpp:

(JSC::ScriptExecutable::newCodeBlockFor): codeBlockFor => unlinkedCodeBlockFor

(JSC::FunctionExecutable::clearUnlinkedCodeForRecompilation): Deleted.
It was strange to put this function on executable, since its name implied
that it only changed the executable, but it actually changed all cached
code. Now, a client that wants to change cached code must do so explicitly.

  • runtime/Executable.h:

(JSC::ScriptExecutable::finishCreation):

  • runtime/VM.cpp:

(JSC::VM::deleteAllCode):

  • runtime/VMEntryScope.cpp:

(JSC::VMEntryScope::VMEntryScope): Updated for renames above.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/Heap.h

    r188846 r188884  
    150150    typedef void (*Finalizer)(JSCell*);
    151151    JS_EXPORT_PRIVATE void addFinalizer(JSCell*, Finalizer);
    152     void addCompiledCode(ExecutableBase*);
     152    void addExecutable(ExecutableBase*);
    153153
    154154    void notifyIsSafeToCollect() { m_isSafeToCollect = true; }
     
    209209    size_t sizeAfterLastFullCollection() const { return m_sizeAfterLastFullCollect; }
    210210
    211     JS_EXPORT_PRIVATE void deleteAllCompiledCode();
    212     void deleteAllUnlinkedFunctionCode();
     211    JS_EXPORT_PRIVATE void deleteAllCodeBlocks();
     212    void deleteAllUnlinkedCodeBlocks();
    213213
    214214    void didAllocate(size_t);
     
    237237
    238238    void addLogicallyEmptyWeakBlock(WeakBlock*);
    239 
    240     Vector<ExecutableBase*>& compiledCode() { return m_compiledCode; }
    241239
    242240private:
     
    393391    double m_lastCodeDiscardTime;
    394392
    395     Vector<ExecutableBase*> m_compiledCode;
     393    Vector<ExecutableBase*> m_executables;
    396394
    397395    Vector<WeakBlock*> m_logicallyEmptyWeakBlocks;
Note: See TracChangeset for help on using the changeset viewer.