Ignore:
Timestamp:
Feb 1, 2017, 5:23:37 PM (8 years ago)
Author:
[email protected]
Message:

The sampling profile should have an option to sample from C frames.
https://bugs.webkit.org/show_bug.cgi?id=167614

Reviewed by Saam Barati.

We should be able to use the sampling profiler, at least
internally, to trace C calls. This patch only modifies the JSC
shell although it would be nice to add it to the Web Inspector in
a future patch.

  • runtime/Options.h:
  • runtime/SamplingProfiler.cpp:

(JSC::FrameWalker::FrameWalker):
(JSC::FrameWalker::walk):
(JSC::FrameWalker::recordJSFrame):
(JSC::CFrameWalker::CFrameWalker):
(JSC::CFrameWalker::walk):
(JSC::CFrameWalker::isCFrame):
(JSC::CFrameWalker::advanceToParentFrame):
(JSC::CFrameWalker::frame):
(JSC::SamplingProfiler::takeSample):
(JSC::SamplingProfiler::processUnverifiedStackTraces):
(JSC::SamplingProfiler::StackFrame::displayName):

  • runtime/SamplingProfiler.h:

(JSC::SamplingProfiler::UnprocessedStackFrame::UnprocessedStackFrame):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/SamplingProfiler.h

    r211316 r211542  
    5252            , callSiteIndex(callSiteIndex)
    5353        { }
     54
     55        UnprocessedStackFrame(void* pc)
     56            : cCodePC(pc)
     57        { }
     58
    5459        UnprocessedStackFrame()
    5560        {
    5661            unverifiedCallee = JSValue::encode(JSValue());
    57             verifiedCodeBlock = nullptr;
    5862        }
    5963
     64        void* cCodePC { nullptr };
    6065        EncodedJSValue unverifiedCallee;
    61         CodeBlock* verifiedCodeBlock;
     66        CodeBlock* verifiedCodeBlock { nullptr };
    6267        CallSiteIndex callSiteIndex;
    6368    };
     
    6671        Executable,
    6772        Host,
    68         Unknown
     73        C,
     74        Unknown
    6975    };
    7076
     
    7985
    8086        FrameType frameType { FrameType::Unknown };
     87        void* cCodePC { nullptr };
    8188        ExecutableBase* executable { nullptr };
    8289        JSObject* callee { nullptr };
Note: See TracChangeset for help on using the changeset viewer.