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

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

Issue 1476473005: [Interpreter] Add support for compare operators to bytecode graph builder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed compile error on linux_gcc bot. Created 5 years, 1 month 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
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index 5bb208ce94f7e5d8a2550d24cb9d0a1f4268c29b..3e8007c5e70e7db5ea9afadaca531ac60b6346d8 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -938,63 +938,74 @@ void BytecodeGraphBuilder::VisitDeletePropertySloppy(
}
+void BytecodeGraphBuilder::BuildCompareOp(
+ const Operator* js_op, const interpreter::BytecodeArrayIterator& iterator) {
+ Node* left = environment()->LookupRegister(iterator.GetRegisterOperand(0));
+ Node* right = environment()->LookupAccumulator();
+ Node* node = NewNode(js_op, left, right);
+
+ AddEmptyFrameStateInputs(node);
+ environment()->BindAccumulator(node);
+}
+
+
void BytecodeGraphBuilder::VisitTestEqual(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCompareOp(javascript()->Equal(), iterator);
}
void BytecodeGraphBuilder::VisitTestNotEqual(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCompareOp(javascript()->NotEqual(), iterator);
}
void BytecodeGraphBuilder::VisitTestEqualStrict(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCompareOp(javascript()->StrictEqual(), iterator);
}
void BytecodeGraphBuilder::VisitTestNotEqualStrict(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCompareOp(javascript()->StrictNotEqual(), iterator);
}
void BytecodeGraphBuilder::VisitTestLessThan(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCompareOp(javascript()->LessThan(language_mode()), iterator);
}
void BytecodeGraphBuilder::VisitTestGreaterThan(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCompareOp(javascript()->GreaterThan(language_mode()), iterator);
}
void BytecodeGraphBuilder::VisitTestLessThanOrEqual(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCompareOp(javascript()->LessThanOrEqual(language_mode()), iterator);
}
void BytecodeGraphBuilder::VisitTestGreaterThanOrEqual(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCompareOp(javascript()->GreaterThanOrEqual(language_mode()), iterator);
}
void BytecodeGraphBuilder::VisitTestIn(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCompareOp(javascript()->HasProperty(), iterator);
}
void BytecodeGraphBuilder::VisitTestInstanceOf(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCompareOp(javascript()->InstanceOf(), iterator);
}

Powered by Google App Engine
This is Rietveld 408576698