[JSC] Use handler IC for single stateless AccessCase#25468
Conversation
|
EWS run on previous version of this PR (hash 0a572e0) Details |
bd15a53 to
0288636
Compare
|
EWS run on previous version of this PR (hash 4d7fc9a) Details
|
|
EWS run on previous version of this PR (hash bd15a53) Details
|
|
EWS run on previous version of this PR (hash 0288636) Details |
0288636 to
1ed1433
Compare
|
EWS run on previous version of this PR (hash 1ed1433) Details |
1ed1433 to
4dcd882
Compare
|
EWS run on previous version of this PR (hash 4dcd882) Details |
4dcd882 to
c99e279
Compare
|
EWS run on previous version of this PR (hash c99e279) Details |
There was a problem hiding this comment.
It'd be nice if these were enums for readability.
There was a problem hiding this comment.
It was actually hard to see it in enum for all of these bools in various places. I feel like using bool is better here since this is not randomly used key. It is only created from StructureStubInfo, for InlineCacheCompiler.
If this is used and created in various places, I think enum would be good, or using struct here would be nice. But given that it is only used in one place, I think this is simpler and better (plus, better for extensibility).
There was a problem hiding this comment.
What's up with this removal and the follow on stubInfo. -> m_stubInfo-> changes? Seems like unnecessary code churn. If the concern is that we can't tell who's accessing stateful StructureStubInfo members we should guard access behind ASSERTs in getters.
There was a problem hiding this comment.
Using m_stubInfo actually found dependent use of stubInfo information in code generation, so I think it is definitely better than using stubInfo. in random places (consistent use of m_stubInfo). Right now, asserting is very hard since it depends on DataIC / RepatchingIC, and making code super complicated.
There was a problem hiding this comment.
"contains the cases" => "contains cases"
c99e279 to
50eaf44
Compare
|
EWS run on current version of this PR (hash 50eaf44) Details |
https://bugs.webkit.org/show_bug.cgi?id=270497 rdar://124047629 Reviewed by Keith Miller. This patch enables Handler IC only for very specific case: single stateless AccessCase. For example, ArrayLength, IndexedContiguousLoad etc. does not care about Structure. They only care about the input's type. So the underlying code can be reused in different places completely. And if AccessCase is only one, the generated code can be reused in various places. And surprisingly this is relatively frequently happening. 1. This patch categorizes stateless AccessCases. They do not require Structure etc. state of the heap. 2. We clean up InlineCacheCompiler implementation about accessing to StructureStubInfo* to figure out what is the values changing the generated code from StructureStubInfo. 3. We clean up InlineCacheCompiler's information collection code from vector of AccessCase so that we can easily see what information is collected. 4. We extend SharedJITStubSet to store stateless stubs. Previously it was only storing megamorphic stubs since they are stateless. But now it gets extended to accept all stateless stubs. * Source/JavaScriptCore/bytecode/AccessCase.h: * Source/JavaScriptCore/bytecode/InlineCacheCompiler.cpp: (JSC::isStateless): (JSC::InlineCacheCompiler::regenerate): (WTF::printInternal): * Source/JavaScriptCore/bytecode/InlineCacheCompiler.h: * Source/JavaScriptCore/bytecode/StructureStubInfo.cpp: (JSC::SharedJITStubSet::getStatelessStub const): (JSC::SharedJITStubSet::setStatelessStub): (JSC::SharedJITStubSet::getMegamorphic const): Deleted. (JSC::SharedJITStubSet::setMegamorphic): Deleted. * Source/JavaScriptCore/bytecode/StructureStubInfo.h: Canonical link: https://commits.webkit.org/275721@main
50eaf44 to
540d08d
Compare
|
Committed 275721@main (540d08d): https://commits.webkit.org/275721@main Reviewed commits have been landed. Closing PR #25468 and removing active labels. |
540d08d
50eaf44
🛠 ios🛠 ios-sim🧪 wpe-wk2🧪 ios-wk2🧪 ios-wk2-wpt🧪 api-ios🛠 tv🧪 mac-AS-debug-wk2🧪 gtk-wk2🛠 tv-sim🧪 api-gtk🛠 watch🛠 watch-sim