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

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

Issue 10908142: Add runtimeType() to Object which returns canonicalized instances of Type. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Refactor. Created 8 years, 3 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 /** 5 /**
6 * A function element that represents a closure call. The signature is copied 6 * A function element that represents a closure call. The signature is copied
7 * from the given element. 7 * from the given element.
8 */ 8 */
9 class ClosureInvocationElement extends FunctionElement { 9 class ClosureInvocationElement extends FunctionElement {
10 ClosureInvocationElement(SourceString name, 10 ClosureInvocationElement(SourceString name,
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 emitStaticFunctions(mainBuffer); 1293 emitStaticFunctions(mainBuffer);
1294 emitStaticFunctionGetters(mainBuffer); 1294 emitStaticFunctionGetters(mainBuffer);
1295 // We need to finish the classes before we construct compile time 1295 // We need to finish the classes before we construct compile time
1296 // constants. 1296 // constants.
1297 emitFinishClassesInvocationIfNecessary(mainBuffer); 1297 emitFinishClassesInvocationIfNecessary(mainBuffer);
1298 emitCompileTimeConstants(mainBuffer); 1298 emitCompileTimeConstants(mainBuffer);
1299 // Static field initializations require the classes and compile-time 1299 // Static field initializations require the classes and compile-time
1300 // constants to be set up. 1300 // constants to be set up.
1301 emitStaticNonFinalFieldInitializations(mainBuffer); 1301 emitStaticNonFinalFieldInitializations(mainBuffer);
1302 emitLazilyInitializedStaticFields(mainBuffer); 1302 emitLazilyInitializedStaticFields(mainBuffer);
1303 if (compiler.enabledRuntimeType) {
1304 mainBuffer.add('$isolateProperties.runtimeTypeCache = {};\n');
1305 }
1303 1306
1304 isolateProperties = isolatePropertiesName; 1307 isolateProperties = isolatePropertiesName;
1305 // The following code should not use the short-hand for the 1308 // The following code should not use the short-hand for the
1306 // initialStatics. 1309 // initialStatics.
1307 mainBuffer.add('var ${namer.CURRENT_ISOLATE} = null;\n'); 1310 mainBuffer.add('var ${namer.CURRENT_ISOLATE} = null;\n');
1308 mainBuffer.add(boundClosureBuffer); 1311 mainBuffer.add(boundClosureBuffer);
1309 emitFinishClassesInvocationIfNecessary(mainBuffer); 1312 emitFinishClassesInvocationIfNecessary(mainBuffer);
1310 // After this assignment we will produce invalid JavaScript code if we use 1313 // After this assignment we will produce invalid JavaScript code if we use
1311 // the classesCollector variable. 1314 // the classesCollector variable.
1312 classesCollector = 'classesCollector should not be used from now on'; 1315 classesCollector = 'classesCollector should not be used from now on';
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1350 const String HOOKS_API_USAGE = """ 1353 const String HOOKS_API_USAGE = """
1351 // Generated by dart2js, the Dart to JavaScript compiler. 1354 // Generated by dart2js, the Dart to JavaScript compiler.
1352 // The code supports the following hooks: 1355 // The code supports the following hooks:
1353 // dartPrint(message) - if this function is defined it is called 1356 // dartPrint(message) - if this function is defined it is called
1354 // instead of the Dart [print] method. 1357 // instead of the Dart [print] method.
1355 // dartMainRunner(main) - if this function is defined, the Dart [main] 1358 // dartMainRunner(main) - if this function is defined, the Dart [main]
1356 // method will not be invoked directly. 1359 // method will not be invoked directly.
1357 // Instead, a closure that will invoke [main] is 1360 // Instead, a closure that will invoke [main] is
1358 // passed to [dartMainRunner]. 1361 // passed to [dartMainRunner].
1359 """; 1362 """;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698