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

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

Issue 2028633002: Provide a tagged allocation top pointer. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: WIP: adding a few tests. 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 | « src/ia32/macro-assembler-ia32.cc ('k') | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »
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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 4496 matching lines...) Expand 10 before | Expand all | Expand 10 after
4507 4507
4508 // Fall back to runtime if the target differs from the new target's 4508 // Fall back to runtime if the target differs from the new target's
4509 // initial map constructor. 4509 // initial map constructor.
4510 __ lw(a0, FieldMemOperand(a2, Map::kConstructorOrBackPointerOffset)); 4510 __ lw(a0, FieldMemOperand(a2, Map::kConstructorOrBackPointerOffset));
4511 __ Branch(&new_object, ne, a0, Operand(a1)); 4511 __ Branch(&new_object, ne, a0, Operand(a1));
4512 4512
4513 // Allocate the JSObject on the heap. 4513 // Allocate the JSObject on the heap.
4514 Label allocate, done_allocate; 4514 Label allocate, done_allocate;
4515 __ lbu(t0, FieldMemOperand(a2, Map::kInstanceSizeOffset)); 4515 __ lbu(t0, FieldMemOperand(a2, Map::kInstanceSizeOffset));
4516 __ Allocate(t0, v0, t1, a0, &allocate, SIZE_IN_WORDS); 4516 __ Allocate(t0, v0, t1, a0, &allocate, SIZE_IN_WORDS);
4517 __ Subu(t1, t1, Operand(kHeapObjectTag)); // Untag result end.
4517 __ bind(&done_allocate); 4518 __ bind(&done_allocate);
4518 4519
4519 // Initialize the JSObject fields. 4520 // Initialize the JSObject fields.
4520 __ sw(a2, FieldMemOperand(v0, JSObject::kMapOffset)); 4521 __ sw(a2, FieldMemOperand(v0, JSObject::kMapOffset));
4521 __ LoadRoot(a3, Heap::kEmptyFixedArrayRootIndex); 4522 __ LoadRoot(a3, Heap::kEmptyFixedArrayRootIndex);
4522 __ sw(a3, FieldMemOperand(v0, JSObject::kPropertiesOffset)); 4523 __ sw(a3, FieldMemOperand(v0, JSObject::kPropertiesOffset));
4523 __ sw(a3, FieldMemOperand(v0, JSObject::kElementsOffset)); 4524 __ sw(a3, FieldMemOperand(v0, JSObject::kElementsOffset));
4524 STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize); 4525 STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize);
4525 __ Addu(a1, v0, Operand(JSObject::kHeaderSize - kHeapObjectTag)); 4526 __ Addu(a1, v0, Operand(JSObject::kHeaderSize - kHeapObjectTag));
4526 4527
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
4650 __ bind(&no_rest_parameters); 4651 __ bind(&no_rest_parameters);
4651 { 4652 {
4652 // ----------- S t a t e ------------- 4653 // ----------- S t a t e -------------
4653 // -- cp : context 4654 // -- cp : context
4654 // -- ra : return address 4655 // -- ra : return address
4655 // ----------------------------------- 4656 // -----------------------------------
4656 4657
4657 // Allocate an empty rest parameter array. 4658 // Allocate an empty rest parameter array.
4658 Label allocate, done_allocate; 4659 Label allocate, done_allocate;
4659 __ Allocate(JSArray::kSize, v0, a0, a1, &allocate, NO_ALLOCATION_FLAGS); 4660 __ Allocate(JSArray::kSize, v0, a0, a1, &allocate, NO_ALLOCATION_FLAGS);
4661 __ Subu(a0, a0, Operand(kHeapObjectTag)); // Untag result end.
4660 __ bind(&done_allocate); 4662 __ bind(&done_allocate);
4661 4663
4662 // Setup the rest parameter array in v0. 4664 // Setup the rest parameter array in v0.
4663 __ LoadNativeContextSlot(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, a1); 4665 __ LoadNativeContextSlot(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, a1);
4664 __ sw(a1, FieldMemOperand(v0, JSArray::kMapOffset)); 4666 __ sw(a1, FieldMemOperand(v0, JSArray::kMapOffset));
4665 __ LoadRoot(a1, Heap::kEmptyFixedArrayRootIndex); 4667 __ LoadRoot(a1, Heap::kEmptyFixedArrayRootIndex);
4666 __ sw(a1, FieldMemOperand(v0, JSArray::kPropertiesOffset)); 4668 __ sw(a1, FieldMemOperand(v0, JSArray::kPropertiesOffset));
4667 __ sw(a1, FieldMemOperand(v0, JSArray::kElementsOffset)); 4669 __ sw(a1, FieldMemOperand(v0, JSArray::kElementsOffset));
4668 __ Move(a1, Smi::FromInt(0)); 4670 __ Move(a1, Smi::FromInt(0));
4669 __ Ret(USE_DELAY_SLOT); 4671 __ Ret(USE_DELAY_SLOT);
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
5546 kStackUnwindSpace, kInvalidStackOffset, 5548 kStackUnwindSpace, kInvalidStackOffset,
5547 return_value_operand, NULL); 5549 return_value_operand, NULL);
5548 } 5550 }
5549 5551
5550 #undef __ 5552 #undef __
5551 5553
5552 } // namespace internal 5554 } // namespace internal
5553 } // namespace v8 5555 } // namespace v8
5554 5556
5555 #endif // V8_TARGET_ARCH_MIPS 5557 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698