Ignore:
Timestamp:
Jul 2, 2008, 9:55:22 PM (17 years ago)
Author:
[email protected]
Message:

Add the ability to trace JavaScriptCore garabge collections using dtrace.

Reviewed by Sam Weinig.

  • JavaScriptCore.xcodeproj/project.pbxproj: Generate the dtrace probe header

file when building on a new enough version of Mac OS X.

  • JavaScriptCorePrefix.h: Add our standard Mac OS X version detection macros.
  • kjs/Tracing.d: Declare three dtrace probes.
  • kjs/Tracing.h: Include the generated dtrace macros if dtrace is available,

otherwise provide versions that do nothing.

  • kjs/collector.cpp:

(KJS::Heap::collect): Fire dtrace probes when starting a collection, after the
mark phase has completed, and when the collection is complete.

  • wtf/Platform.h: Define HAVE_DTRACE when building on a new enough version of Mac OS X.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/collector.cpp

    r34947 r34969  
    2929#include "list.h"
    3030#include "Machine.h"
     31#include "Tracing.h"
    3132#include <algorithm>
    3233#include <setjmp.h>
     
    933934    if ((primaryHeap.operationInProgress != NoOperation) | (numberHeap.operationInProgress != NoOperation))
    934935        abort();
    935    
     936
     937    JAVASCRIPTCORE_GC_BEGIN();
    936938    primaryHeap.operationInProgress = Collection;
    937939    numberHeap.operationInProgress = Collection;
     
    944946        ArgList::markLists(*m_markListSet);
    945947
     948    JAVASCRIPTCORE_GC_MARKED();
     949
    946950    size_t originalLiveObjects = primaryHeap.numLiveObjects + numberHeap.numLiveObjects;
    947951    size_t numLiveObjects = sweep<PrimaryHeap>();
    948952    numLiveObjects += sweep<NumberHeap>();
    949  
     953
    950954    primaryHeap.operationInProgress = NoOperation;
    951955    numberHeap.operationInProgress = NoOperation;
     956    JAVASCRIPTCORE_GC_END(originalLiveObjects, numLiveObjects);
    952957
    953958    return numLiveObjects < originalLiveObjects;
Note: See TracChangeset for help on using the changeset viewer.