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 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 DCHECK(IsDeclaredVariableMode(mode)); | 793 DCHECK(IsDeclaredVariableMode(mode)); |
794 // Push initial value, if any. | 794 // Push initial value, if any. |
795 // Note: For variables we must not push an initial value (such as | 795 // Note: For variables we must not push an initial value (such as |
796 // 'undefined') because we may have a (legal) redeclaration and we | 796 // 'undefined') because we may have a (legal) redeclaration and we |
797 // must not destroy the current value. | 797 // must not destroy the current value. |
798 if (hole_init) { | 798 if (hole_init) { |
799 __ push(Immediate(isolate()->factory()->the_hole_value())); | 799 __ push(Immediate(isolate()->factory()->the_hole_value())); |
800 } else { | 800 } else { |
801 __ push(Immediate(Smi::FromInt(0))); // Indicates no initial value. | 801 __ push(Immediate(Smi::FromInt(0))); // Indicates no initial value. |
802 } | 802 } |
803 __ CallRuntime(IsImmutableVariableMode(mode) | 803 __ push( |
804 ? Runtime::kDeclareReadOnlyLookupSlot | 804 Immediate(Smi::FromInt(variable->DeclarationPropertyAttributes()))); |
805 : Runtime::kDeclareLookupSlot, | 805 __ CallRuntime(Runtime::kDeclareLookupSlot, 3); |
806 2); | |
807 break; | 806 break; |
808 } | 807 } |
809 } | 808 } |
810 } | 809 } |
811 | 810 |
812 | 811 |
813 void FullCodeGenerator::VisitFunctionDeclaration( | 812 void FullCodeGenerator::VisitFunctionDeclaration( |
814 FunctionDeclaration* declaration) { | 813 FunctionDeclaration* declaration) { |
815 VariableProxy* proxy = declaration->proxy(); | 814 VariableProxy* proxy = declaration->proxy(); |
816 Variable* variable = proxy->var(); | 815 Variable* variable = proxy->var(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 EMIT_REMEMBERED_SET, | 847 EMIT_REMEMBERED_SET, |
849 OMIT_SMI_CHECK); | 848 OMIT_SMI_CHECK); |
850 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 849 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
851 break; | 850 break; |
852 } | 851 } |
853 | 852 |
854 case VariableLocation::LOOKUP: { | 853 case VariableLocation::LOOKUP: { |
855 Comment cmnt(masm_, "[ FunctionDeclaration"); | 854 Comment cmnt(masm_, "[ FunctionDeclaration"); |
856 __ push(Immediate(variable->name())); | 855 __ push(Immediate(variable->name())); |
857 VisitForStackValue(declaration->fun()); | 856 VisitForStackValue(declaration->fun()); |
858 __ CallRuntime(Runtime::kDeclareLookupSlot, 2); | 857 __ push( |
| 858 Immediate(Smi::FromInt(variable->DeclarationPropertyAttributes()))); |
| 859 __ CallRuntime(Runtime::kDeclareLookupSlot, 3); |
859 break; | 860 break; |
860 } | 861 } |
861 } | 862 } |
862 } | 863 } |
863 | 864 |
864 | 865 |
865 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 866 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
866 // Call the runtime to declare the globals. | 867 // Call the runtime to declare the globals. |
867 __ Push(pairs); | 868 __ Push(pairs); |
868 __ Push(Smi::FromInt(DeclareGlobalsFlags())); | 869 __ Push(Smi::FromInt(DeclareGlobalsFlags())); |
(...skipping 4273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5142 Assembler::target_address_at(call_target_address, | 5143 Assembler::target_address_at(call_target_address, |
5143 unoptimized_code)); | 5144 unoptimized_code)); |
5144 return OSR_AFTER_STACK_CHECK; | 5145 return OSR_AFTER_STACK_CHECK; |
5145 } | 5146 } |
5146 | 5147 |
5147 | 5148 |
5148 } // namespace internal | 5149 } // namespace internal |
5149 } // namespace v8 | 5150 } // namespace v8 |
5150 | 5151 |
5151 #endif // V8_TARGET_ARCH_IA32 | 5152 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |