Skip to content
  • msaboff@apple.com's avatar
    ENH: Add Logging to GC Marking Phase · 9d9eab6c
    msaboff@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=88364
    
    Reviewed by Filip Pizlo.
    
    Source/JavaScriptCore: 
    
    Log GC marking to stderr or a file.  The logging in controlled
    with the define ENABLE_OBJECT_MARK_LOGGING in wtf/Platform.h.
    If DATA_LOG_TO_FILE in wtf/DataLog.cpp is set to 1, output is
    logged to a file otherwise it is logged to stderr.
    
    When logging is enabled, the GC is built single threaded since the
    log output from the various threads isn't buffered and output in a
    thread safe manner.
    
    * heap/Heap.cpp:
    (JSC::Heap::markRoots):
    * heap/MarkStack.cpp:
    (JSC::MarkStackThreadSharedData::resetChildren):
    (JSC::MarkStackThreadSharedData::childVisitCount):
    (JSC::MarkStackThreadSharedData::markingThreadMain):
    (JSC::MarkStackThreadSharedData::markingThreadStartFunc):
    (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
    (JSC::MarkStackThreadSharedData::reset):
    * heap/MarkStack.h:
    (MarkStackThreadSharedData):
    (MarkStack):
    (JSC::MarkStack::sharedData):
    (JSC::MarkStack::resetChildCount):
    (JSC::MarkStack::childCount):
    (JSC::MarkStack::incrementChildCount):
    * runtime/JSArray.cpp:
    (JSC::JSArray::visitChildren):
    * runtime/JSCell.cpp:
    (JSC::JSCell::className):
    * runtime/JSCell.h:
    (JSCell):
    (JSC::JSCell::visitChildren):
    * runtime/JSString.cpp:
    (JSC::JSString::visitChildren):
    * runtime/JSString.h:
    (JSString):
    * runtime/Structure.h:
    (JSC::MarkStack::internalAppend):
    
    Source/WTF: 
    
    * wtf/DataLog.cpp:
    (WTF::dataLogString): Additional method to support GC Mark logging.
    * wtf/DataLog.h:
    * wtf/Platform.h: New ENABLE_OBJECT_MARK_LOGGING flag macro.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119633 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    9d9eab6c