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

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: Removed redundant null-check 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 return emitter.interceptorClassAccess(e); 113 return emitter.interceptorClassAccess(e);
114 } 114 }
115 115
116 /// Returns the JS expression representing the type [e]. 116 /// Returns the JS expression representing the type [e].
117 /// 117 ///
118 /// The given type [e] might be a Typedef. 118 /// The given type [e] might be a Typedef.
119 jsAst.Expression typeAccess(Element e) { 119 jsAst.Expression typeAccess(Element e) {
120 return emitter.typeAccess(e); 120 return emitter.typeAccess(e);
121 } 121 }
122 122
123 jsAst.Expression closureClassConstructorAccess(ClosureClassElement e) {
124 return emitter.closureClassConstructorAccess(e);
125 }
126
123 void registerReadTypeVariable(TypeVariableElement element) { 127 void registerReadTypeVariable(TypeVariableElement element) {
124 readTypeVariables.add(element); 128 readTypeVariables.add(element);
125 } 129 }
126 130
127 Set<ClassElement> interceptorsReferencedFromConstants() { 131 Set<ClassElement> interceptorsReferencedFromConstants() {
128 Set<ClassElement> classes = new Set<ClassElement>(); 132 Set<ClassElement> classes = new Set<ClassElement>();
129 JavaScriptConstantCompiler handler = backend.constants; 133 JavaScriptConstantCompiler handler = backend.constants;
130 List<ConstantValue> constants = handler.getConstantsForEmission(); 134 List<ConstantValue> constants = handler.getConstantsForEmission();
131 for (ConstantValue constant in constants) { 135 for (ConstantValue constant in constants) {
132 if (constant is InterceptorConstantValue) { 136 if (constant is InterceptorConstantValue) {
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 455
452 /// Returns the JS prototype of the given class [e]. 456 /// Returns the JS prototype of the given class [e].
453 jsAst.Expression prototypeAccess(ClassElement e, bool hasBeenInstantiated); 457 jsAst.Expression prototypeAccess(ClassElement e, bool hasBeenInstantiated);
454 458
455 /// Returns the JS constructor of the given interceptor class [e]. 459 /// Returns the JS constructor of the given interceptor class [e].
456 jsAst.Expression interceptorClassAccess(ClassElement e); 460 jsAst.Expression interceptorClassAccess(ClassElement e);
457 461
458 /// Returns the JS expression representing the type [e]. 462 /// Returns the JS expression representing the type [e].
459 jsAst.Expression typeAccess(Element e); 463 jsAst.Expression typeAccess(Element e);
460 464
465 /// Returns the JS constructor for the given closure class [e].
466 jsAst.Expression closureClassConstructorAccess(ClosureClassElement e);
467
461 int compareConstants(ConstantValue a, ConstantValue b); 468 int compareConstants(ConstantValue a, ConstantValue b);
462 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); 469 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant);
463 470
464 void invalidateCaches(); 471 void invalidateCaches();
465 } 472 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/task.dart ('k') | pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698