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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/code_emitter_task.dart

Issue 831133004: Use closure conversion in new dart2js backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 years, 11 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 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 const USE_NEW_EMITTER = const bool.fromEnvironment("dart2js.use.new.emitter"); 7 const USE_NEW_EMITTER = const bool.fromEnvironment("dart2js.use.new.emitter");
8 8
9 /** 9 /**
10 * Generates the code for all used classes in the program. Static fields (even 10 * Generates the code for all used classes in the program. Static fields (even
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 return emitter.interceptorClassAccess(e); 111 return emitter.interceptorClassAccess(e);
112 } 112 }
113 113
114 /// Returns the JS expression representing the type [e]. 114 /// Returns the JS expression representing the type [e].
115 /// 115 ///
116 /// The given type [e] might be a Typedef. 116 /// The given type [e] might be a Typedef.
117 jsAst.Expression typeAccess(Element e) { 117 jsAst.Expression typeAccess(Element e) {
118 return emitter.typeAccess(e); 118 return emitter.typeAccess(e);
119 } 119 }
120 120
121 jsAst.Expression closureClassConstructorAccess(ClosureClassElement e) {
122 return emitter.closureClassConstructorAccess(e);
123 }
124
121 void registerReadTypeVariable(TypeVariableElement element) { 125 void registerReadTypeVariable(TypeVariableElement element) {
122 readTypeVariables.add(element); 126 readTypeVariables.add(element);
123 } 127 }
124 128
125 Set<ClassElement> interceptorsReferencedFromConstants() { 129 Set<ClassElement> interceptorsReferencedFromConstants() {
126 Set<ClassElement> classes = new Set<ClassElement>(); 130 Set<ClassElement> classes = new Set<ClassElement>();
127 JavaScriptConstantCompiler handler = backend.constants; 131 JavaScriptConstantCompiler handler = backend.constants;
128 List<ConstantValue> constants = handler.getConstantsForEmission(); 132 List<ConstantValue> constants = handler.getConstantsForEmission();
129 for (ConstantValue constant in constants) { 133 for (ConstantValue constant in constants) {
130 if (constant is InterceptorConstantValue) { 134 if (constant is InterceptorConstantValue) {
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 440
437 /// Returns the JS prototype of the given class [e]. 441 /// Returns the JS prototype of the given class [e].
438 jsAst.Expression prototypeAccess(ClassElement e, bool hasBeenInstantiated); 442 jsAst.Expression prototypeAccess(ClassElement e, bool hasBeenInstantiated);
439 443
440 /// Returns the JS constructor of the given interceptor class [e]. 444 /// Returns the JS constructor of the given interceptor class [e].
441 jsAst.Expression interceptorClassAccess(ClassElement e); 445 jsAst.Expression interceptorClassAccess(ClassElement e);
442 446
443 /// Returns the JS expression representing the type [e]. 447 /// Returns the JS expression representing the type [e].
444 jsAst.Expression typeAccess(Element e); 448 jsAst.Expression typeAccess(Element e);
445 449
450 /// Returns the JS constructor for the given closure class [e].
451 jsAst.Expression closureClassConstructorAccess(ClosureClassElement e);
452
446 int compareConstants(ConstantValue a, ConstantValue b); 453 int compareConstants(ConstantValue a, ConstantValue b);
447 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); 454 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant);
448 455
449 void invalidateCaches(); 456 void invalidateCaches();
450 } 457 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698