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

Issue 10632009: Make the parser agnostic to the TokenStream implementation. This is the first step towards compacti… (Closed)

Created:
8 years, 6 months ago by siva
Modified:
8 years, 6 months ago
Reviewers:
hausner
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Make the parser agnostic to the TokenStream implementation. This is the first step towards compacting the token stream. Pull the data stream writer/reader code out of snapshot into a generic file so that it can be reused into the token stream compaction implementation. Committed: https://code.google.com/p/dart/source/detail?r=9043

Patch Set 1 #

Patch Set 2 : #

Total comments: 10

Patch Set 3 : #

Total comments: 2

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1478 lines, -1417 lines) Patch
M vm/ast.h View 1 2 3 45 chunks +98 lines, -98 lines 0 comments Download
M vm/ast.cc View 1 2 3 5 chunks +10 lines, -10 lines 0 comments Download
M vm/ast_printer.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M vm/class_finalizer.cc View 1 2 3 23 chunks +26 lines, -26 lines 0 comments Download
M vm/code_generator_ia32.cc View 1 2 3 89 chunks +126 lines, -126 lines 0 comments Download
M vm/compiler.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
A vm/datastream.h View 1 2 3 1 chunk +203 lines, -0 lines 0 comments Download
M vm/debugger.h View 1 2 3 6 chunks +9 lines, -9 lines 0 comments Download
M vm/debugger.cc View 1 2 3 17 chunks +34 lines, -34 lines 0 comments Download
M vm/flow_graph_builder.h View 1 2 3 5 chunks +10 lines, -10 lines 0 comments Download
M vm/flow_graph_builder.cc View 1 2 3 56 chunks +66 lines, -66 lines 0 comments Download
M vm/flow_graph_compiler.cc View 1 2 3 5 chunks +10 lines, -10 lines 0 comments Download
M vm/flow_graph_compiler_ia32.h View 1 2 3 7 chunks +16 lines, -16 lines 0 comments Download
M vm/flow_graph_compiler_ia32.cc View 1 2 3 19 chunks +29 lines, -29 lines 0 comments Download
M vm/flow_graph_compiler_x64.h View 1 2 3 6 chunks +16 lines, -16 lines 0 comments Download
M vm/flow_graph_compiler_x64.cc View 1 2 3 19 chunks +29 lines, -29 lines 0 comments Download
M vm/intermediate_language.h View 1 2 3 51 chunks +86 lines, -86 lines 0 comments Download
M vm/intermediate_language.cc View 1 2 3 9 chunks +10 lines, -10 lines 0 comments Download
M vm/intermediate_language_ia32.cc View 1 2 3 43 chunks +49 lines, -49 lines 0 comments Download
M vm/intermediate_language_x64.cc View 1 2 3 43 chunks +49 lines, -49 lines 0 comments Download
M vm/object.h View 1 2 3 24 chunks +34 lines, -34 lines 0 comments Download
M vm/object.cc View 1 2 3 34 chunks +75 lines, -75 lines 0 comments Download
M vm/opt_code_generator_ia32.h View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download
M vm/opt_code_generator_ia32.cc View 1 2 3 34 chunks +36 lines, -36 lines 0 comments Download
M vm/parser.h View 1 2 3 12 chunks +47 lines, -23 lines 0 comments Download
M vm/parser.cc View 1 2 3 196 chunks +350 lines, -327 lines 0 comments Download
M vm/raw_object.h View 1 2 3 7 chunks +8 lines, -8 lines 0 comments Download
M vm/raw_object_snapshot.cc View 1 2 3 12 chunks +14 lines, -14 lines 0 comments Download
M vm/scopes.h View 1 2 3 8 chunks +17 lines, -17 lines 0 comments Download
M vm/scopes.cc View 1 2 3 6 chunks +10 lines, -10 lines 0 comments Download
M vm/snapshot.h View 1 2 3 5 chunks +3 lines, -192 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
siva
8 years, 6 months ago (2012-06-21 22:45:48 UTC) #1
hausner
I think the interface to the iterator should change, it's too confusing now. http://codereview.chromium.org/10632009/diff/5001/vm/datastream.h File ...
8 years, 6 months ago (2012-06-22 00:02:27 UTC) #2
siva
http://codereview.chromium.org/10632009/diff/5001/vm/datastream.h File vm/datastream.h (right): http://codereview.chromium.org/10632009/diff/5001/vm/datastream.h#newcode14 vm/datastream.h:14: static const int8_t kSerializedBitsPerByte = 7; I have renamed ...
8 years, 6 months ago (2012-06-22 17:59:02 UTC) #3
hausner
LGTM. http://codereview.chromium.org/10632009/diff/5001/vm/datastream.h File vm/datastream.h (right): http://codereview.chromium.org/10632009/diff/5001/vm/datastream.h#newcode14 vm/datastream.h:14: static const int8_t kSerializedBitsPerByte = 7; Thanks for ...
8 years, 6 months ago (2012-06-22 18:54:36 UTC) #4
siva
8 years, 6 months ago (2012-06-22 20:36:29 UTC) #5
http://codereview.chromium.org/10632009/diff/5001/vm/datastream.h
File vm/datastream.h (right):

http://codereview.chromium.org/10632009/diff/5001/vm/datastream.h#newcode14
vm/datastream.h:14: static const int8_t kSerializedBitsPerByte = 7;
Used calculations for 63, -64, 127 etc.

On 2012/06/22 18:54:37, hausner wrote:
> Thanks for making the names shorter. I still have a nit though: if you think
> that the calculations are the right way, why do you not calculate 63 and -64
and
> 127? Feel free to ignore the comment though.
>  
> On 2012/06/22 17:59:02, asiva wrote:
> > I have renamed the constants removing the Serialized part as that only
applied
> > in the snapshot context.
> > 
> > but I disagree with your comment about not having calculations in them. When
> one
> > constant is dependent on another constant it makes sense to use them in that
> > fashion, otherwise one would have to add a comment explaining that the
> > subsequent constant is dependent etc. etc.
> > 
> > On 2012/06/22 00:02:27, hausner wrote:
> > > I know you just copied this code from another file, so leaving it
unchanged
> is
> > > fine. I would find it more readable though if the names were shorter and
did
> > not
> > > have calculations in them. For example, the mask and end byte marker could
> be
> > > fixed values just like the min and max values.
> > 
>

http://codereview.chromium.org/10632009/diff/8001/vm/parser.h
File vm/parser.h (right):

http://codereview.chromium.org/10632009/diff/8001/vm/parser.h#newcode125
vm/parser.h:125: void AdvanceToNextToken() { token_position_ += 1; }
On 2012/06/22 18:54:37, hausner wrote:
> I prefer shorter names, e.g. Advance() here. This method name lives in the
> context of a TokenStreamIterator, so it's pretty clear what the method
advances
> to.

Done.

Powered by Google App Engine
This is Rietveld 408576698