Bug 144585 - Optimize WeakBlock's "reap" and "visit" operations.
Summary: Optimize WeakBlock's "reap" and "visit" operations.
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
Keywords: Performance
Depends on:
Reported: 2015-05-04 10:20 PDT by Andreas Kling
Modified: 2015-05-05 00:26 PDT (History)
3 users (show)

See Also:

Patch idea (10.15 KB, patch)
2015-05-04 10:21 PDT, Andreas Kling
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2015-05-04 10:20:44 PDT
WeakBlock's reap() and visit() could be a lot faster if they stopped doing so many paranoid address checks. Have patch, will post.
Comment 1 Andreas Kling 2015-05-04 10:21:38 PDT
Created attachment 252319 [details]
Patch idea
Comment 2 Geoffrey Garen 2015-05-04 10:46:01 PDT
Comment on attachment 252319 [details]
Patch idea

View in context: https://bugs.webkit.org/attachment.cgi?id=252319&action=review


> Source/JavaScriptCore/heap/MarkedBlock.h:415
> +    inline bool MarkedBlock::isLiveForWeakBlockScan(const JSCell* cell)

Let's call this isMarkedOrNewlyAllocated, and have isLive call it. That way, the MarkedBlock class is not responsible for promising that it's right to call this during weak block scan. It's only responsible for providing the answer that it knows.

> Source/JavaScriptCore/heap/WeakBlock.h:74
> +    void didDetachFromMarkedBlock() { m_markedBlock = nullptr; }

I think we usually call this "disconnectMarkedBlock".
Comment 3 Andreas Kling 2015-05-04 13:43:30 PDT
Committed r183769: <http://trac.webkit.org/changeset/183769>
Comment 4 Andreas Kling 2015-05-05 00:26:27 PDT
mac-mavericks perf bot says this was a 3.2% progression on Dromaeo/dom-modify :)