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

Issue 165403: Streamline the scanner for external two byte string input. (Closed)

Created:
11 years, 4 months ago by Feng Qian
Modified:
9 years, 7 months ago
Reviewers:
plesner, Kasper Lund, iposva
CC:
Mads Ager (chromium)
Visibility:
Public.

Description

Streamline the scanner for external two byte string input. Committed: http://code.google.com/p/v8/source/detail?r=2703

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 18
Unified diffs Side-by-side diffs Delta from patch set Stats (+124 lines, -47 lines) Patch
M src/api.cc View 1 chunk +1 line, -1 line 2 comments Download
M src/compiler.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/parser.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/parser.cc View 4 chunks +7 lines, -5 lines 0 comments Download
M src/scanner.h View 1 4 chunks +46 lines, -11 lines 2 comments Download
M src/scanner.cc View 1 6 chunks +67 lines, -28 lines 14 comments Download

Messages

Total messages: 2 (0 generated)
Kasper Lund
I'm okay with change as a first step - but I think we should consider ...
11 years, 4 months ago (2009-08-18 06:49:41 UTC) #1
Feng Qian
11 years, 4 months ago (2009-08-18 07:14:10 UTC) #2
http://codereview.chromium.org/165403/diff/1004/1005
File src/api.cc (right):

http://codereview.chromium.org/165403/diff/1004/1005#newcode1049
Line 1049: return i::PreParse(i::Handle<i::String>(), &buf, NULL);
On 2009/08/18 06:49:41, Kasper Lund wrote:
> i::Handle<i::String>::null() to make it more explicit?

Ah, didn't know this trick, but it is a bit confusing that one may think
i::Handle<i::String>::null() is a null string.

http://codereview.chromium.org/165403/diff/1004/1007
File src/scanner.cc (right):

http://codereview.chromium.org/165403/diff/1004/1007#newcode95
Line 95: : pos_(0), size_(0) { }
On 2009/08/18 06:49:41, Kasper Lund wrote:
> 4 space indent.

Done.

http://codereview.chromium.org/165403/diff/1004/1007#newcode95
Line 95: : pos_(0), size_(0) { }
On 2009/08/18 06:49:41, Kasper Lund wrote:
> 4 space indent.

Done.

http://codereview.chromium.org/165403/diff/1004/1007#newcode105
Line 105: : pushback_buffer_(0), last_(0), stream_(NULL) { }
On 2009/08/18 06:49:41, Kasper Lund wrote:
> 4 space indent.

Done.

http://codereview.chromium.org/165403/diff/1004/1007#newcode105
Line 105: : pushback_buffer_(0), last_(0), stream_(NULL) { }
On 2009/08/18 06:49:41, Kasper Lund wrote:
> 4 space indent.

Done.

http://codereview.chromium.org/165403/diff/1004/1007#newcode157
Line 157: : raw_data_(NULL) { }
On 2009/08/18 06:49:41, Kasper Lund wrote:
> 4 space indent.

Done.

http://codereview.chromium.org/165403/diff/1004/1007#newcode162
Line 162: ASSERT(!data.is_null() && StringShape(*data).IsExternalTwoByte());
On 2009/08/18 06:49:41, Kasper Lund wrote:
> StringShape(*data).IsExternalTwoByte() -> data->IsExternalTwoByteString()

IsExternalTwoByte check is unnecessary here, removed.

http://codereview.chromium.org/165403/diff/1004/1007#newcode176
Line 176: // note: currently the following increment is necessary to avoid a
On 2009/08/18 06:49:41, Kasper Lund wrote:
> note -> Note

Done.

http://codereview.chromium.org/165403/diff/1004/1007#newcode206
Line 206: if (!source.is_null() && StringShape(*source).IsExternalTwoByte()) {
On 2009/08/18 06:49:41, Kasper Lund wrote:
> StringShape(*source).IsExternalTwoByte() -> source->IsExternalTwoByteString()?

IsExternalTwoByteString is only implemented in #if DEBUG, and comments in
objects-inl.h states that one should consider use StringShape instead of moving
the implementation out of #if DEBUG

http://codereview.chromium.org/165403/diff/1004/1008
File src/scanner.h (right):

http://codereview.chromium.org/165403/diff/1004/1008#newcode78
Line 78: virtual void PushBack(uc32 ch) = 0;
Let's do it later.

On 2009/08/18 06:49:41, Kasper Lund wrote:
> Ideally, these functions could be made non-virtuals again if we change the
> internal format of the CharacterStream to be two byte encodings.

Powered by Google App Engine
This is Rietveld 408576698