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 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1691 __ addi(r11, r11, Operand(kParameterMapHeaderSize)); | 1691 __ addi(r11, r11, Operand(kParameterMapHeaderSize)); |
1692 __ bind(&skip3); | 1692 __ bind(&skip3); |
1693 } | 1693 } |
1694 | 1694 |
1695 // 2. Backing store. | 1695 // 2. Backing store. |
1696 __ SmiToPtrArrayOffset(r7, r8); | 1696 __ SmiToPtrArrayOffset(r7, r8); |
1697 __ add(r11, r11, r7); | 1697 __ add(r11, r11, r7); |
1698 __ addi(r11, r11, Operand(FixedArray::kHeaderSize)); | 1698 __ addi(r11, r11, Operand(FixedArray::kHeaderSize)); |
1699 | 1699 |
1700 // 3. Arguments object. | 1700 // 3. Arguments object. |
1701 __ addi(r11, r11, Operand(Heap::kSloppyArgumentsObjectSize)); | 1701 __ addi(r11, r11, Operand(JSSloppyArgumentsObject::kSize)); |
1702 | 1702 |
1703 // Do the allocation of all three objects in one go. | 1703 // Do the allocation of all three objects in one go. |
1704 __ Allocate(r11, r3, r11, r7, &runtime, TAG_OBJECT); | 1704 __ Allocate(r11, r3, r11, r7, &runtime, TAG_OBJECT); |
1705 | 1705 |
1706 // r3 = address of new object(s) (tagged) | 1706 // r3 = address of new object(s) (tagged) |
1707 // r5 = argument count (smi-tagged) | 1707 // r5 = argument count (smi-tagged) |
1708 // Get the arguments boilerplate from the current native context into r4. | 1708 // Get the arguments boilerplate from the current native context into r4. |
1709 const int kNormalOffset = | 1709 const int kNormalOffset = |
1710 Context::SlotOffset(Context::SLOPPY_ARGUMENTS_MAP_INDEX); | 1710 Context::SlotOffset(Context::SLOPPY_ARGUMENTS_MAP_INDEX); |
1711 const int kAliasedOffset = | 1711 const int kAliasedOffset = |
(...skipping 18 matching lines...) Expand all Loading... |
1730 // r3 = address of new object (tagged) | 1730 // r3 = address of new object (tagged) |
1731 // r5 = argument count (smi-tagged) | 1731 // r5 = argument count (smi-tagged) |
1732 // r7 = address of arguments map (tagged) | 1732 // r7 = address of arguments map (tagged) |
1733 // r9 = mapped parameter count (tagged) | 1733 // r9 = mapped parameter count (tagged) |
1734 __ StoreP(r7, FieldMemOperand(r3, JSObject::kMapOffset), r0); | 1734 __ StoreP(r7, FieldMemOperand(r3, JSObject::kMapOffset), r0); |
1735 __ LoadRoot(r11, Heap::kEmptyFixedArrayRootIndex); | 1735 __ LoadRoot(r11, Heap::kEmptyFixedArrayRootIndex); |
1736 __ StoreP(r11, FieldMemOperand(r3, JSObject::kPropertiesOffset), r0); | 1736 __ StoreP(r11, FieldMemOperand(r3, JSObject::kPropertiesOffset), r0); |
1737 __ StoreP(r11, FieldMemOperand(r3, JSObject::kElementsOffset), r0); | 1737 __ StoreP(r11, FieldMemOperand(r3, JSObject::kElementsOffset), r0); |
1738 | 1738 |
1739 // Set up the callee in-object property. | 1739 // Set up the callee in-object property. |
1740 STATIC_ASSERT(Heap::kArgumentsCalleeIndex == 1); | |
1741 __ AssertNotSmi(r4); | 1740 __ AssertNotSmi(r4); |
1742 const int kCalleeOffset = | 1741 __ StoreP(r4, FieldMemOperand(r3, JSSloppyArgumentsObject::kCalleeOffset), |
1743 JSObject::kHeaderSize + Heap::kArgumentsCalleeIndex * kPointerSize; | 1742 r0); |
1744 __ StoreP(r4, FieldMemOperand(r3, kCalleeOffset), r0); | |
1745 | 1743 |
1746 // Use the length (smi tagged) and set that as an in-object property too. | 1744 // Use the length (smi tagged) and set that as an in-object property too. |
1747 __ AssertSmi(r8); | 1745 __ AssertSmi(r8); |
1748 STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0); | 1746 __ StoreP(r8, FieldMemOperand(r3, JSSloppyArgumentsObject::kLengthOffset), |
1749 const int kLengthOffset = | 1747 r0); |
1750 JSObject::kHeaderSize + Heap::kArgumentsLengthIndex * kPointerSize; | |
1751 __ StoreP(r8, FieldMemOperand(r3, kLengthOffset), r0); | |
1752 | 1748 |
1753 // Set up the elements pointer in the allocated arguments object. | 1749 // Set up the elements pointer in the allocated arguments object. |
1754 // If we allocated a parameter map, r7 will point there, otherwise | 1750 // If we allocated a parameter map, r7 will point there, otherwise |
1755 // it will point to the backing store. | 1751 // it will point to the backing store. |
1756 __ addi(r7, r3, Operand(Heap::kSloppyArgumentsObjectSize)); | 1752 __ addi(r7, r3, Operand(JSSloppyArgumentsObject::kSize)); |
1757 __ StoreP(r7, FieldMemOperand(r3, JSObject::kElementsOffset), r0); | 1753 __ StoreP(r7, FieldMemOperand(r3, JSObject::kElementsOffset), r0); |
1758 | 1754 |
1759 // r3 = address of new object (tagged) | 1755 // r3 = address of new object (tagged) |
1760 // r5 = argument count (tagged) | 1756 // r5 = argument count (tagged) |
1761 // r7 = address of parameter map or backing store (tagged) | 1757 // r7 = address of parameter map or backing store (tagged) |
1762 // r9 = mapped parameter count (tagged) | 1758 // r9 = mapped parameter count (tagged) |
1763 // Initialize parameter map. If there are no mapped arguments, we're done. | 1759 // Initialize parameter map. If there are no mapped arguments, we're done. |
1764 Label skip_parameter_map; | 1760 Label skip_parameter_map; |
1765 __ CmpSmiLiteral(r9, Smi::FromInt(0), r0); | 1761 __ CmpSmiLiteral(r9, Smi::FromInt(0), r0); |
1766 if (CpuFeatures::IsSupported(ISELECT)) { | 1762 if (CpuFeatures::IsSupported(ISELECT)) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1818 __ addi(r10, r10, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 1814 __ addi(r10, r10, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
1819 __ addi(r8, r8, Operand(kParameterMapHeaderSize - kHeapObjectTag)); | 1815 __ addi(r8, r8, Operand(kParameterMapHeaderSize - kHeapObjectTag)); |
1820 | 1816 |
1821 __ bind(¶meters_loop); | 1817 __ bind(¶meters_loop); |
1822 __ StorePU(r11, MemOperand(r8, -kPointerSize)); | 1818 __ StorePU(r11, MemOperand(r8, -kPointerSize)); |
1823 __ StorePU(ip, MemOperand(r10, -kPointerSize)); | 1819 __ StorePU(ip, MemOperand(r10, -kPointerSize)); |
1824 __ AddSmiLiteral(r11, r11, Smi::FromInt(1), r0); | 1820 __ AddSmiLiteral(r11, r11, Smi::FromInt(1), r0); |
1825 __ bdnz(¶meters_loop); | 1821 __ bdnz(¶meters_loop); |
1826 | 1822 |
1827 // Restore r8 = argument count (tagged). | 1823 // Restore r8 = argument count (tagged). |
1828 __ LoadP(r8, FieldMemOperand(r3, kLengthOffset)); | 1824 __ LoadP(r8, FieldMemOperand(r3, JSSloppyArgumentsObject::kLengthOffset)); |
1829 | 1825 |
1830 __ bind(&skip_parameter_map); | 1826 __ bind(&skip_parameter_map); |
1831 // r3 = address of new object (tagged) | 1827 // r3 = address of new object (tagged) |
1832 // r4 = address of backing store (tagged) | 1828 // r4 = address of backing store (tagged) |
1833 // r8 = argument count (tagged) | 1829 // r8 = argument count (tagged) |
1834 // r9 = mapped parameter count (tagged) | 1830 // r9 = mapped parameter count (tagged) |
1835 // r11 = scratch | 1831 // r11 = scratch |
1836 // Copy arguments header and remaining slots (if there are any). | 1832 // Copy arguments header and remaining slots (if there are any). |
1837 __ LoadRoot(r11, Heap::kFixedArrayMapRootIndex); | 1833 __ LoadRoot(r11, Heap::kFixedArrayMapRootIndex); |
1838 __ StoreP(r11, FieldMemOperand(r4, FixedArray::kMapOffset), r0); | 1834 __ StoreP(r11, FieldMemOperand(r4, FixedArray::kMapOffset), r0); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1882 | 1878 |
1883 // Perform tail call to the entry. | 1879 // Perform tail call to the entry. |
1884 __ TailCallRuntime(Runtime::kLoadElementWithInterceptor); | 1880 __ TailCallRuntime(Runtime::kLoadElementWithInterceptor); |
1885 | 1881 |
1886 __ bind(&slow); | 1882 __ bind(&slow); |
1887 PropertyAccessCompiler::TailCallBuiltin( | 1883 PropertyAccessCompiler::TailCallBuiltin( |
1888 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); | 1884 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); |
1889 } | 1885 } |
1890 | 1886 |
1891 | 1887 |
1892 void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) { | |
1893 // r4 : function | |
1894 // r5 : number of parameters (tagged) | |
1895 // r6 : parameters pointer | |
1896 | |
1897 DCHECK(r4.is(ArgumentsAccessNewDescriptor::function())); | |
1898 DCHECK(r5.is(ArgumentsAccessNewDescriptor::parameter_count())); | |
1899 DCHECK(r6.is(ArgumentsAccessNewDescriptor::parameter_pointer())); | |
1900 | |
1901 // Check if the calling frame is an arguments adaptor frame. | |
1902 Label try_allocate, runtime; | |
1903 __ LoadP(r7, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | |
1904 __ LoadP(r3, MemOperand(r7, StandardFrameConstants::kContextOffset)); | |
1905 __ CmpSmiLiteral(r3, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); | |
1906 __ bne(&try_allocate); | |
1907 | |
1908 // Patch the arguments.length and the parameters pointer. | |
1909 __ LoadP(r5, MemOperand(r7, ArgumentsAdaptorFrameConstants::kLengthOffset)); | |
1910 __ SmiToPtrArrayOffset(r6, r5); | |
1911 __ add(r6, r6, r7); | |
1912 __ addi(r6, r6, Operand(StandardFrameConstants::kCallerSPOffset)); | |
1913 | |
1914 // Try the new space allocation. Start out with computing the size | |
1915 // of the arguments object and the elements array in words. | |
1916 Label add_arguments_object; | |
1917 __ bind(&try_allocate); | |
1918 __ SmiUntag(r11, r5, SetRC); | |
1919 __ beq(&add_arguments_object, cr0); | |
1920 __ addi(r11, r11, Operand(FixedArray::kHeaderSize / kPointerSize)); | |
1921 __ bind(&add_arguments_object); | |
1922 __ addi(r11, r11, Operand(Heap::kStrictArgumentsObjectSize / kPointerSize)); | |
1923 | |
1924 // Do the allocation of both objects in one go. | |
1925 __ Allocate(r11, r3, r7, r8, &runtime, | |
1926 static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS)); | |
1927 | |
1928 // Get the arguments boilerplate from the current native context. | |
1929 __ LoadNativeContextSlot(Context::STRICT_ARGUMENTS_MAP_INDEX, r7); | |
1930 | |
1931 __ StoreP(r7, FieldMemOperand(r3, JSObject::kMapOffset), r0); | |
1932 __ LoadRoot(r8, Heap::kEmptyFixedArrayRootIndex); | |
1933 __ StoreP(r8, FieldMemOperand(r3, JSObject::kPropertiesOffset), r0); | |
1934 __ StoreP(r8, FieldMemOperand(r3, JSObject::kElementsOffset), r0); | |
1935 | |
1936 // Get the length (smi tagged) and set that as an in-object property too. | |
1937 STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0); | |
1938 __ AssertSmi(r5); | |
1939 __ StoreP(r5, | |
1940 FieldMemOperand(r3, JSObject::kHeaderSize + | |
1941 Heap::kArgumentsLengthIndex * kPointerSize), | |
1942 r0); | |
1943 | |
1944 // If there are no actual arguments, we're done. | |
1945 __ SmiUntag(r9, r5, SetRC); | |
1946 __ Ret(eq, cr0); | |
1947 | |
1948 // Set up the elements pointer in the allocated arguments object and | |
1949 // initialize the header in the elements fixed array. | |
1950 __ addi(r7, r3, Operand(Heap::kStrictArgumentsObjectSize)); | |
1951 __ StoreP(r7, FieldMemOperand(r3, JSObject::kElementsOffset), r0); | |
1952 __ LoadRoot(r8, Heap::kFixedArrayMapRootIndex); | |
1953 __ StoreP(r8, FieldMemOperand(r7, FixedArray::kMapOffset), r0); | |
1954 __ StoreP(r5, FieldMemOperand(r7, FixedArray::kLengthOffset), r0); | |
1955 | |
1956 // Copy the fixed array slots. | |
1957 Label loop; | |
1958 // Set up r7 to point just prior to the first array slot. | |
1959 __ addi(r7, r7, | |
1960 Operand(FixedArray::kHeaderSize - kHeapObjectTag - kPointerSize)); | |
1961 __ mtctr(r9); | |
1962 __ bind(&loop); | |
1963 // Pre-decrement r6 with kPointerSize on each iteration. | |
1964 // Pre-decrement in order to skip receiver. | |
1965 __ LoadPU(r8, MemOperand(r6, -kPointerSize)); | |
1966 // Pre-increment r7 with kPointerSize on each iteration. | |
1967 __ StorePU(r8, MemOperand(r7, kPointerSize)); | |
1968 __ bdnz(&loop); | |
1969 | |
1970 // Return. | |
1971 __ Ret(); | |
1972 | |
1973 // Do the runtime call to allocate the arguments object. | |
1974 __ bind(&runtime); | |
1975 __ Push(r4, r6, r5); | |
1976 __ TailCallRuntime(Runtime::kNewStrictArguments); | |
1977 } | |
1978 | |
1979 | |
1980 void RegExpExecStub::Generate(MacroAssembler* masm) { | 1888 void RegExpExecStub::Generate(MacroAssembler* masm) { |
1981 // Just jump directly to runtime if native RegExp is not selected at compile | 1889 // Just jump directly to runtime if native RegExp is not selected at compile |
1982 // time or if regexp entry in generated code is turned off runtime switch or | 1890 // time or if regexp entry in generated code is turned off runtime switch or |
1983 // at compilation. | 1891 // at compilation. |
1984 #ifdef V8_INTERPRETED_REGEXP | 1892 #ifdef V8_INTERPRETED_REGEXP |
1985 __ TailCallRuntime(Runtime::kRegExpExec); | 1893 __ TailCallRuntime(Runtime::kRegExpExec); |
1986 #else // V8_INTERPRETED_REGEXP | 1894 #else // V8_INTERPRETED_REGEXP |
1987 | 1895 |
1988 // Stack frame on entry. | 1896 // Stack frame on entry. |
1989 // sp[0]: last_match_info (expected JSArray) | 1897 // sp[0]: last_match_info (expected JSArray) |
(...skipping 3279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5269 __ StoreP(r3, MemOperand(r7, JSArray::kLengthOffset)); | 5177 __ StoreP(r3, MemOperand(r7, JSArray::kLengthOffset)); |
5270 STATIC_ASSERT(JSArray::kSize == 4 * kPointerSize); | 5178 STATIC_ASSERT(JSArray::kSize == 4 * kPointerSize); |
5271 __ addi(r3, r7, Operand(kHeapObjectTag)); | 5179 __ addi(r3, r7, Operand(kHeapObjectTag)); |
5272 __ Ret(); | 5180 __ Ret(); |
5273 | 5181 |
5274 // Fall back to %AllocateInNewSpace. | 5182 // Fall back to %AllocateInNewSpace. |
5275 __ bind(&allocate); | 5183 __ bind(&allocate); |
5276 { | 5184 { |
5277 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 5185 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
5278 __ SmiTag(r4); | 5186 __ SmiTag(r4); |
5279 __ Push(r3, r5, r9, r4); | 5187 __ Push(r3, r5, r4); |
5280 __ CallRuntime(Runtime::kAllocateInNewSpace); | 5188 __ CallRuntime(Runtime::kAllocateInNewSpace); |
5281 __ mr(r6, r3); | 5189 __ mr(r6, r3); |
5282 __ Pop(r3, r5, r9); | 5190 __ Pop(r3, r5); |
5283 } | 5191 } |
5284 __ b(&done_allocate); | 5192 __ b(&done_allocate); |
5285 } | 5193 } |
5286 } | 5194 } |
5287 | 5195 |
| 5196 void FastNewStrictArgumentsStub::Generate(MacroAssembler* masm) { |
| 5197 // ----------- S t a t e ------------- |
| 5198 // -- r4 : function |
| 5199 // -- cp : context |
| 5200 // -- fp : frame pointer |
| 5201 // -- lr : return address |
| 5202 // ----------------------------------- |
| 5203 __ AssertFunction(r4); |
| 5204 |
| 5205 // For Ignition we need to skip all possible handler/stub frames until |
| 5206 // we reach the JavaScript frame for the function (similar to what the |
| 5207 // runtime fallback implementation does). So make r5 point to that |
| 5208 // JavaScript frame. |
| 5209 { |
| 5210 Label loop, loop_entry; |
| 5211 __ mr(r5, fp); |
| 5212 __ b(&loop_entry); |
| 5213 __ bind(&loop); |
| 5214 __ LoadP(r5, MemOperand(r5, StandardFrameConstants::kCallerFPOffset)); |
| 5215 __ bind(&loop_entry); |
| 5216 __ LoadP(ip, MemOperand(r5, StandardFrameConstants::kMarkerOffset)); |
| 5217 __ cmp(ip, r4); |
| 5218 __ bne(&loop); |
| 5219 } |
| 5220 |
| 5221 // Check if we have an arguments adaptor frame below the function frame. |
| 5222 Label arguments_adaptor, arguments_done; |
| 5223 __ LoadP(r6, MemOperand(r5, StandardFrameConstants::kCallerFPOffset)); |
| 5224 __ LoadP(ip, MemOperand(r6, StandardFrameConstants::kContextOffset)); |
| 5225 __ CmpSmiLiteral(ip, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); |
| 5226 __ beq(&arguments_adaptor); |
| 5227 { |
| 5228 __ LoadP(r4, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
| 5229 __ LoadWordArith( |
| 5230 r3, |
| 5231 FieldMemOperand(r4, SharedFunctionInfo::kFormalParameterCountOffset)); |
| 5232 #if V8_TARGET_ARCH_PPC64 |
| 5233 __ SmiTag(r3); |
| 5234 #endif |
| 5235 __ SmiToPtrArrayOffset(r9, r3); |
| 5236 __ add(r5, r5, r9); |
| 5237 } |
| 5238 __ b(&arguments_done); |
| 5239 __ bind(&arguments_adaptor); |
| 5240 { |
| 5241 __ LoadP(r3, MemOperand(r6, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 5242 __ SmiToPtrArrayOffset(r9, r3); |
| 5243 __ add(r5, r6, r9); |
| 5244 } |
| 5245 __ bind(&arguments_done); |
| 5246 __ addi(r5, r5, Operand(StandardFrameConstants::kCallerSPOffset)); |
| 5247 |
| 5248 // ----------- S t a t e ------------- |
| 5249 // -- cp : context |
| 5250 // -- r3 : number of rest parameters (tagged) |
| 5251 // -- r5 : pointer just past first rest parameters |
| 5252 // -- r9 : size of rest parameters |
| 5253 // -- lr : return address |
| 5254 // ----------------------------------- |
| 5255 |
| 5256 // Allocate space for the strict arguments object plus the backing store. |
| 5257 Label allocate, done_allocate; |
| 5258 __ mov(r4, Operand(JSStrictArgumentsObject::kSize + FixedArray::kHeaderSize)); |
| 5259 __ add(r4, r4, r9); |
| 5260 __ Allocate(r4, r6, r7, r8, &allocate, TAG_OBJECT); |
| 5261 __ bind(&done_allocate); |
| 5262 |
| 5263 // Setup the elements array in r6. |
| 5264 __ LoadRoot(r4, Heap::kFixedArrayMapRootIndex); |
| 5265 __ StoreP(r4, FieldMemOperand(r6, FixedArray::kMapOffset), r0); |
| 5266 __ StoreP(r3, FieldMemOperand(r6, FixedArray::kLengthOffset), r0); |
| 5267 __ addi(r7, r6, |
| 5268 Operand(FixedArray::kHeaderSize - kHeapObjectTag - kPointerSize)); |
| 5269 { |
| 5270 Label loop, done_loop; |
| 5271 __ SmiUntag(r0, r3, SetRC); |
| 5272 __ beq(&done_loop, cr0); |
| 5273 __ mtctr(r0); |
| 5274 __ bind(&loop); |
| 5275 __ LoadPU(ip, MemOperand(r5, -kPointerSize)); |
| 5276 __ StorePU(ip, MemOperand(r7, kPointerSize)); |
| 5277 __ bdnz(&loop); |
| 5278 __ bind(&done_loop); |
| 5279 __ addi(r7, r7, Operand(kPointerSize)); |
| 5280 } |
| 5281 |
| 5282 // Setup the rest parameter array in r7. |
| 5283 __ LoadNativeContextSlot(Context::STRICT_ARGUMENTS_MAP_INDEX, r4); |
| 5284 __ StoreP(r4, MemOperand(r7, JSStrictArgumentsObject::kMapOffset)); |
| 5285 __ LoadRoot(r4, Heap::kEmptyFixedArrayRootIndex); |
| 5286 __ StoreP(r4, MemOperand(r7, JSStrictArgumentsObject::kPropertiesOffset)); |
| 5287 __ StoreP(r6, MemOperand(r7, JSStrictArgumentsObject::kElementsOffset)); |
| 5288 __ StoreP(r3, MemOperand(r7, JSStrictArgumentsObject::kLengthOffset)); |
| 5289 STATIC_ASSERT(JSStrictArgumentsObject::kSize == 4 * kPointerSize); |
| 5290 __ addi(r3, r7, Operand(kHeapObjectTag)); |
| 5291 __ Ret(); |
| 5292 |
| 5293 // Fall back to %AllocateInNewSpace. |
| 5294 __ bind(&allocate); |
| 5295 { |
| 5296 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
| 5297 __ SmiTag(r4); |
| 5298 __ Push(r3, r5, r4); |
| 5299 __ CallRuntime(Runtime::kAllocateInNewSpace); |
| 5300 __ mr(r6, r3); |
| 5301 __ Pop(r3, r5); |
| 5302 } |
| 5303 __ b(&done_allocate); |
| 5304 } |
| 5305 |
5288 void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) { | 5306 void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) { |
5289 Register context = cp; | 5307 Register context = cp; |
5290 Register result = r3; | 5308 Register result = r3; |
5291 Register slot = r5; | 5309 Register slot = r5; |
5292 | 5310 |
5293 // Go up the context chain to the script context. | 5311 // Go up the context chain to the script context. |
5294 for (int i = 0; i < depth(); ++i) { | 5312 for (int i = 0; i < depth(); ++i) { |
5295 __ LoadP(result, ContextMemOperand(context, Context::PREVIOUS_INDEX)); | 5313 __ LoadP(result, ContextMemOperand(context, Context::PREVIOUS_INDEX)); |
5296 context = result; | 5314 context = result; |
5297 } | 5315 } |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5808 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5826 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5809 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5827 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5810 } | 5828 } |
5811 | 5829 |
5812 | 5830 |
5813 #undef __ | 5831 #undef __ |
5814 } // namespace internal | 5832 } // namespace internal |
5815 } // namespace v8 | 5833 } // namespace v8 |
5816 | 5834 |
5817 #endif // V8_TARGET_ARCH_PPC | 5835 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |