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

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

Issue 1537663002: dart2js: Initial implementation of inlining. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebaseline test expectations and fix a bug (typo). 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 side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart
index a6d7a1cbf091a67afb8e025ff0bb0a19e82fcce7..152a552a0a46401fa22f718c515a0961952bde87 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart
@@ -15,43 +15,89 @@ var x = 1;
foo() => ++x > 10;
main() {
print(foo() ? "hello world" : "bad bad");
-}""","""
+}""",r"""
function() {
- P.print(V.foo() ? "hello world" : "bad bad");
-}"""),
- const TestEntry("""
-var x = 1;
-foo() => ++x > 10;
-main() {
- print(foo() ? "hello world" : "bad bad");
-}""","""
-function() {
- P.print(V.foo() ? "hello world" : "bad bad");
+ var v0 = $.x + 1;
+ $.x = v0;
+ v0 = v0 > 10 ? "hello world" : "bad bad";
+ if (typeof dartPrint == "function")
+ dartPrint(v0);
+ else if (typeof console == "object" && typeof console.log != "undefined")
+ console.log(v0);
+ else if (!(typeof window == "object")) {
+ if (!(typeof print == "function"))
+ throw "Unable to print message: " + String(v0);
+ print(v0);
+ }
}"""),
const TestEntry("""
var x = 1;
get foo => ++x > 10;
main() {
print(foo ? "hello world" : "bad bad");
-}""","""
+}""",r"""
function() {
- P.print(V.foo() ? "hello world" : "bad bad");
+ var v0 = $.x + 1;
+ $.x = v0;
+ v0 = v0 > 10 ? "hello world" : "bad bad";
+ if (typeof dartPrint == "function")
+ dartPrint(v0);
+ else if (typeof console == "object" && typeof console.log != "undefined")
+ console.log(v0);
+ else if (!(typeof window == "object")) {
+ if (!(typeof print == "function"))
+ throw "Unable to print message: " + String(v0);
+ print(v0);
+ }
}"""),
const TestEntry("""
var x = 1;
get foo => ++x > 10;
main() { print(foo && foo); }
-""", """
+""", r"""
function() {
- P.print(V.foo() ? !!V.foo() : false);
+ var v0 = $.x + 1;
+ $.x = v0;
+ if (v0 > 10) {
+ $.x = v0 = $.x + 1;
+ v0 = v0 > 10;
+ } else
+ v0 = false;
+ v0 = H.S(v0);
+ if (typeof dartPrint == "function")
+ dartPrint(v0);
+ else if (typeof console == "object" && typeof console.log != "undefined")
+ console.log(v0);
+ else if (!(typeof window == "object")) {
+ if (!(typeof print == "function"))
+ throw "Unable to print message: " + String(v0);
+ print(v0);
+ }
}"""),
const TestEntry("""
var x = 1;
get foo => ++x > 10;
main() { print(foo || foo); }
-""","""
+""",r"""
function() {
- P.print(V.foo() ? true : !!V.foo());
+ var v0 = $.x + 1;
+ $.x = v0;
+ if (v0 > 10)
+ v0 = true;
+ else {
+ $.x = v0 = $.x + 1;
+ v0 = v0 > 10;
+ }
+ v0 = H.S(v0);
+ if (typeof dartPrint == "function")
+ dartPrint(v0);
+ else if (typeof console == "object" && typeof console.log != "undefined")
+ console.log(v0);
+ else if (!(typeof window == "object")) {
+ if (!(typeof print == "function"))
+ throw "Unable to print message: " + String(v0);
+ print(v0);
+ }
}"""),
const TestEntry("""
get foo => foo;
@@ -84,9 +130,20 @@ main() {
print(list);
}""", r"""
function() {
- var list = [1, 2, 3];
+ var list = [1, 2, 3], res, v0;
list[1] = 6;
- P.print(list);
+ if (!(typeof (res = C.JSArray_methods.toString$0(list)) === "string"))
+ throw H.wrapException(H.argumentErrorValue(list));
+ v0 = res;
+ if (typeof dartPrint == "function")
+ dartPrint(v0);
+ else if (typeof console == "object" && typeof console.log != "undefined")
+ console.log(v0);
+ else if (!(typeof window == "object")) {
+ if (!(typeof print == "function"))
+ throw "Unable to print message: " + String(v0);
+ print(v0);
+ }
}"""),
];

Powered by Google App Engine
This is Rietveld 408576698