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

Unified Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 2547043002: [Interpreter] Optimize equality check with null/undefined with a check on the map. (Closed)
Patch Set: Address comments from Ross. Created 4 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
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/Generators.golden ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/interpreter/test-bytecode-generator.cc
diff --git a/test/cctest/interpreter/test-bytecode-generator.cc b/test/cctest/interpreter/test-bytecode-generator.cc
index 235ebacf8e83601a717f8a069b4ac3954244763e..aa8d8dcea74213aa6be91998c6487551c005a110 100644
--- a/test/cctest/interpreter/test-bytecode-generator.cc
+++ b/test/cctest/interpreter/test-bytecode-generator.cc
@@ -1742,6 +1742,31 @@ TEST(RemoveRedundantLdar) {
LoadGolden("RemoveRedundantLdar.golden")));
}
+TEST(GenerateTestUndetectable) {
+ InitializedIgnitionHandleScope scope;
+ BytecodeExpectationsPrinter printer(CcTest::isolate());
+ const char* snippets[] = {
+ "var obj_a = {val:1};\n"
+ "var b = 10;\n"
+ "if (obj_a == null) { b = 20;}\n"
+ "return b;\n",
+ "var obj_a = {val:1};\n"
+ "var b = 10;\n"
+ "if (obj_a == undefined) { b = 20;}\n"
+ "return b;\n",
+ "var obj_a = {val:1};\n"
+ "var b = 10;\n"
+ "if (obj_a != null) { b = 20;}\n"
+ "return b;\n",
+ "var obj_a = {val:1};\n"
+ "var b = 10;\n"
+ "if (obj_a != undefined) { b = 20;}\n"
+ "return b;\n"};
+
+ CHECK(CompareTexts(BuildActual(printer, snippets),
+ LoadGolden("GenerateTestUndetectable.golden")));
+}
+
TEST(AssignmentsInBinaryExpression) {
InitializedIgnitionHandleScope scope;
BytecodeExpectationsPrinter printer(CcTest::isolate());
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/Generators.golden ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698