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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 VisitDeclarations(scope()->declarations()); | 350 VisitDeclarations(scope()->declarations()); |
351 } | 351 } |
352 | 352 |
353 // Assert that the declarations do not use ICs. Otherwise the debugger | |
354 // won't be able to redirect a PC at an IC to the correct IC in newly | |
355 // recompiled code. | |
356 DCHECK_EQ(0, ic_total_count_); | |
357 | |
353 { Comment cmnt(masm_, "[ Stack check"); | 358 { Comment cmnt(masm_, "[ Stack check"); |
354 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); | 359 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); |
355 Label ok; | 360 Label ok; |
356 ExternalReference stack_limit | 361 ExternalReference stack_limit |
357 = ExternalReference::address_of_stack_limit(isolate()); | 362 = ExternalReference::address_of_stack_limit(isolate()); |
358 __ cmp(esp, Operand::StaticVariable(stack_limit)); | 363 __ cmp(esp, Operand::StaticVariable(stack_limit)); |
359 __ j(above_equal, &ok, Label::kNear); | 364 __ j(above_equal, &ok, Label::kNear); |
360 __ call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET); | 365 __ call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET); |
361 __ bind(&ok); | 366 __ bind(&ok); |
362 } | 367 } |
(...skipping 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2642 Label assign; | 2647 Label assign; |
2643 MemOperand location = VarOperand(var, ecx); | 2648 MemOperand location = VarOperand(var, ecx); |
2644 __ mov(edx, location); | 2649 __ mov(edx, location); |
2645 __ cmp(edx, isolate()->factory()->the_hole_value()); | 2650 __ cmp(edx, isolate()->factory()->the_hole_value()); |
2646 __ j(not_equal, &assign, Label::kNear); | 2651 __ j(not_equal, &assign, Label::kNear); |
2647 __ push(Immediate(var->name())); | 2652 __ push(Immediate(var->name())); |
2648 __ CallRuntime(Runtime::kThrowReferenceError, 1); | 2653 __ CallRuntime(Runtime::kThrowReferenceError, 1); |
2649 __ bind(&assign); | 2654 __ bind(&assign); |
2650 EmitStoreToStackLocalOrContextSlot(var, location); | 2655 EmitStoreToStackLocalOrContextSlot(var, location); |
2651 | 2656 |
2657 printf("let "); | |
mvstanton
2015/07/30 13:44:07
This should go, right?
Yang
2015/07/30 13:45:58
Correct. Thanks for catching this!
| |
2658 var->name()->Print(); | |
2659 | |
2652 } else if (var->mode() == CONST && op != Token::INIT_CONST) { | 2660 } else if (var->mode() == CONST && op != Token::INIT_CONST) { |
2653 // Assignment to const variable needs a write barrier. | 2661 // Assignment to const variable needs a write barrier. |
2654 DCHECK(!var->IsLookupSlot()); | 2662 DCHECK(!var->IsLookupSlot()); |
2655 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 2663 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
2656 Label const_error; | 2664 Label const_error; |
2657 MemOperand location = VarOperand(var, ecx); | 2665 MemOperand location = VarOperand(var, ecx); |
2658 __ mov(edx, location); | 2666 __ mov(edx, location); |
2659 __ cmp(edx, isolate()->factory()->the_hole_value()); | 2667 __ cmp(edx, isolate()->factory()->the_hole_value()); |
2660 __ j(not_equal, &const_error, Label::kNear); | 2668 __ j(not_equal, &const_error, Label::kNear); |
2661 __ push(Immediate(var->name())); | 2669 __ push(Immediate(var->name())); |
2662 __ CallRuntime(Runtime::kThrowReferenceError, 1); | 2670 __ CallRuntime(Runtime::kThrowReferenceError, 1); |
2663 __ bind(&const_error); | 2671 __ bind(&const_error); |
2664 __ CallRuntime(Runtime::kThrowConstAssignError, 0); | 2672 __ CallRuntime(Runtime::kThrowConstAssignError, 0); |
2665 | 2673 |
2674 printf("con "); | |
2675 var->name()->Print(); | |
2676 | |
2666 } else if (var->is_this() && op == Token::INIT_CONST) { | 2677 } else if (var->is_this() && op == Token::INIT_CONST) { |
2667 // Initializing assignment to const {this} needs a write barrier. | 2678 // Initializing assignment to const {this} needs a write barrier. |
2668 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 2679 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
2669 Label uninitialized_this; | 2680 Label uninitialized_this; |
2670 MemOperand location = VarOperand(var, ecx); | 2681 MemOperand location = VarOperand(var, ecx); |
2671 __ mov(edx, location); | 2682 __ mov(edx, location); |
2672 __ cmp(edx, isolate()->factory()->the_hole_value()); | 2683 __ cmp(edx, isolate()->factory()->the_hole_value()); |
2673 __ j(equal, &uninitialized_this); | 2684 __ j(equal, &uninitialized_this); |
2674 __ push(Immediate(var->name())); | 2685 __ push(Immediate(var->name())); |
2675 __ CallRuntime(Runtime::kThrowReferenceError, 1); | 2686 __ CallRuntime(Runtime::kThrowReferenceError, 1); |
(...skipping 2665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5341 Assembler::target_address_at(call_target_address, | 5352 Assembler::target_address_at(call_target_address, |
5342 unoptimized_code)); | 5353 unoptimized_code)); |
5343 return OSR_AFTER_STACK_CHECK; | 5354 return OSR_AFTER_STACK_CHECK; |
5344 } | 5355 } |
5345 | 5356 |
5346 | 5357 |
5347 } // namespace internal | 5358 } // namespace internal |
5348 } // namespace v8 | 5359 } // namespace v8 |
5349 | 5360 |
5350 #endif // V8_TARGET_ARCH_IA32 | 5361 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |