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

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

Issue 1697373002: dart2js cps: Fix inlining of stringify. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update status 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
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c200cc185b34add440c692936863bc1ba9c8ad16..8519565cd1f709b838f504c31de0ef11c6692225 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -2078,14 +2078,18 @@ class TransformingVisitor extends DeepRecursiveVisitor {
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;
+ TypeMask toStringReturn = typeSystem.getInvokeReturnType(
+ Selectors.toString_, value.type);
+ if (typeSystem.isDefinitelyString(toStringReturn)) {
+ 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 | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698