[webkit-changes] [WebKit/WebKit] 667a73: [JSC] __proto__ produces incorrect value after Obj...

Commit Queue noreply at github.com
Wed Jun 28 12:59:04 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 667a7374f1ddff4f597489916022e7856e4e2664
      https://github.com/WebKit/WebKit/commit/667a7374f1ddff4f597489916022e7856e4e2664
  Author: Alexey Shvayka <ashvayka at apple.com>
  Date:   2023-06-28 (Wed, 28 Jun 2023)

  Changed paths:
    A JSTests/stress/intrinsic-getter-object-proto-getter-change.js
    A JSTests/stress/intrinsic-getter-typed-array-byteLength-getter-change.js
    A JSTests/stress/intrinsic-getter-typed-array-byteOffset-getter-change.js
    A JSTests/stress/intrinsic-getter-typed-array-length-getter-change.js
    M Source/JavaScriptCore/bytecode/ObjectPropertyConditionSet.cpp
    M Source/JavaScriptCore/bytecode/ObjectPropertyConditionSet.h
    M Source/JavaScriptCore/bytecode/Repatch.cpp

  Log Message:
  -----------
  [JSC] __proto__ produces incorrect value after Object.prototype.__proto__ changes
https://bugs.webkit.org/show_bug.cgi?id=257774
<rdar://problem/110464460>

Reviewed by Yusuke Suzuki.

Before this change, PropertyCondition::Presence was generated for intrinsic getters just as for
userland getters, causing IC bug if the built-in getter was redefined after compilation:
compiled code was still calling the old intrinsic getter.

The above-mentioned bug was caused by the fact that PropertyCondition::Presence merely validates
only StructureID, property offset, and the attributes. The bug was observed only when both getter
and setter were present, like by default in Object.prototype.__proto__ accessor.

This change fixes the bug by generating PropertyCondition::Equivalence for all intrinsic getters.

* JSTests/stress/intrinsic-getter-object-proto-getter-change.js: Added.
* JSTests/stress/intrinsic-getter-typed-array-byteLength-getter-change.js: Added.
* JSTests/stress/intrinsic-getter-typed-array-byteOffset-getter-change.js: Added.
* JSTests/stress/intrinsic-getter-typed-array-length-getter-change.js: Added.
* Source/JavaScriptCore/bytecode/ObjectPropertyConditionSet.cpp:
(JSC::generateConditionsForPrototypePropertyHit):
* Source/JavaScriptCore/bytecode/ObjectPropertyConditionSet.h:
* Source/JavaScriptCore/bytecode/Repatch.cpp:
(JSC::tryCacheGetBy):

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




More information about the webkit-changes mailing list