Index: src/compiler/bytecode-graph-builder.cc |
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc |
index c141e880f86bef80792da6306f6a5bb4a7c39438..03789b343904a2e9d72c708e3e767dc34e1a79f2 100644 |
--- a/src/compiler/bytecode-graph-builder.cc |
+++ b/src/compiler/bytecode-graph-builder.cc |
@@ -1021,27 +1021,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); |
} |