Skip to content

Commit

Permalink
[JSC] Keeping Identifiers in PolymorphicAccessJITStubRoutine is not n…
Browse files Browse the repository at this point in the history
…ecessary

https://bugs.webkit.org/show_bug.cgi?id=273610
rdar://127411952

Reviewed by Justin Michaud.

We are using shared JIT stub only for Baseline JIT IC, and ById case with Baseline JIT IC always has
CodeBlock which holds CacheableIdentifier. So JIT stub itself does not need to keep them.
When the stub is no longer used, then it gets zero-ref-count, and removed from shared JIT stub table automatically.

* Source/JavaScriptCore/jit/GCAwareJITStubRoutine.cpp:
(JSC::PolymorphicAccessJITStubRoutine::addedToSharedJITStubSet):
* Source/JavaScriptCore/jit/GCAwareJITStubRoutine.h:

Canonical link: https://commits.webkit.org/278268@main
  • Loading branch information
Constellation committed May 2, 2024
1 parent 03028cd commit 244f3f7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
10 changes: 0 additions & 10 deletions Source/JavaScriptCore/jit/GCAwareJITStubRoutine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,6 @@ unsigned PolymorphicAccessJITStubRoutine::computeHash(const FixedVector<RefPtr<A
void PolymorphicAccessJITStubRoutine::addedToSharedJITStubSet()
{
m_isInSharedJITStubSet = true;
// Since this stub no longer belongs to any CodeBlocks (since it is shared),
// identifiers need to be owned by this stub itself.
m_identifiers = FixedVector<Identifier>(m_cases.size());
unsigned index = 0;
for (auto& accessCase : m_cases) {
auto identifier = Identifier::fromUid(m_vm, accessCase->uid());
accessCase->updateIdentifier(CacheableIdentifier::createFromSharedStub(identifier.impl()));
m_identifiers[index] = WTFMove(identifier);
++index;
}
}

MarkingGCAwareJITStubRoutine::MarkingGCAwareJITStubRoutine(
Expand Down
1 change: 0 additions & 1 deletion Source/JavaScriptCore/jit/GCAwareJITStubRoutine.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ class PolymorphicAccessJITStubRoutine : public GCAwareJITStubRoutine {
VM& m_vm;
FixedVector<RefPtr<AccessCase>> m_cases;
FixedVector<StructureID> m_weakStructures;
FixedVector<Identifier> m_identifiers;
RefPtr<WatchpointSet> m_watchpointSet;
std::unique_ptr<WatchpointsOnStructureStubInfo> m_watchpoints;
};
Expand Down

0 comments on commit 244f3f7

Please sign in to comment.