[webkit-changes] [WebKit/WebKit] 1f69d0: [JSC] Clean up Structure transition watchpoint fir...

Yusuke Suzuki noreply at github.com
Wed Dec 7 15:34:08 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1f69d0944e676846b9daa722f4830db27390b14f
      https://github.com/WebKit/WebKit/commit/1f69d0944e676846b9daa722f4830db27390b14f
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2022-12-07 (Wed, 07 Dec 2022)

  Changed paths:
    M Source/JavaScriptCore/bytecode/Watchpoint.cpp
    M Source/JavaScriptCore/bytecode/Watchpoint.h
    M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
    M Source/JavaScriptCore/runtime/JSObject.cpp
    M Source/JavaScriptCore/runtime/JSObjectInlines.h
    M Source/JavaScriptCore/runtime/Structure.cpp
    M Source/JavaScriptCore/runtime/Structure.h
    M Source/JavaScriptCore/runtime/StructureInlines.h

  Log Message:
  -----------
  [JSC] Clean up Structure transition watchpoint firing to pave a way to faster / cheap adaptive watchpoint
https://bugs.webkit.org/show_bug.cgi?id=248853

Reviewed by Ross Kirsling and Alexey Shvayka.

This patch paves the way to adding more complex / faster / cheaper adaptive watchpoint for some of important objects.
Right now, we adaptively re-install watchpoint by using ObjectPropertyCondition's validation, which works great, but
a bit too generic & focusing on super common pattern. We would like to have more complex condition for this check,
and we would like to examine the reason of transition in that case.

So, we clean up our transition code to appropriately pass StructureFireDetail. We also clean up JSObject's transitions
so that we always use DeferredStructureTransitionWatchpointFire when structure is held by an object.

* Source/JavaScriptCore/bytecode/Watchpoint.cpp:
(JSC::DeferredWatchpointFire::fireAllSlow): Deleted.
* Source/JavaScriptCore/bytecode/Watchpoint.h:
(JSC::DeferredWatchpointFire::DeferredWatchpointFire):
(JSC::DeferredWatchpointFire::watchpointsToFire):
(JSC::DeferredWatchpointFire::fireAll): Deleted.
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* Source/JavaScriptCore/runtime/JSObject.cpp:
(JSC::JSObject::notifyPresenceOfIndexedAccessors):
(JSC::JSObject::createInitialUndecided):
(JSC::JSObject::createInitialInt32):
(JSC::JSObject::createInitialDouble):
(JSC::JSObject::createInitialContiguous):
(JSC::JSObject::createArrayStorage):
(JSC::JSObject::convertUndecidedToInt32):
(JSC::JSObject::convertUndecidedToDouble):
(JSC::JSObject::convertUndecidedToContiguous):
(JSC::JSObject::convertUndecidedToArrayStorage):
(JSC::JSObject::convertInt32ToDouble):
(JSC::JSObject::convertInt32ToContiguous):
(JSC::JSObject::convertInt32ToArrayStorage):
(JSC::JSObject::convertDoubleToContiguous):
(JSC::JSObject::convertDoubleToArrayStorage):
(JSC::JSObject::convertContiguousToArrayStorage):
(JSC::JSObject::convertFromCopyOnWrite):
(JSC::JSObject::switchToSlowPutArrayStorage):
(JSC::JSObject::seal):
(JSC::JSObject::freeze):
(JSC::JSObject::preventExtensions):
(JSC::JSObject::reifyAllStaticProperties):
(JSC::JSObject::convertToDictionary):
(JSC::JSObject::convertToUncacheableDictionary):
* Source/JavaScriptCore/runtime/JSObjectInlines.h:
(JSC::JSObject::putDirectInternal):
* Source/JavaScriptCore/runtime/Structure.cpp:
(JSC::Structure::create):
(JSC::Structure::addPropertyTransition):
(JSC::Structure::addNewPropertyTransition):
(JSC::Structure::removeNewPropertyTransition):
(JSC::Structure::changePrototypeTransition):
(JSC::Structure::attributeChangeTransition):
(JSC::Structure::toDictionaryTransition):
(JSC::Structure::sealTransition):
(JSC::Structure::freezeTransition):
(JSC::Structure::preventExtensionsTransition):
(JSC::Structure::nonPropertyTransitionSlow):
(JSC::DeferredStructureTransitionWatchpointFire::DeferredStructureTransitionWatchpointFire):
(JSC::DeferredStructureTransitionWatchpointFire::~DeferredStructureTransitionWatchpointFire):
* Source/JavaScriptCore/runtime/Structure.h:
* Source/JavaScriptCore/runtime/StructureInlines.h:
(JSC::Structure::nonPropertyTransition):

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




More information about the webkit-changes mailing list