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

Side by Side Diff: lib/compiler/implementation/closure.dart

Issue 10854158: Make selector registration in the resolver and code generator more explicit. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 4 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
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 #library("closureToClassMapper"); 5 #library("closureToClassMapper");
6 6
7 #import("elements/elements.dart"); 7 #import("elements/elements.dart");
8 #import("leg.dart"); 8 #import("leg.dart");
9 #import("scanner/scannerlib.dart"); 9 #import("scanner/scannerlib.dart");
10 #import("tree/tree.dart"); 10 #import("tree/tree.dart");
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 } 396 }
397 scopeData.boxedLoopVariables = result; 397 scopeData.boxedLoopVariables = result;
398 } 398 }
399 399
400 ClosureClassMap globalizeClosure(FunctionExpression node, Element element) { 400 ClosureClassMap globalizeClosure(FunctionExpression node, Element element) {
401 SourceString closureName = 401 SourceString closureName =
402 new SourceString(compiler.namer.closureName(element)); 402 new SourceString(compiler.namer.closureName(element));
403 ClassElement globalizedElement = new ClosureClassElement( 403 ClassElement globalizedElement = new ClosureClassElement(
404 closureName, compiler, element.getCompilationUnit()); 404 closureName, compiler, element.getCompilationUnit());
405 FunctionElement callElement = 405 FunctionElement callElement =
406 new FunctionElement.from(compiler.namer.CLOSURE_INVOCATION_NAME, 406 new FunctionElement.from(Namer.CLOSURE_INVOCATION_NAME,
407 element, 407 element,
408 globalizedElement); 408 globalizedElement);
409 globalizedElement.backendMembers = 409 globalizedElement.backendMembers =
410 const EmptyLink<Element>().prepend(callElement); 410 const EmptyLink<Element>().prepend(callElement);
411 // The nested function's 'this' is the same as the one for the outer 411 // The nested function's 'this' is the same as the one for the outer
412 // function. It could be [null] if we are inside a static method. 412 // function. It could be [null] if we are inside a static method.
413 Element thisElement = closureData.thisElement; 413 Element thisElement = closureData.thisElement;
414 return new ClosureClassMap(element, globalizedElement, 414 return new ClosureClassMap(element, globalizedElement,
415 callElement, thisElement); 415 callElement, thisElement);
416 } 416 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 } 505 }
506 506
507 visitTryStatement(TryStatement node) { 507 visitTryStatement(TryStatement node) {
508 // TODO(ngeoffray): implement finer grain state. 508 // TODO(ngeoffray): implement finer grain state.
509 bool oldInTryStatement = inTryStatement; 509 bool oldInTryStatement = inTryStatement;
510 inTryStatement = true; 510 inTryStatement = true;
511 node.visitChildren(this); 511 node.visitChildren(this);
512 inTryStatement = oldInTryStatement; 512 inTryStatement = oldInTryStatement;
513 } 513 }
514 } 514 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/elements/elements.dart » ('j') | lib/compiler/implementation/enqueue.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698