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

Unified Diff: frog/leg/emitter.dart

Issue 9592009: Reapply "Refactor constant part." (r4958) with fixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update tests and fix code after renaming. Created 8 years, 9 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: frog/leg/emitter.dart
diff --git a/frog/leg/emitter.dart b/frog/leg/emitter.dart
index b9f79d49c1ee4b8721a5e14ae791c0a15d2b294f..118548f8371bfad6ea8dfe58668e0b74cf48a8c3 100644
--- a/frog/leg/emitter.dart
+++ b/frog/leg/emitter.dart
@@ -71,7 +71,7 @@ function(child, parent) {
assert(selector.namedArgumentCount == 0);
return;
}
- CompileTimeConstantHandler constants = compiler.compileTimeConstantHandler;
+ ConstantHandler handler = compiler.constantHandler;
List<SourceString> names = selector.getOrderedNamedArguments();
String invocationName =
@@ -133,7 +133,7 @@ function(child, parent) {
argumentsBuffer[count] = jsName;
parametersBuffer[selector.positionalArgumentCount + index] = jsName;
} else {
- Constant value = constants.initialVariableValues[element];
+ Constant value = handler.initialVariableValues[element];
if (value == null) {
argumentsBuffer[count] = '(void 0)';
} else {
@@ -143,7 +143,7 @@ function(child, parent) {
indexOfLastOptionalArgumentInParameters = count;
}
argumentsBuffer[count] =
- constants.writeJsCode(new StringBuffer(), value).toString();
+ handler.writeJsCode(new StringBuffer(), value).toString();
}
}
}
@@ -475,7 +475,7 @@ function(child, parent) {
// this.staticNonFinal = Isolate.prototype.someVal;
// ...
// }
- CompileTimeConstantHandler handler = compiler.compileTimeConstantHandler;
+ ConstantHandler handler = compiler.constantHandler;
List<VariableElement> staticNonFinalFields =
handler.getStaticNonFinalFieldsForEmission();
if (!staticNonFinalFields.isEmpty()) buffer.add('\n');
@@ -489,7 +489,7 @@ function(child, parent) {
}
void emitCompileTimeConstants(StringBuffer buffer) {
- CompileTimeConstantHandler handler = compiler.compileTimeConstantHandler;
+ ConstantHandler handler = compiler.constantHandler;
List<Constant> constants = handler.getConstantsForEmission();
String prototype = "${namer.ISOLATE}.prototype";
emitMakeConstantList(prototype, buffer);
@@ -512,13 +512,13 @@ function(child, parent) {
}
void emitStaticFinalFieldInitializations(StringBuffer buffer) {
- CompileTimeConstantHandler constants = compiler.compileTimeConstantHandler;
+ ConstantHandler handler = compiler.constantHandler;
List<VariableElement> staticFinalFields =
- constants.getStaticFinalFieldsForEmission();
+ handler.getStaticFinalFieldsForEmission();
for (VariableElement element in staticFinalFields) {
buffer.add('${namer.isolatePropertyAccess(element)} = ');
compiler.withCurrentElement(element, () {
- constants.writeJsCodeForVariable(buffer, element);
+ handler.writeJsCodeForVariable(buffer, element);
});
buffer.add(';\n');
}
« no previous file with comments | « frog/leg/compiler.dart ('k') | frog/leg/native_handler.dart » ('j') | frog/leg/ssa/optimize.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698