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

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

Issue 1430453002: dart2js cps: Extend type masks to handle reflective invocations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge Created 5 years 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 | « no previous file | pkg/compiler/lib/src/js_backend/codegen/glue.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library code_generator; 5 library code_generator;
6 6
7 import 'glue.dart'; 7 import 'glue.dart';
8 8
9 import '../../closure.dart' show 9 import '../../closure.dart' show
10 ClosureClassElement; 10 ClosureClassElement;
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 List<js.Expression> arguments = visitExpressionList(node.arguments); 265 List<js.Expression> arguments = visitExpressionList(node.arguments);
266 return buildStaticInvoke( 266 return buildStaticInvoke(
267 target, 267 target,
268 arguments, 268 arguments,
269 sourceInformation: node.sourceInformation); 269 sourceInformation: node.sourceInformation);
270 } 270 }
271 271
272 void registerMethodInvoke(tree_ir.InvokeMethod node) { 272 void registerMethodInvoke(tree_ir.InvokeMethod node) {
273 Selector selector = node.selector; 273 Selector selector = node.selector;
274 TypeMask mask = node.mask; 274 TypeMask mask = node.mask;
275 mask = glue.extendMaskIfReachesAll(selector, mask);
275 if (selector.isGetter) { 276 if (selector.isGetter) {
276 registry.registerDynamicUse(new DynamicUse(selector, mask)); 277 registry.registerDynamicUse(new DynamicUse(selector, mask));
277 } else if (selector.isSetter) { 278 } else if (selector.isSetter) {
278 registry.registerDynamicUse(new DynamicUse(selector, mask)); 279 registry.registerDynamicUse(new DynamicUse(selector, mask));
279 } else { 280 } else {
280 assert(invariant(CURRENT_ELEMENT_SPANNABLE, 281 assert(invariant(CURRENT_ELEMENT_SPANNABLE,
281 selector.isCall || selector.isOperator || 282 selector.isCall || selector.isOperator ||
282 selector.isIndex || selector.isIndexSet, 283 selector.isIndex || selector.isIndexSet,
283 message: 'unexpected kind ${selector.kind}')); 284 message: 'unexpected kind ${selector.kind}'));
284 // TODO(sigurdm): We should find a better place to register the call. 285 // TODO(sigurdm): We should find a better place to register the call.
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 void registerDefaultParameterValues(ExecutableElement element) { 1090 void registerDefaultParameterValues(ExecutableElement element) {
1090 if (element is! FunctionElement) return; 1091 if (element is! FunctionElement) return;
1091 FunctionElement function = element; 1092 FunctionElement function = element;
1092 if (function.isStatic) return; // Defaults are inlined at call sites. 1093 if (function.isStatic) return; // Defaults are inlined at call sites.
1093 function.functionSignature.forEachOptionalParameter((param) { 1094 function.functionSignature.forEachOptionalParameter((param) {
1094 ConstantValue constant = glue.getDefaultParameterValue(param); 1095 ConstantValue constant = glue.getDefaultParameterValue(param);
1095 registry.registerCompileTimeConstant(constant); 1096 registry.registerCompileTimeConstant(constant);
1096 }); 1097 });
1097 } 1098 }
1098 } 1099 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/codegen/glue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698