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

Issue 12218086: Add StringSink and update StringBuffer. (Closed)

Created:
7 years, 10 months ago by floitsch
Modified:
7 years, 10 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 17

Patch Set 2 : Address comments and fix code-buffer. #

Patch Set 3 : writeln/writeAll #

Patch Set 4 : Remove obsolete comments. #

Total comments: 3

Patch Set 5 : Rename stringConcat to stringConcatUnchecked. #

Patch Set 6 : Rebase #

Patch Set 7 : Add writeAll to CodeBuffer. #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+151 lines, -84 lines) Patch
M runtime/lib/string_buffer_patch.dart View 1 2 3 1 chunk +17 lines, -30 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/code_buffer.dart View 1 2 3 4 5 6 3 chunks +22 lines, -9 lines 4 comments Download
M sdk/lib/_internal/compiler/implementation/lib/core_patch.dart View 1 2 3 4 1 chunk +21 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/js_helper.dart View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/string_helper.dart View 1 2 3 4 1 chunk +0 lines, -30 lines 0 comments Download
M sdk/lib/core/core.dart View 1 chunk +1 line, -0 lines 0 comments Download
M sdk/lib/core/corelib_sources.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M sdk/lib/core/string_buffer.dart View 1 2 1 chunk +53 lines, -13 lines 4 comments Download
A sdk/lib/core/string_sink.dart View 1 2 1 chunk +32 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
floitsch
Tests and users still need to get updated. https://codereview.chromium.org/12218086/diff/1/sdk/lib/core/string_buffer.dart File sdk/lib/core/string_buffer.dart (right): https://codereview.chromium.org/12218086/diff/1/sdk/lib/core/string_buffer.dart#newcode64 sdk/lib/core/string_buffer.dart:64: @deprecated ...
7 years, 10 months ago (2013-02-09 00:59:02 UTC) #1
kasperl
https://codereview.chromium.org/12218086/diff/1/sdk/lib/core/string_sink.dart File sdk/lib/core/string_sink.dart (right): https://codereview.chromium.org/12218086/diff/1/sdk/lib/core/string_sink.dart#newcode26 sdk/lib/core/string_sink.dart:26: void addCharCode(int charCode); Wouldn't writeCharCode be more consistent?
7 years, 10 months ago (2013-02-11 07:51:53 UTC) #2
Lasse Reichstein Nielsen
lgtm https://codereview.chromium.org/12218086/diff/1/sdk/lib/core/string_buffer.dart File sdk/lib/core/string_buffer.dart (right): https://codereview.chromium.org/12218086/diff/1/sdk/lib/core/string_buffer.dart#newcode15 sdk/lib/core/string_buffer.dart:15: StringBuffer([Object content = ""]) { Just make the ...
7 years, 10 months ago (2013-02-11 12:30:11 UTC) #3
floitsch
Needed to update the code-buffer class. https://codereview.chromium.org/12218086/diff/1/sdk/lib/core/string_buffer.dart File sdk/lib/core/string_buffer.dart (right): https://codereview.chromium.org/12218086/diff/1/sdk/lib/core/string_buffer.dart#newcode15 sdk/lib/core/string_buffer.dart:15: StringBuffer([Object content = ...
7 years, 10 months ago (2013-02-11 17:10:49 UTC) #4
floitsch
PTAL. added Peter (for dart2js) added Srdjan (for the VM. sorry I forgot you the ...
7 years, 10 months ago (2013-02-13 14:15:05 UTC) #5
srdjan
LGTM for runtime changes and thanks for adding me.
7 years, 10 months ago (2013-02-13 18:22:39 UTC) #6
floitsch
@lrn: PTAL @peter: ping.
7 years, 10 months ago (2013-02-15 10:40:27 UTC) #7
ahe
There are a lot of changes in this CL that makes me nervous. Did you ...
7 years, 10 months ago (2013-02-15 11:30:41 UTC) #8
Lasse Reichstein Nielsen
Still LGTM
7 years, 10 months ago (2013-02-15 16:12:27 UTC) #9
floitsch
Needed to add writeAll to CodeBuffer. Resubmitting. @ahe: I looked at the generated JS code ...
7 years, 10 months ago (2013-02-18 14:15:40 UTC) #10
Ivan Posva
Please make sure that the benchmarks are updated to avoid breakage when the deprecated methods ...
7 years, 10 months ago (2013-02-18 15:39:48 UTC) #11
sra1
DBC https://codereview.chromium.org/12218086/diff/23001/sdk/lib/_internal/compiler/implementation/code_buffer.dart File sdk/lib/_internal/compiler/implementation/code_buffer.dart (right): https://codereview.chromium.org/12218086/diff/23001/sdk/lib/_internal/compiler/implementation/code_buffer.dart#newcode7 sdk/lib/_internal/compiler/implementation/code_buffer.dart:7: class CodeBuffer implements StringBuffer { It would be ...
7 years, 10 months ago (2013-02-18 21:06:57 UTC) #12
ahe
https://codereview.chromium.org/12218086/diff/23001/sdk/lib/core/string_buffer.dart File sdk/lib/core/string_buffer.dart (right): https://codereview.chromium.org/12218086/diff/23001/sdk/lib/core/string_buffer.dart#newcode31 sdk/lib/core/string_buffer.dart:31: external void write(Object obj); You forgot to document all ...
7 years, 10 months ago (2013-02-19 12:11:43 UTC) #13
floitsch
7 years, 10 months ago (2013-02-19 14:21:17 UTC) #14
Message was sent while issue was closed.
Changes in:
https://codereview.chromium.org/12303026

https://codereview.chromium.org/12218086/diff/23001/sdk/lib/_internal/compile...
File sdk/lib/_internal/compiler/implementation/code_buffer.dart (right):

https://codereview.chromium.org/12218086/diff/23001/sdk/lib/_internal/compile...
sdk/lib/_internal/compiler/implementation/code_buffer.dart:7: class CodeBuffer
implements StringBuffer {
On 2013/02/18 21:06:57, sra1 wrote:
> It would be better if the methods that implement methods from StringBuffer had
> compatible signatures.
> The methods here return CodeBuffer, but the ones from StringBuffer /
StringSink
> return void.
> 
> You might have to change the call sites to use cascades.

Agreed. The CodeBuffer already diverged, so I just followed its conventions, but
it should be modified.

Filed issue 8607.

https://codereview.chromium.org/12218086/diff/23001/sdk/lib/_internal/compile...
sdk/lib/_internal/compiler/implementation/code_buffer.dart:48: return
write(object).write("\n");
On 2013/02/18 21:06:57, sra1 wrote:
> If you really need to chain here, use cascades.

Will do, when I refactor the CodeBuffer.

https://codereview.chromium.org/12218086/diff/23001/sdk/lib/core/string_buffe...
File sdk/lib/core/string_buffer.dart (right):

https://codereview.chromium.org/12218086/diff/23001/sdk/lib/core/string_buffe...
sdk/lib/core/string_buffer.dart:17: /// Returns the length of the buffer.
On 2013/02/18 21:06:57, sra1 wrote:
> Does it return the length of the buffer (could have additional capacity), or
the
> length of the string thus far accumulated?
> 
> Are you guaranteeing this is constant time? (The use in isEmpty would hint
that
> is so, but please state.)
> 

Done.

https://codereview.chromium.org/12218086/diff/23001/sdk/lib/core/string_buffe...
sdk/lib/core/string_buffer.dart:31: external void write(Object obj);
On 2013/02/19 12:11:44, ahe wrote:
> You forgot to document all the new methods you added.

Documentation for them is inherited.

Powered by Google App Engine
This is Rietveld 408576698