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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart

Issue 27510003: Scanner for UTF-8 byte arrays (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixes compiler tests Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 /** 7 /**
8 * Generates the code for all used classes in the program. Static fields (even 8 * Generates the code for all used classes in the program. Static fields (even
9 * in classes) are ignored, since they can be treated as non-class elements. 9 * in classes) are ignored, since they can be treated as non-class elements.
10 * 10 *
(...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after
1541 1541
1542 String buildSourceMap(CodeBuffer buffer, SourceFile compiledFile) { 1542 String buildSourceMap(CodeBuffer buffer, SourceFile compiledFile) {
1543 SourceMapBuilder sourceMapBuilder = 1543 SourceMapBuilder sourceMapBuilder =
1544 new SourceMapBuilder(compiler.sourceMapUri); 1544 new SourceMapBuilder(compiler.sourceMapUri);
1545 buffer.forEachSourceLocation(sourceMapBuilder.addMapping); 1545 buffer.forEachSourceLocation(sourceMapBuilder.addMapping);
1546 return sourceMapBuilder.build(compiledFile); 1546 return sourceMapBuilder.build(compiledFile);
1547 } 1547 }
1548 1548
1549 void outputSourceMap(String code, String name) { 1549 void outputSourceMap(String code, String name) {
1550 if (!generateSourceMap) return; 1550 if (!generateSourceMap) return;
1551 SourceFile compiledFile = new SourceFile(null, compiler.assembledCode); 1551 // Create a source file for the compilation output. This allows using
1552 // [:getLine:] to transform offsets to line numbers in [SourceMapBuilder].
1553 SourceFile compiledFile =
1554 new StringSourceFile(null, compiler.assembledCode);
1552 String sourceMap = buildSourceMap(mainBuffer, compiledFile); 1555 String sourceMap = buildSourceMap(mainBuffer, compiledFile);
1553 compiler.outputProvider(name, 'js.map') 1556 compiler.outputProvider(name, 'js.map')
1554 ..add(sourceMap) 1557 ..add(sourceMap)
1555 ..close(); 1558 ..close();
1556 } 1559 }
1557 1560
1558 bool isDeferred(Element element) { 1561 bool isDeferred(Element element) {
1559 return compiler.deferredLoadTask.isDeferred(element); 1562 return compiler.deferredLoadTask.isDeferred(element);
1560 } 1563 }
1561 1564
1562 bool get areAnyElementsDeferred { 1565 bool get areAnyElementsDeferred {
1563 return compiler.deferredLoadTask.areAnyElementsDeferred; 1566 return compiler.deferredLoadTask.areAnyElementsDeferred;
1564 } 1567 }
1565 } 1568 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698