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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart

Issue 19754002: Rewrite how we handle synthesized constructors in the compiler. This was motivated by issue https:/… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 js_backend; 5 part of js_backend;
6 6
7 /** 7 /**
8 * A function element that represents a closure call. The signature is copied 8 * A function element that represents a closure call. The signature is copied
9 * from the given element. 9 * from the given element.
10 */ 10 */
(...skipping 3406 matching lines...) Expand 10 before | Expand all | Expand 10 after
3417 return globalMetadataMap.putIfAbsent(string, () { 3417 return globalMetadataMap.putIfAbsent(string, () {
3418 globalMetadata.add(string); 3418 globalMetadata.add(string);
3419 return globalMetadata.length - 1; 3419 return globalMetadata.length - 1;
3420 }); 3420 });
3421 } 3421 }
3422 3422
3423 jsAst.Fun extendWithMetadata(FunctionElement element, jsAst.Fun code) { 3423 jsAst.Fun extendWithMetadata(FunctionElement element, jsAst.Fun code) {
3424 if (!backend.retainMetadataOf(element)) return code; 3424 if (!backend.retainMetadataOf(element)) return code;
3425 return compiler.withCurrentElement(element, () { 3425 return compiler.withCurrentElement(element, () {
3426 List<int> metadata = <int>[]; 3426 List<int> metadata = <int>[];
3427 FunctionSignature signature = element.functionSignature; 3427 FunctionSignature signature = element.computeSignature(compiler);
3428 if (element.isConstructor()) { 3428 if (element.isConstructor()) {
3429 metadata.add(reifyType(element.getEnclosingClass().thisType)); 3429 metadata.add(reifyType(element.getEnclosingClass().thisType));
3430 } else { 3430 } else {
3431 metadata.add(reifyType(signature.returnType)); 3431 metadata.add(reifyType(signature.returnType));
3432 } 3432 }
3433 signature.forEachParameter((Element parameter) { 3433 signature.forEachParameter((Element parameter) {
3434 metadata 3434 metadata
3435 ..add(reifyName(parameter.name)) 3435 ..add(reifyName(parameter.name))
3436 ..add(reifyType(parameter.computeType(compiler))); 3436 ..add(reifyType(parameter.computeType(compiler)));
3437 }); 3437 });
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
3894 3894
3895 const String HOOKS_API_USAGE = """ 3895 const String HOOKS_API_USAGE = """
3896 // The code supports the following hooks: 3896 // The code supports the following hooks:
3897 // dartPrint(message) - if this function is defined it is called 3897 // dartPrint(message) - if this function is defined it is called
3898 // instead of the Dart [print] method. 3898 // instead of the Dart [print] method.
3899 // dartMainRunner(main) - if this function is defined, the Dart [main] 3899 // dartMainRunner(main) - if this function is defined, the Dart [main]
3900 // method will not be invoked directly. 3900 // method will not be invoked directly.
3901 // Instead, a closure that will invoke [main] is 3901 // Instead, a closure that will invoke [main] is
3902 // passed to [dartMainRunner]. 3902 // passed to [dartMainRunner].
3903 """; 3903 """;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698