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

Unified Diff: tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart

Issue 1220193003: dart2js cps: Fuse tear-off and call invocation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase Created 5 years, 6 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 | « pkg/compiler/lib/src/cps_ir/type_propagation.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart
index 97b53e7460f02aa1a8713190a62d35763909d8eb..42d4e5afba9ccb8bbb79bdc95b4a217e489ded2c 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart
@@ -106,6 +106,86 @@ r"""
function() {
return new V.A_b_closure(this);
}"""),
+
+ const TestEntry("""
+staticMethod(x) => x;
+main(x) {
+ var tearOff = staticMethod;
+ print(tearOff(123));
+}
+""",
+r"""
+function(x) {
+ P.print(V.staticMethod(123));
+}"""),
+
+ const TestEntry("""
+class Foo {
+ instanceMethod(x) => x;
+}
+main(x) {
+ var tearOff = new Foo().instanceMethod;
+ print(tearOff(123));
+}
+""",
+r"""
+function(x) {
+ P.print(V.Foo$().instanceMethod$1(123));
+}"""),
+
+ const TestEntry("""
+class Foo {
+ instanceMethod(x) => x;
+}
+main(x) {
+ var tearOff = new Foo().instanceMethod;
+ print(tearOff(123));
+ print(tearOff(321));
+}
+""",
+r"""
+function(x) {
+ var v0 = V.Foo$();
+ P.print(v0.instanceMethod$1(123));
+ P.print(v0.instanceMethod$1(321));
+}"""),
+
+ const TestEntry("""
+class Foo {
+ get getter {
+ print('getter');
+ return (x) => x;
+ }
+}
+main(x) {
+ var notTearOff = new Foo().getter;
+ print(notTearOff(123));
+ print(notTearOff(321));
+}
+""",
+r"""
+function(x) {
+ var notTearOff = V.Foo$().get$getter();
+ P.print(notTearOff.call$1(123));
+ P.print(notTearOff.call$1(321));
+}"""),
+
+ const TestEntry("""
+class Foo {
+ get getter {
+ print('getter');
+ return (x) => x;
+ }
+}
+main(x) {
+ var notTearOff = new Foo().getter;
+ print(notTearOff(123));
+}
+""",
+r"""
+function(x) {
+ P.print(V.Foo$().getter$1(123));
+}"""),
];
void main() {
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_propagation.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698