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

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

Issue 10941031: Reapply 'Add runtimeType() to Object which returns canonicalized instances of Type'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 emitStaticFunctions(mainBuffer); 1304 emitStaticFunctions(mainBuffer);
1305 emitStaticFunctionGetters(mainBuffer); 1305 emitStaticFunctionGetters(mainBuffer);
1306 // We need to finish the classes before we construct compile time 1306 // We need to finish the classes before we construct compile time
1307 // constants. 1307 // constants.
1308 emitFinishClassesInvocationIfNecessary(mainBuffer); 1308 emitFinishClassesInvocationIfNecessary(mainBuffer);
1309 emitCompileTimeConstants(mainBuffer); 1309 emitCompileTimeConstants(mainBuffer);
1310 // Static field initializations require the classes and compile-time 1310 // Static field initializations require the classes and compile-time
1311 // constants to be set up. 1311 // constants to be set up.
1312 emitStaticNonFinalFieldInitializations(mainBuffer); 1312 emitStaticNonFinalFieldInitializations(mainBuffer);
1313 emitLazilyInitializedStaticFields(mainBuffer); 1313 emitLazilyInitializedStaticFields(mainBuffer);
1314 if (compiler.enabledRuntimeType) {
1315 mainBuffer.add('$isolateProperties.runtimeTypeCache = {};\n');
1316 }
1314 1317
1315 isolateProperties = isolatePropertiesName; 1318 isolateProperties = isolatePropertiesName;
1316 // The following code should not use the short-hand for the 1319 // The following code should not use the short-hand for the
1317 // initialStatics. 1320 // initialStatics.
1318 mainBuffer.add('var ${namer.CURRENT_ISOLATE} = null;\n'); 1321 mainBuffer.add('var ${namer.CURRENT_ISOLATE} = null;\n');
1319 mainBuffer.add(boundClosureBuffer); 1322 mainBuffer.add(boundClosureBuffer);
1320 emitFinishClassesInvocationIfNecessary(mainBuffer); 1323 emitFinishClassesInvocationIfNecessary(mainBuffer);
1321 // After this assignment we will produce invalid JavaScript code if we use 1324 // After this assignment we will produce invalid JavaScript code if we use
1322 // the classesCollector variable. 1325 // the classesCollector variable.
1323 classesCollector = 'classesCollector should not be used from now on'; 1326 classesCollector = 'classesCollector should not be used from now on';
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 const String HOOKS_API_USAGE = """ 1364 const String HOOKS_API_USAGE = """
1362 // Generated by dart2js, the Dart to JavaScript compiler. 1365 // Generated by dart2js, the Dart to JavaScript compiler.
1363 // The code supports the following hooks: 1366 // The code supports the following hooks:
1364 // dartPrint(message) - if this function is defined it is called 1367 // dartPrint(message) - if this function is defined it is called
1365 // instead of the Dart [print] method. 1368 // instead of the Dart [print] method.
1366 // dartMainRunner(main) - if this function is defined, the Dart [main] 1369 // dartMainRunner(main) - if this function is defined, the Dart [main]
1367 // method will not be invoked directly. 1370 // method will not be invoked directly.
1368 // Instead, a closure that will invoke [main] is 1371 // Instead, a closure that will invoke [main] is
1369 // passed to [dartMainRunner]. 1372 // passed to [dartMainRunner].
1370 """; 1373 """;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698