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_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 | 337 |
338 // Visit the declarations and body unless there is an illegal | 338 // Visit the declarations and body unless there is an illegal |
339 // redeclaration. | 339 // redeclaration. |
340 if (scope()->HasIllegalRedeclaration()) { | 340 if (scope()->HasIllegalRedeclaration()) { |
341 Comment cmnt(masm_, "[ Declarations"); | 341 Comment cmnt(masm_, "[ Declarations"); |
342 scope()->VisitIllegalRedeclaration(this); | 342 scope()->VisitIllegalRedeclaration(this); |
343 | 343 |
344 } else { | 344 } else { |
345 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); | 345 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); |
346 { Comment cmnt(masm_, "[ Declarations"); | 346 { Comment cmnt(masm_, "[ Declarations"); |
347 // For named function expressions, declare the function name as a | |
348 // constant. | |
349 if (scope()->is_function_scope() && scope()->function() != NULL) { | |
350 VariableDeclaration* function = scope()->function(); | |
351 DCHECK(function->proxy()->var()->mode() == CONST || | |
352 function->proxy()->var()->mode() == CONST_LEGACY); | |
353 DCHECK(!function->proxy()->var()->IsUnallocatedOrGlobalSlot()); | |
354 VisitVariableDeclaration(function); | |
355 } | |
356 VisitDeclarations(scope()->declarations()); | 347 VisitDeclarations(scope()->declarations()); |
357 } | 348 } |
358 | 349 |
359 { Comment cmnt(masm_, "[ Stack check"); | 350 { Comment cmnt(masm_, "[ Stack check"); |
360 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); | 351 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); |
361 Label ok; | 352 Label ok; |
362 ExternalReference stack_limit | 353 ExternalReference stack_limit |
363 = ExternalReference::address_of_stack_limit(isolate()); | 354 = ExternalReference::address_of_stack_limit(isolate()); |
364 __ cmp(esp, Operand::StaticVariable(stack_limit)); | 355 __ cmp(esp, Operand::StaticVariable(stack_limit)); |
365 __ j(above_equal, &ok, Label::kNear); | 356 __ j(above_equal, &ok, Label::kNear); |
(...skipping 5081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5447 Assembler::target_address_at(call_target_address, | 5438 Assembler::target_address_at(call_target_address, |
5448 unoptimized_code)); | 5439 unoptimized_code)); |
5449 return OSR_AFTER_STACK_CHECK; | 5440 return OSR_AFTER_STACK_CHECK; |
5450 } | 5441 } |
5451 | 5442 |
5452 | 5443 |
5453 } // namespace internal | 5444 } // namespace internal |
5454 } // namespace v8 | 5445 } // namespace v8 |
5455 | 5446 |
5456 #endif // V8_TARGET_ARCH_X87 | 5447 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |