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

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

Issue 2310573002: dart2js: Pass type information to constructor rather than add later. (Closed)
Patch Set: Filter out type info pseudofield when parsing fieldspec for mirrors Created 4 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
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/nodes.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 import '../common.dart'; 5 import '../common.dart';
6 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; 6 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
7 import '../common/tasks.dart' show CompilerTask; 7 import '../common/tasks.dart' show CompilerTask;
8 import '../compiler.dart' show Compiler; 8 import '../compiler.dart' show Compiler;
9 import '../constants/constant_system.dart'; 9 import '../constants/constant_system.dart';
10 import '../constants/values.dart'; 10 import '../constants/values.dart';
(...skipping 1925 matching lines...) Expand 10 before | Expand all | Expand 10 after
1936 backend.emitter.constructorAccess(node.element); 1936 backend.emitter.constructorAccess(node.element);
1937 List<js.Expression> arguments = visitArguments(node.inputs, start: 0); 1937 List<js.Expression> arguments = visitArguments(node.inputs, start: 0);
1938 push(new js.New(jsClassReference, arguments) 1938 push(new js.New(jsClassReference, arguments)
1939 .withSourceInformation(node.sourceInformation)); 1939 .withSourceInformation(node.sourceInformation));
1940 // We also use HCreate to instantiate closure classes that belong to 1940 // We also use HCreate to instantiate closure classes that belong to
1941 // function expressions. We have to register their use here, as otherwise 1941 // function expressions. We have to register their use here, as otherwise
1942 // code for them might not be emitted. 1942 // code for them might not be emitted.
1943 if (node.element.isClosure) { 1943 if (node.element.isClosure) {
1944 registry.registerInstantiatedClass(node.element); 1944 registry.registerInstantiatedClass(node.element);
1945 } 1945 }
1946 if (node.instantiatedTypes == null) { 1946 node.instantiatedTypes?.forEach(registry.registerInstantiation);
1947 return;
1948 }
1949 node.instantiatedTypes.forEach((type) {
1950 registry.registerInstantiation(type);
1951 });
1952 } 1947 }
1953 1948
1954 js.Expression newLiteralBool( 1949 js.Expression newLiteralBool(
1955 bool value, SourceInformation sourceInformation) { 1950 bool value, SourceInformation sourceInformation) {
1956 if (compiler.options.enableMinification) { 1951 if (compiler.options.enableMinification) {
1957 // Use !0 for true, !1 for false. 1952 // Use !0 for true, !1 for false.
1958 return new js.Prefix("!", new js.LiteralNumber(value ? "0" : "1")) 1953 return new js.Prefix("!", new js.LiteralNumber(value ? "0" : "1"))
1959 .withSourceInformation(sourceInformation); 1954 .withSourceInformation(sourceInformation);
1960 } else { 1955 } else {
1961 return new js.LiteralBool(value).withSourceInformation(sourceInformation); 1956 return new js.LiteralBool(value).withSourceInformation(sourceInformation);
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
2989 registry.registerStaticUse(new StaticUse.staticInvoke( 2984 registry.registerStaticUse(new StaticUse.staticInvoke(
2990 helper, new CallStructure.unnamed(argumentCount))); 2985 helper, new CallStructure.unnamed(argumentCount)));
2991 return backend.emitter.staticFunctionAccess(helper); 2986 return backend.emitter.staticFunctionAccess(helper);
2992 } 2987 }
2993 2988
2994 @override 2989 @override
2995 void visitRef(HRef node) { 2990 void visitRef(HRef node) {
2996 visit(node.value); 2991 visit(node.value);
2997 } 2992 }
2998 } 2993 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698