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

Side by Side Diff: lib/src/codegen/js_codegen.dart

Issue 1413683006: Move runtime js files down to lib/runtime/dart (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « lib/runtime/dart_utils.js ('k') | lib/src/compiler.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dev_compiler.src.codegen.js_codegen; 5 library dev_compiler.src.codegen.js_codegen;
6 6
7 import 'dart:collection' show HashSet, HashMap, SplayTreeSet; 7 import 'dart:collection' show HashSet, HashMap, SplayTreeSet;
8 8
9 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; 9 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator;
10 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator; 10 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator;
(...skipping 21 matching lines...) Expand all
32 import 'code_generator.dart'; 32 import 'code_generator.dart';
33 import 'js_field_storage.dart'; 33 import 'js_field_storage.dart';
34 import 'js_names.dart' as JS; 34 import 'js_names.dart' as JS;
35 import 'js_metalet.dart' as JS; 35 import 'js_metalet.dart' as JS;
36 import 'js_module_item_order.dart'; 36 import 'js_module_item_order.dart';
37 import 'js_printer.dart' show writeJsLibrary; 37 import 'js_printer.dart' show writeJsLibrary;
38 import 'side_effect_analysis.dart'; 38 import 'side_effect_analysis.dart';
39 39
40 // Various dynamic helpers we call. 40 // Various dynamic helpers we call.
41 // If renaming these, make sure to check other places like the 41 // If renaming these, make sure to check other places like the
42 // dart_runtime.js file and comments. 42 // _runtime.js file and comments.
43 // TODO(jmesserly): ideally we'd have a "dynamic call" dart library we can 43 // TODO(jmesserly): ideally we'd have a "dynamic call" dart library we can
44 // import and generate calls to, rather than dart_runtime.js 44 // import and generate calls to, rather than dart_runtime.js
45 const DPUT = 'dput'; 45 const DPUT = 'dput';
46 const DLOAD = 'dload'; 46 const DLOAD = 'dload';
47 const DINDEX = 'dindex'; 47 const DINDEX = 'dindex';
48 const DSETINDEX = 'dsetindex'; 48 const DSETINDEX = 'dsetindex';
49 const DCALL = 'dcall'; 49 const DCALL = 'dcall';
50 const DSEND = 'dsend'; 50 const DSEND = 'dsend';
51 51
52 class JSCodegenVisitor extends GeneralizingAstVisitor with ClosureAnnotator { 52 class JSCodegenVisitor extends GeneralizingAstVisitor with ClosureAnnotator {
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // TODO(jmesserly): it would be great to run the renamer on the body, 188 // TODO(jmesserly): it would be great to run the renamer on the body,
189 // then figure out if we really need each of these parameters. 189 // then figure out if we really need each of these parameters.
190 // See ES6 modules: https://github.com/dart-lang/dev_compiler/issues/34 190 // See ES6 modules: https://github.com/dart-lang/dev_compiler/issues/34
191 var params = [_exportsVar, _runtimeLibVar]; 191 var params = [_exportsVar, _runtimeLibVar];
192 var processImport = 192 var processImport =
193 (LibraryElement library, JS.TemporaryId temp, List list) { 193 (LibraryElement library, JS.TemporaryId temp, List list) {
194 params.add(temp); 194 params.add(temp);
195 list.add(js.string(compiler.getModuleName(library.source.uri), "'")); 195 list.add(js.string(compiler.getModuleName(library.source.uri), "'"));
196 }; 196 };
197 197
198 var imports = <JS.Expression>[js.string('dart_runtime/dart')]; 198 var imports = <JS.Expression>[js.string('dart/_runtime')];
199 _imports.forEach((library, temp) { 199 _imports.forEach((library, temp) {
200 if (_loader.libraryIsLoaded(library)) { 200 if (_loader.libraryIsLoaded(library)) {
201 processImport(library, temp, imports); 201 processImport(library, temp, imports);
202 } 202 }
203 }); 203 });
204 204
205 var lazyImports = <JS.Expression>[]; 205 var lazyImports = <JS.Expression>[];
206 _imports.forEach((library, temp) { 206 _imports.forEach((library, temp) {
207 if (!_loader.libraryIsLoaded(library)) { 207 if (!_loader.libraryIsLoaded(library)) {
208 processImport(library, temp, lazyImports); 208 processImport(library, temp, lazyImports);
(...skipping 3105 matching lines...) Expand 10 before | Expand all | Expand 10 after
3314 3314
3315 /// A special kind of element created by the compiler, signifying a temporary 3315 /// A special kind of element created by the compiler, signifying a temporary
3316 /// variable. These objects use instance equality, and should be shared 3316 /// variable. These objects use instance equality, and should be shared
3317 /// everywhere in the tree where they are treated as the same variable. 3317 /// everywhere in the tree where they are treated as the same variable.
3318 class TemporaryVariableElement extends LocalVariableElementImpl { 3318 class TemporaryVariableElement extends LocalVariableElementImpl {
3319 TemporaryVariableElement.forNode(Identifier name) : super.forNode(name); 3319 TemporaryVariableElement.forNode(Identifier name) : super.forNode(name);
3320 3320
3321 int get hashCode => identityHashCode(this); 3321 int get hashCode => identityHashCode(this);
3322 bool operator ==(Object other) => identical(this, other); 3322 bool operator ==(Object other) => identical(this, other);
3323 } 3323 }
OLDNEW
« no previous file with comments | « lib/runtime/dart_utils.js ('k') | lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698