Bug 107147

Summary: DFG Node::ref() and Node::deref() should not return bool, and should have postfixRef variants
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, ggaren, mark.lam, mhahnenberg, msaboff, oliver, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 106868    
Attachments:
Description Flags
the patch
none
the patch mhahnenberg: review+

Description Filip Pizlo 2013-01-17 11:21:02 PST
This small refactoring will enable a world where ref() returns Node*, which is useful for https://bugs.webkit.org/show_bug.cgi?id=106868.  Also, while this refactoring does lead to slightly less terse code, it's also slightly more self-explanatory.  I could never quite remember what the meaning of the bool return from ref() and deref() was.
Comment 1 Filip Pizlo 2013-01-17 11:22:01 PST
Created attachment 183226 [details]
the patch
Comment 2 Oliver Hunt 2013-01-17 12:00:49 PST
Comment on attachment 183226 [details]
the patch

I don't understand what "exchangeAnd(Der|Re)f" is exchanging, so the meaning of the name doesn't seem obvious to me.
Comment 3 Filip Pizlo 2013-01-17 12:35:50 PST
(In reply to comment #2)
> (From update of attachment 183226 [details])
> I don't understand what "exchangeAnd(Der|Re)f" is exchanging, so the meaning of the name doesn't seem obvious to me.

It's exchanging the ref count.
Comment 4 Filip Pizlo 2013-01-17 12:43:04 PST
Created attachment 183248 [details]
the patch
Comment 5 Mark Hahnenberg 2013-01-17 12:44:29 PST
Comment on attachment 183248 [details]
the patch

r=me
Comment 6 Filip Pizlo 2013-01-17 12:46:46 PST
Landed in http://trac.webkit.org/changeset/140030