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

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

Issue 132313012: Fix typechecks for constant assignments of function to typedefs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file for analyzer. Created 6 years, 10 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 const VERBOSE_OPTIMIZER_HINTS = false; 7 const VERBOSE_OPTIMIZER_HINTS = false;
8 8
9 class JavaScriptItemCompilationContext extends ItemCompilationContext { 9 class JavaScriptItemCompilationContext extends ItemCompilationContext {
10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>();
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 registerInstantiatedConstantType(interceptor.dispatchedType, elements); 659 registerInstantiatedConstantType(interceptor.dispatchedType, elements);
660 } else if (constant.isType()) { 660 } else if (constant.isType()) {
661 TypeConstant typeConstant = constant; 661 TypeConstant typeConstant = constant;
662 registerTypeLiteral(typeConstant.representedType.element, 662 registerTypeLiteral(typeConstant.representedType.element,
663 compiler.enqueuer.codegen, elements); 663 compiler.enqueuer.codegen, elements);
664 } 664 }
665 } 665 }
666 666
667 void registerInstantiatedConstantType(DartType type, TreeElements elements) { 667 void registerInstantiatedConstantType(DartType type, TreeElements elements) {
668 Enqueuer enqueuer = compiler.enqueuer.codegen; 668 Enqueuer enqueuer = compiler.enqueuer.codegen;
669 enqueuer.registerInstantiatedType(type, elements); 669 DartType instantiatedType =
670 type.kind == TypeKind.FUNCTION ? compiler.functionClass.rawType : type;
671 enqueuer.registerInstantiatedType(instantiatedType, elements);
670 if (type is InterfaceType && !type.treatAsRaw && 672 if (type is InterfaceType && !type.treatAsRaw &&
671 classNeedsRti(type.element)) { 673 classNeedsRti(type.element)) {
672 enqueuer.registerStaticUse(getSetRuntimeTypeInfo()); 674 enqueuer.registerStaticUse(getSetRuntimeTypeInfo());
673 } 675 }
674 if (type.element == typeImplementation) { 676 if (type.element == typeImplementation) {
675 // If we use a type literal in a constant, the compile time 677 // If we use a type literal in a constant, the compile time
676 // constant emitter will generate a call to the createRuntimeType 678 // constant emitter will generate a call to the createRuntimeType
677 // helper so we register a use of that. 679 // helper so we register a use of that.
678 enqueuer.registerStaticUse(getCreateRuntimeType()); 680 enqueuer.registerStaticUse(getCreateRuntimeType());
679 } 681 }
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1909 copy(constant.values); 1911 copy(constant.values);
1910 copy(constant.protoValue); 1912 copy(constant.protoValue);
1911 copy(constant); 1913 copy(constant);
1912 } 1914 }
1913 1915
1914 void visitConstructed(ConstructedConstant constant) { 1916 void visitConstructed(ConstructedConstant constant) {
1915 copy(constant.fields); 1917 copy(constant.fields);
1916 copy(constant); 1918 copy(constant);
1917 } 1919 }
1918 } 1920 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/constants.dart ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698