Index: src/full-codegen.cc |
=================================================================== |
--- src/full-codegen.cc (revision 4643) |
+++ src/full-codegen.cc (working copy) |
@@ -1,4 +1,4 @@ |
-// Copyright 2009 the V8 project authors. All rights reserved. |
+// Copyright 2010 the V8 project authors. All rights reserved. |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
// met: |
@@ -760,11 +760,6 @@ |
} |
-void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { |
- UNREACHABLE(); |
-} |
- |
- |
void FullCodeGenerator::VisitDoWhileStatement(DoWhileStatement* stmt) { |
Comment cmnt(masm_, "[ DoWhileStatement"); |
SetStatementPosition(stmt); |
@@ -810,6 +805,7 @@ |
Visit(stmt->body()); |
__ bind(loop_statement.continue_target()); |
+ |
// Check stack before looping. |
__ StackLimitCheck(&stack_limit_hit); |
__ bind(&stack_check_success); |
@@ -872,11 +868,6 @@ |
} |
-void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
- UNREACHABLE(); |
-} |
- |
- |
void FullCodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) { |
Comment cmnt(masm_, "[ TryCatchStatement"); |
SetStatementPosition(stmt); |
@@ -995,12 +986,6 @@ |
} |
-void FullCodeGenerator::VisitSharedFunctionInfoLiteral( |
- SharedFunctionInfoLiteral* expr) { |
- UNREACHABLE(); |
-} |
- |
- |
void FullCodeGenerator::VisitConditional(Conditional* expr) { |
Comment cmnt(masm_, "[ Conditional"); |
Label true_case, false_case, done; |
@@ -1034,6 +1019,24 @@ |
} |
+void FullCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) { |
+ Comment cmnt(masm_, "[ FunctionLiteral"); |
+ |
+ // Build the function boilerplate and instantiate it. |
+ Handle<SharedFunctionInfo> function_info = |
+ Compiler::BuildFunctionInfo(expr, script(), this); |
+ if (HasStackOverflow()) return; |
+ EmitNewClosure(function_info); |
+} |
+ |
+ |
+void FullCodeGenerator::VisitSharedFunctionInfoLiteral( |
+ SharedFunctionInfoLiteral* expr) { |
+ Comment cmnt(masm_, "[ SharedFunctionInfoLiteral"); |
+ EmitNewClosure(expr->shared_function_info()); |
+} |
+ |
+ |
void FullCodeGenerator::VisitCatchExtensionObject(CatchExtensionObject* expr) { |
// Call runtime routine to allocate the catch extension object and |
// assign the exception value to the catch variable. |