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

Unified Diff: test/unittests/interpreter/bytecode-array-builder-unittest.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/test-serialize.cc ('k') | test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/interpreter/bytecode-array-builder-unittest.cc
diff --git a/test/unittests/interpreter/bytecode-array-builder-unittest.cc b/test/unittests/interpreter/bytecode-array-builder-unittest.cc
index 3a75fc0f0210a6c133ddad6d2271170dfcc75768..a80797151366c22d6f4d703c8c6e02509cf1ebc5 100644
--- a/test/unittests/interpreter/bytecode-array-builder-unittest.cc
+++ b/test/unittests/interpreter/bytecode-array-builder-unittest.cc
@@ -195,6 +195,12 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
.CompareOperation(Token::Value::INSTANCEOF, reg, 8)
.CompareOperation(Token::Value::IN, reg, 9);
+ // Emit peephole optimizations of equality with Null or Undefined.
+ builder.LoadUndefined()
+ .CompareOperation(Token::Value::EQ, reg, 1)
+ .LoadNull()
+ .CompareOperation(Token::Value::EQ, reg, 1);
+
// Emit conversion operator invocations.
builder.ConvertAccumulatorToNumber(reg)
.ConvertAccumulatorToObject(reg)
@@ -398,6 +404,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
scorecard[Bytecodes::ToByte(Bytecode::kBitwiseOrSmi)] = 1;
scorecard[Bytecodes::ToByte(Bytecode::kShiftLeftSmi)] = 1;
scorecard[Bytecodes::ToByte(Bytecode::kShiftRightSmi)] = 1;
+ scorecard[Bytecodes::ToByte(Bytecode::kTestUndetectable)] = 1;
}
// Check return occurs at the end and only once in the BytecodeArray.
« no previous file with comments | « test/cctest/test-serialize.cc ('k') | test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698