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

Unified Diff: src/interpreter/bytecode-peephole-optimizer.cc

Issue 2793923002: [Interpreter] Optimize code of the form 'if (x === undefined)'. (Closed)
Patch Set: Rebase Created 3 years, 9 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 | « src/interpreter/bytecode-generator.cc ('k') | src/interpreter/bytecode-peephole-table.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-peephole-optimizer.cc
diff --git a/src/interpreter/bytecode-peephole-optimizer.cc b/src/interpreter/bytecode-peephole-optimizer.cc
index acfe484ad37f85c6a32ff881d281ab3642c5f5ca..24a9ddcc046d3da73e258e5537ec8e2ee64421e2 100644
--- a/src/interpreter/bytecode-peephole-optimizer.cc
+++ b/src/interpreter/bytecode-peephole-optimizer.cc
@@ -141,20 +141,6 @@ BytecodeNode TransformLdaZeroBinaryOpToBinaryOpWithZero(
return node;
}
-BytecodeNode TransformEqualityWithNullOrUndefined(Bytecode new_bytecode,
- BytecodeNode* const last,
- BytecodeNode* const current) {
- DCHECK((last->bytecode() == Bytecode::kLdaNull) ||
- (last->bytecode() == Bytecode::kLdaUndefined));
- DCHECK((current->bytecode() == Bytecode::kTestEqual) ||
- (current->bytecode() == Bytecode::kTestEqualStrict));
- BytecodeNode node(new_bytecode, current->operand(0), current->source_info());
- if (last->source_info().is_valid()) {
- node.set_source_info(last->source_info());
- }
- return node;
-}
-
} // namespace
void BytecodePeepholeOptimizer::DefaultAction(
@@ -268,16 +254,6 @@ void BytecodePeepholeOptimizer::
}
}
-void BytecodePeepholeOptimizer::TransformEqualityWithNullOrUndefinedAction(
- BytecodeNode* const node, const PeepholeActionAndData* action_data) {
- DCHECK(LastIsValid());
- DCHECK(!Bytecodes::IsJump(node->bytecode()));
- // Fused last and current into current.
- BytecodeNode new_node(TransformEqualityWithNullOrUndefined(
- action_data->bytecode, last(), node));
- SetLast(&new_node);
-}
-
void BytecodePeepholeOptimizer::DefaultJumpAction(
BytecodeNode* const node, const PeepholeActionAndData* action_data) {
DCHECK(LastIsValid());
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/interpreter/bytecode-peephole-table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698