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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart

Issue 1271953003: dart2js: Add a header to the output of the startup emitter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library dart2js.js_emitter.full_emitter; 5 library dart2js.js_emitter.full_emitter;
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 import 'dart:collection' show HashMap; 8 import 'dart:collection' show HashMap;
9 9
10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; 10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames;
11 import 'package:js_runtime/shared/embedded_names.dart' show 11 import 'package:js_runtime/shared/embedded_names.dart' show
12 JsBuiltin, 12 JsBuiltin,
13 JsGetName; 13 JsGetName;
14 14
15 import '../headers.dart';
16
15 import '../js_emitter.dart' hide Emitter; 17 import '../js_emitter.dart' hide Emitter;
16 import '../js_emitter.dart' as js_emitter show Emitter; 18 import '../js_emitter.dart' as js_emitter show Emitter;
17 19
18 import '../model.dart'; 20 import '../model.dart';
19 import '../program_builder/program_builder.dart'; 21 import '../program_builder/program_builder.dart';
20 22
21 import '../../common.dart'; 23 import '../../common.dart';
22 24
23 import '../../constants/values.dart'; 25 import '../../constants/values.dart';
24 26
(...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after
2065 } else { 2067 } else {
2066 output.close(); 2068 output.close();
2067 } 2069 }
2068 2070
2069 hunkHashes[outputUnit] = hash; 2071 hunkHashes[outputUnit] = hash;
2070 } 2072 }
2071 return hunkHashes; 2073 return hunkHashes;
2072 } 2074 }
2073 2075
2074 jsAst.Comment buildGeneratedBy() { 2076 jsAst.Comment buildGeneratedBy() {
2075 String suffix = ''; 2077 return new jsAst.Comment(generatedBy(compiler));
2076 if (compiler.hasBuildId) suffix = ' version: ${compiler.buildId}';
2077 String msg = '// Generated by dart2js, the Dart to JavaScript '
2078 'compiler$suffix.';
2079 return new jsAst.Comment(msg);
2080 } 2078 }
2081 2079
2082 void outputSourceMap(CodeOutput output, 2080 void outputSourceMap(CodeOutput output,
2083 LineColumnProvider lineColumnProvider, 2081 LineColumnProvider lineColumnProvider,
2084 String name, 2082 String name,
2085 [Uri sourceMapUri, 2083 [Uri sourceMapUri,
2086 Uri fileUri]) { 2084 Uri fileUri]) {
2087 if (!generateSourceMap) return; 2085 if (!generateSourceMap) return;
2088 // Create a source file for the compilation output. This allows using 2086 // Create a source file for the compilation output. This allows using
2089 // [:getLine:] to transform offsets to line numbers in [SourceMapBuilder]. 2087 // [:getLine:] to transform offsets to line numbers in [SourceMapBuilder].
(...skipping 24 matching lines...) Expand all
2114 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { 2112 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
2115 if (element.isInstanceMember) { 2113 if (element.isInstanceMember) {
2116 cachedClassBuilders.remove(element.enclosingClass); 2114 cachedClassBuilders.remove(element.enclosingClass);
2117 2115
2118 nativeEmitter.cachedBuilders.remove(element.enclosingClass); 2116 nativeEmitter.cachedBuilders.remove(element.enclosingClass);
2119 2117
2120 } 2118 }
2121 } 2119 }
2122 } 2120 }
2123 } 2121 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698