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

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

Issue 1468003002: [Interpreter] Add support for cast operators to bytecode graph builder and (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed review comments. 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..a9720418caecb1f367ef9915512efbc3f77d58f4 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -998,27 +998,35 @@ void BytecodeGraphBuilder::VisitTestInstanceOf(
}
+void BytecodeGraphBuilder::BuildCastOperator(
+ const Operator* js_op, const interpreter::BytecodeArrayIterator& iterator) {
+ Node* node = NewNode(js_op, environment()->LookupAccumulator());
+ AddEmptyFrameStateInputs(node);
+ environment()->BindAccumulator(node);
+}
+
+
void BytecodeGraphBuilder::VisitToBoolean(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCastOperator(javascript()->ToBoolean(), iterator);
}
void BytecodeGraphBuilder::VisitToName(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCastOperator(javascript()->ToName(), iterator);
}
void BytecodeGraphBuilder::VisitToNumber(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCastOperator(javascript()->ToNumber(), iterator);
}
void BytecodeGraphBuilder::VisitToObject(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCastOperator(javascript()->ToObject(), iterator);
}

Powered by Google App Engine
This is Rietveld 408576698