Ignore:
Timestamp:
Feb 1, 2019, 1:14:19 PM (6 years ago)
Author:
[email protected]
Message:

[JSC] Unify CodeBlock IsoSubspaces
https://bugs.webkit.org/show_bug.cgi?id=194167

Reviewed by Saam Barati.

When we move CodeBlock into its IsoSubspace, we create IsoSubspaces for each subclass of CodeBlock.
But this is not necessary since,

  1. They do not override the classInfo methods.
  2. sizeof(ProgramCodeBlock etc.) == sizeof(CodeBlock) since subclasses adds no additional fields.

Creating IsoSubspace for each subclass is costly in terms of memory. Especially, IsoSubspace for
ProgramCodeBlock is. We typically create only one ProgramCodeBlock, and it means the rest of the
MarkedBlock (16KB - sizeof(footer) - sizeof(ProgramCodeBlock)) is just wasted.

This patch unifies these IsoSubspaces into one.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::destroy):

  • bytecode/CodeBlock.h:
  • bytecode/EvalCodeBlock.cpp:

(JSC::EvalCodeBlock::destroy): Deleted.

  • bytecode/EvalCodeBlock.h: We drop some utility functions in EvalCodeBlock and use UnlinkedEvalCodeBlock's one directly.
  • bytecode/FunctionCodeBlock.cpp:

(JSC::FunctionCodeBlock::destroy): Deleted.

  • bytecode/FunctionCodeBlock.h:
  • bytecode/GlobalCodeBlock.h:
  • bytecode/ModuleProgramCodeBlock.cpp:

(JSC::ModuleProgramCodeBlock::destroy): Deleted.

  • bytecode/ModuleProgramCodeBlock.h:
  • bytecode/ProgramCodeBlock.cpp:

(JSC::ProgramCodeBlock::destroy): Deleted.

  • bytecode/ProgramCodeBlock.h:
  • interpreter/Interpreter.cpp:

(JSC::Interpreter::execute):

  • runtime/VM.cpp:

(JSC::VM::VM):

  • runtime/VM.h:

(JSC::VM::forEachCodeBlockSpace):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r240860 r240864  
    318318    , executableToCodeBlockEdgesWithFinalizers(executableToCodeBlockEdgeSpace)
    319319    , inferredValuesWithFinalizers(inferredValueSpace)
    320     , evalCodeBlockSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), EvalCodeBlock)
    321     , functionCodeBlockSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), FunctionCodeBlock)
    322     , moduleProgramCodeBlockSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), ModuleProgramCodeBlock)
    323     , programCodeBlockSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), ProgramCodeBlock)
     320    , codeBlockSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), CodeBlock)
    324321    , directEvalExecutableSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), DirectEvalExecutable)
    325322    , functionExecutableSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), FunctionExecutable)
Note: See TracChangeset for help on using the changeset viewer.