OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 340 |
341 // Visit the declarations and body unless there is an illegal | 341 // Visit the declarations and body unless there is an illegal |
342 // redeclaration. | 342 // redeclaration. |
343 if (scope()->HasIllegalRedeclaration()) { | 343 if (scope()->HasIllegalRedeclaration()) { |
344 Comment cmnt(masm_, "[ Declarations"); | 344 Comment cmnt(masm_, "[ Declarations"); |
345 scope()->VisitIllegalRedeclaration(this); | 345 scope()->VisitIllegalRedeclaration(this); |
346 | 346 |
347 } else { | 347 } else { |
348 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); | 348 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); |
349 { Comment cmnt(masm_, "[ Declarations"); | 349 { Comment cmnt(masm_, "[ Declarations"); |
350 // For named function expressions, declare the function name as a | |
351 // constant. | |
352 if (scope()->is_function_scope() && scope()->function() != NULL) { | |
353 VariableDeclaration* function = scope()->function(); | |
354 DCHECK(function->proxy()->var()->mode() == CONST || | |
355 function->proxy()->var()->mode() == CONST_LEGACY); | |
356 DCHECK(!function->proxy()->var()->IsUnallocatedOrGlobalSlot()); | |
357 VisitVariableDeclaration(function); | |
358 } | |
359 VisitDeclarations(scope()->declarations()); | 350 VisitDeclarations(scope()->declarations()); |
360 } | 351 } |
361 | 352 |
362 { Comment cmnt(masm_, "[ Stack check"); | 353 { Comment cmnt(masm_, "[ Stack check"); |
363 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); | 354 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); |
364 Label ok; | 355 Label ok; |
365 ExternalReference stack_limit | 356 ExternalReference stack_limit |
366 = ExternalReference::address_of_stack_limit(isolate()); | 357 = ExternalReference::address_of_stack_limit(isolate()); |
367 __ cmp(esp, Operand::StaticVariable(stack_limit)); | 358 __ cmp(esp, Operand::StaticVariable(stack_limit)); |
368 __ j(above_equal, &ok, Label::kNear); | 359 __ j(above_equal, &ok, Label::kNear); |
(...skipping 5088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5457 Assembler::target_address_at(call_target_address, | 5448 Assembler::target_address_at(call_target_address, |
5458 unoptimized_code)); | 5449 unoptimized_code)); |
5459 return OSR_AFTER_STACK_CHECK; | 5450 return OSR_AFTER_STACK_CHECK; |
5460 } | 5451 } |
5461 | 5452 |
5462 | 5453 |
5463 } // namespace internal | 5454 } // namespace internal |
5464 } // namespace v8 | 5455 } // namespace v8 |
5465 | 5456 |
5466 #endif // V8_TARGET_ARCH_IA32 | 5457 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |