[webkit-changes] [WebKit/WebKit] 7a6823: Have functions that only require VMs take a VM ref...

Rose noreply at github.com
Mon Mar 27 11:44:22 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7a682381645f03d8fc7f2fa58c134d45b5b59c2d
      https://github.com/WebKit/WebKit/commit/7a682381645f03d8fc7f2fa58c134d45b5b59c2d
  Author: Rose <83477269+AtariDreams at users.noreply.github.com>
  Date:   2023-03-27 (Mon, 27 Mar 2023)

  Changed paths:
    M Source/JavaScriptCore/runtime/JSONObject.cpp
    M Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.cpp
    M Source/WebCore/bindings/js/JSDOMConvertEnumeration.h
    M Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
    M Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h
    M Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONEnum.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONEnum.h
    M Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
    M Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.h
    M Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.h

  Log Message:
  -----------
  Have functions that only require VMs take a VM reference https://bugs.webkit.org/show_bug.cgi?id=202392

Reviewed by Darin Adler.

We can have the .vm() method be called before these functions,
and pass the result VM reference instead of passing the pointer to the JSGlobalObject, potentially calling the .vm() methods redundantly in each method to which said JSGlobalObject pointer is passed, and dereferencing the pointers to the VM.

* Source/JavaScriptCore/runtime/JSONObject.cpp:(value): Change argument
  type from JSGlobalObject* to VM&.

* Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.cpp:
  (get): Pass the VM of the state object to convertEnumerationToJS
  rather than the whole object.

* Source/WebCore/bindings/js/JSDOMConvertEnumeration.h:
  (convertEnumerationToJS): Change argument type from JSGlobalObject to
  VM.
  (convert): Pass the VM of lexicalGlobalObject instead of the entire
  global object.

* Source/WebCore/bindings/scripts/CodeGeneratorJS.pm: Ditto.

* Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
  Ditto.

* Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h:
  Ditto.

* Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONEnum.cpp:
  Ditto.

* Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONEnum.h:
  Ditto.

* Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp: Ditto.

* Source/WebCore/bindings/scripts/test/JS/JSTestObj.h: Ditto.

* Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
  Ditto.

* Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
  Ditto.

* Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
  Ditto.

* Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.h:
  Ditto.

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




More information about the webkit-changes mailing list