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

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

Issue 2732663002: Late creation of CodegenEnqueuer (Closed)
Patch Set: Updated cf. comment Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/backend_api.dart' show BackendClasses; 5 import '../common/backend_api.dart' show BackendClasses;
6 import '../compiler.dart' show Compiler; 6 import '../compiler.dart' show Compiler;
7 import '../constants/constant_system.dart'; 7 import '../constants/constant_system.dart';
8 import '../constants/values.dart'; 8 import '../constants/values.dart';
9 import '../elements/entities.dart'; 9 import '../elements/entities.dart';
10 import '../js_backend/backend.dart'; 10 import '../js_backend/backend.dart';
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 block.addAfter(user, replacement); 345 block.addAfter(user, replacement);
346 block.rewrite(user, replacement); 346 block.rewrite(user, replacement);
347 block.remove(user); 347 block.remove(user);
348 return false; 348 return false;
349 } 349 }
350 350
351 if (user is HIs) { 351 if (user is HIs) {
352 // See if we can rewrite the is-check to use 'instanceof', i.e. rewrite 352 // See if we can rewrite the is-check to use 'instanceof', i.e. rewrite
353 // "getInterceptor(x).$isT" to "x instanceof T". 353 // "getInterceptor(x).$isT" to "x instanceof T".
354 if (node == user.interceptor) { 354 if (node == user.interceptor) {
355 if (backend.mayGenerateInstanceofCheck(user.typeExpression)) { 355 if (backend.interceptorData
356 .mayGenerateInstanceofCheck(user.typeExpression)) {
356 HInstruction instanceofCheck = new HIs.instanceOf( 357 HInstruction instanceofCheck = new HIs.instanceOf(
357 user.typeExpression, user.expression, user.instructionType); 358 user.typeExpression, user.expression, user.instructionType);
358 instanceofCheck.sourceInformation = user.sourceInformation; 359 instanceofCheck.sourceInformation = user.sourceInformation;
359 instanceofCheck.sourceElement = user.sourceElement; 360 instanceofCheck.sourceElement = user.sourceElement;
360 return replaceUserWith(instanceofCheck); 361 return replaceUserWith(instanceofCheck);
361 } 362 }
362 } 363 }
363 } else if (user is HInvokeDynamic) { 364 } else if (user is HInvokeDynamic) {
364 if (node == user.inputs[0]) { 365 if (node == user.inputs[0]) {
365 // Replace the user with a [HOneShotInterceptor]. 366 // Replace the user with a [HOneShotInterceptor].
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 instruction = new HInvokeDynamicMethod( 423 instruction = new HInvokeDynamicMethod(
423 selector, mask, inputs, node.instructionType, true); 424 selector, mask, inputs, node.instructionType, true);
424 } 425 }
425 426
426 HBasicBlock block = node.block; 427 HBasicBlock block = node.block;
427 block.addAfter(node, instruction); 428 block.addAfter(node, instruction);
428 block.rewrite(node, instruction); 429 block.rewrite(node, instruction);
429 return true; 430 return true;
430 } 431 }
431 } 432 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/mirrors_analysis.dart ('k') | tests/compiler/dart2js/type_representation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698