-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JSC] Reland Handler IC #28106
[JSC] Reland Handler IC #28106
Conversation
30465a9
to
70615bc
Compare
EWS run on previous version of this PR (hash 70615bc)
|
70615bc
to
8e0d558
Compare
EWS run on previous version of this PR (hash 8e0d558)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me with nits.
template<typename Functor> | ||
bool removeAllIf(const Functor&); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: could be const auto&
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
@@ -84,6 +84,27 @@ IGNORE_GCC_WARNINGS_BEGIN("sequence-point") | |||
IGNORE_GCC_WARNINGS_END | |||
} | |||
|
|||
bool GCAwareJITStubRoutine::removeDeadOwners(VM& vm) | |||
{ | |||
if (m_owner) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add: ASSERT(vm.heap.isInPhase(CollectorPhase::End));
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
8e0d558
to
b6b9842
Compare
EWS run on current version of this PR (hash b6b9842)
|
I've searched |
Failed to access https://raw.githubusercontent.com/WebKit/WebKit/main/metadata/contributors.json, blocking PR #28106 |
https://bugs.webkit.org/show_bug.cgi?id=273693 rdar://127496851 Reviewed by Keith Miller. This patch enables limited variant of Handler IC. The limitation means, 1. Only enabled for Baseline JIT. 2. Getter and Setter are not supported yet. 3. We are caching entire code as an one handler. This is not the final form we would like to have. Next step is splitting them into one per AccessCase and chain them. 4. After (3) gets done, we would like to put more data into InlineCacheHandler itself so that code can be more and more sharable. But even with this limited form, we are already observing good cache hit rate. So we take an approach starting with this, and further extending Handler IC based on the above milestones. We enable Handler IC, which is only enabled for Baseline JIT right now. The IC is hash-consed via SharedJITStubSet. And InlineCacheCompiler first search for an already compiled stub, if it finds it, we register watchpoint to this stub and use it without new compilation. If it is not found, we compile a new stub and register it to this table if possible. When nobody uses this stub, then refCount becomes zero, and it automatically unregister itself from the table. Each StructureStubInfo site's access cases is always subsumes stub's access cases. So GC will check validity via this StructureStubInfo's access cases, and drop stub when it is no longer valid (as the same to the current IC). The major difference from the last patch is adding multiple owners to the shared JIT IC. Stubs are unregistering themselves from SharedJITStubSet when it reaches to zero-ref-count. But this does not work well since CodeBlock can be destroyed lazily: if CodeBlock is dead, during that, no GC scanning happens to this stub while ref-count is still non-zero. For normal JIT stubs, we have owner concept for JIT stub. At GC end phase, we iterate stubs and check whether the owner is already dead. And if it is dead, we mark it m_ownerIsDead. But shared JIT stub does not have this concept. Instead, we have HashCountedSet for shared JIT stub, and register multiple owners for shared JIT stub. And at GC end phase, we scan owners to wipe dead owners, and when live owners become zero, we mark the stub as m_ownerIsDead too. * Source/JavaScriptCore/bytecode/AccessCase.cpp: (JSC::AccessCase::tryGetAlternateBaseImpl const): (JSC::AccessCase::canBeShared): (JSC::AccessCase::tryGetAlternateBase const): (JSC::AccessCase::hasAlternateBaseImpl const): Deleted. (JSC::AccessCase::alternateBaseImpl const): Deleted. (JSC::AccessCase::hasAlternateBase const): Deleted. (JSC::AccessCase::alternateBase const): Deleted. * Source/JavaScriptCore/bytecode/AccessCase.h: (JSC::AccessCase::identifier const): (JSC::AccessCase::dumpImpl const): (JSC::AccessCase::updateIdentifier): Deleted. * Source/JavaScriptCore/bytecode/GetByStatus.cpp: (JSC::GetByStatus::computeForStubInfoWithoutExitSiteFeedback): * Source/JavaScriptCore/bytecode/GetterSetterAccessCase.cpp: (JSC::GetterSetterAccessCase::tryGetAlternateBaseImpl const): (JSC::GetterSetterAccessCase::hasAlternateBaseImpl const): Deleted. (JSC::GetterSetterAccessCase::alternateBaseImpl const): Deleted. * Source/JavaScriptCore/bytecode/GetterSetterAccessCase.h: * Source/JavaScriptCore/bytecode/InlineCacheCompiler.cpp: (JSC::InlineCacheCompiler::generateImpl): (JSC::InlineCacheCompiler::regenerate): (JSC::isMegamorphicById): Deleted. * Source/JavaScriptCore/bytecode/PutByStatus.cpp: (JSC::PutByStatus::computeForStubInfo): * Source/JavaScriptCore/jit/GCAwareJITStubRoutine.h: (JSC::PolymorphicAccessJITStubRoutine::isStillValid const): * Source/JavaScriptCore/runtime/StructureID.h: Canonical link: https://commits.webkit.org/278369@main
b6b9842
to
13455c7
Compare
Committed 278369@main (13455c7): https://commits.webkit.org/278369@main Reviewed commits have been landed. Closing PR #28106 and removing active labels. |
13455c7
b6b9842