Bug 161751 - Heap version should be 32-bit
Summary: Heap version should be 32-bit
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-08 12:51 PDT by Filip Pizlo
Modified: 2016-09-08 21:52 PDT (History)
5 users (show)

See Also:


Attachments
the patch (13.49 KB, patch)
2016-09-08 12:53 PDT, Filip Pizlo
mark.lam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2016-09-08 12:51:05 PDT
Patch forthcoming.
Comment 1 Filip Pizlo 2016-09-08 12:53:14 PDT
Created attachment 288308 [details]
the patch
Comment 2 WebKit Commit Bot 2016-09-08 12:55:02 PDT
Attachment 288308 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/heap/MarkedSpace.h:68:  One space before end of line comments  [whitespace/comments] [5]
ERROR: Source/JavaScriptCore/heap/MarkedSpace.cpp:465:  Should have only a single space after a punctuation in a comment.  [whitespace/comments] [5]
ERROR: Source/JavaScriptCore/heap/ConservativeRoots.h:54:  The parameter name "heapVersion" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/heap/CellContainer.h:76:  The parameter name "heapVersion" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/heap/MarkedBlock.h:189:  The parameter name "heapVersion" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/heap/MarkedBlock.h:190:  The parameter name "heapVersion" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/heap/MarkedBlock.h:269:  The parameter name "heapVersion" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/heap/MarkedBlock.h:270:  The parameter name "heapVersion" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 8 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Mark Lam 2016-09-08 13:02:06 PDT
Comment on attachment 288308 [details]
the patch

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

r=me.  Please fix the fixable style issues that the style checker complained about.

> Source/JavaScriptCore/heap/MarkedBlock.h:323
> +        

Please remove leading empty space characters.
Comment 4 Filip Pizlo 2016-09-08 13:03:38 PDT
(In reply to comment #3)
> Comment on attachment 288308 [details]
> the patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=288308&action=review
> 
> r=me.  Please fix the fixable style issues that the style checker complained
> about.

OK

> 
> > Source/JavaScriptCore/heap/MarkedBlock.h:323
> > +        
> 
> Please remove leading empty space characters.

OK!  Thanks for the review!
Comment 5 Filip Pizlo 2016-09-08 13:39:58 PDT
Landed in https://trac.webkit.org/changeset/205658
Comment 6 Geoffrey Garen 2016-09-08 21:26:48 PDT
Comment on attachment 288308 [details]
the patch

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

> Source/JavaScriptCore/heap/MarkedSpace.h:68
> +    static const HeapVersion initialVersion = 42;  // This can be any value, including random garbage, so long as it's consistent for the lifetime of the process.

It's an interesting tidbit that any value can work, but I'm not sure it's necessary or desirable to take advantage. 0 is the best value to delay flipping for as long as possible, and it is also the least comment-worthy.
Comment 7 Filip Pizlo 2016-09-08 21:52:58 PDT
(In reply to comment #6)
> Comment on attachment 288308 [details]
> the patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=288308&action=review
> 
> > Source/JavaScriptCore/heap/MarkedSpace.h:68
> > +    static const HeapVersion initialVersion = 42;  // This can be any value, including random garbage, so long as it's consistent for the lifetime of the process.
> 
> It's an interesting tidbit that any value can work, but I'm not sure it's
> necessary or desirable to take advantage. 0 is the best value to delay
> flipping for as long as possible, and it is also the least comment-worthy.

Wrap-around is not at zero. It's at the initial value. Therefore wrap-around happens after 2^32 flips, regardless of the initial value. 

That's sort of surprising, and I thought it deserved the comment. It's interesting that the comment fails to call out that it can be any value for not just correctness but performance, too.