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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 4253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4264 Label allocate, done_allocate; | 4264 Label allocate, done_allocate; |
4265 __ Allocate(JSArray::kSize, x0, x1, x2, &allocate, NO_ALLOCATION_FLAGS); | 4265 __ Allocate(JSArray::kSize, x0, x1, x2, &allocate, NO_ALLOCATION_FLAGS); |
4266 __ Bind(&done_allocate); | 4266 __ Bind(&done_allocate); |
4267 | 4267 |
4268 // Setup the rest parameter array in x0. | 4268 // Setup the rest parameter array in x0. |
4269 __ LoadNativeContextSlot(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, x1); | 4269 __ LoadNativeContextSlot(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, x1); |
4270 __ Str(x1, FieldMemOperand(x0, JSArray::kMapOffset)); | 4270 __ Str(x1, FieldMemOperand(x0, JSArray::kMapOffset)); |
4271 __ LoadRoot(x1, Heap::kEmptyFixedArrayRootIndex); | 4271 __ LoadRoot(x1, Heap::kEmptyFixedArrayRootIndex); |
4272 __ Str(x1, FieldMemOperand(x0, JSArray::kPropertiesOffset)); | 4272 __ Str(x1, FieldMemOperand(x0, JSArray::kPropertiesOffset)); |
4273 __ Str(x1, FieldMemOperand(x0, JSArray::kElementsOffset)); | 4273 __ Str(x1, FieldMemOperand(x0, JSArray::kElementsOffset)); |
4274 __ Mov(x1, Smi::kZero); | 4274 __ Mov(x1, Smi::FromInt(0)); |
4275 __ Str(x1, FieldMemOperand(x0, JSArray::kLengthOffset)); | 4275 __ Str(x1, FieldMemOperand(x0, JSArray::kLengthOffset)); |
4276 STATIC_ASSERT(JSArray::kSize == 4 * kPointerSize); | 4276 STATIC_ASSERT(JSArray::kSize == 4 * kPointerSize); |
4277 __ Ret(); | 4277 __ Ret(); |
4278 | 4278 |
4279 // Fall back to %AllocateInNewSpace. | 4279 // Fall back to %AllocateInNewSpace. |
4280 __ Bind(&allocate); | 4280 __ Bind(&allocate); |
4281 { | 4281 { |
4282 FrameScope scope(masm, StackFrame::INTERNAL); | 4282 FrameScope scope(masm, StackFrame::INTERNAL); |
4283 __ Push(Smi::FromInt(JSArray::kSize)); | 4283 __ Push(Smi::FromInt(JSArray::kSize)); |
4284 __ CallRuntime(Runtime::kAllocateInNewSpace); | 4284 __ CallRuntime(Runtime::kAllocateInNewSpace); |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5195 Register scratch2 = x5; | 5195 Register scratch2 = x5; |
5196 Register scratch3 = x6; | 5196 Register scratch3 = x6; |
5197 DCHECK(!AreAliased(receiver, holder, callback, scratch)); | 5197 DCHECK(!AreAliased(receiver, holder, callback, scratch)); |
5198 | 5198 |
5199 __ Push(receiver); | 5199 __ Push(receiver); |
5200 | 5200 |
5201 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); | 5201 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); |
5202 __ Mov(scratch2, Operand(ExternalReference::isolate_address(isolate()))); | 5202 __ Mov(scratch2, Operand(ExternalReference::isolate_address(isolate()))); |
5203 __ Ldr(scratch3, FieldMemOperand(callback, AccessorInfo::kDataOffset)); | 5203 __ Ldr(scratch3, FieldMemOperand(callback, AccessorInfo::kDataOffset)); |
5204 __ Push(scratch3, scratch, scratch, scratch2, holder); | 5204 __ Push(scratch3, scratch, scratch, scratch2, holder); |
5205 __ Push(Smi::kZero); // should_throw_on_error -> false | 5205 __ Push(Smi::FromInt(0)); // should_throw_on_error -> false |
5206 __ Ldr(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset)); | 5206 __ Ldr(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset)); |
5207 __ Push(scratch); | 5207 __ Push(scratch); |
5208 | 5208 |
5209 // v8::PropertyCallbackInfo::args_ array and name handle. | 5209 // v8::PropertyCallbackInfo::args_ array and name handle. |
5210 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; | 5210 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; |
5211 | 5211 |
5212 // Load address of v8::PropertyAccessorInfo::args_ array and name handle. | 5212 // Load address of v8::PropertyAccessorInfo::args_ array and name handle. |
5213 __ Mov(x0, masm->StackPointer()); // x0 = Handle<Name> | 5213 __ Mov(x0, masm->StackPointer()); // x0 = Handle<Name> |
5214 __ Add(x1, x0, 1 * kPointerSize); // x1 = v8::PCI::args_ | 5214 __ Add(x1, x0, 1 * kPointerSize); // x1 = v8::PCI::args_ |
5215 | 5215 |
(...skipping 28 matching lines...) Expand all Loading... |
5244 kStackUnwindSpace, NULL, spill_offset, | 5244 kStackUnwindSpace, NULL, spill_offset, |
5245 return_value_operand, NULL); | 5245 return_value_operand, NULL); |
5246 } | 5246 } |
5247 | 5247 |
5248 #undef __ | 5248 #undef __ |
5249 | 5249 |
5250 } // namespace internal | 5250 } // namespace internal |
5251 } // namespace v8 | 5251 } // namespace v8 |
5252 | 5252 |
5253 #endif // V8_TARGET_ARCH_ARM64 | 5253 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |