Bug 165910

Summary: Make the collector's fixpoint smart about scheduling work
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on: 165911, 165963    
Bug Blocks: 165909, 166828, 166827, 166831    
Attachments:
Description Flags
possible patch
none
the patch
none
the patch
none
the patch keith_miller: review+

Filip Pizlo
Reported 2016-12-15 12:18:54 PST
The GC currently scans a bunch of things in each fixpoint iteration. It will sometimes do many fixpoint iterations. I suspect that when it does have to perform multiple fixpoint iterations, it's because some specific part of the fixpoint is being very needy. This implies that we can dramatically improve the fixpoint's performance using traditional fixpoint optimization tricks.
Attachments
possible patch (145.25 KB, patch)
2017-01-08 11:54 PST, Filip Pizlo
no flags
the patch (148.03 KB, patch)
2017-01-08 14:27 PST, Filip Pizlo
no flags
the patch (148.26 KB, patch)
2017-01-08 15:32 PST, Filip Pizlo
no flags
the patch (148.27 KB, patch)
2017-01-08 15:46 PST, Filip Pizlo
keith_miller: review+
Filip Pizlo
Comment 1 2016-12-15 14:49:12 PST
I'm imagining that each of the phases of the weak fixpoint would be put into a SharedTask or some even smarter object, and then we'd be able to write some scheduler that runs them in an order that reduces the average number of executions.
Filip Pizlo
Comment 2 2017-01-08 11:34:10 PST
*** Bug 165963 has been marked as a duplicate of this bug. ***
Filip Pizlo
Comment 3 2017-01-08 11:36:33 PST
I was originally thinking that in bug 165963, I would implement the infrastructure that's needed to intelligently schedule work and then in this bug I would use that infrastructure to get an optimization. I ended up doing both of those things in bug 165963.
Filip Pizlo
Comment 4 2017-01-08 11:54:29 PST
Created attachment 298310 [details] possible patch
Filip Pizlo
Comment 5 2017-01-08 14:27:22 PST
Created attachment 298316 [details] the patch
WebKit Commit Bot
Comment 6 2017-01-08 14:29:15 PST
Attachment 298316 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/heap/MarkingConstraintSet.cpp:201: An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:37: Code inside a namespace should not be indented. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:37: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:38: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:39: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:40: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:49: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:50: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:51: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:52: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:53: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] Total errors found: 11 in 27 files If any of these errors are false positives, please file a bug against check-webkit-style.
Filip Pizlo
Comment 7 2017-01-08 15:32:38 PST
Created attachment 298320 [details] the patch
WebKit Commit Bot
Comment 8 2017-01-08 15:35:45 PST
Attachment 298320 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/heap/MarkingConstraintSet.cpp:201: An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:37: Code inside a namespace should not be indented. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:37: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:38: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:39: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:40: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:49: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:50: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:51: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:52: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:53: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] Total errors found: 11 in 27 files If any of these errors are false positives, please file a bug against check-webkit-style.
Filip Pizlo
Comment 9 2017-01-08 15:46:06 PST
Created attachment 298321 [details] the patch
WebKit Commit Bot
Comment 10 2017-01-08 15:48:54 PST
Attachment 298321 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/heap/MarkingConstraintSet.cpp:201: An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:37: Code inside a namespace should not be indented. [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:37: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:38: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:39: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:40: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:49: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:50: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:51: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:52: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/heap/MarkingConstraint.cpp:53: Wrong number of spaces before statement. (expected: 8) [whitespace/indent] [4] Total errors found: 11 in 27 files If any of these errors are false positives, please file a bug against check-webkit-style.
Keith Miller
Comment 11 2017-01-09 12:57:06 PST
Comment on attachment 298321 [details] the patch View in context: https://bugs.webkit.org/attachment.cgi?id=298321&action=review r=me with some minor comments. > Source/JavaScriptCore/heap/MarkingConstraintSet.cpp:124 > +void MarkingConstraintSet::add( > + std::unique_ptr<MarkingConstraint> constraint) Nit, put this on one line. > Source/JavaScriptCore/heap/SpaceTimeMutatorScheduler.cpp:2 > + * Copyright (C) 2016 Apple Inc. All rights reserved. 2017 > Source/JavaScriptCore/heap/SpaceTimeMutatorScheduler.h:2 > + * Copyright (C) 2016 Apple Inc. All rights reserved. 2017
Filip Pizlo
Comment 12 2017-01-09 12:58:41 PST
(In reply to comment #11) > Comment on attachment 298321 [details] > the patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=298321&action=review > > r=me with some minor comments. > > > Source/JavaScriptCore/heap/MarkingConstraintSet.cpp:124 > > +void MarkingConstraintSet::add( > > + std::unique_ptr<MarkingConstraint> constraint) > > Nit, put this on one line. Done. > > > Source/JavaScriptCore/heap/SpaceTimeMutatorScheduler.cpp:2 > > + * Copyright (C) 2016 Apple Inc. All rights reserved. > > 2017 You're commenting on the pseudofile that the patch is showing you. In fact, SpaceTimeMutatorScheduler.cpp:2 is: * Copyright (C) 2016-2017 Apple Inc. All rights reserved. > > > Source/JavaScriptCore/heap/SpaceTimeMutatorScheduler.h:2 > > + * Copyright (C) 2016 Apple Inc. All rights reserved. > > 2017 Ditto.
Filip Pizlo
Comment 13 2017-01-09 13:48:27 PST
Filip Pizlo
Comment 14 2017-01-09 16:16:31 PST
Note You need to log in before you can comment on or make changes to this bug.