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

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

Issue 1023673012: Emit diagnostics for bad NSM implementations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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; 5 part of dart2js;
6 6
7 /** 7 /**
8 * If true, print a warning for each method that was resolved, but not 8 * If true, print a warning for each method that was resolved, but not
9 * compiled. 9 * compiled.
10 */ 10 */
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } 284 }
285 285
286 /// Generates the output and returns the total size of the generated code. 286 /// Generates the output and returns the total size of the generated code.
287 int assembleProgram(); 287 int assembleProgram();
288 288
289 List<CompilerTask> get tasks; 289 List<CompilerTask> get tasks;
290 290
291 bool get canHandleCompilationFailed; 291 bool get canHandleCompilationFailed;
292 292
293 void onResolutionComplete() {} 293 void onResolutionComplete() {}
294 void onTypeInferenceComplete() {}
294 295
295 ItemCompilationContext createItemCompilationContext() { 296 ItemCompilationContext createItemCompilationContext() {
296 return new ItemCompilationContext(); 297 return new ItemCompilationContext();
297 } 298 }
298 299
299 bool classNeedsRti(ClassElement cls); 300 bool classNeedsRti(ClassElement cls);
300 bool methodNeedsRti(FunctionElement function); 301 bool methodNeedsRti(FunctionElement function);
301 302
302 /// Called during codegen when [constant] has been used. 303 /// Called during codegen when [constant] has been used.
303 void registerCompileTimeConstant(ConstantValue constant, Registry registry) {} 304 void registerCompileTimeConstant(ConstantValue constant, Registry registry) {}
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 356
356 /// Call this to register that a static function has been closurized. 357 /// Call this to register that a static function has been closurized.
357 void registerGetOfStaticFunction(Enqueuer enqueuer) {} 358 void registerGetOfStaticFunction(Enqueuer enqueuer) {}
358 359
359 /** 360 /**
360 * Call this to register that the [:runtimeType:] property has been accessed. 361 * Call this to register that the [:runtimeType:] property has been accessed.
361 */ 362 */
362 void registerRuntimeType(Enqueuer enqueuer, Registry registry) {} 363 void registerRuntimeType(Enqueuer enqueuer, Registry registry) {}
363 364
364 /// Call this to register a `noSuchMethod` implementation. 365 /// Call this to register a `noSuchMethod` implementation.
365 void registerNoSuchMethod(Element noSuchMethodElement) {} 366 void registerNoSuchMethod(FunctionElement noSuchMethodElement) {}
366 367
367 /// Call this method to enable support for `noSuchMethod`. 368 /// Call this method to enable support for `noSuchMethod`.
368 void enableNoSuchMethod(Enqueuer enqueuer) {} 369 void enableNoSuchMethod(Enqueuer enqueuer) {}
369 370
370 /// Returns whether or not `noSuchMethod` support has been enabled. 371 /// Returns whether or not `noSuchMethod` support has been enabled.
371 bool get enabledNoSuchMethod => false; 372 bool get enabledNoSuchMethod => false;
372 373
373 /// Call this method to enable support for isolates. 374 /// Call this method to enable support for isolates.
374 void enableIsolateSupport(Enqueuer enqueuer) {} 375 void enableIsolateSupport(Enqueuer enqueuer) {}
375 376
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1604 if (irEnabled()) { 1605 if (irEnabled()) {
1605 log('Building IR...'); 1606 log('Building IR...');
1606 irBuilder.buildNodes(); 1607 irBuilder.buildNodes();
1607 } 1608 }
1608 1609
1609 log('Inferring types...'); 1610 log('Inferring types...');
1610 typesTask.onResolutionComplete(mainFunction); 1611 typesTask.onResolutionComplete(mainFunction);
1611 1612
1612 if (stopAfterTypeInference) return; 1613 if (stopAfterTypeInference) return;
1613 1614
1615 backend.onTypeInferenceComplete();
1616
1614 log('Compiling...'); 1617 log('Compiling...');
1615 phase = PHASE_COMPILING; 1618 phase = PHASE_COMPILING;
1616 // TODO(johnniwinther): Move these to [CodegenEnqueuer]. 1619 // TODO(johnniwinther): Move these to [CodegenEnqueuer].
1617 if (hasIsolateSupport) { 1620 if (hasIsolateSupport) {
1618 backend.enableIsolateSupport(enqueuer.codegen); 1621 backend.enableIsolateSupport(enqueuer.codegen);
1619 } 1622 }
1620 if (compileAll) { 1623 if (compileAll) {
1621 libraryLoader.libraries.forEach((LibraryElement library) { 1624 libraryLoader.libraries.forEach((LibraryElement library) {
1622 fullyEnqueueLibrary(library, enqueuer.codegen); 1625 fullyEnqueueLibrary(library, enqueuer.codegen);
1623 }); 1626 });
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
2408 return futureClass.computeType(compiler).createInstantiation([elementType]); 2411 return futureClass.computeType(compiler).createInstantiation([elementType]);
2409 } 2412 }
2410 2413
2411 @override 2414 @override
2412 InterfaceType streamType([DartType elementType = const DynamicType()]) { 2415 InterfaceType streamType([DartType elementType = const DynamicType()]) {
2413 return streamClass.computeType(compiler).createInstantiation([elementType]); 2416 return streamClass.computeType(compiler).createInstantiation([elementType]);
2414 } 2417 }
2415 } 2418 }
2416 2419
2417 typedef void InternalErrorFunction(Spannable location, String message); 2420 typedef void InternalErrorFunction(Spannable location, String message);
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698