Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d2c63be26cd676053519933c4bdfbd4f2f94009f
https://github.com/WebKit/WebKit/commit/d2c63be26cd676053519933c4bdfbd4f2f94009f
Author: Yusuke Suzuki <[email protected]>
Date: 2026-03-10 (Tue, 10 Mar 2026)
Changed paths:
A JSTests/microbenchmarks/regexp-last-index-ic.js
A JSTests/stress/regexp-last-index.js
A JSTests/stress/regexp-lastindex-inline-cache.js
M Source/JavaScriptCore/bytecode/AccessCase.cpp
M Source/JavaScriptCore/bytecode/AccessCase.h
M Source/JavaScriptCore/bytecode/InlineCacheCompiler.cpp
M Source/JavaScriptCore/bytecode/Repatch.cpp
Log Message:
-----------
[JSC] Add RegExp#lastIndex IC
https://bugs.webkit.org/show_bug.cgi?id=309549
rdar://172150739
Reviewed by Sosuke Suzuki.
This patch implements RegExp#lastIndex IC for load and store. This is
pretty easy since it is own property, non-configurable and data
property. So we should just load and store a value to the field. Only
thing we need to care is writable=false flag can be set so
RegExpLastIndexStore side checks this before storing.
With disabling DFG,
ToT Patched
regexp-last-index 52.5397+-0.4507 ^ 25.8446+-16.5492
^ definitely 2.0329x faster
regexp-last-index-ic 29.3950+-0.4737 ^ 21.9877+-1.3869
^ definitely 1.3369x faster
Tests: JSTests/microbenchmarks/regexp-last-index-ic.js
JSTests/stress/regexp-last-index.js
JSTests/stress/regexp-lastindex-inline-cache.js
* JSTests/microbenchmarks/regexp-last-index-ic.js: Added.
(load):
(store):
(reg.test.i):
* JSTests/stress/regexp-last-index.js: Added.
(shouldThrow):
(test):
(test2):
* JSTests/stress/regexp-lastindex-inline-cache.js: Added.
(testGet):
(testSet):
(testGetAfterExec):
(testNonWritable):
(testPolymorphic.getLastIndex):
(testPolymorphic):
(testSetWithCellValue):
* Source/JavaScriptCore/bytecode/AccessCase.cpp:
(JSC::AccessCase::create):
(JSC::AccessCase::guardedByStructureCheckSkippingConstantIdentifierCheck const):
(JSC::AccessCase::requiresIdentifierNameMatch const):
(JSC::AccessCase::requiresInt32PropertyCheck const):
(JSC::AccessCase::forEachDependentCell const):
(JSC::AccessCase::doesCalls const):
(JSC::AccessCase::canReplace const):
(JSC::AccessCase::runWithDowncast):
(JSC::AccessCase::canBeShared):
* Source/JavaScriptCore/bytecode/AccessCase.h:
* Source/JavaScriptCore/bytecode/InlineCacheCompiler.cpp:
(JSC::needsScratchFPR):
(JSC::forInBy):
(JSC::isStateless):
(JSC::doesJSCalls):
(JSC::isMegamorphic):
(JSC::canBeViaGlobalProxy):
(JSC::InlineCacheCompiler::generateWithGuard):
(JSC::InlineCacheCompiler::generateAccessCase):
* Source/JavaScriptCore/bytecode/Repatch.cpp:
(JSC::tryCacheGetBy):
(JSC::tryCachePutBy):
Canonical link: https://commits.webkit.org/309027@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications