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

Unified Diff: pkg/compiler/lib/src/cps_ir/type_propagation.dart

Issue 1689933002: dart2js cps: Do not inline string interpolation helper. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase + update test expectations Created 4 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/cps_ir/type_propagation.dart
diff --git a/pkg/compiler/lib/src/cps_ir/type_propagation.dart b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
index 9ff934b597328ab01794f286e2b3424934420d5b..c200cc185b34add440c692936863bc1ba9c8ad16 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -2072,10 +2072,20 @@ class TransformingVisitor extends DeepRecursiveVisitor {
/// Specialize calls to internal static methods.
specializeInternalMethodCall(InvokeStatic node) {
if (node.target == backend.helpers.stringInterpolationHelper) {
- AbstractConstantValue value = getValue(node.arguments[0].definition);
+ Primitive argument = node.arguments[0].definition;
+ AbstractConstantValue value = getValue(argument);
if (lattice.isDefinitelyString(value)) {
- node.replaceUsesWith(node.arguments[0].definition);
+ node.replaceUsesWith(argument);
return new CpsFragment();
+ } else if (typeSystem.isDefinitelySelfInterceptor(value.type)) {
+ CpsFragment cps = new CpsFragment(node.sourceInformation);
+ Primitive invoke = cps.invokeMethod(argument,
+ Selectors.toString_,
+ value.type,
+ [cps.makeZero()],
+ CallingConvention.DummyIntercepted);
+ node.replaceUsesWith(invoke);
+ return cps;
}
} else if (node.target == compiler.identicalFunction) {
if (node.arguments.length == 2) {
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_mask_system.dart ('k') | pkg/compiler/lib/src/types/abstract_value_domain.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698