Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index a66e44a145d48144bc46a4799c0f11a1ecfbe6b3..df9f21cb8529556672d6f84d50d2ffe69200aeb8 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -619,8 +619,41 @@ void BytecodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
} |
+void BytecodeGenerator::VisitVoid(UnaryOperation* expr) { |
+ Visit(expr->expression()); |
+ builder()->LoadUndefined(); |
+} |
+ |
+ |
+void BytecodeGenerator::VisitTypeOf(UnaryOperation* expr) { |
+ Visit(expr->expression()); |
+ builder()->TypeOf(); |
+} |
+ |
+ |
+void BytecodeGenerator::VisitNot(UnaryOperation* expr) { |
+ Visit(expr->expression()); |
+ builder()->LogicalNot(); |
+} |
+ |
+ |
void BytecodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
- UNIMPLEMENTED(); |
+ switch (expr->op()) { |
+ case Token::Value::NOT: |
+ VisitNot(expr); |
+ break; |
+ case Token::Value::TYPEOF: |
+ VisitTypeOf(expr); |
+ break; |
+ case Token::Value::VOID: |
+ VisitVoid(expr); |
+ break; |
+ case Token::Value::BIT_NOT: |
+ case Token::Value::DELETE: |
+ UNIMPLEMENTED(); |
+ default: |
+ UNREACHABLE(); |
+ } |
} |