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

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

Issue 862703002: Implement constructor bodies and initializers in CPS->JS backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rename in analyzer2dart 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
127 void registerReadTypeVariable(TypeVariableElement element) { 123 void registerReadTypeVariable(TypeVariableElement element) {
128 readTypeVariables.add(element); 124 readTypeVariables.add(element);
129 } 125 }
130 126
131 Set<ClassElement> computeInterceptorsReferencedFromConstants() { 127 Set<ClassElement> computeInterceptorsReferencedFromConstants() {
132 Set<ClassElement> classes = new Set<ClassElement>(); 128 Set<ClassElement> classes = new Set<ClassElement>();
133 JavaScriptConstantCompiler handler = backend.constants; 129 JavaScriptConstantCompiler handler = backend.constants;
134 List<ConstantValue> constants = handler.getConstantsForEmission(); 130 List<ConstantValue> constants = handler.getConstantsForEmission();
135 for (ConstantValue constant in constants) { 131 for (ConstantValue constant in constants) {
136 if (constant is InterceptorConstantValue) { 132 if (constant is InterceptorConstantValue) {
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 449
454 /// Returns the JS prototype of the given class [e]. 450 /// Returns the JS prototype of the given class [e].
455 jsAst.Expression prototypeAccess(ClassElement e, bool hasBeenInstantiated); 451 jsAst.Expression prototypeAccess(ClassElement e, bool hasBeenInstantiated);
456 452
457 /// Returns the JS constructor of the given interceptor class [e]. 453 /// Returns the JS constructor of the given interceptor class [e].
458 jsAst.Expression interceptorClassAccess(ClassElement e); 454 jsAst.Expression interceptorClassAccess(ClassElement e);
459 455
460 /// Returns the JS expression representing the type [e]. 456 /// Returns the JS expression representing the type [e].
461 jsAst.Expression typeAccess(Element e); 457 jsAst.Expression typeAccess(Element e);
462 458
463 /// Returns the JS constructor for the given closure class [e].
464 jsAst.Expression closureClassConstructorAccess(ClosureClassElement e);
465
466 /// Returns the JS expression representing a function that returns 'null' 459 /// Returns the JS expression representing a function that returns 'null'
467 jsAst.Expression generateFunctionThatReturnsNull(); 460 jsAst.Expression generateFunctionThatReturnsNull();
468 461
469 int compareConstants(ConstantValue a, ConstantValue b); 462 int compareConstants(ConstantValue a, ConstantValue b);
470 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); 463 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant);
471 464
472 void invalidateCaches(); 465 void invalidateCaches();
473 } 466 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698