Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cd91e7f128dd09f6f9bb8f19e8bc66c6d7e94dfa
https://github.com/WebKit/WebKit/commit/cd91e7f128dd09f6f9bb8f19e8bc66c6d7e94dfa
Author: Yusuke Suzuki <[email protected]>
Date: 2026-07-27 (Mon, 27 Jul 2026)
Changed paths:
A JSTests/stress/object-toprimitive-fastpath-deopt.js
A JSTests/stress/object-toprimitive-fastpath-overrides.js
A JSTests/stress/object-toprimitive-fastpath-prototype.js
A JSTests/stress/object-toprimitive-fastpath.js
M Source/JavaScriptCore/runtime/JSObject.cpp
M Source/JavaScriptCore/runtime/Structure.h
M Source/JavaScriptCore/runtime/StructureInlines.h
M Source/JavaScriptCore/runtime/StructureRareData.cpp
M Source/JavaScriptCore/runtime/StructureRareData.h
Log Message:
-----------
[JSC] Add fast flag for ToPrimitive(Object) calls in runtime
https://bugs.webkit.org/show_bug.cgi?id=320343
rdar://183289080
Reviewed by Sosuke Suzuki.
Make ToPrimitive(object) faster by caching a flag in StructureRareData.
m_cachedHasDefaultToPrimitiveFastAndNonObservable says that we can use
toStringTag cached value.
Tests: JSTests/stress/object-toprimitive-fastpath-deopt.js
JSTests/stress/object-toprimitive-fastpath-overrides.js
JSTests/stress/object-toprimitive-fastpath-prototype.js
JSTests/stress/object-toprimitive-fastpath.js
* JSTests/stress/object-toprimitive-fastpath-deopt.js: Added.
(shouldBe):
(O):
(Object.prototype.toString):
(a.Symbol.toPrimitive):
(Tagged):
(Plain):
* JSTests/stress/object-toprimitive-fastpath-overrides.js: Added.
(shouldBe):
(v.valueOf):
(s.toString):
(tp.Symbol.toPrimitive):
(catch):
(other.Object.prototype.toString):
(Plain):
* JSTests/stress/object-toprimitive-fastpath-prototype.js: Added.
(shouldBe):
(O):
(O.prototype.valueOf):
(O.prototype.toString):
(O.prototype.Symbol.toPrimitive):
(valueOf):
(o.valueOf):
* JSTests/stress/object-toprimitive-fastpath.js: Added.
(shouldBe):
(O):
* Source/JavaScriptCore/runtime/JSObject.cpp:
(JSC::JSObject::toPrimitive const):
* Source/JavaScriptCore/runtime/Structure.h:
* Source/JavaScriptCore/runtime/StructureInlines.h:
(JSC::Structure::defaultToPrimitiveFastAndNonObservable):
* Source/JavaScriptCore/runtime/StructureRareData.cpp:
(JSC::StructureRareData::giveUpOnSpecialPropertyCache):
(JSC::StructureRareData::clearCachedSpecialProperty):
* Source/JavaScriptCore/runtime/StructureRareData.h:
Canonical link: https://commits.webkit.org/317978@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications