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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1704 // r3 = address of new object(s) (tagged) | 1704 // r3 = address of new object(s) (tagged) |
1705 // r5 = argument count (smi-tagged) | 1705 // r5 = argument count (smi-tagged) |
1706 // Get the arguments boilerplate from the current native context into r4. | 1706 // Get the arguments boilerplate from the current native context into r4. |
1707 const int kNormalOffset = | 1707 const int kNormalOffset = |
1708 Context::SlotOffset(Context::SLOPPY_ARGUMENTS_MAP_INDEX); | 1708 Context::SlotOffset(Context::SLOPPY_ARGUMENTS_MAP_INDEX); |
1709 const int kAliasedOffset = | 1709 const int kAliasedOffset = |
1710 Context::SlotOffset(Context::FAST_ALIASED_ARGUMENTS_MAP_INDEX); | 1710 Context::SlotOffset(Context::FAST_ALIASED_ARGUMENTS_MAP_INDEX); |
1711 | 1711 |
1712 __ LoadP(r7, | 1712 __ LoadP(r7, |
1713 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 1713 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
1714 __ LoadP(r7, FieldMemOperand(r7, GlobalObject::kNativeContextOffset)); | 1714 __ LoadP(r7, FieldMemOperand(r7, JSGlobalObject::kNativeContextOffset)); |
1715 __ cmpi(r9, Operand::Zero()); | 1715 __ cmpi(r9, Operand::Zero()); |
1716 if (CpuFeatures::IsSupported(ISELECT)) { | 1716 if (CpuFeatures::IsSupported(ISELECT)) { |
1717 __ LoadP(r11, MemOperand(r7, kNormalOffset)); | 1717 __ LoadP(r11, MemOperand(r7, kNormalOffset)); |
1718 __ LoadP(r7, MemOperand(r7, kAliasedOffset)); | 1718 __ LoadP(r7, MemOperand(r7, kAliasedOffset)); |
1719 __ isel(eq, r7, r11, r7); | 1719 __ isel(eq, r7, r11, r7); |
1720 } else { | 1720 } else { |
1721 Label skip4, skip5; | 1721 Label skip4, skip5; |
1722 __ bne(&skip4); | 1722 __ bne(&skip4); |
1723 __ LoadP(r7, MemOperand(r7, kNormalOffset)); | 1723 __ LoadP(r7, MemOperand(r7, kNormalOffset)); |
1724 __ b(&skip5); | 1724 __ b(&skip5); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1921 __ bind(&add_arguments_object); | 1921 __ bind(&add_arguments_object); |
1922 __ addi(r11, r11, Operand(Heap::kStrictArgumentsObjectSize / kPointerSize)); | 1922 __ addi(r11, r11, Operand(Heap::kStrictArgumentsObjectSize / kPointerSize)); |
1923 | 1923 |
1924 // Do the allocation of both objects in one go. | 1924 // Do the allocation of both objects in one go. |
1925 __ Allocate(r11, r3, r7, r8, &runtime, | 1925 __ Allocate(r11, r3, r7, r8, &runtime, |
1926 static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS)); | 1926 static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS)); |
1927 | 1927 |
1928 // Get the arguments boilerplate from the current native context. | 1928 // Get the arguments boilerplate from the current native context. |
1929 __ LoadP(r7, | 1929 __ LoadP(r7, |
1930 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 1930 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
1931 __ LoadP(r7, FieldMemOperand(r7, GlobalObject::kNativeContextOffset)); | 1931 __ LoadP(r7, FieldMemOperand(r7, JSGlobalObject::kNativeContextOffset)); |
1932 __ LoadP( | 1932 __ LoadP( |
1933 r7, | 1933 r7, |
1934 MemOperand(r7, Context::SlotOffset(Context::STRICT_ARGUMENTS_MAP_INDEX))); | 1934 MemOperand(r7, Context::SlotOffset(Context::STRICT_ARGUMENTS_MAP_INDEX))); |
1935 | 1935 |
1936 __ StoreP(r7, FieldMemOperand(r3, JSObject::kMapOffset), r0); | 1936 __ StoreP(r7, FieldMemOperand(r3, JSObject::kMapOffset), r0); |
1937 __ LoadRoot(r8, Heap::kEmptyFixedArrayRootIndex); | 1937 __ LoadRoot(r8, Heap::kEmptyFixedArrayRootIndex); |
1938 __ StoreP(r8, FieldMemOperand(r3, JSObject::kPropertiesOffset), r0); | 1938 __ StoreP(r8, FieldMemOperand(r3, JSObject::kPropertiesOffset), r0); |
1939 __ StoreP(r8, FieldMemOperand(r3, JSObject::kElementsOffset), r0); | 1939 __ StoreP(r8, FieldMemOperand(r3, JSObject::kElementsOffset), r0); |
1940 | 1940 |
1941 // Get the length (smi tagged) and set that as an in-object property too. | 1941 // Get the length (smi tagged) and set that as an in-object property too. |
(...skipping 3921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5863 kStackUnwindSpace, NULL, | 5863 kStackUnwindSpace, NULL, |
5864 MemOperand(fp, 6 * kPointerSize), NULL); | 5864 MemOperand(fp, 6 * kPointerSize), NULL); |
5865 } | 5865 } |
5866 | 5866 |
5867 | 5867 |
5868 #undef __ | 5868 #undef __ |
5869 } // namespace internal | 5869 } // namespace internal |
5870 } // namespace v8 | 5870 } // namespace v8 |
5871 | 5871 |
5872 #endif // V8_TARGET_ARCH_PPC | 5872 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |