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

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

Issue 172853007: Rename DummyRecieverConstant to DummyConstant (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 if (constant.isList()) emitMakeConstantListIfNotEmitted(buffer); 919 if (constant.isList()) emitMakeConstantListIfNotEmitted(buffer);
920 jsAst.Expression init = js( 920 jsAst.Expression init = js(
921 '${namer.globalObjectForConstant(constant)}.$name = #', 921 '${namer.globalObjectForConstant(constant)}.$name = #',
922 constantInitializerExpression(constant)); 922 constantInitializerExpression(constant));
923 buffer.write(jsAst.prettyPrint(init, compiler)); 923 buffer.write(jsAst.prettyPrint(init, compiler));
924 buffer.write('$N'); 924 buffer.write('$N');
925 } 925 }
926 } 926 }
927 927
928 bool isConstantInlinedOrAlreadyEmitted(Constant constant) { 928 bool isConstantInlinedOrAlreadyEmitted(Constant constant) {
929 if (constant.isFunction()) return true; // Already emitted. 929 if (constant.isFunction()) return true; // Already emitted.
930 if (constant.isPrimitive()) return true; // Inlined. 930 if (constant.isPrimitive()) return true; // Inlined.
931 if (constant.isDummyReceiver()) return true; // Inlined. 931 if (constant.isDummy()) return true; // Inlined.
932 // The name is null when the constant is already a JS constant. 932 // The name is null when the constant is already a JS constant.
933 // TODO(floitsch): every constant should be registered, so that we can 933 // TODO(floitsch): every constant should be registered, so that we can
934 // share the ones that take up too much space (like some strings). 934 // share the ones that take up too much space (like some strings).
935 if (namer.constantName(constant) == null) return true; 935 if (namer.constantName(constant) == null) return true;
936 return false; 936 return false;
937 } 937 }
938 938
939 int compareConstants(Constant a, Constant b) { 939 int compareConstants(Constant a, Constant b) {
940 // Inlined constants don't affect the order and sometimes don't even have 940 // Inlined constants don't affect the order and sometimes don't even have
941 // names. 941 // names.
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 String sourceMap = buildSourceMap(mainBuffer, compiledFile); 1644 String sourceMap = buildSourceMap(mainBuffer, compiledFile);
1645 compiler.outputProvider(name, 'js.map') 1645 compiler.outputProvider(name, 'js.map')
1646 ..add(sourceMap) 1646 ..add(sourceMap)
1647 ..close(); 1647 ..close();
1648 } 1648 }
1649 1649
1650 void registerReadTypeVariable(TypeVariableElement element) { 1650 void registerReadTypeVariable(TypeVariableElement element) {
1651 readTypeVariables.add(element); 1651 readTypeVariables.add(element);
1652 } 1652 }
1653 } 1653 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698