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

Issue 10696194: Introduce CodeBuffer as StringBuffer replacement in compiler. (Closed)

Created:
8 years, 5 months ago by podivilov
Modified:
8 years, 4 months ago
Reviewers:
floitsch, sra1, kasperl
CC:
reviews_dartlang.org, ahe
Visibility:
Public.

Description

Introduce CodeBuffer as StringBuffer replacement in compiler. CodeBuffer stores source location markers along with emitted JavaScript code. When CodeBuffer content is added to another CodeBuffer, the markers are added as well. CodeBuffers will be used to propagate source mappings from inside ssa codegen to emitter, see https://chromiumcodereview.appspot.com/10695174/ for details. R=floitsch@google.com,kasperl@google.com Committed: https://code.google.com/p/dart/source/detail?r=9628

Patch Set 1 #

Patch Set 2 : . #

Total comments: 20

Patch Set 3 : . #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+255 lines, -183 lines) Patch
A lib/compiler/implementation/code_buffer.dart View 1 2 1 chunk +85 lines, -0 lines 4 comments Download
M lib/compiler/implementation/compile_time_constants.dart View 1 2 14 chunks +19 lines, -19 lines 0 comments Download
M lib/compiler/implementation/compiler.dart View 1 2 5 chunks +11 lines, -11 lines 0 comments Download
M lib/compiler/implementation/dart_backend/backend.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M lib/compiler/implementation/emitter.dart View 1 2 30 chunks +86 lines, -74 lines 0 comments Download
M lib/compiler/implementation/leg.dart View 1 chunk +1 line, -0 lines 0 comments Download
M lib/compiler/implementation/native_emitter.dart View 10 chunks +11 lines, -13 lines 0 comments Download
M lib/compiler/implementation/source_map_builder.dart View 1 7 chunks +14 lines, -32 lines 0 comments Download
M lib/compiler/implementation/ssa/codegen.dart View 7 chunks +19 lines, -19 lines 0 comments Download
M lib/compiler/implementation/universe.dart View 4 chunks +8 lines, -14 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
podivilov
8 years, 5 months ago (2012-07-12 13:45:56 UTC) #1
floitsch
LGTM. https://chromiumcodereview.appspot.com/10696194/diff/2001/lib/compiler/implementation/code_buffer.dart File lib/compiler/implementation/code_buffer.dart (right): https://chromiumcodereview.appspot.com/10696194/diff/2001/lib/compiler/implementation/code_buffer.dart#newcode6 lib/compiler/implementation/code_buffer.dart:6: StringBuffer _buffer; Any reason those fields are marked ...
8 years, 5 months ago (2012-07-12 16:29:09 UTC) #2
podivilov
Thanks! https://chromiumcodereview.appspot.com/10696194/diff/2001/lib/compiler/implementation/code_buffer.dart File lib/compiler/implementation/code_buffer.dart (right): https://chromiumcodereview.appspot.com/10696194/diff/2001/lib/compiler/implementation/code_buffer.dart#newcode6 lib/compiler/implementation/code_buffer.dart:6: StringBuffer _buffer; On 2012/07/12 16:29:09, floitsch wrote: > ...
8 years, 5 months ago (2012-07-13 12:49:57 UTC) #3
floitsch
https://chromiumcodereview.appspot.com/10696194/diff/2002/lib/compiler/implementation/code_buffer.dart File lib/compiler/implementation/code_buffer.dart (right): https://chromiumcodereview.appspot.com/10696194/diff/2002/lib/compiler/implementation/code_buffer.dart#newcode5 lib/compiler/implementation/code_buffer.dart:5: class CodeBuffer implements StringBuffer { Please implement the 'addAll' ...
8 years, 5 months ago (2012-07-16 09:55:43 UTC) #4
sra1
https://chromiumcodereview.appspot.com/10696194/diff/2002/lib/compiler/implementation/code_buffer.dart File lib/compiler/implementation/code_buffer.dart (right): https://chromiumcodereview.appspot.com/10696194/diff/2002/lib/compiler/implementation/code_buffer.dart#newcode14 lib/compiler/implementation/code_buffer.dart:14: int get length() { nit: int get length() => ...
8 years, 5 months ago (2012-07-16 20:00:49 UTC) #5
ahe
8 years, 4 months ago (2012-08-02 19:31:54 UTC) #6
DBC

https://chromiumcodereview.appspot.com/10696194/diff/2002/lib/compiler/implem...
File lib/compiler/implementation/code_buffer.dart (right):

https://chromiumcodereview.appspot.com/10696194/diff/2002/lib/compiler/implem...
lib/compiler/implementation/code_buffer.dart:65: void setSourceLocation(Element
element, Token token) {
I mentioned in a comment in another CL that it looks like bad offsets are
sneaking through. Here is an assertion that will catch that:

assert(() {
  for (Token current = element.position; current !== null; current =
current.next) {
    if (token === current) return true;
  }
  return false;
});

Powered by Google App Engine
This is Rietveld 408576698