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); |
} |