Repository navigation
[JSC] Skip the generic lookup in get_by_val slow paths when the base has no prototype - #79733
Open
sosukesuzuki wants to merge 1 commit into
Conversation
…e has no prototype https://bugs.webkit.org/show_bug.cgi?id=330274 Reviewed by NOBODY (OOPS!). The get_by_val slow paths try fastGetOwnProperty() first. When it misses, they call the generic get(), which sets up a PropertySlot, looks the name up in the same Structure again, finds no prototype to walk, and finally calls parseIndex() on the name. If the base is a JSFinalObject whose prototype is null, the result is already known after the miss: an index-like name can only be an indexed property of the base, and any other name is undefined. This patch returns that directly. LLInt, Baseline and DFG each had their own copy of this lookup. This patch moves DFG's getByValObject() to CommonSlowPaths and uses it from all of them. This helps objects created with Object.create(null) and used as maps. A lookup reaches these slow paths when the IC gave up, when the key is not an atom string yet, when the key is an index-like string such as "123", and always in LLInt. Baseline Patched get-by-val-null-prototype-index-string 197.0297+-5.9499 ^ 168.7088+-6.4240 ^ definitely 1.1679x faster get-by-val-null-prototype-dictionary-miss 245.5512+-9.7113 ^ 156.2362+-5.4247 ^ definitely 1.5717x faster Tests: JSTests/microbenchmarks/get-by-val-null-prototype-dictionary-miss.js JSTests/microbenchmarks/get-by-val-null-prototype-index-string.js JSTests/stress/get-by-val-null-prototype-miss.js * JSTests/microbenchmarks/get-by-val-null-prototype-dictionary-miss.js: Added. (get map): (get countHits): * JSTests/microbenchmarks/get-by-val-null-prototype-index-string.js: Added. (sum): * JSTests/stress/get-by-val-null-prototype-miss.js: Added. (shouldBe): (getString): (getFreshString): (getSymbol): (getAny): (fill): (small): (empty): (dictionary): (uncacheableDictionary): (ordinary): (inheriting): (inheritingFromNullPrototype): (inheritingFromProxy): (get inheritingGetter): (get inheritingFromProxyReturningReceiver): (get polyProto.create.Constructor): (get polyProto.create): (get polyProto): (frozen): (array): (func): (withIndexedGetter.get return): (withIndexedGetter): (withGetter.get return): (withGetter): (check): (let.throwing.fill.Object.create.get inherited): (let.throwing.fill.Object.create.get missingSymbol): (get catch): (let.get of): * Source/JavaScriptCore/dfg/DFGOperations.cpp: (JSC::DFG::JSC_DEFINE_JIT_OPERATION): (JSC::DFG::getByValObject): Deleted. * Source/JavaScriptCore/jit/JITOperations.cpp: (JSC::getByVal): * Source/JavaScriptCore/llint/LLIntSlowPaths.cpp: (JSC::LLInt::getByVal): * Source/JavaScriptCore/runtime/CommonSlowPathsInlines.h: (JSC::CommonSlowPaths::getByValObject):
Collaborator
|
EWS run on current version of this PR (hash 3cf0fe9) Details |
This was referenced Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
3cf0fe9
3cf0fe9