Bug 129741 - JSCell::m_gcData should encode its information differently
Summary: JSCell::m_gcData should encode its information differently
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Hahnenberg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-05 08:24 PST by Mark Hahnenberg
Modified: 2014-03-05 15:27 PST (History)
0 users

See Also:


Attachments
Patch (22.91 KB, patch)
2014-03-05 12:11 PST, Mark Hahnenberg
no flags Details | Formatted Diff | Diff
Patch (22.85 KB, patch)
2014-03-05 12:18 PST, Mark Hahnenberg
no flags Details | Formatted Diff | Diff
Patch (22.91 KB, patch)
2014-03-05 12:29 PST, Mark Hahnenberg
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hahnenberg 2014-03-05 08:24:40 PST
We want to keep track of three states for an object:

(1) Not marked (which implies not in the remembered set)
(2) Marked but not in the remembered set
(3) Marked and in the remembered set

Currently we only indicate marked vs. not marked in JSCell::m_gcData. During a write barrier, we only want to take the slow path if the object being stored to is in state (2). We'd like to make the test for state (2) as fast as possible, which probably means making it a compare against 0.
Comment 1 Mark Hahnenberg 2014-03-05 12:11:52 PST
Created attachment 225902 [details]
Patch
Comment 2 Mark Hahnenberg 2014-03-05 12:18:53 PST
Created attachment 225903 [details]
Patch
Comment 3 Mark Hahnenberg 2014-03-05 12:29:01 PST
Created attachment 225905 [details]
Patch
Comment 4 Geoffrey Garen 2014-03-05 13:07:24 PST
Comment on attachment 225905 [details]
Patch

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

r=me

Is speedup?

> Source/JavaScriptCore/runtime/JSCell.h:150
> +    void mark() { m_gcData = Marked; }

I would call this "setMarked".

> Source/JavaScriptCore/runtime/JSCell.h:151
> +    void remember() { ASSERT(m_gcData == Marked); m_gcData = MarkedAndRemembered; }

"setRemembered(true)"

> Source/JavaScriptCore/runtime/JSCell.h:152
> +    void forget() { ASSERT(m_gcData == MarkedAndRemembered); m_gcData = Marked; }

"setRemembered(false)"
Comment 5 Mark Hahnenberg 2014-03-05 14:33:09 PST
(In reply to comment #4)
> (From update of attachment 225905 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=225905&action=review
> 
> r=me
> 
> Is speedup?
No visible effect on benchmarks.
Comment 6 Mark Hahnenberg 2014-03-05 15:27:43 PST
Committed r165135: <http://trac.webkit.org/changeset/165135>