Bug 129741

Summary: JSCell::m_gcData should encode its information differently
Product: WebKit Reporter: Mark Hahnenberg <mhahnenberg>
Component: JavaScriptCoreAssignee: Mark Hahnenberg <mhahnenberg>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch ggaren: review+

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>