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

Unified Diff: src/compiler/bytecode-graph-builder.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 | « no previous file | src/interpreter/bytecode-peephole-optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index 12a5d29d21770df1c39b691df66c3654c3f27946..ed11f1090bcc2eec8499ca5eb7159b312dd88765 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -1665,6 +1665,22 @@ void BytecodeGraphBuilder::VisitTestUndetectable() {
environment()->BindAccumulator(node);
}
+void BytecodeGraphBuilder::VisitTestNull() {
+ Node* object =
+ environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
+ Node* result = NewNode(javascript()->StrictEqual(CompareOperationHint::kAny),
+ object, jsgraph()->NullConstant());
+ environment()->BindAccumulator(result);
+}
+
+void BytecodeGraphBuilder::VisitTestUndefined() {
+ Node* object =
+ environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
+ Node* result = NewNode(javascript()->StrictEqual(CompareOperationHint::kAny),
+ object, jsgraph()->UndefinedConstant());
+ environment()->BindAccumulator(result);
+}
+
void BytecodeGraphBuilder::BuildCastOperator(const Operator* js_op) {
PrepareEagerCheckpoint();
Node* value = NewNode(js_op, environment()->LookupAccumulator());
« no previous file with comments | « no previous file | src/interpreter/bytecode-peephole-optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698