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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart

Issue 759193005: Add support for fields to the new dart backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix dart2js-cps Created 6 years 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 dart2js.ir_nodes_sexpr; 5 library dart2js.ir_nodes_sexpr;
6 6
7 import '../util/util.dart'; 7 import '../util/util.dart';
8 import 'cps_ir_nodes.dart'; 8 import 'cps_ir_nodes.dart';
9 9
10 /// Generate a Lisp-like S-expression representation of an IR node as a string. 10 /// Generate a Lisp-like S-expression representation of an IR node as a string.
(...skipping 14 matching lines...) Expand all
25 String name = p.hint.name; 25 String name = p.hint.name;
26 names[p] = name; 26 names[p] = name;
27 return name; 27 return name;
28 }) 28 })
29 .join(' '); 29 .join(' ');
30 String body = indentBlock(() => visit(node.body)); 30 String body = indentBlock(() => visit(node.body));
31 return '$indentation(FunctionDefinition $name ($parameters return)\n' 31 return '$indentation(FunctionDefinition $name ($parameters return)\n'
32 '$body)'; 32 '$body)';
33 } 33 }
34 34
35 String visitFieldDefinition(FieldDefinition node) {
36 String name = node.element.name;
37 names[node.returnContinuation] = 'return';
38 String body = indentBlock(() => visit(node.body));
39 return '$indentation(FieldDefinition $name (return)\n'
40 '$body)';
41 }
42
35 String visitLetPrim(LetPrim node) { 43 String visitLetPrim(LetPrim node) {
36 String name = newValueName(); 44 String name = newValueName();
37 names[node.primitive] = name; 45 names[node.primitive] = name;
38 String value = visit(node.primitive); 46 String value = visit(node.primitive);
39 String body = visit(node.body); 47 String body = visit(node.body);
40 return '$indentation(LetPrim $name $value)\n$body'; 48 return '$indentation(LetPrim $name $value)\n$body';
41 } 49 }
42 50
43 String visitLetCont(LetCont node) { 51 String visitLetCont(LetCont node) {
44 String cont = newContinuationName(); 52 String cont = newContinuationName();
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 return '$indentation(DeclareFunction ${node.variable.name} =\n' 197 return '$indentation(DeclareFunction ${node.variable.name} =\n'
190 '$function in\n' 198 '$function in\n'
191 '$body)'; 199 '$body)';
192 } 200 }
193 201
194 String visitIsTrue(IsTrue node) { 202 String visitIsTrue(IsTrue node) {
195 String value = names[node.value.definition]; 203 String value = names[node.value.definition];
196 return '(IsTrue $value)'; 204 return '(IsTrue $value)';
197 } 205 }
198 } 206 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698