Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(696)

Side by Side Diff: src/arm64/code-stubs-arm64.cc

Issue 2028633002: Provide a tagged allocation top pointer. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 4677 matching lines...) Expand 10 before | Expand all | Expand 10 after
4688 4688
4689 // Fall back to runtime if the target differs from the new target's 4689 // Fall back to runtime if the target differs from the new target's
4690 // initial map constructor. 4690 // initial map constructor.
4691 __ Ldr(x0, FieldMemOperand(x2, Map::kConstructorOrBackPointerOffset)); 4691 __ Ldr(x0, FieldMemOperand(x2, Map::kConstructorOrBackPointerOffset));
4692 __ CompareAndBranch(x0, x1, ne, &new_object); 4692 __ CompareAndBranch(x0, x1, ne, &new_object);
4693 4693
4694 // Allocate the JSObject on the heap. 4694 // Allocate the JSObject on the heap.
4695 Label allocate, done_allocate; 4695 Label allocate, done_allocate;
4696 __ Ldrb(x4, FieldMemOperand(x2, Map::kInstanceSizeOffset)); 4696 __ Ldrb(x4, FieldMemOperand(x2, Map::kInstanceSizeOffset));
4697 __ Allocate(x4, x0, x5, x6, &allocate, SIZE_IN_WORDS); 4697 __ Allocate(x4, x0, x5, x6, &allocate, SIZE_IN_WORDS);
4698 __ Sub(x5, x5, Operand(kHeapObjectTag)); // Untag result end.
4698 __ Bind(&done_allocate); 4699 __ Bind(&done_allocate);
4699 4700
4700 // Initialize the JSObject fields. 4701 // Initialize the JSObject fields.
4701 STATIC_ASSERT(JSObject::kMapOffset == 0 * kPointerSize); 4702 STATIC_ASSERT(JSObject::kMapOffset == 0 * kPointerSize);
4702 __ Str(x2, FieldMemOperand(x0, JSObject::kMapOffset)); 4703 __ Str(x2, FieldMemOperand(x0, JSObject::kMapOffset));
4703 __ LoadRoot(x3, Heap::kEmptyFixedArrayRootIndex); 4704 __ LoadRoot(x3, Heap::kEmptyFixedArrayRootIndex);
4704 STATIC_ASSERT(JSObject::kPropertiesOffset == 1 * kPointerSize); 4705 STATIC_ASSERT(JSObject::kPropertiesOffset == 1 * kPointerSize);
4705 STATIC_ASSERT(JSObject::kElementsOffset == 2 * kPointerSize); 4706 STATIC_ASSERT(JSObject::kElementsOffset == 2 * kPointerSize);
4706 __ Str(x3, FieldMemOperand(x0, JSObject::kPropertiesOffset)); 4707 __ Str(x3, FieldMemOperand(x0, JSObject::kPropertiesOffset));
4707 __ Str(x3, FieldMemOperand(x0, JSObject::kElementsOffset)); 4708 __ Str(x3, FieldMemOperand(x0, JSObject::kElementsOffset));
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
4835 __ Bind(&no_rest_parameters); 4836 __ Bind(&no_rest_parameters);
4836 { 4837 {
4837 // ----------- S t a t e ------------- 4838 // ----------- S t a t e -------------
4838 // -- cp : context 4839 // -- cp : context
4839 // -- lr : return address 4840 // -- lr : return address
4840 // ----------------------------------- 4841 // -----------------------------------
4841 4842
4842 // Allocate an empty rest parameter array. 4843 // Allocate an empty rest parameter array.
4843 Label allocate, done_allocate; 4844 Label allocate, done_allocate;
4844 __ Allocate(JSArray::kSize, x0, x1, x2, &allocate, NO_ALLOCATION_FLAGS); 4845 __ Allocate(JSArray::kSize, x0, x1, x2, &allocate, NO_ALLOCATION_FLAGS);
4846 __ Sub(x1, x1, Operand(kHeapObjectTag)); // Untag result end.
4845 __ Bind(&done_allocate); 4847 __ Bind(&done_allocate);
4846 4848
4847 // Setup the rest parameter array in x0. 4849 // Setup the rest parameter array in x0.
4848 __ LoadNativeContextSlot(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, x1); 4850 __ LoadNativeContextSlot(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, x1);
4849 __ Str(x1, FieldMemOperand(x0, JSArray::kMapOffset)); 4851 __ Str(x1, FieldMemOperand(x0, JSArray::kMapOffset));
4850 __ LoadRoot(x1, Heap::kEmptyFixedArrayRootIndex); 4852 __ LoadRoot(x1, Heap::kEmptyFixedArrayRootIndex);
4851 __ Str(x1, FieldMemOperand(x0, JSArray::kPropertiesOffset)); 4853 __ Str(x1, FieldMemOperand(x0, JSArray::kPropertiesOffset));
4852 __ Str(x1, FieldMemOperand(x0, JSArray::kElementsOffset)); 4854 __ Str(x1, FieldMemOperand(x0, JSArray::kElementsOffset));
4853 __ Mov(x1, Smi::FromInt(0)); 4855 __ Mov(x1, Smi::FromInt(0));
4854 __ Str(x1, FieldMemOperand(x0, JSArray::kLengthOffset)); 4856 __ Str(x1, FieldMemOperand(x0, JSArray::kLengthOffset));
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
5834 kStackUnwindSpace, NULL, spill_offset, 5836 kStackUnwindSpace, NULL, spill_offset,
5835 return_value_operand, NULL); 5837 return_value_operand, NULL);
5836 } 5838 }
5837 5839
5838 #undef __ 5840 #undef __
5839 5841
5840 } // namespace internal 5842 } // namespace internal
5841 } // namespace v8 5843 } // namespace v8
5842 5844
5843 #endif // V8_TARGET_ARCH_ARM64 5845 #endif // V8_TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698