[webkit-changes] [WebKit/WebKit] 927202: [JSC] Use JSONValues for Bytecode Profiler output ...

Yusuke Suzuki noreply at github.com
Wed Jun 28 10:05:25 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9272021e237d560258752975dbe6219975cafac2
      https://github.com/WebKit/WebKit/commit/9272021e237d560258752975dbe6219975cafac2
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2023-06-28 (Wed, 28 Jun 2023)

  Changed paths:
    M Source/JavaScriptCore/CMakeLists.txt
    M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
    M Source/JavaScriptCore/bytecode/CodeBlock.cpp
    M Source/JavaScriptCore/profiler/ProfilerBytecode.cpp
    M Source/JavaScriptCore/profiler/ProfilerBytecode.h
    M Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp
    M Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.h
    M Source/JavaScriptCore/profiler/ProfilerBytecodes.cpp
    M Source/JavaScriptCore/profiler/ProfilerBytecodes.h
    M Source/JavaScriptCore/profiler/ProfilerCompilation.cpp
    M Source/JavaScriptCore/profiler/ProfilerCompilation.h
    M Source/JavaScriptCore/profiler/ProfilerCompiledBytecode.cpp
    M Source/JavaScriptCore/profiler/ProfilerCompiledBytecode.h
    M Source/JavaScriptCore/profiler/ProfilerDatabase.cpp
    M Source/JavaScriptCore/profiler/ProfilerDatabase.h
    A Source/JavaScriptCore/profiler/ProfilerDumper.h
    M Source/JavaScriptCore/profiler/ProfilerEvent.cpp
    M Source/JavaScriptCore/profiler/ProfilerEvent.h
    M Source/JavaScriptCore/profiler/ProfilerOSRExit.cpp
    M Source/JavaScriptCore/profiler/ProfilerOSRExit.h
    M Source/JavaScriptCore/profiler/ProfilerOSRExitSite.cpp
    M Source/JavaScriptCore/profiler/ProfilerOSRExitSite.h
    M Source/JavaScriptCore/profiler/ProfilerOrigin.cpp
    M Source/JavaScriptCore/profiler/ProfilerOrigin.h
    M Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp
    M Source/JavaScriptCore/profiler/ProfilerOriginStack.h
    M Source/JavaScriptCore/profiler/ProfilerProfiledBytecodes.cpp
    M Source/JavaScriptCore/profiler/ProfilerProfiledBytecodes.h
    M Source/JavaScriptCore/profiler/ProfilerUID.cpp
    M Source/JavaScriptCore/profiler/ProfilerUID.h
    M Source/JavaScriptCore/runtime/CommonIdentifiers.h
    M Source/JavaScriptCore/runtime/OptionsList.h
    M Source/JavaScriptCore/runtime/VM.cpp
    M Source/WTF/wtf/JSONValues.cpp
    M Source/WTF/wtf/JSONValues.h
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp

  Log Message:
  -----------
  [JSC] Use JSONValues for Bytecode Profiler output instead of JSC's JSON
https://bugs.webkit.org/show_bug.cgi?id=258606
rdar://111435544

Reviewed by Keith Miller.

This prevents us from relying on JSC when dumping bytecode profiler result JSON,
so we do not need to create JSGlobalObject for that. Plus,

1. Add JSON::Value::dump so that we can dump content through PrintStream, which allows us to dump very large JSON in streaming fashion.
2. Add Options::abbreviateSourceCodeForProfiler to control included source string size. Some of script has massive size of source string,
   so we would like to limit the size included as a profiler output.
3. Add Options::dumpProfilerDataAtExit to avoid dumping profiler output twice when `-p` option is specified for JSC shell.
4. Fix CodeBlock::sourceCodeForTools() to align it to Function#toString.

* Source/JavaScriptCore/CMakeLists.txt:
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/profiler/ProfilerBytecode.cpp:
(JSC::Profiler::Bytecode::toJSON const):
(JSC::Profiler::Bytecode::toJS const): Deleted.
* Source/JavaScriptCore/profiler/ProfilerBytecode.h:
* Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp:
(JSC::Profiler::BytecodeSequence::addSequenceProperties const):
* Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.h:
* Source/JavaScriptCore/profiler/ProfilerBytecodes.cpp:
(JSC::Profiler::Bytecodes::toJSON const):
(JSC::Profiler::Bytecodes::toJS const): Deleted.
* Source/JavaScriptCore/profiler/ProfilerBytecodes.h:
* Source/JavaScriptCore/profiler/ProfilerCompilation.cpp:
(JSC::Profiler::Compilation::toJSON const):
(JSC::Profiler::Compilation::toJS const): Deleted.
* Source/JavaScriptCore/profiler/ProfilerCompilation.h:
* Source/JavaScriptCore/profiler/ProfilerCompiledBytecode.cpp:
(JSC::Profiler::CompiledBytecode::toJSON const):
(JSC::Profiler::CompiledBytecode::toJS const): Deleted.
* Source/JavaScriptCore/profiler/ProfilerCompiledBytecode.h:
* Source/JavaScriptCore/profiler/ProfilerDatabase.cpp:
(JSC::Profiler::Database::toJSON const):
(JSC::Profiler::Database::save const):
(JSC::Profiler::Database::toJS const): Deleted.
* Source/JavaScriptCore/profiler/ProfilerDatabase.h:
* Source/JavaScriptCore/profiler/ProfilerDumper.h: Copied from Source/JavaScriptCore/profiler/ProfilerEvent.h.
(JSC::Profiler::Dumper::Dumper):
(JSC::Profiler::Dumper::database const):
(JSC::Profiler::Dumper::keys const):
* Source/JavaScriptCore/profiler/ProfilerEvent.cpp:
(JSC::Profiler::Event::toJSON const):
(JSC::Profiler::Event::toJS const): Deleted.
* Source/JavaScriptCore/profiler/ProfilerEvent.h:
* Source/JavaScriptCore/profiler/ProfilerOSRExit.cpp:
(JSC::Profiler::OSRExit::toJSON const):
(JSC::Profiler::OSRExit::toJS const): Deleted.
* Source/JavaScriptCore/profiler/ProfilerOSRExit.h:
* Source/JavaScriptCore/profiler/ProfilerOSRExitSite.cpp:
(JSC::Profiler::OSRExitSite::toJSON const):
(JSC::Profiler::OSRExitSite::toJS const): Deleted.
* Source/JavaScriptCore/profiler/ProfilerOSRExitSite.h:
* Source/JavaScriptCore/profiler/ProfilerOrigin.cpp:
(JSC::Profiler::Origin::toJSON const):
(JSC::Profiler::Origin::toJS const): Deleted.
* Source/JavaScriptCore/profiler/ProfilerOrigin.h:
* Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp:
(JSC::Profiler::OriginStack::toJSON const):
(JSC::Profiler::OriginStack::toJS const): Deleted.
* Source/JavaScriptCore/profiler/ProfilerOriginStack.h:
* Source/JavaScriptCore/profiler/ProfilerProfiledBytecodes.cpp:
(JSC::Profiler::ProfiledBytecodes::toJSON const):
(JSC::Profiler::ProfiledBytecodes::toJS const): Deleted.
* Source/JavaScriptCore/profiler/ProfilerProfiledBytecodes.h:
* Source/JavaScriptCore/profiler/ProfilerUID.cpp:
(JSC::Profiler::UID::toJSON const):
(JSC::Profiler::UID::toJS const): Deleted.
* Source/JavaScriptCore/profiler/ProfilerUID.h:
* Source/JavaScriptCore/runtime/CommonIdentifiers.h:
* Source/JavaScriptCore/runtime/OptionsList.h:
* Source/JavaScriptCore/runtime/VM.cpp:
(JSC::VM::VM):
* Source/WTF/wtf/JSONValues.cpp:
(WTF::JSONImpl::Value::dump const):
* Source/WTF/wtf/JSONValues.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::getBytecodeProfile):

Canonical link: https://commits.webkit.org/265586@main




More information about the webkit-changes mailing list