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

Unified Diff: src/compiler/bytecode-graph-builder.cc

Issue 2554723004: [Interpreter] Transform StrictEquality with null/undefined to special bytecodes. (Closed)
Patch Set: "Fixed a DCHECK" 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') | src/interpreter/interpreter.cc » ('J')
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 07236118a0c59bcb8ec66b72a92a80835f8e217a..28901ad42b05af6a5a4f851b432ce2907e6b48e1 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -1651,6 +1651,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') | src/interpreter/interpreter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698