| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 7 #if V8_TARGET_ARCH_PPC |
| 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 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 // No write barrier since the_hole_value is in old space. | 824 // No write barrier since the_hole_value is in old space. |
| 825 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 825 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
| 826 } | 826 } |
| 827 break; | 827 break; |
| 828 | 828 |
| 829 case VariableLocation::LOOKUP: { | 829 case VariableLocation::LOOKUP: { |
| 830 Comment cmnt(masm_, "[ VariableDeclaration"); | 830 Comment cmnt(masm_, "[ VariableDeclaration"); |
| 831 __ mov(r5, Operand(variable->name())); | 831 __ mov(r5, Operand(variable->name())); |
| 832 // Declaration nodes are always introduced in one of four modes. | 832 // Declaration nodes are always introduced in one of four modes. |
| 833 DCHECK(IsDeclaredVariableMode(mode)); | 833 DCHECK(IsDeclaredVariableMode(mode)); |
| 834 PropertyAttributes attr = | |
| 835 IsImmutableVariableMode(mode) ? READ_ONLY : NONE; | |
| 836 __ LoadSmiLiteral(r4, Smi::FromInt(attr)); | |
| 837 // Push initial value, if any. | 834 // Push initial value, if any. |
| 838 // Note: For variables we must not push an initial value (such as | 835 // Note: For variables we must not push an initial value (such as |
| 839 // 'undefined') because we may have a (legal) redeclaration and we | 836 // 'undefined') because we may have a (legal) redeclaration and we |
| 840 // must not destroy the current value. | 837 // must not destroy the current value. |
| 841 if (hole_init) { | 838 if (hole_init) { |
| 842 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); | 839 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); |
| 843 __ Push(cp, r5, r4, r3); | 840 __ Push(r5, r3); |
| 844 } else { | 841 } else { |
| 845 __ LoadSmiLiteral(r3, Smi::FromInt(0)); // Indicates no initial value. | 842 __ LoadSmiLiteral(r3, Smi::FromInt(0)); // Indicates no initial value. |
| 846 __ Push(cp, r5, r4, r3); | 843 __ Push(r5, r3); |
| 847 } | 844 } |
| 848 __ CallRuntime(Runtime::kDeclareLookupSlot, 4); | 845 __ CallRuntime(IsImmutableVariableMode(mode) |
| 846 ? Runtime::kDeclareReadOnlyLookupSlot |
| 847 : Runtime::kDeclareLookupSlot, |
| 848 2); |
| 849 break; | 849 break; |
| 850 } | 850 } |
| 851 } | 851 } |
| 852 } | 852 } |
| 853 | 853 |
| 854 | 854 |
| 855 void FullCodeGenerator::VisitFunctionDeclaration( | 855 void FullCodeGenerator::VisitFunctionDeclaration( |
| 856 FunctionDeclaration* declaration) { | 856 FunctionDeclaration* declaration) { |
| 857 VariableProxy* proxy = declaration->proxy(); | 857 VariableProxy* proxy = declaration->proxy(); |
| 858 Variable* variable = proxy->var(); | 858 Variable* variable = proxy->var(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 886 __ RecordWriteContextSlot(cp, offset, result_register(), r5, | 886 __ RecordWriteContextSlot(cp, offset, result_register(), r5, |
| 887 kLRHasBeenSaved, kDontSaveFPRegs, | 887 kLRHasBeenSaved, kDontSaveFPRegs, |
| 888 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | 888 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
| 889 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 889 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
| 890 break; | 890 break; |
| 891 } | 891 } |
| 892 | 892 |
| 893 case VariableLocation::LOOKUP: { | 893 case VariableLocation::LOOKUP: { |
| 894 Comment cmnt(masm_, "[ FunctionDeclaration"); | 894 Comment cmnt(masm_, "[ FunctionDeclaration"); |
| 895 __ mov(r5, Operand(variable->name())); | 895 __ mov(r5, Operand(variable->name())); |
| 896 __ LoadSmiLiteral(r4, Smi::FromInt(NONE)); | 896 __ Push(r5); |
| 897 __ Push(cp, r5, r4); | |
| 898 // Push initial value for function declaration. | 897 // Push initial value for function declaration. |
| 899 VisitForStackValue(declaration->fun()); | 898 VisitForStackValue(declaration->fun()); |
| 900 __ CallRuntime(Runtime::kDeclareLookupSlot, 4); | 899 __ CallRuntime(Runtime::kDeclareLookupSlot, 2); |
| 901 break; | 900 break; |
| 902 } | 901 } |
| 903 } | 902 } |
| 904 } | 903 } |
| 905 | 904 |
| 906 | 905 |
| 907 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 906 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
| 908 // Call the runtime to declare the globals. | 907 // Call the runtime to declare the globals. |
| 909 // The context is the first argument. | |
| 910 __ mov(r4, Operand(pairs)); | 908 __ mov(r4, Operand(pairs)); |
| 911 __ LoadSmiLiteral(r3, Smi::FromInt(DeclareGlobalsFlags())); | 909 __ LoadSmiLiteral(r3, Smi::FromInt(DeclareGlobalsFlags())); |
| 912 __ Push(cp, r4, r3); | 910 __ Push(r4, r3); |
| 913 __ CallRuntime(Runtime::kDeclareGlobals, 3); | 911 __ CallRuntime(Runtime::kDeclareGlobals, 2); |
| 914 // Return value is ignored. | 912 // Return value is ignored. |
| 915 } | 913 } |
| 916 | 914 |
| 917 | 915 |
| 918 void FullCodeGenerator::DeclareModules(Handle<FixedArray> descriptions) { | 916 void FullCodeGenerator::DeclareModules(Handle<FixedArray> descriptions) { |
| 919 // Call the runtime to declare the modules. | 917 // Call the runtime to declare the modules. |
| 920 __ Push(descriptions); | 918 __ Push(descriptions); |
| 921 __ CallRuntime(Runtime::kDeclareModules, 1); | 919 __ CallRuntime(Runtime::kDeclareModules, 1); |
| 922 // Return value is ignored. | 920 // Return value is ignored. |
| 923 } | 921 } |
| (...skipping 4493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5417 return ON_STACK_REPLACEMENT; | 5415 return ON_STACK_REPLACEMENT; |
| 5418 } | 5416 } |
| 5419 | 5417 |
| 5420 DCHECK(interrupt_address == | 5418 DCHECK(interrupt_address == |
| 5421 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5419 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5422 return OSR_AFTER_STACK_CHECK; | 5420 return OSR_AFTER_STACK_CHECK; |
| 5423 } | 5421 } |
| 5424 } // namespace internal | 5422 } // namespace internal |
| 5425 } // namespace v8 | 5423 } // namespace v8 |
| 5426 #endif // V8_TARGET_ARCH_PPC | 5424 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |