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

Side by Side Diff: dart/frog/leg/ssa/closure.dart

Issue 9447100: Return null from stringValue and call slowToString() instead of toString(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: changes Created 8 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
« no previous file with comments | « dart/frog/leg/ssa/builder.dart ('k') | dart/frog/leg/ssa/codegen.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 class ClosureFieldElement extends Element { 5 class ClosureFieldElement extends Element {
6 ClosureFieldElement(SourceString name, ClassElement enclosing) 6 ClosureFieldElement(SourceString name, ClassElement enclosing)
7 : super(name, ElementKind.FIELD, enclosing); 7 : super(name, ElementKind.FIELD, enclosing);
8 8
9 bool isInstanceMember() => true; 9 bool isInstanceMember() => true;
10 bool isAssignable() => false; 10 bool isAssignable() => false;
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 for (Element element in scopeVariables) { 234 for (Element element in scopeVariables) {
235 if (capturedVariableMapping.containsKey(element)) { 235 if (capturedVariableMapping.containsKey(element)) {
236 if (box == null) { 236 if (box == null) {
237 // TODO(floitsch): construct better box names. 237 // TODO(floitsch): construct better box names.
238 SourceString boxName = new SourceString("box${boxCounter++}"); 238 SourceString boxName = new SourceString("box${boxCounter++}");
239 box = new Element(boxName, 239 box = new Element(boxName,
240 ElementKind.VARIABLE, 240 ElementKind.VARIABLE,
241 currentFunctionElement); 241 currentFunctionElement);
242 } 242 }
243 // TODO(floitsch): construct better boxed names. 243 // TODO(floitsch): construct better boxed names.
244 String elementName = element.name.toString(); 244 String elementName = element.name.slowToString();
245 // We are currently using the name in an HForeign which could replace 245 // We are currently using the name in an HForeign which could replace
246 // "$X" with something else. 246 // "$X" with something else.
247 String escaped = elementName.replaceAll("\$", "_"); 247 String escaped = elementName.replaceAll("\$", "_");
248 SourceString boxedName = new SourceString("${escaped}_${boxCounter++}"); 248 SourceString boxedName = new SourceString("${escaped}_${boxCounter++}");
249 Element boxed = new Element(boxedName, ElementKind.FIELD, box); 249 Element boxed = new Element(boxedName, ElementKind.FIELD, box);
250 scopeMapping[element] = boxed; 250 scopeMapping[element] = boxed;
251 capturedVariableMapping[element] = boxed; 251 capturedVariableMapping[element] = boxed;
252 } 252 }
253 } 253 }
254 if (!scopeMapping.isEmpty()) { 254 if (!scopeMapping.isEmpty()) {
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 } 396 }
397 } 397 }
398 398
399 visitTryStatement(TryStatement node) { 399 visitTryStatement(TryStatement node) {
400 // TODO(ngeoffray): implement finer grain state. 400 // TODO(ngeoffray): implement finer grain state.
401 inTryCatchOrFinally = true; 401 inTryCatchOrFinally = true;
402 node.visitChildren(this); 402 node.visitChildren(this);
403 inTryCatchOrFinally = false; 403 inTryCatchOrFinally = false;
404 } 404 }
405 } 405 }
OLDNEW
« no previous file with comments | « dart/frog/leg/ssa/builder.dart ('k') | dart/frog/leg/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698