Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index 423c438cf2c17910227d08fd4b873294538d2dbb..6fbb46e722bc3c67896e1e2a9d059747d830f4d8 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -394,7 +394,14 @@ void BytecodeGenerator::VisitDebuggerStatement(DebuggerStatement* stmt) { |
void BytecodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) { |
- UNIMPLEMENTED(); |
+ // Find or build a shared function info. |
+ Handle<SharedFunctionInfo> shared_info = |
+ Compiler::GetSharedFunctionInfo(expr, info()->script(), info()); |
+ CHECK(!shared_info.is_null()); // TODO(rmcilroy): Set stack overflow? |
+ |
+ builder() |
+ ->LoadLiteral(shared_info) |
+ .CreateClosure(expr->pretenure() ? TENURED : NOT_TENURED); |
} |
@@ -679,10 +686,15 @@ void BytecodeGenerator::VisitCall(Call* expr) { |
builder()->StoreAccumulatorInRegister(callee); |
break; |
} |
+ case Call::OTHER_CALL: { |
+ builder()->LoadUndefined().StoreAccumulatorInRegister(receiver); |
+ Visit(callee_expr); |
+ builder()->StoreAccumulatorInRegister(callee); |
+ break; |
+ } |
case Call::LOOKUP_SLOT_CALL: |
case Call::SUPER_CALL: |
case Call::POSSIBLY_EVAL_CALL: |
- case Call::OTHER_CALL: |
UNIMPLEMENTED(); |
} |