OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2116 Register global_object = x10; | 2116 Register global_object = x10; |
2117 Register global_ctx = x10; | 2117 Register global_ctx = x10; |
2118 Register args_offset = x11; | 2118 Register args_offset = x11; |
2119 Register aliased_args_offset = x10; | 2119 Register aliased_args_offset = x10; |
2120 __ Ldr(global_object, GlobalObjectMemOperand()); | 2120 __ Ldr(global_object, GlobalObjectMemOperand()); |
2121 __ Ldr(global_ctx, FieldMemOperand(global_object, | 2121 __ Ldr(global_ctx, FieldMemOperand(global_object, |
2122 GlobalObject::kNativeContextOffset)); | 2122 GlobalObject::kNativeContextOffset)); |
2123 | 2123 |
2124 __ Ldr(args_offset, | 2124 __ Ldr(args_offset, |
2125 ContextMemOperand(global_ctx, | 2125 ContextMemOperand(global_ctx, |
2126 Context::SLOPPY_ARGUMENTS_BOILERPLATE_INDEX)); | 2126 Context::SLOPPY_ARGUMENTS_MAP_INDEX)); |
2127 __ Ldr(aliased_args_offset, | 2127 __ Ldr(aliased_args_offset, |
2128 ContextMemOperand(global_ctx, | 2128 ContextMemOperand(global_ctx, |
2129 Context::ALIASED_ARGUMENTS_BOILERPLATE_INDEX)); | 2129 Context::ALIASED_ARGUMENTS_MAP_INDEX)); |
2130 __ Cmp(mapped_params, 0); | 2130 __ Cmp(mapped_params, 0); |
2131 __ CmovX(args_offset, aliased_args_offset, ne); | 2131 __ CmovX(args_offset, aliased_args_offset, ne); |
2132 | 2132 |
2133 // Copy the JS object part. | 2133 // Copy the JS object part. |
2134 __ CopyFields(alloc_obj, args_offset, CPURegList(x10, x12, x13), | 2134 __ Str(args_offset, FieldMemOperand(alloc_obj, JSObject::kMapOffset)); |
Igor Sheludko
2014/07/02 14:17:14
While you are here: args_offset and aliased_args_o
| |
2135 JSObject::kHeaderSize / kPointerSize); | 2135 __ LoadRoot(x10, Heap::kEmptyFixedArrayRootIndex); |
2136 __ Str(x10, FieldMemOperand(alloc_obj, JSObject::kPropertiesOffset)); | |
2137 __ Str(x10, FieldMemOperand(alloc_obj, JSObject::kElementsOffset)); | |
2136 | 2138 |
2137 // Set up the callee in-object property. | 2139 // Set up the callee in-object property. |
2138 STATIC_ASSERT(Heap::kArgumentsCalleeIndex == 1); | 2140 STATIC_ASSERT(Heap::kArgumentsCalleeIndex == 1); |
2139 const int kCalleeOffset = JSObject::kHeaderSize + | 2141 const int kCalleeOffset = JSObject::kHeaderSize + |
2140 Heap::kArgumentsCalleeIndex * kPointerSize; | 2142 Heap::kArgumentsCalleeIndex * kPointerSize; |
2143 __ AssertNotSmi(function); | |
2141 __ Str(function, FieldMemOperand(alloc_obj, kCalleeOffset)); | 2144 __ Str(function, FieldMemOperand(alloc_obj, kCalleeOffset)); |
2142 | 2145 |
2143 // Use the length and set that as an in-object property. | 2146 // Use the length and set that as an in-object property. |
2144 STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0); | 2147 STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0); |
2145 const int kLengthOffset = JSObject::kHeaderSize + | 2148 const int kLengthOffset = JSObject::kHeaderSize + |
2146 Heap::kArgumentsLengthIndex * kPointerSize; | 2149 Heap::kArgumentsLengthIndex * kPointerSize; |
2147 __ Str(arg_count_smi, FieldMemOperand(alloc_obj, kLengthOffset)); | 2150 __ Str(arg_count_smi, FieldMemOperand(alloc_obj, kLengthOffset)); |
2148 | 2151 |
2149 // Set up the elements pointer in the allocated arguments object. | 2152 // Set up the elements pointer in the allocated arguments object. |
2150 // If we allocated a parameter map, "elements" will point there, otherwise | 2153 // If we allocated a parameter map, "elements" will point there, otherwise |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2337 | 2340 |
2338 // Get the arguments boilerplate from the current (native) context. | 2341 // Get the arguments boilerplate from the current (native) context. |
2339 Register global_object = x10; | 2342 Register global_object = x10; |
2340 Register global_ctx = x10; | 2343 Register global_ctx = x10; |
2341 Register args_offset = x4; | 2344 Register args_offset = x4; |
2342 __ Ldr(global_object, GlobalObjectMemOperand()); | 2345 __ Ldr(global_object, GlobalObjectMemOperand()); |
2343 __ Ldr(global_ctx, FieldMemOperand(global_object, | 2346 __ Ldr(global_ctx, FieldMemOperand(global_object, |
2344 GlobalObject::kNativeContextOffset)); | 2347 GlobalObject::kNativeContextOffset)); |
2345 __ Ldr(args_offset, | 2348 __ Ldr(args_offset, |
2346 ContextMemOperand(global_ctx, | 2349 ContextMemOperand(global_ctx, |
2347 Context::STRICT_ARGUMENTS_BOILERPLATE_INDEX)); | 2350 Context::STRICT_ARGUMENTS_MAP_INDEX)); |
2348 | 2351 |
2349 // x0 alloc_obj pointer to allocated objects: parameter array and | 2352 // x0 alloc_obj pointer to allocated objects: parameter array and |
2350 // arguments object | 2353 // arguments object |
2351 // x1 param_count_smi number of parameters passed to function (smi) | 2354 // x1 param_count_smi number of parameters passed to function (smi) |
2352 // x2 params pointer to parameters | 2355 // x2 params pointer to parameters |
2353 // x3 function function pointer | 2356 // x3 function function pointer |
2354 // x4 args_offset offset to arguments boilerplate | 2357 // x4 args_offset offset to arguments boilerplate |
2355 // x13 param_count number of parameters passed to function | 2358 // x13 param_count number of parameters passed to function |
2356 | 2359 __ Str(args_offset, FieldMemOperand(alloc_obj, JSObject::kMapOffset)); |
Igor Sheludko
2014/07/02 14:17:14
Same here: strict_args_map + outdated comment abou
| |
2357 // Copy the JS object part. | 2360 __ LoadRoot(x5, Heap::kEmptyFixedArrayRootIndex); |
2358 __ CopyFields(alloc_obj, args_offset, CPURegList(x5, x6, x7), | 2361 __ Str(x5, FieldMemOperand(alloc_obj, JSObject::kPropertiesOffset)); |
2359 JSObject::kHeaderSize / kPointerSize); | 2362 __ Str(x5, FieldMemOperand(alloc_obj, JSObject::kElementsOffset)); |
2360 | 2363 |
2361 // Set the smi-tagged length as an in-object property. | 2364 // Set the smi-tagged length as an in-object property. |
2362 STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0); | 2365 STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0); |
2363 const int kLengthOffset = JSObject::kHeaderSize + | 2366 const int kLengthOffset = JSObject::kHeaderSize + |
2364 Heap::kArgumentsLengthIndex * kPointerSize; | 2367 Heap::kArgumentsLengthIndex * kPointerSize; |
2365 __ Str(param_count_smi, FieldMemOperand(alloc_obj, kLengthOffset)); | 2368 __ Str(param_count_smi, FieldMemOperand(alloc_obj, kLengthOffset)); |
2366 | 2369 |
2367 // If there are no actual arguments, we're done. | 2370 // If there are no actual arguments, we're done. |
2368 Label done; | 2371 Label done; |
2369 __ Cbz(param_count, &done); | 2372 __ Cbz(param_count, &done); |
(...skipping 3058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5428 MemOperand(fp, 6 * kPointerSize), | 5431 MemOperand(fp, 6 * kPointerSize), |
5429 NULL); | 5432 NULL); |
5430 } | 5433 } |
5431 | 5434 |
5432 | 5435 |
5433 #undef __ | 5436 #undef __ |
5434 | 5437 |
5435 } } // namespace v8::internal | 5438 } } // namespace v8::internal |
5436 | 5439 |
5437 #endif // V8_TARGET_ARCH_ARM64 | 5440 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |