Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Issue 10310040: Sort the output (for now just the classes and instance members). (Closed)

Created:
8 years, 7 months ago by floitsch
Modified:
8 years, 7 months ago
Reviewers:
ngeoffray, kasperl
CC:
reviews_dartlang.org, ngeoffray
Visibility:
Public.

Description

Sort the output (for now just the classes and instance members). Committed: https://code.google.com/p/dart/source/detail?r=7447

Patch Set 1 #

Patch Set 2 : Sort instance methods too. #

Patch Set 3 : Rebase #

Total comments: 6

Patch Set 4 : Use an id in classelement to compare #

Patch Set 5 : Remove SourceString.compareTo #

Patch Set 6 : Remove (now) unnecessary changes. #

Total comments: 4

Patch Set 7 : Address comments. #

Patch Set 8 : Add test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -18 lines) Patch
A frog/tests/leg/class_order_test.dart View 1 2 3 4 5 6 7 1 chunk +43 lines, -0 lines 0 comments Download
M frog/tests/leg/parser_helper.dart View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M lib/compiler/implementation/elements/elements.dart View 1 2 3 3 chunks +3 lines, -1 line 0 comments Download
M lib/compiler/implementation/emitter.dart View 1 2 3 4 5 6 7 1 chunk +9 lines, -1 line 0 comments Download
M lib/compiler/implementation/scanner/class_element_parser.dart View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M lib/compiler/implementation/scanner/listener.dart View 1 2 3 4 5 5 chunks +10 lines, -6 lines 0 comments Download
M lib/compiler/implementation/scanner/scanner_task.dart View 1 2 3 4 5 2 chunks +4 lines, -2 lines 0 comments Download
M lib/compiler/implementation/ssa/closure.dart View 1 2 3 4 5 6 1 chunk +6 lines, -1 line 0 comments Download
M lib/compiler/implementation/typechecker.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M lib/compiler/implementation/universe.dart View 1 2 3 4 5 5 chunks +6 lines, -3 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
floitsch
8 years, 7 months ago (2012-05-07 17:05:21 UTC) #1
floitsch
rebased.
8 years, 7 months ago (2012-05-07 17:06:52 UTC) #2
floitsch
With this CL code emission of Swarm takes now 14secs. So I will have to ...
8 years, 7 months ago (2012-05-07 20:14:31 UTC) #3
ngeoffray
No surprise this slows down sooooooo much the emitter :) Could we instead used the ...
8 years, 7 months ago (2012-05-08 07:58:02 UTC) #4
floitsch
PTAL.
8 years, 7 months ago (2012-05-08 15:26:44 UTC) #5
kasperl
LGTM. The output order is implicitly defined through the class ids and the way the ...
8 years, 7 months ago (2012-05-09 08:15:20 UTC) #6
ngeoffray
LGTM! Very nice and simple :)
8 years, 7 months ago (2012-05-09 08:58:27 UTC) #7
floitsch
8 years, 7 months ago (2012-05-09 10:55:07 UTC) #8
https://chromiumcodereview.appspot.com/10310040/diff/4001/lib/compiler/implem...
File lib/compiler/implementation/emitter.dart (right):

https://chromiumcodereview.appspot.com/10310040/diff/4001/lib/compiler/implem...
lib/compiler/implementation/emitter.dart:437: return member1.compareTo(member2);
On 2012/05/08 07:58:02, ngeoffray wrote:
> Should the list already be sorted? After all, these elements are stored in the
> ClassElement, and we should build that list sorted when creating the
> ClassElement.

Removed sorting of instance members.

https://chromiumcodereview.appspot.com/10310040/diff/4001/lib/compiler/implem...
lib/compiler/implementation/emitter.dart:499: sortedClasses.sort((ClassElement
class1, ClassElement class2) {
On 2012/05/08 07:58:02, ngeoffray wrote:
> I guess this one is hard to sort eagerly. How about assigning an index to the
> ClassElement when it's created, so the order is only dependent on the way we
> scan files?

Done.

https://chromiumcodereview.appspot.com/10310040/diff/4001/lib/compiler/implem...
lib/compiler/implementation/emitter.dart:587: member.position());
On 2012/05/08 07:58:02, ngeoffray wrote:
> Maybe a FunctionElement should contain a list of closure elements?

change reverted.

https://chromiumcodereview.appspot.com/10310040/diff/2014/lib/compiler/implem...
File lib/compiler/implementation/emitter.dart (right):

https://chromiumcodereview.appspot.com/10310040/diff/2014/lib/compiler/implem...
lib/compiler/implementation/emitter.dart:492: sortedClasses.sort((ClassElement
class1, ClassElement class2) {
On 2012/05/09 08:15:20, kasperl wrote:
> Maybe describe what kind of sorting this implies? Here you are assuming that
the
> ids are increasing within a source file?

I added a comment. We don't rely on the sorting and it is not crucial that the
ids increase with the source file. But yes. that's the intention.

https://chromiumcodereview.appspot.com/10310040/diff/2014/lib/compiler/implem...
File lib/compiler/implementation/ssa/closure.dart (right):

https://chromiumcodereview.appspot.com/10310040/diff/2014/lib/compiler/implem...
lib/compiler/implementation/ssa/closure.dart:19:
compiler.universe.getNextFreeClassId()) {
On 2012/05/09 08:15:20, kasperl wrote:
> So all closures come after the classes in a source file? Maybe add a comment
to
> that extent.

Done.

Powered by Google App Engine
This is Rietveld 408576698