Commit 2950df96 authored by bryleun's avatar bryleun Committed by Commit bot

S390: Get rid of AllocationFlags::TAG_OBJECT

Port 9bf7a31a

 Original commit message:

        Default (and only way) is now to retrieve a tagged object.

R=joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, bjaideep@ca.ibm.com

BUG=

Review-Url: https://codereview.chromium.org/1929673002
Cr-Commit-Position: refs/heads/master@{#35874}
parent 60497de2
...@@ -5255,7 +5255,7 @@ void LCodeGen::DoAllocate(LAllocate* instr) { ...@@ -5255,7 +5255,7 @@ void LCodeGen::DoAllocate(LAllocate* instr) {
Register scratch2 = ToRegister(instr->temp2()); Register scratch2 = ToRegister(instr->temp2());
// Allocate memory for the object. // Allocate memory for the object.
AllocationFlags flags = TAG_OBJECT; AllocationFlags flags = NO_ALLOCATION_FLAGS;
if (instr->hydrogen()->MustAllocateDoubleAligned()) { if (instr->hydrogen()->MustAllocateDoubleAligned()) {
flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT);
} }
......
...@@ -1825,7 +1825,8 @@ void FullCodeGenerator::EmitOperandStackDepthCheck() { ...@@ -1825,7 +1825,8 @@ void FullCodeGenerator::EmitOperandStackDepthCheck() {
void FullCodeGenerator::EmitCreateIteratorResult(bool done) { void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
Label allocate, done_allocate; Label allocate, done_allocate;
__ Allocate(JSIteratorResult::kSize, r2, r4, r5, &allocate, TAG_OBJECT); __ Allocate(JSIteratorResult::kSize, r2, r4, r5, &allocate,
NO_ALLOCATION_FLAGS);
__ b(&done_allocate); __ b(&done_allocate);
__ bind(&allocate); __ bind(&allocate);
...@@ -3098,7 +3099,8 @@ void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) { ...@@ -3098,7 +3099,8 @@ void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
Label runtime, done; Label runtime, done;
__ Allocate(JSIteratorResult::kSize, r2, r4, r5, &runtime, TAG_OBJECT); __ Allocate(JSIteratorResult::kSize, r2, r4, r5, &runtime,
NO_ALLOCATION_FLAGS);
__ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, r3); __ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, r3);
__ Pop(r4, r5); __ Pop(r4, r5);
__ LoadRoot(r6, Heap::kEmptyFixedArrayRootIndex); __ LoadRoot(r6, Heap::kEmptyFixedArrayRootIndex);
......
...@@ -4626,15 +4626,15 @@ void FastNewObjectStub::Generate(MacroAssembler* masm) { ...@@ -4626,15 +4626,15 @@ void FastNewObjectStub::Generate(MacroAssembler* masm) {
__ bind(&done_allocate); __ bind(&done_allocate);
// Initialize the JSObject fields. // Initialize the JSObject fields.
__ StoreP(r4, MemOperand(r2, JSObject::kMapOffset)); __ StoreP(r4, FieldMemOperand(r2, JSObject::kMapOffset));
__ LoadRoot(r5, Heap::kEmptyFixedArrayRootIndex); __ LoadRoot(r5, Heap::kEmptyFixedArrayRootIndex);
__ StoreP(r5, MemOperand(r2, JSObject::kPropertiesOffset)); __ StoreP(r5, FieldMemOperand(r2, JSObject::kPropertiesOffset));
__ StoreP(r5, MemOperand(r2, JSObject::kElementsOffset)); __ StoreP(r5, FieldMemOperand(r2, JSObject::kElementsOffset));
STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize); STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize);
__ AddP(r3, r2, Operand(JSObject::kHeaderSize)); __ AddP(r3, r2, Operand(JSObject::kHeaderSize - kHeapObjectTag));
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- r2 : result (untagged) // -- r2 : result (tagged)
// -- r3 : result fields (untagged) // -- r3 : result fields (untagged)
// -- r7 : result end (untagged) // -- r7 : result end (untagged)
// -- r4 : initial map // -- r4 : initial map
...@@ -4654,8 +4654,6 @@ void FastNewObjectStub::Generate(MacroAssembler* masm) { ...@@ -4654,8 +4654,6 @@ void FastNewObjectStub::Generate(MacroAssembler* masm) {
// Initialize all in-object fields with undefined. // Initialize all in-object fields with undefined.
__ InitializeFieldsWithFiller(r3, r7, r8); __ InitializeFieldsWithFiller(r3, r7, r8);
// Add the object tag to make the JSObject real.
__ AddP(r2, r2, Operand(kHeapObjectTag));
__ Ret(); __ Ret();
} }
__ bind(&slack_tracking); __ bind(&slack_tracking);
...@@ -4675,9 +4673,6 @@ void FastNewObjectStub::Generate(MacroAssembler* masm) { ...@@ -4675,9 +4673,6 @@ void FastNewObjectStub::Generate(MacroAssembler* masm) {
__ LoadRoot(r8, Heap::kOnePointerFillerMapRootIndex); __ LoadRoot(r8, Heap::kOnePointerFillerMapRootIndex);
__ InitializeFieldsWithFiller(r3, r7, r8); __ InitializeFieldsWithFiller(r3, r7, r8);
// Add the object tag to make the JSObject real.
__ AddP(r2, r2, Operand(kHeapObjectTag));
// Check if we can finalize the instance size. // Check if we can finalize the instance size.
__ CmpP(r9, Operand(Map::kSlackTrackingCounterEnd)); __ CmpP(r9, Operand(Map::kSlackTrackingCounterEnd));
__ Ret(ne); __ Ret(ne);
...@@ -4703,10 +4698,10 @@ void FastNewObjectStub::Generate(MacroAssembler* masm) { ...@@ -4703,10 +4698,10 @@ void FastNewObjectStub::Generate(MacroAssembler* masm) {
__ CallRuntime(Runtime::kAllocateInNewSpace); __ CallRuntime(Runtime::kAllocateInNewSpace);
__ Pop(r4); __ Pop(r4);
} }
__ SubP(r2, r2, Operand(kHeapObjectTag));
__ LoadlB(r7, FieldMemOperand(r4, Map::kInstanceSizeOffset)); __ LoadlB(r7, FieldMemOperand(r4, Map::kInstanceSizeOffset));
__ ShiftLeftP(r7, r7, Operand(kPointerSizeLog2)); __ ShiftLeftP(r7, r7, Operand(kPointerSizeLog2));
__ AddP(r7, r2, r7); __ AddP(r7, r2, r7);
__ SubP(r7, r7, Operand(kHeapObjectTag));
__ b(&done_allocate); __ b(&done_allocate);
// Fall back to %NewObject. // Fall back to %NewObject.
...@@ -4771,7 +4766,7 @@ void FastNewRestParameterStub::Generate(MacroAssembler* masm) { ...@@ -4771,7 +4766,7 @@ void FastNewRestParameterStub::Generate(MacroAssembler* masm) {
// Allocate an empty rest parameter array. // Allocate an empty rest parameter array.
Label allocate, done_allocate; Label allocate, done_allocate;
__ Allocate(JSArray::kSize, r2, r3, r4, &allocate, TAG_OBJECT); __ Allocate(JSArray::kSize, r2, r3, r4, &allocate, NO_ALLOCATION_FLAGS);
__ bind(&done_allocate); __ bind(&done_allocate);
// Setup the rest parameter array in r0. // Setup the rest parameter array in r0.
...@@ -4814,7 +4809,7 @@ void FastNewRestParameterStub::Generate(MacroAssembler* masm) { ...@@ -4814,7 +4809,7 @@ void FastNewRestParameterStub::Generate(MacroAssembler* masm) {
Label allocate, done_allocate; Label allocate, done_allocate;
__ mov(r3, Operand(JSArray::kSize + FixedArray::kHeaderSize)); __ mov(r3, Operand(JSArray::kSize + FixedArray::kHeaderSize));
__ AddP(r3, r3, r8); __ AddP(r3, r3, r8);
__ Allocate(r3, r5, r6, r7, &allocate, TAG_OBJECT); __ Allocate(r3, r5, r6, r7, &allocate, NO_ALLOCATION_FLAGS);
__ bind(&done_allocate); __ bind(&done_allocate);
// Setup the elements array in r5. // Setup the elements array in r5.
...@@ -4961,7 +4956,7 @@ void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) { ...@@ -4961,7 +4956,7 @@ void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) {
__ AddP(r1, r1, Operand(JSSloppyArgumentsObject::kSize)); __ AddP(r1, r1, Operand(JSSloppyArgumentsObject::kSize));
// Do the allocation of all three objects in one go. // Do the allocation of all three objects in one go.
__ Allocate(r1, r2, r1, r6, &runtime, TAG_OBJECT); __ Allocate(r1, r2, r1, r6, &runtime, NO_ALLOCATION_FLAGS);
// r2 = address of new object(s) (tagged) // r2 = address of new object(s) (tagged)
// r4 = argument count (smi-tagged) // r4 = argument count (smi-tagged)
...@@ -5179,7 +5174,7 @@ void FastNewStrictArgumentsStub::Generate(MacroAssembler* masm) { ...@@ -5179,7 +5174,7 @@ void FastNewStrictArgumentsStub::Generate(MacroAssembler* masm) {
Label allocate, done_allocate; Label allocate, done_allocate;
__ mov(r3, Operand(JSStrictArgumentsObject::kSize + FixedArray::kHeaderSize)); __ mov(r3, Operand(JSStrictArgumentsObject::kSize + FixedArray::kHeaderSize));
__ AddP(r3, r3, r8); __ AddP(r3, r3, r8);
__ Allocate(r3, r5, r6, r7, &allocate, TAG_OBJECT); __ Allocate(r3, r5, r6, r7, &allocate, NO_ALLOCATION_FLAGS);
__ bind(&done_allocate); __ bind(&done_allocate);
// Setup the elements array in r5. // Setup the elements array in r5.
......
...@@ -172,7 +172,7 @@ void ElementsTransitionGenerator::GenerateSmiToDouble( ...@@ -172,7 +172,7 @@ void ElementsTransitionGenerator::GenerateSmiToDouble(
__ SmiToDoubleArrayOffset(r14, length); __ SmiToDoubleArrayOffset(r14, length);
__ AddP(r14, Operand(FixedDoubleArray::kHeaderSize)); __ AddP(r14, Operand(FixedDoubleArray::kHeaderSize));
__ Allocate(r14, array, r9, scratch2, &gc_required, DOUBLE_ALIGNMENT); __ Allocate(r14, array, r9, scratch2, &gc_required, DOUBLE_ALIGNMENT);
__ SubP(array, array, Operand(kHeapObjectTag));
// Set destination FixedDoubleArray's length and map. // Set destination FixedDoubleArray's length and map.
__ LoadRoot(scratch2, Heap::kFixedDoubleArrayMapRootIndex); __ LoadRoot(scratch2, Heap::kFixedDoubleArrayMapRootIndex);
__ StoreP(length, MemOperand(array, FixedDoubleArray::kLengthOffset)); __ StoreP(length, MemOperand(array, FixedDoubleArray::kLengthOffset));
...@@ -302,12 +302,12 @@ void ElementsTransitionGenerator::GenerateDoubleToObject( ...@@ -302,12 +302,12 @@ void ElementsTransitionGenerator::GenerateDoubleToObject(
__ AddP(array_size, r0); __ AddP(array_size, r0);
__ Allocate(array_size, array, allocate_scratch, scratch, &gc_required, __ Allocate(array_size, array, allocate_scratch, scratch, &gc_required,
NO_ALLOCATION_FLAGS); NO_ALLOCATION_FLAGS);
// array: destination FixedArray, not tagged as heap object // array: destination FixedArray, tagged as heap object
// Set destination FixedDoubleArray's length and map. // Set destination FixedDoubleArray's length and map.
__ LoadRoot(scratch, Heap::kFixedArrayMapRootIndex); __ LoadRoot(scratch, Heap::kFixedArrayMapRootIndex);
__ StoreP(length, MemOperand(array, FixedDoubleArray::kLengthOffset)); __ StoreP(length, FieldMemOperand(array, FixedDoubleArray::kLengthOffset),
__ StoreP(scratch, MemOperand(array, HeapObject::kMapOffset)); r0);
__ AddP(array, Operand(kHeapObjectTag)); __ StoreP(scratch, FieldMemOperand(array, HeapObject::kMapOffset), r0);
// Prepare for conversion loop. // Prepare for conversion loop.
Register src_elements = elements; Register src_elements = elements;
......
...@@ -1815,10 +1815,8 @@ void MacroAssembler::Allocate(int object_size, Register result, ...@@ -1815,10 +1815,8 @@ void MacroAssembler::Allocate(int object_size, Register result,
} }
StoreP(result_end, MemOperand(top_address)); StoreP(result_end, MemOperand(top_address));
// Tag object if requested. // Tag object.
if ((flags & TAG_OBJECT) != 0) { AddP(result, result, Operand(kHeapObjectTag));
AddP(result, result, Operand(kHeapObjectTag));
}
} }
void MacroAssembler::Allocate(Register object_size, Register result, void MacroAssembler::Allocate(Register object_size, Register result,
...@@ -1915,10 +1913,8 @@ void MacroAssembler::Allocate(Register object_size, Register result, ...@@ -1915,10 +1913,8 @@ void MacroAssembler::Allocate(Register object_size, Register result,
} }
StoreP(result_end, MemOperand(top_address)); StoreP(result_end, MemOperand(top_address));
// Tag object if requested. // Tag object.
if ((flags & TAG_OBJECT) != 0) { AddP(result, result, Operand(kHeapObjectTag));
AddP(result, result, Operand(kHeapObjectTag));
}
} }
void MacroAssembler::AllocateTwoByteString(Register result, Register length, void MacroAssembler::AllocateTwoByteString(Register result, Register length,
...@@ -1935,7 +1931,8 @@ void MacroAssembler::AllocateTwoByteString(Register result, Register length, ...@@ -1935,7 +1931,8 @@ void MacroAssembler::AllocateTwoByteString(Register result, Register length,
AndP(scratch1, Operand(~kObjectAlignmentMask)); AndP(scratch1, Operand(~kObjectAlignmentMask));
// Allocate two-byte string in new space. // Allocate two-byte string in new space.
Allocate(scratch1, result, scratch2, scratch3, gc_required, TAG_OBJECT); Allocate(scratch1, result, scratch2, scratch3, gc_required,
NO_ALLOCATION_FLAGS);
// Set the map, length and hash field. // Set the map, length and hash field.
InitializeNewString(result, length, Heap::kStringMapRootIndex, scratch1, InitializeNewString(result, length, Heap::kStringMapRootIndex, scratch1,
...@@ -1955,7 +1952,8 @@ void MacroAssembler::AllocateOneByteString(Register result, Register length, ...@@ -1955,7 +1952,8 @@ void MacroAssembler::AllocateOneByteString(Register result, Register length,
AndP(scratch1, Operand(~kObjectAlignmentMask)); AndP(scratch1, Operand(~kObjectAlignmentMask));
// Allocate one-byte string in new space. // Allocate one-byte string in new space.
Allocate(scratch1, result, scratch2, scratch3, gc_required, TAG_OBJECT); Allocate(scratch1, result, scratch2, scratch3, gc_required,
NO_ALLOCATION_FLAGS);
// Set the map, length and hash field. // Set the map, length and hash field.
InitializeNewString(result, length, Heap::kOneByteStringMapRootIndex, InitializeNewString(result, length, Heap::kOneByteStringMapRootIndex,
...@@ -1967,7 +1965,7 @@ void MacroAssembler::AllocateTwoByteConsString(Register result, Register length, ...@@ -1967,7 +1965,7 @@ void MacroAssembler::AllocateTwoByteConsString(Register result, Register length,
Register scratch2, Register scratch2,
Label* gc_required) { Label* gc_required) {
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required, Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
TAG_OBJECT); NO_ALLOCATION_FLAGS);
InitializeNewString(result, length, Heap::kConsStringMapRootIndex, scratch1, InitializeNewString(result, length, Heap::kConsStringMapRootIndex, scratch1,
scratch2); scratch2);
...@@ -1978,7 +1976,7 @@ void MacroAssembler::AllocateOneByteConsString(Register result, Register length, ...@@ -1978,7 +1976,7 @@ void MacroAssembler::AllocateOneByteConsString(Register result, Register length,
Register scratch2, Register scratch2,
Label* gc_required) { Label* gc_required) {
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required, Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
TAG_OBJECT); NO_ALLOCATION_FLAGS);
InitializeNewString(result, length, Heap::kConsOneByteStringMapRootIndex, InitializeNewString(result, length, Heap::kConsOneByteStringMapRootIndex,
scratch1, scratch2); scratch1, scratch2);
...@@ -1990,7 +1988,7 @@ void MacroAssembler::AllocateTwoByteSlicedString(Register result, ...@@ -1990,7 +1988,7 @@ void MacroAssembler::AllocateTwoByteSlicedString(Register result,
Register scratch2, Register scratch2,
Label* gc_required) { Label* gc_required) {
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required, Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
TAG_OBJECT); NO_ALLOCATION_FLAGS);
InitializeNewString(result, length, Heap::kSlicedStringMapRootIndex, scratch1, InitializeNewString(result, length, Heap::kSlicedStringMapRootIndex, scratch1,
scratch2); scratch2);
...@@ -2002,7 +2000,7 @@ void MacroAssembler::AllocateOneByteSlicedString(Register result, ...@@ -2002,7 +2000,7 @@ void MacroAssembler::AllocateOneByteSlicedString(Register result,
Register scratch2, Register scratch2,
Label* gc_required) { Label* gc_required) {
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required, Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
TAG_OBJECT); NO_ALLOCATION_FLAGS);
InitializeNewString(result, length, Heap::kSlicedOneByteStringMapRootIndex, InitializeNewString(result, length, Heap::kSlicedOneByteStringMapRootIndex,
scratch1, scratch2); scratch1, scratch2);
...@@ -2969,12 +2967,11 @@ void MacroAssembler::AllocateHeapNumber(Register result, Register scratch1, ...@@ -2969,12 +2967,11 @@ void MacroAssembler::AllocateHeapNumber(Register result, Register scratch1,
Register scratch2, Register scratch2,
Register heap_number_map, Register heap_number_map,
Label* gc_required, Label* gc_required,
TaggingMode tagging_mode,
MutableMode mode) { MutableMode mode) {
// Allocate an object in the heap for the heap number and tag it as a heap // Allocate an object in the heap for the heap number and tag it as a heap
// object. // object.
Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required,
tagging_mode == TAG_RESULT ? TAG_OBJECT : NO_ALLOCATION_FLAGS); NO_ALLOCATION_FLAGS);
Heap::RootListIndex map_index = mode == MUTABLE Heap::RootListIndex map_index = mode == MUTABLE
? Heap::kMutableHeapNumberMapRootIndex ? Heap::kMutableHeapNumberMapRootIndex
...@@ -2982,11 +2979,7 @@ void MacroAssembler::AllocateHeapNumber(Register result, Register scratch1, ...@@ -2982,11 +2979,7 @@ void MacroAssembler::AllocateHeapNumber(Register result, Register scratch1,
AssertIsRoot(heap_number_map, map_index); AssertIsRoot(heap_number_map, map_index);
// Store heap number map in the allocated object. // Store heap number map in the allocated object.
if (tagging_mode == TAG_RESULT) {
StoreP(heap_number_map, FieldMemOperand(result, HeapObject::kMapOffset)); StoreP(heap_number_map, FieldMemOperand(result, HeapObject::kMapOffset));
} else {
StoreP(heap_number_map, MemOperand(result, HeapObject::kMapOffset));
}
} }
void MacroAssembler::AllocateHeapNumberWithValue( void MacroAssembler::AllocateHeapNumberWithValue(
...@@ -3005,7 +2998,8 @@ void MacroAssembler::AllocateJSValue(Register result, Register constructor, ...@@ -3005,7 +2998,8 @@ void MacroAssembler::AllocateJSValue(Register result, Register constructor,
DCHECK(!result.is(value)); DCHECK(!result.is(value));
// Allocate JSValue in new space. // Allocate JSValue in new space.
Allocate(JSValue::kSize, result, scratch1, scratch2, gc_required, TAG_OBJECT); Allocate(JSValue::kSize, result, scratch1, scratch2, gc_required,
NO_ALLOCATION_FLAGS);
// Initialize the JSValue. // Initialize the JSValue.
LoadGlobalFunctionInitialMap(constructor, scratch1, scratch2); LoadGlobalFunctionInitialMap(constructor, scratch1, scratch2);
......
...@@ -983,7 +983,6 @@ class MacroAssembler : public Assembler { ...@@ -983,7 +983,6 @@ class MacroAssembler : public Assembler {
// when control continues at the gc_required label. // when control continues at the gc_required label.
void AllocateHeapNumber(Register result, Register scratch1, Register scratch2, void AllocateHeapNumber(Register result, Register scratch1, Register scratch2,
Register heap_number_map, Label* gc_required, Register heap_number_map, Label* gc_required,
TaggingMode tagging_mode = TAG_RESULT,
MutableMode mode = IMMUTABLE); MutableMode mode = IMMUTABLE);
void AllocateHeapNumberWithValue(Register result, DoubleRegister value, void AllocateHeapNumberWithValue(Register result, DoubleRegister value,
Register scratch1, Register scratch2, Register scratch1, Register scratch2,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment