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

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

Issue 10377166: Prepare to have more than one universe. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 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;
11 11
12 String toString() => "ClosureFieldElement($name)"; 12 String toString() => "ClosureFieldElement($name)";
13 } 13 }
14 14
15 class ClosureClassElement extends ClassElement { 15 class ClosureClassElement extends ClassElement {
16 ClosureClassElement(Compiler compiler, Element enclosingElement) 16 ClosureClassElement(Compiler compiler, Element enclosingElement)
17 : super(compiler.closureClass.name, 17 : super(compiler.closureClass.name,
18 enclosingElement, 18 enclosingElement,
19 // By assigning a fresh class-id we make sure that the hashcode 19 // By assigning a fresh class-id we make sure that the hashcode
20 // is unique, but also emit closure class after all other 20 // is unique, but also emit closure class after all other
21 // classes (since the emitter sorts classes by their id). 21 // classes (since the emitter sorts classes by their id).
22 compiler.universe.getNextFreeClassId()) { 22 compiler.getNextFreeClassId()) {
23 isResolved = true; 23 isResolved = true;
24 compiler.closureClass.ensureResolved(compiler); 24 compiler.closureClass.ensureResolved(compiler);
25 supertype = compiler.closureClass.computeType(compiler); 25 supertype = compiler.closureClass.computeType(compiler);
26 } 26 }
27 } 27 }
28 28
29 class BoxElement extends Element { 29 class BoxElement extends Element {
30 BoxElement(SourceString name, Element enclosingElement) 30 BoxElement(SourceString name, Element enclosingElement)
31 : super(name, ElementKind.VARIABLE, enclosingElement); 31 : super(name, ElementKind.VARIABLE, enclosingElement);
32 } 32 }
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 declareLocal(elements[node]); 432 declareLocal(elements[node]);
433 } 433 }
434 434
435 visitTryStatement(TryStatement node) { 435 visitTryStatement(TryStatement node) {
436 // TODO(ngeoffray): implement finer grain state. 436 // TODO(ngeoffray): implement finer grain state.
437 inTryCatchOrFinally = true; 437 inTryCatchOrFinally = true;
438 node.visitChildren(this); 438 node.visitChildren(this);
439 inTryCatchOrFinally = false; 439 inTryCatchOrFinally = false;
440 } 440 }
441 } 441 }
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/ssa/builder.dart ('k') | dart/lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698