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

Unified Diff: tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart

Issue 886053003: dart2dart: Remove the list of closureVariables from FunctionDefinitions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Restore inadvertently removed code. Created 5 years, 11 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
« no previous file with comments | « tests/compiler/dart2js/backend_dart/opt_shrinking_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
diff --git a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
index 7e525852f412e9e267b4d73ac5c372e9e0ad19ba..7527102f7e17030f0bc805853825cf382f3f9cef 100644
--- a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
+++ b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
@@ -254,7 +254,7 @@ class SExpressionUnstringifier {
return prims;
}
- /// (FunctionDefinition name (args cont) body)
+ /// (FunctionDefinition name (parameters) continuation body)
FunctionDefinition parseFunctionDefinition() {
tokens.consumeStart(FUNCTION_DEFINITION);
@@ -285,25 +285,12 @@ class SExpressionUnstringifier {
Continuation cont = name2variable[contName];
assert(cont != null);
- // [closure-variables]
- List<ClosureVariable> closureVariables = <ClosureVariable>[];
- tokens.consumeStart();
- while (tokens.current != ')') {
- String varName = tokens.read();
- ClosureVariable variable =
- new ClosureVariable(element, new DummyElement(varName));
- closureVariables.add(variable);
- name2variable[varName] = variable;
- }
- tokens.consumeEnd();
-
// body
Expression body = parseExpression();
tokens.consumeEnd();
return new FunctionDefinition(element, parameters,
- new RunnableBody(body, cont), null, null,
- closureVariables);
+ new RunnableBody(body, cont), null, null);
}
/// (IsTrue arg)
@@ -349,7 +336,7 @@ class SExpressionUnstringifier {
tokens.consumeStart(DECLARE_FUNCTION);
// name =
- ClosureVariable local = name2variable[tokens.read()];
+ ClosureVariable local = getClosureVariable(tokens.read());
tokens.read("=");
// function in
@@ -390,7 +377,7 @@ class SExpressionUnstringifier {
String name = tokens.read();
bool isRecursive = name == "rec";
if (isRecursive) name = tokens.read();
-
+
Continuation cont = name2variable[name];
assert(cont != null);
@@ -507,7 +494,8 @@ class SExpressionUnstringifier {
SetClosureVariable parseSetClosureVariable() {
tokens.consumeStart(SET_CLOSURE_VARIABLE);
- ClosureVariable local = name2variable[tokens.read()];
+ String name = tokens.read();
+ ClosureVariable local = getClosureVariable(name);
Primitive value = name2variable[tokens.read()];
assert(value != null);
@@ -649,11 +637,21 @@ class SExpressionUnstringifier {
return new CreateFunction(def);
}
+ ClosureVariable getClosureVariable(String name) {
+ if (!name2variable.containsKey(name)) {
+ ClosureVariable variable =
+ new ClosureVariable(new DummyElement(""), new DummyElement(name));
+ name2variable[name] = variable;
+ }
+ return name2variable[name];
+ }
+
/// (GetClosureVariable name)
GetClosureVariable parseGetClosureVariable() {
tokens.consumeStart(GET_CLOSURE_VARIABLE);
- ClosureVariable local = name2variable[tokens.read()];
+ String name = tokens.read();
+ ClosureVariable local = getClosureVariable(name);
tokens.consumeEnd();
return new GetClosureVariable(local);
« no previous file with comments | « tests/compiler/dart2js/backend_dart/opt_shrinking_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698