[webkit-changes] [WebKit/WebKit] 169cc4: [JSC] Refactor scattered JIT code into InlineCache...

Yusuke Suzuki noreply at github.com
Mon Mar 27 15:25:36 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 169cc466998a189223c37aebe53032ae0dde8f13
      https://github.com/WebKit/WebKit/commit/169cc466998a189223c37aebe53032ae0dde8f13
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2023-03-27 (Mon, 27 Mar 2023)

  Changed paths:
    M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
    M Source/JavaScriptCore/Sources.txt
    M Source/JavaScriptCore/bytecode/AccessCase.cpp
    M Source/JavaScriptCore/bytecode/AccessCase.h
    M Source/JavaScriptCore/bytecode/AccessCaseSnippetParams.cpp
    M Source/JavaScriptCore/bytecode/AccessCaseSnippetParams.h
    M Source/JavaScriptCore/bytecode/CheckPrivateBrandStatus.cpp
    M Source/JavaScriptCore/bytecode/DeleteByStatus.cpp
    M Source/JavaScriptCore/bytecode/GetByStatus.cpp
    M Source/JavaScriptCore/bytecode/GetterSetterAccessCase.cpp
    M Source/JavaScriptCore/bytecode/GetterSetterAccessCase.h
    M Source/JavaScriptCore/bytecode/InByStatus.cpp
    A Source/JavaScriptCore/bytecode/InlineCacheCompiler.cpp
    A Source/JavaScriptCore/bytecode/InlineCacheCompiler.h
    M Source/JavaScriptCore/bytecode/InstanceOfAccessCase.h
    M Source/JavaScriptCore/bytecode/InstanceOfStatus.cpp
    M Source/JavaScriptCore/bytecode/IntrinsicGetterAccessCase.cpp
    M Source/JavaScriptCore/bytecode/IntrinsicGetterAccessCase.h
    M Source/JavaScriptCore/bytecode/ModuleNamespaceAccessCase.cpp
    M Source/JavaScriptCore/bytecode/ModuleNamespaceAccessCase.h
    R Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp
    R Source/JavaScriptCore/bytecode/PolymorphicAccess.h
    M Source/JavaScriptCore/bytecode/ProxyObjectAccessCase.cpp
    M Source/JavaScriptCore/bytecode/ProxyObjectAccessCase.h
    M Source/JavaScriptCore/bytecode/ProxyableAccessCase.h
    M Source/JavaScriptCore/bytecode/PutByStatus.cpp
    M Source/JavaScriptCore/bytecode/Repatch.cpp
    M Source/JavaScriptCore/bytecode/SetPrivateBrandStatus.cpp
    M Source/JavaScriptCore/bytecode/StructureStubInfo.cpp
    M Source/JavaScriptCore/bytecode/StructureStubInfo.h
    R Source/JavaScriptCore/jit/IntrinsicEmitter.cpp

  Log Message:
  -----------
  [JSC] Refactor scattered JIT code into InlineCacheCompiler and make AccessCases more pure-data objects
https://bugs.webkit.org/show_bug.cgi?id=254445
rdar://107203467

Reviewed by Justin Michaud.

This patch refactors existing IC infrastructure. Factor out JIT code generation into one InlineCacheCompiler class instead
of scattering it in various AccessCase subclasses. And this patch makes AccessCase more pure data objects.

* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/Sources.txt:
* Source/JavaScriptCore/bytecode/AccessCase.cpp:
(JSC::AccessCase::generateWithGuard): Deleted.
(JSC::AccessCase::generate): Deleted.
(JSC::AccessCase::generateImpl): Deleted.
(JSC::AccessCase::toTypedArrayType): Deleted.
(JSC::AccessCase::forResizableTypedArray): Deleted.
* Source/JavaScriptCore/bytecode/AccessCase.h:
* Source/JavaScriptCore/bytecode/AccessCaseSnippetParams.cpp:
(JSC::AccessCaseSnippetParams::emitSlowPathCalls):
* Source/JavaScriptCore/bytecode/AccessCaseSnippetParams.h:
* Source/JavaScriptCore/bytecode/CheckPrivateBrandStatus.cpp:
* Source/JavaScriptCore/bytecode/DeleteByStatus.cpp:
* Source/JavaScriptCore/bytecode/GetByStatus.cpp:
* Source/JavaScriptCore/bytecode/GetterSetterAccessCase.cpp:
(JSC::GetterSetterAccessCase::emitDOMJITGetter): Deleted.
* Source/JavaScriptCore/bytecode/GetterSetterAccessCase.h:
* Source/JavaScriptCore/bytecode/InByStatus.cpp:
* Source/JavaScriptCore/bytecode/InlineCacheCompiler.cpp: Added.
(JSC::AccessGenerationResult::dump const):
(JSC::toTypedArrayType):
(JSC::forResizableTypedArray):
(JSC::InlineCacheCompiler::installWatchpoint):
(JSC::InlineCacheCompiler::restoreScratch):
(JSC::InlineCacheCompiler::succeed):
(JSC::InlineCacheCompiler::liveRegistersForCall):
(JSC::InlineCacheCompiler::liveRegistersToPreserveAtExceptionHandlingCallSite):
(JSC::calleeSaveRegisters):
(JSC::InlineCacheCompiler::calculateLiveRegistersForCallAndExceptionHandling):
(JSC::InlineCacheCompiler::preserveLiveRegistersToStackForCall):
(JSC::InlineCacheCompiler::preserveLiveRegistersToStackForCallWithoutExceptions):
(JSC::InlineCacheCompiler::restoreLiveRegistersFromStackForCallWithThrownException):
(JSC::InlineCacheCompiler::restoreLiveRegistersFromStackForCall):
(JSC::InlineCacheCompiler::callSiteIndexForExceptionHandlingOrOriginal):
(JSC::InlineCacheCompiler::callSiteIndexForExceptionHandling):
(JSC::InlineCacheCompiler::originalExceptionHandler):
(JSC::InlineCacheCompiler::originalCallSiteIndex const):
(JSC::InlineCacheCompiler::emitExplicitExceptionHandler):
(JSC::InlineCacheCompiler::makeDefaultScratchAllocator):
(JSC::InlineCacheCompiler::generateWithGuard):
(JSC::InlineCacheCompiler::generate):
(JSC::InlineCacheCompiler::generateImpl):
(JSC::InlineCacheCompiler::emitDOMJITGetter):
(JSC::InlineCacheCompiler::emitModuleNamespaceLoad):
(JSC::InlineCacheCompiler::emitProxyObjectAccess):
(JSC::InlineCacheCompiler::canEmitIntrinsicGetter):
(JSC::InlineCacheCompiler::emitIntrinsicGetter):
(JSC::commit):
(JSC::InlineCacheCompiler::regenerate):
(JSC::PolymorphicAccess::PolymorphicAccess):
(JSC::PolymorphicAccess::~PolymorphicAccess):
(JSC::PolymorphicAccess::addCases):
(JSC::PolymorphicAccess::addCase):
(JSC::PolymorphicAccess::visitWeak const):
(JSC::PolymorphicAccess::propagateTransitions const):
(JSC::PolymorphicAccess::visitAggregateImpl):
(JSC::PolymorphicAccess::dump const):
(JSC::PolymorphicAccess::aboutToDie):
(WTF::printInternal):
* Source/JavaScriptCore/bytecode/InlineCacheCompiler.h: Renamed from Source/JavaScriptCore/bytecode/PolymorphicAccess.h.
(JSC::AccessGenerationResult::AccessGenerationResult):
(JSC::AccessGenerationResult::operator== const):
(JSC::AccessGenerationResult::operator!= const):
(JSC::AccessGenerationResult::operator bool const):
(JSC::AccessGenerationResult::kind const):
(JSC::AccessGenerationResult::code const):
(JSC::AccessGenerationResult::madeNoChanges const):
(JSC::AccessGenerationResult::gaveUp const):
(JSC::AccessGenerationResult::buffered const):
(JSC::AccessGenerationResult::generatedNewCode const):
(JSC::AccessGenerationResult::generatedFinalCode const):
(JSC::AccessGenerationResult::shouldResetStubAndFireWatchpoints const):
(JSC::AccessGenerationResult::shouldGiveUpNow const):
(JSC::AccessGenerationResult::generatedSomeCode const):
(JSC::AccessGenerationResult::addWatchpointToFire):
(JSC::AccessGenerationResult::fireWatchpoints):
(JSC::PolymorphicAccess::isEmpty const):
(JSC::PolymorphicAccess::size const):
(JSC::PolymorphicAccess::at const):
(JSC::PolymorphicAccess::operator[] const):
(JSC::PolymorphicAccess::containsPC const):
(JSC::InlineCacheCompiler::InlineCacheCompiler):
(JSC::InlineCacheCompiler::SpillState::SpillState):
(JSC::InlineCacheCompiler::SpillState::isEmpty const):
(JSC::InlineCacheCompiler::preserveLiveRegistersToStackForCall):
(JSC::InlineCacheCompiler::restoreLiveRegistersFromStackForCall):
(JSC::InlineCacheCompiler::needsToRestoreRegistersIfException const):
(JSC::InlineCacheCompiler::setSpillStateForJSCall):
(JSC::InlineCacheCompiler::spillStateForJSCall const):
(JSC::InlineCacheCompiler::vm):
* Source/JavaScriptCore/bytecode/InstanceOfAccessCase.h:
* Source/JavaScriptCore/bytecode/InstanceOfStatus.cpp:
* Source/JavaScriptCore/bytecode/IntrinsicGetterAccessCase.cpp:
(JSC::IntrinsicGetterAccessCase::doesCalls const):
* Source/JavaScriptCore/bytecode/IntrinsicGetterAccessCase.h:
* Source/JavaScriptCore/bytecode/ModuleNamespaceAccessCase.cpp:
(JSC::ModuleNamespaceAccessCase::emit): Deleted.
* Source/JavaScriptCore/bytecode/ModuleNamespaceAccessCase.h:
* Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp: Removed.
* Source/JavaScriptCore/bytecode/ProxyObjectAccessCase.cpp:
(JSC::ProxyObjectAccessCase::emit): Deleted.
* Source/JavaScriptCore/bytecode/ProxyObjectAccessCase.h:
* Source/JavaScriptCore/bytecode/ProxyableAccessCase.h:
* Source/JavaScriptCore/bytecode/PutByStatus.cpp:
* Source/JavaScriptCore/bytecode/Repatch.cpp:
(JSC::tryCacheGetBy):
* Source/JavaScriptCore/bytecode/SetPrivateBrandStatus.cpp:
* Source/JavaScriptCore/bytecode/StructureStubInfo.cpp:
(JSC::StructureStubInfo::addAccessCase):
* Source/JavaScriptCore/bytecode/StructureStubInfo.h:
* Source/JavaScriptCore/jit/IntrinsicEmitter.cpp: Removed.

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




More information about the webkit-changes mailing list