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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart

Issue 614993002: Rename Constant to ConstantValue and ConstExp to ConstantExpression. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
index afd2b9efd4d760ccfe816a66813623e9b49d671a..b8fe4507c11027d844cf2691ff2394a078857efa 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
@@ -16,7 +16,7 @@ class OldEmitter implements Emitter {
final InterceptorEmitter interceptorEmitter = new InterceptorEmitter();
final MetadataEmitter metadataEmitter = new MetadataEmitter();
- final Set<Constant> cachedEmittedConstants;
+ final Set<ConstantValue> cachedEmittedConstants;
final CodeBuffer cachedEmittedConstantsBuffer = new CodeBuffer();
final Map<Element, ClassBuilder> cachedClassBuilders;
final Set<Element> cachedElements;
@@ -39,7 +39,7 @@ class OldEmitter implements Emitter {
Set<ClassElement> get neededClasses => task.neededClasses;
Map<OutputUnit, List<ClassElement>> get outputClassLists
=> task.outputClassLists;
- Map<OutputUnit, List<Constant>> get outputConstantLists
+ Map<OutputUnit, List<ConstantValue>> get outputConstantLists
=> task.outputConstantLists;
List<ClassElement> get nativeClasses => task.nativeClasses;
final Map<String, String> mangledFieldNames = <String, String>{};
@@ -142,11 +142,11 @@ class OldEmitter implements Emitter {
buffer.write(jsAst.prettyPrint(js.comment(comment), compiler));
}
- jsAst.Expression constantReference(Constant value) {
+ jsAst.Expression constantReference(ConstantValue value) {
return constantEmitter.reference(value);
}
- jsAst.Expression constantInitializerExpression(Constant value) {
+ jsAst.Expression constantInitializerExpression(ConstantValue value) {
return constantEmitter.initializationExpression(value);
}
@@ -903,7 +903,7 @@ class OldEmitter implements Emitter {
// `mapTypeToInterceptor` is handled in [emitMapTypeToInterceptor].
if (element == backend.mapTypeToInterceptor) continue;
compiler.withCurrentElement(element, () {
- Constant initialValue = handler.getInitialValueFor(element).value;
+ ConstantValue initialValue = handler.getInitialValueFor(element).value;
jsAst.Expression init =
js('$isolateProperties.# = #',
[namer.getNameOfGlobalField(element),
@@ -953,7 +953,7 @@ class OldEmitter implements Emitter {
return null;
}
- bool isConstantInlinedOrAlreadyEmitted(Constant constant) {
+ bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant) {
if (constant.isFunction) return true; // Already emitted.
if (constant.isPrimitive) return true; // Inlined.
if (constant.isDummy) return true; // Inlined.
@@ -964,7 +964,7 @@ class OldEmitter implements Emitter {
return false;
}
- int compareConstants(Constant a, Constant b) {
+ int compareConstants(ConstantValue a, ConstantValue b) {
// Inlined constants don't affect the order and sometimes don't even have
// names.
int cmp1 = isConstantInlinedOrAlreadyEmitted(a) ? 0 : 1;
@@ -987,13 +987,13 @@ class OldEmitter implements Emitter {
}
void emitCompileTimeConstants(CodeBuffer buffer, OutputUnit outputUnit) {
- List<Constant> constants = outputConstantLists[outputUnit];
+ List<ConstantValue> constants = outputConstantLists[outputUnit];
if (constants == null) return;
bool isMainBuffer = buffer == mainBuffer;
if (compiler.hasIncrementalSupport && isMainBuffer) {
buffer = cachedEmittedConstantsBuffer;
}
- for (Constant constant in constants) {
+ for (ConstantValue constant in constants) {
if (compiler.hasIncrementalSupport && isMainBuffer) {
if (cachedEmittedConstants.contains(constant)) continue;
cachedEmittedConstants.add(constant);

Powered by Google App Engine
This is Rietveld 408576698