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

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

Issue 10574046: Remove static fields in the namer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 6 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 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 }; 323 };
324 } 324 }
325 scopeData.boxedLoopVariables = result; 325 scopeData.boxedLoopVariables = result;
326 } 326 }
327 327
328 ClosureData globalizeClosure(FunctionExpression node) { 328 ClosureData globalizeClosure(FunctionExpression node) {
329 FunctionElement element = elements[node]; 329 FunctionElement element = elements[node];
330 ClassElement globalizedElement = 330 ClassElement globalizedElement =
331 new ClosureClassElement(compiler, element.getCompilationUnit()); 331 new ClosureClassElement(compiler, element.getCompilationUnit());
332 FunctionElement callElement = 332 FunctionElement callElement =
333 new FunctionElement.from(Namer.CLOSURE_INVOCATION_NAME, 333 new FunctionElement.from(compiler.namer.CLOSURE_INVOCATION_NAME,
334 element, 334 element,
335 globalizedElement); 335 globalizedElement);
336 globalizedElement.backendMembers = 336 globalizedElement.backendMembers =
337 const EmptyLink<Element>().prepend(callElement); 337 const EmptyLink<Element>().prepend(callElement);
338 // The nested function's 'this' is the same as the one for the outer 338 // The nested function's 'this' is the same as the one for the outer
339 // function. It could be [null] if we are inside a static method. 339 // function. It could be [null] if we are inside a static method.
340 Element thisElement = closureData.thisElement; 340 Element thisElement = closureData.thisElement;
341 return new ClosureData(element, globalizedElement, 341 return new ClosureData(element, globalizedElement,
342 callElement, thisElement); 342 callElement, thisElement);
343 } 343 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 } 435 }
436 436
437 visitTryStatement(TryStatement node) { 437 visitTryStatement(TryStatement node) {
438 // TODO(ngeoffray): implement finer grain state. 438 // TODO(ngeoffray): implement finer grain state.
439 bool oldInTryStatement = inTryStatement; 439 bool oldInTryStatement = inTryStatement;
440 inTryStatement = true; 440 inTryStatement = true;
441 node.visitChildren(this); 441 node.visitChildren(this);
442 inTryStatement = oldInTryStatement; 442 inTryStatement = oldInTryStatement;
443 } 443 }
444 } 444 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698