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_X64 | 5 #if V8_TARGET_ARCH_X64 |
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/debug/debug.h" | 10 #include "src/debug/debug.h" |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 DCHECK(IsDeclaredVariableMode(mode)); | 802 DCHECK(IsDeclaredVariableMode(mode)); |
803 // Push initial value, if any. | 803 // Push initial value, if any. |
804 // Note: For variables we must not push an initial value (such as | 804 // Note: For variables we must not push an initial value (such as |
805 // 'undefined') because we may have a (legal) redeclaration and we | 805 // 'undefined') because we may have a (legal) redeclaration and we |
806 // must not destroy the current value. | 806 // must not destroy the current value. |
807 if (hole_init) { | 807 if (hole_init) { |
808 __ PushRoot(Heap::kTheHoleValueRootIndex); | 808 __ PushRoot(Heap::kTheHoleValueRootIndex); |
809 } else { | 809 } else { |
810 __ Push(Smi::FromInt(0)); // Indicates no initial value. | 810 __ Push(Smi::FromInt(0)); // Indicates no initial value. |
811 } | 811 } |
812 __ CallRuntime(IsImmutableVariableMode(mode) | 812 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
813 ? Runtime::kDeclareReadOnlyLookupSlot | 813 __ CallRuntime(Runtime::kDeclareLookupSlot, 3); |
814 : Runtime::kDeclareLookupSlot, | |
815 2); | |
816 break; | 814 break; |
817 } | 815 } |
818 } | 816 } |
819 } | 817 } |
820 | 818 |
821 | 819 |
822 void FullCodeGenerator::VisitFunctionDeclaration( | 820 void FullCodeGenerator::VisitFunctionDeclaration( |
823 FunctionDeclaration* declaration) { | 821 FunctionDeclaration* declaration) { |
824 VariableProxy* proxy = declaration->proxy(); | 822 VariableProxy* proxy = declaration->proxy(); |
825 Variable* variable = proxy->var(); | 823 Variable* variable = proxy->var(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 EMIT_REMEMBERED_SET, | 856 EMIT_REMEMBERED_SET, |
859 OMIT_SMI_CHECK); | 857 OMIT_SMI_CHECK); |
860 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 858 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
861 break; | 859 break; |
862 } | 860 } |
863 | 861 |
864 case VariableLocation::LOOKUP: { | 862 case VariableLocation::LOOKUP: { |
865 Comment cmnt(masm_, "[ FunctionDeclaration"); | 863 Comment cmnt(masm_, "[ FunctionDeclaration"); |
866 __ Push(variable->name()); | 864 __ Push(variable->name()); |
867 VisitForStackValue(declaration->fun()); | 865 VisitForStackValue(declaration->fun()); |
868 __ CallRuntime(Runtime::kDeclareLookupSlot, 2); | 866 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
| 867 __ CallRuntime(Runtime::kDeclareLookupSlot, 3); |
869 break; | 868 break; |
870 } | 869 } |
871 } | 870 } |
872 } | 871 } |
873 | 872 |
874 | 873 |
875 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 874 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
876 // Call the runtime to declare the globals. | 875 // Call the runtime to declare the globals. |
877 __ Push(pairs); | 876 __ Push(pairs); |
878 __ Push(Smi::FromInt(DeclareGlobalsFlags())); | 877 __ Push(Smi::FromInt(DeclareGlobalsFlags())); |
(...skipping 4288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5167 Assembler::target_address_at(call_target_address, | 5166 Assembler::target_address_at(call_target_address, |
5168 unoptimized_code)); | 5167 unoptimized_code)); |
5169 return OSR_AFTER_STACK_CHECK; | 5168 return OSR_AFTER_STACK_CHECK; |
5170 } | 5169 } |
5171 | 5170 |
5172 | 5171 |
5173 } // namespace internal | 5172 } // namespace internal |
5174 } // namespace v8 | 5173 } // namespace v8 |
5175 | 5174 |
5176 #endif // V8_TARGET_ARCH_X64 | 5175 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |