[webkit-changes] [WebKit/WebKit] 464f08: [JavaScriptCore] Prepare for InstallAPI

Elliott Williams noreply at github.com
Thu Apr 13 13:18:43 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 464f082ed06c3b7e262e48d8b6bc49fbc80d06e0
      https://github.com/WebKit/WebKit/commit/464f082ed06c3b7e262e48d8b6bc49fbc80d06e0
  Author: Elliott Williams <emw at apple.com>
  Date:   2023-04-13 (Thu, 13 Apr 2023)

  Changed paths:
    M Source/JavaScriptCore/API/JSManagedValueInternal.h
    M Source/JavaScriptCore/API/JSValueInternal.h
    M Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
    M Source/JavaScriptCore/API/ObjCCallbackFunction.h
    M Source/JavaScriptCore/CMakeLists.txt
    M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
    M Source/JavaScriptCore/assembler/ARM64Registers.h
    M Source/JavaScriptCore/assembler/ARMv7Registers.h
    M Source/JavaScriptCore/assembler/AbstractMacroAssembler.h
    M Source/JavaScriptCore/assembler/AssemblerBuffer.h
    M Source/JavaScriptCore/assembler/FastJITPermissions.h
    M Source/JavaScriptCore/assembler/MIPSRegisters.h
    M Source/JavaScriptCore/assembler/MacroAssemblerARM64.h
    M Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h
    M Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h
    M Source/JavaScriptCore/assembler/RISCV64Registers.h
    M Source/JavaScriptCore/assembler/X86Registers.h
    M Source/JavaScriptCore/assembler/X86_64Registers.h
    M Source/JavaScriptCore/b3/B3MemoryValue.h
    M Source/JavaScriptCore/b3/B3MemoryValueInlines.h
    M Source/JavaScriptCore/bytecode/AccessCase.h
    M Source/JavaScriptCore/bytecode/AccessCaseSnippetParams.h
    M Source/JavaScriptCore/bytecode/RepatchInlines.h
    M Source/JavaScriptCore/bytecode/Watchpoint.h
    M Source/JavaScriptCore/disassembler/ARM64/A64DOpcode.h
    M Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
    M Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h
    M Source/JavaScriptCore/inspector/augmentable/AlternateDispatchableAgent.h
    R Source/JavaScriptCore/inspector/cocoa/DeprecatedInspectorValues.cpp
    M Source/JavaScriptCore/inspector/remote/RemoteInspector.h
    M Source/JavaScriptCore/jit/ExecutableMemoryHandle.h
    M Source/JavaScriptCore/jit/JITSizeStatistics.h
    M Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
    M Source/JavaScriptCore/llint/LLIntThunks.h
    M Source/JavaScriptCore/llint/LowLevelInterpreter.asm
    M Source/JavaScriptCore/parser/ASTBuilder.h
    M Source/JavaScriptCore/parser/SyntaxChecker.h
    M Source/JavaScriptCore/runtime/CachePayload.h
    M Source/JavaScriptCore/runtime/DeferredWorkTimer.h
    M Source/JavaScriptCore/runtime/HashMapImpl.h
    M Source/JavaScriptCore/runtime/Identifier.h
    M Source/JavaScriptCore/runtime/JSCPtrTag.h
    M Source/JavaScriptCore/runtime/JSGlobalObject.h
    M Source/JavaScriptCore/runtime/JSObject.h
    M Source/JavaScriptCore/runtime/JSTypedArrays.h
    M Source/JavaScriptCore/runtime/ThrowScope.h
    M Source/JavaScriptCore/runtime/VM.cpp
    M Source/JavaScriptCore/runtime/VM.h
    M Source/JavaScriptCore/wasm/WasmOperationsInlines.h
    M Source/WebCore/cssjit/SelectorCompiler.cpp
    M Source/WebCore/cssjit/SelectorCompiler.h

  Log Message:
  -----------
  [JavaScriptCore] Prepare for InstallAPI
https://bugs.webkit.org/show_bug.cgi?id=254783
rdar://107446500

Reviewed by Mark Lam and Alexey Proskuryakov.

`tapi installapi` is a compiler technology which produces a library stub
by parsing headers declarations. For it to work correctly, symbols
declared in headers need to exactly match the symbols in the binary.
Work towards enabling InstallAPI by fixing up headers in JavaScriptCore.

There are a few common themes to these header fixups:

JavaScriptCore's private SPI has no umbrella header, so TAPI reads
private headers in lexicographic order. Many headers need additional
includes when imported in this order.

Some headers are architecture-specific and were included contextually.
They need CPU preprocessor guards so that TAPI only parses the right
declarations for the target(s) it is generating.

Until TAPI, there has never been verification that header declarations
are cleaned up when a function implementation is removed. Some
stale declarations can simply be deleted.

* Source/JavaScriptCore/API/JSManagedValueInternal.h: Add missing
  include revealed by TAPI's include order.
* Source/JavaScriptCore/API/JSValueInternal.h: Add extern "C" fences.
* Source/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp: Remove
  undeclared function that was left behind to support nightlies in 2011.
* Source/JavaScriptCore/API/ObjCCallbackFunction.h: Add needed forward
  declaration revealed by TAPI's include order.
* Source/JavaScriptCore/CMakeLists.txt: Treat LLIntThunks.h as a private
  framework header (as it already is in Xcode).
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
  - Change some header visibilities. Many headers that are generated
    and/or used in context-specific ways, such as look-up tables, are
    not really part of JavaScriptCore's API and do not export symbols.
    They also tend not to work well with TAPI, because we configure TAPI
    to parse all headers as Objective-C++. Remove these headers from
    "Private" and "Project" membership so that they will not be given to
    TAPI. They are still importable in the project via normal header
    search paths.
  - Add file references for B3CanonicalizePrePostIncrements, which were
    missing, despite B3CanonicalizePrePostIncrements.cpp being compiled
    in unified sources.
  - Add file references for missing headers, AirTmpWidthInlines.h,
    WasmLLIntPlan.h, and WasmEntryPlan.h.
  - Remove reference to DeprecatedInspectorValues.cpp.
* Source/JavaScriptCore/assembler/ARM64Registers.h: Guard with
  CPU(ARM64).
* Source/JavaScriptCore/assembler/ARMv7Registers.h: Guard with
  CPU(ARM_THUMB2).
* Source/JavaScriptCore/assembler/AbstractMacroAssembler.h: Add missing
  includes.
* Source/JavaScriptCore/assembler/AssemblerBuffer.h: Use the same if
  guard on threadSpecificAssemblerHashes() as is used in the
  implementation.
* Source/JavaScriptCore/assembler/FastJITPermissions.h: Add missing
  includes.
* Source/JavaScriptCore/assembler/MIPSRegisters.h: Guard with CPU(MIPS).
* Source/JavaScriptCore/assembler/MacroAssemblerARM64.h: Guard with CPU(ARM64).
* Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h: Guard with
  CPU(ARM_THUMB2).
* Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h: Guard with
  (CPU(X86) || CPU(X86_64)).
* Source/JavaScriptCore/assembler/RISCV64Registers.h: Guard with
  CPU(RISCV64).
* Source/JavaScriptCore/assembler/X86Registers.h: Guard with CPU(X86).
* Source/JavaScriptCore/assembler/X86_64Registers.h: Guard with
  CPU(X86_64).
* Source/JavaScriptCore/b3/B3MemoryValue.h: Mark inlined functions as
  `inline` to avoid declaring symbol visibility.
* Source/JavaScriptCore/b3/B3MemoryValueInlines.h:
(JSC::B3::MemoryValue::isCanonicalWidth const): Move inline
  definition here to prevent TAPI from having to parse it.
* Source/JavaScriptCore/bytecode/AccessCase.h: Add missing include.
* Source/JavaScriptCore/bytecode/AccessCaseSnippetParams.h: Add missing
  include.
* Source/JavaScriptCore/bytecode/RepatchInlines.h: Add missing includes.
* Source/JavaScriptCore/bytecode/Watchpoint.h: Remove declaration for
  deleted fireAllSlow() function.
* Source/JavaScriptCore/disassembler/ARM64/A64DOpcode.h: Add missing
  includes.
* Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::isInspectorDebuggerAgent const):
  Moved from an inline implementation to match its declaration.
* Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h:
  Remove inlined isInspectorDebuggerAgent(). We declare a visible
  symbol, so there must be a non-inline implementation.
* Source/JavaScriptCore/inspector/augmentable/AlternateDispatchableAgent.h:
  Add missing include.
* Source/JavaScriptCore/inspector/cocoa/DeprecatedInspectorValues.cpp:
  Removed. These declarations were removed in 2017, so it is safe to
  remove their implementation now.
* Source/JavaScriptCore/inspector/remote/RemoteInspector.h: Remove
  declaration for setParentProcessInformationIsDelayed() function, which
  was never implemented.
* Source/JavaScriptCore/jit/ExecutableMemoryHandle.h: Add missing
  include.
* Source/JavaScriptCore/jit/JITSizeStatistics.h: Add missing include.
* Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h: Add a config
  macro for JITCage, needed below.
* Source/JavaScriptCore/llint/LLIntThunks.h: Entry points to CSSJIT were
  visible but undeclared (and were declared in WebCore). Move these
  declarations here so that JSC's API matches.
* Source/JavaScriptCore/llint/LowLevelInterpreter.asm: The declaration
  for jitCagePtr is guarded by ENABLE(JIT_CAGE), but the implementation
  is unconditionally assembled. Use the JIT_CAGE setting added above to
  conditionally emit it.
* Source/JavaScriptCore/parser/ASTBuilder.h: Add missing include.
* Source/JavaScriptCore/parser/SyntaxChecker.h: Add needed forward
  declaration.
* Source/JavaScriptCore/runtime/CachePayload.h: Remove declaration for
  undefined operator=() function.
* Source/JavaScriptCore/runtime/DeferredWorkTimer.h: Mark inline
  functions as inline, to avoid declaraing symbols with these names.
* Source/JavaScriptCore/runtime/HashMapImpl.h: Remove declarations for
  undefined getHashMapImpl* functions.
* Source/JavaScriptCore/runtime/Identifier.h: Remove declaration for
  undefined add() function.
* Source/JavaScriptCore/runtime/JSCPtrTag.h: Guard pointer tag
  declarations with CPU(ARM64E).
* Source/JavaScriptCore/runtime/JSGlobalObject.h: Remove declaration for
  undefined registerImportMap() function.
* Source/JavaScriptCore/runtime/JSObject.h: Remove declaration for
  undefined setUpStaticFunctionSlot() function.
* Source/JavaScriptCore/runtime/JSTypedArrays.h: Remove declaration for
  undefined createUint8TypedArray() function.
* Source/JavaScriptCore/runtime/ThrowScope.h: Remove declaration for
  undefined printIfNeedCheck() function.
* Source/JavaScriptCore/runtime/VM.cpp: There is a tapi bug which
  prevents it from recognizing the symbol declared from a pure virtual
  destructor (rdar://107384624). Work around this by inlining the
  (empty) destructor. The class is still abstract because of its other
  pure virtual function.
(JSC::VM::ClientData::~ClientData): Deleted.
* Source/JavaScriptCore/runtime/VM.h: Make inlining change described
  above.
(JSC::VM::ClientData::~ClientData):
* Source/JavaScriptCore/wasm/WasmOperationsInlines.h: Add missing
  includes.

* Source/WebCore/cssjit/SelectorCompiler.cpp: Adjust namespacing of the CSSJIT
  entry point declarations.
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateReturn):
* Source/WebCore/cssjit/SelectorCompiler.h: Use CSSJIT entry points from
  LLIntThunks.h.
(WebCore::SelectorCompiler::ruleCollectorSimpleSelectorChecker):
(WebCore::SelectorCompiler::querySelectorSimpleSelectorChecker):
(WebCore::SelectorCompiler::ruleCollectorSelectorCheckerWithCheckingContext):
(WebCore::SelectorCompiler::querySelectorSelectorCheckerWithCheckingContext):

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




More information about the webkit-changes mailing list