Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index 1351bae28683272dbacdf9a5a514ad0896a58a92..3c094a4e120e09e02e442641cce097dfba528b89 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -206,45 +206,48 @@ void FullCodeGenerator::Generate(CompilationInfo* info) { |
Move(dot_arguments_slot, ecx, ebx, edx); |
} |
- { Comment cmnt(masm_, "[ Declarations"); |
- // For named function expressions, declare the function name as a |
- // constant. |
- if (scope()->is_function_scope() && scope()->function() != NULL) { |
- EmitDeclaration(scope()->function(), Variable::CONST, NULL); |
- } |
- // Visit all the explicit declarations unless there is an illegal |
- // redeclaration. |
- if (scope()->HasIllegalRedeclaration()) { |
- scope()->VisitIllegalRedeclaration(this); |
- } else { |
- VisitDeclarations(scope()->declarations()); |
- } |
- } |
- |
if (FLAG_trace) { |
__ CallRuntime(Runtime::kTraceEnter, 0); |
} |
- { Comment cmnt(masm_, "[ Stack check"); |
- PrepareForBailout(info->function(), NO_REGISTERS); |
- NearLabel ok; |
- ExternalReference stack_limit = |
- ExternalReference::address_of_stack_limit(); |
- __ cmp(esp, Operand::StaticVariable(stack_limit)); |
- __ j(above_equal, &ok, taken); |
- StackCheckStub stub; |
- __ CallStub(&stub); |
- __ bind(&ok); |
- } |
+ // Visit the declarations and body unless there is an illegal |
+ // redeclaration. |
+ if (scope()->HasIllegalRedeclaration()) { |
+ Comment cmnt(masm_, "[ Declarations"); |
+ scope()->VisitIllegalRedeclaration(this); |
- { Comment cmnt(masm_, "[ Body"); |
- ASSERT(loop_depth() == 0); |
- VisitStatements(function()->body()); |
- ASSERT(loop_depth() == 0); |
+ } else { |
+ { Comment cmnt(masm_, "[ Declarations"); |
+ // For named function expressions, declare the function name as a |
+ // constant. |
+ if (scope()->is_function_scope() && scope()->function() != NULL) { |
+ EmitDeclaration(scope()->function(), Variable::CONST, NULL); |
+ } |
+ VisitDeclarations(scope()->declarations()); |
+ } |
+ |
+ { Comment cmnt(masm_, "[ Stack check"); |
+ PrepareForBailout(info->function(), NO_REGISTERS); |
+ NearLabel ok; |
+ ExternalReference stack_limit = |
+ ExternalReference::address_of_stack_limit(); |
+ __ cmp(esp, Operand::StaticVariable(stack_limit)); |
+ __ j(above_equal, &ok, taken); |
+ StackCheckStub stub; |
+ __ CallStub(&stub); |
+ __ bind(&ok); |
+ } |
+ |
+ { Comment cmnt(masm_, "[ Body"); |
+ ASSERT(loop_depth() == 0); |
+ VisitStatements(function()->body()); |
+ ASSERT(loop_depth() == 0); |
+ } |
} |
+ // Always emit a 'return undefined' in case control fell off the end of |
+ // the body. |
{ Comment cmnt(masm_, "[ return <undefined>;"); |
- // Emit a 'return undefined' in case control fell off the end of the body. |
__ mov(eax, Factory::undefined_value()); |
EmitReturnSequence(); |
} |