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

Side by Side Diff: src/arm/code-stubs-arm.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
« no previous file with comments | « no previous file | src/arm/macro-assembler-arm.cc » ('j') | src/heap/spaces.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_ARM 5 #if V8_TARGET_ARCH_ARM
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/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 4405 matching lines...) Expand 10 before | Expand all | Expand 10 after
4416 // Fall back to runtime if the target differs from the new target's 4416 // Fall back to runtime if the target differs from the new target's
4417 // initial map constructor. 4417 // initial map constructor.
4418 __ ldr(r0, FieldMemOperand(r2, Map::kConstructorOrBackPointerOffset)); 4418 __ ldr(r0, FieldMemOperand(r2, Map::kConstructorOrBackPointerOffset));
4419 __ cmp(r0, r1); 4419 __ cmp(r0, r1);
4420 __ b(ne, &new_object); 4420 __ b(ne, &new_object);
4421 4421
4422 // Allocate the JSObject on the heap. 4422 // Allocate the JSObject on the heap.
4423 Label allocate, done_allocate; 4423 Label allocate, done_allocate;
4424 __ ldrb(r4, FieldMemOperand(r2, Map::kInstanceSizeOffset)); 4424 __ ldrb(r4, FieldMemOperand(r2, Map::kInstanceSizeOffset));
4425 __ Allocate(r4, r0, r5, r6, &allocate, SIZE_IN_WORDS); 4425 __ Allocate(r4, r0, r5, r6, &allocate, SIZE_IN_WORDS);
4426 __ sub(r5, r5, Operand(kHeapObjectTag)); // Untag result end.
4426 __ bind(&done_allocate); 4427 __ bind(&done_allocate);
4427 4428
4428 // Initialize the JSObject fields. 4429 // Initialize the JSObject fields.
4429 __ str(r2, FieldMemOperand(r0, JSObject::kMapOffset)); 4430 __ str(r2, FieldMemOperand(r0, JSObject::kMapOffset));
4430 __ LoadRoot(r3, Heap::kEmptyFixedArrayRootIndex); 4431 __ LoadRoot(r3, Heap::kEmptyFixedArrayRootIndex);
4431 __ str(r3, FieldMemOperand(r0, JSObject::kPropertiesOffset)); 4432 __ str(r3, FieldMemOperand(r0, JSObject::kPropertiesOffset));
4432 __ str(r3, FieldMemOperand(r0, JSObject::kElementsOffset)); 4433 __ str(r3, FieldMemOperand(r0, JSObject::kElementsOffset));
4433 STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize); 4434 STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize);
4434 __ add(r1, r0, Operand(JSObject::kHeaderSize - kHeapObjectTag)); 4435 __ add(r1, r0, Operand(JSObject::kHeaderSize - kHeapObjectTag));
4435 4436
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
4556 __ bind(&no_rest_parameters); 4557 __ bind(&no_rest_parameters);
4557 { 4558 {
4558 // ----------- S t a t e ------------- 4559 // ----------- S t a t e -------------
4559 // -- cp : context 4560 // -- cp : context
4560 // -- lr : return address 4561 // -- lr : return address
4561 // ----------------------------------- 4562 // -----------------------------------
4562 4563
4563 // Allocate an empty rest parameter array. 4564 // Allocate an empty rest parameter array.
4564 Label allocate, done_allocate; 4565 Label allocate, done_allocate;
4565 __ Allocate(JSArray::kSize, r0, r1, r2, &allocate, NO_ALLOCATION_FLAGS); 4566 __ Allocate(JSArray::kSize, r0, r1, r2, &allocate, NO_ALLOCATION_FLAGS);
4567 __ sub(r1, r1, Operand(kHeapObjectTag)); // Untag result end.
4566 __ bind(&done_allocate); 4568 __ bind(&done_allocate);
4567 4569
4568 // Setup the rest parameter array in r0. 4570 // Setup the rest parameter array in r0.
4569 __ LoadNativeContextSlot(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, r1); 4571 __ LoadNativeContextSlot(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, r1);
4570 __ str(r1, FieldMemOperand(r0, JSArray::kMapOffset)); 4572 __ str(r1, FieldMemOperand(r0, JSArray::kMapOffset));
4571 __ LoadRoot(r1, Heap::kEmptyFixedArrayRootIndex); 4573 __ LoadRoot(r1, Heap::kEmptyFixedArrayRootIndex);
4572 __ str(r1, FieldMemOperand(r0, JSArray::kPropertiesOffset)); 4574 __ str(r1, FieldMemOperand(r0, JSArray::kPropertiesOffset));
4573 __ str(r1, FieldMemOperand(r0, JSArray::kElementsOffset)); 4575 __ str(r1, FieldMemOperand(r0, JSArray::kElementsOffset));
4574 __ mov(r1, Operand(0)); 4576 __ mov(r1, Operand(0));
4575 __ str(r1, FieldMemOperand(r0, JSArray::kLengthOffset)); 4577 __ str(r1, FieldMemOperand(r0, JSArray::kLengthOffset));
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
5438 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 5440 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
5439 kStackUnwindSpace, NULL, return_value_operand, NULL); 5441 kStackUnwindSpace, NULL, return_value_operand, NULL);
5440 } 5442 }
5441 5443
5442 #undef __ 5444 #undef __
5443 5445
5444 } // namespace internal 5446 } // namespace internal
5445 } // namespace v8 5447 } // namespace v8
5446 5448
5447 #endif // V8_TARGET_ARCH_ARM 5449 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/macro-assembler-arm.cc » ('j') | src/heap/spaces.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698