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

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

Issue 2554723004: [Interpreter] Transform StrictEquality with null/undefined to special bytecodes. (Closed)
Patch Set: rebased the patch. 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 | « src/compiler/bytecode-graph-builder.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 887f9ce9737525c9e12231d4f1dcfac796cb7016..acfe484ad37f85c6a32ff881d281ab3642c5f5ca 100644
--- a/src/interpreter/bytecode-peephole-optimizer.cc
+++ b/src/interpreter/bytecode-peephole-optimizer.cc
@@ -141,13 +141,14 @@ BytecodeNode TransformLdaZeroBinaryOpToBinaryOpWithZero(
return node;
}
-BytecodeNode TransformEqualityWithNullOrUndefinedToTestUndetectable(
- BytecodeNode* const last, BytecodeNode* const current) {
+BytecodeNode TransformEqualityWithNullOrUndefined(Bytecode new_bytecode,
+ BytecodeNode* const last,
+ BytecodeNode* const current) {
DCHECK((last->bytecode() == Bytecode::kLdaNull) ||
(last->bytecode() == Bytecode::kLdaUndefined));
- DCHECK_EQ(current->bytecode(), Bytecode::kTestEqual);
- BytecodeNode node(BytecodeNode::TestUndetectable(current->source_info(),
- current->operand(0)));
+ 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());
}
@@ -267,14 +268,13 @@ void BytecodePeepholeOptimizer::
}
}
-void BytecodePeepholeOptimizer::
- TransformEqualityWithNullOrUndefinedToTestUndetectableAction(
- BytecodeNode* const node, const PeepholeActionAndData* action_data) {
+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(
- TransformEqualityWithNullOrUndefinedToTestUndetectable(last(), node));
+ BytecodeNode new_node(TransformEqualityWithNullOrUndefined(
+ action_data->bytecode, last(), node));
SetLast(&new_node);
}
« no previous file with comments | « src/compiler/bytecode-graph-builder.cc ('k') | src/interpreter/bytecode-peephole-table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698