Bug 144585

Summary: Optimize WeakBlock's "reap" and "visit" operations.
Product: WebKit Reporter: Andreas Kling <kling>
Component: JavaScriptCoreAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: ggaren, kling, mhahnenb
Priority: P2 Keywords: Performance
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch idea ggaren: review+

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

r=me

> 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 :)