[cleanup] Drop unused Allocate*String MacroAssembler instructions
Review-Url: https://codereview.chromium.org/2580653002 Cr-Commit-Position: refs/heads/master@{#41813}
This commit is contained in:
parent
86eafdd4c0
commit
9fcceeb176
@ -2306,112 +2306,6 @@ void MacroAssembler::FastAllocate(int object_size, Register result,
|
||||
add(result, result, Operand(kHeapObjectTag));
|
||||
}
|
||||
|
||||
void MacroAssembler::AllocateTwoByteString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
// Calculate the number of bytes needed for the characters in the string while
|
||||
// observing object alignment.
|
||||
DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
||||
mov(scratch1, Operand(length, LSL, 1)); // Length in bytes, not chars.
|
||||
add(scratch1, scratch1,
|
||||
Operand(kObjectAlignmentMask + SeqTwoByteString::kHeaderSize));
|
||||
and_(scratch1, scratch1, Operand(~kObjectAlignmentMask));
|
||||
|
||||
// Allocate two-byte string in new space.
|
||||
Allocate(scratch1, result, scratch2, scratch3, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
InitializeNewString(result,
|
||||
length,
|
||||
Heap::kStringMapRootIndex,
|
||||
scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
// Calculate the number of bytes needed for the characters in the string while
|
||||
// observing object alignment.
|
||||
DCHECK((SeqOneByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
||||
DCHECK(kCharSize == 1);
|
||||
add(scratch1, length,
|
||||
Operand(kObjectAlignmentMask + SeqOneByteString::kHeaderSize));
|
||||
and_(scratch1, scratch1, Operand(~kObjectAlignmentMask));
|
||||
|
||||
// Allocate one-byte string in new space.
|
||||
Allocate(scratch1, result, scratch2, scratch3, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
InitializeNewString(result, length, Heap::kOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteConsString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result,
|
||||
length,
|
||||
Heap::kConsStringMapRootIndex,
|
||||
scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteConsString(Register result, Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result, length, Heap::kConsOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteSlicedString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result,
|
||||
length,
|
||||
Heap::kSlicedStringMapRootIndex,
|
||||
scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteSlicedString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result, length, Heap::kSlicedOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::CompareObjectType(Register object,
|
||||
Register map,
|
||||
Register type_reg,
|
||||
@ -3447,19 +3341,6 @@ void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialOneByte(
|
||||
b(ne, failure);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpIfInstanceTypeIsNotSequentialOneByte(Register type,
|
||||
Register scratch,
|
||||
Label* failure) {
|
||||
const int kFlatOneByteStringMask =
|
||||
kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask;
|
||||
const int kFlatOneByteStringTag =
|
||||
kStringTag | kOneByteStringTag | kSeqStringTag;
|
||||
and_(scratch, type, Operand(kFlatOneByteStringMask));
|
||||
cmp(scratch, Operand(kFlatOneByteStringTag));
|
||||
b(ne, failure);
|
||||
}
|
||||
|
||||
static const int kRegisterPassedArguments = 4;
|
||||
|
||||
|
||||
|
@ -797,32 +797,6 @@ class MacroAssembler: public Assembler {
|
||||
void FastAllocate(Register object_size, Register result, Register result_end,
|
||||
Register scratch, AllocationFlags flags);
|
||||
|
||||
void AllocateTwoByteString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3, Label* gc_required);
|
||||
void AllocateTwoByteConsString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteConsString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateTwoByteSlicedString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteSlicedString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required);
|
||||
|
||||
// Allocates a heap number or jumps to the gc_required label if the young
|
||||
// space is full and a scavenge is needed. All registers are clobbered also
|
||||
// when control continues at the gc_required label.
|
||||
@ -1356,11 +1330,6 @@ class MacroAssembler: public Assembler {
|
||||
Register first_object_instance_type, Register second_object_instance_type,
|
||||
Register scratch1, Register scratch2, Label* failure);
|
||||
|
||||
// Check if instance type is sequential one-byte string and jump to label if
|
||||
// it is not.
|
||||
void JumpIfInstanceTypeIsNotSequentialOneByte(Register type, Register scratch,
|
||||
Label* failure);
|
||||
|
||||
void JumpIfNotUniqueNameInstanceType(Register reg, Label* not_unique_name);
|
||||
|
||||
void EmitSeqStringSetCharCheck(Register string,
|
||||
|
@ -2203,65 +2203,6 @@ void MacroAssembler::InitializeFieldsWithFiller(Register current_address,
|
||||
Bind(&done);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpIfEitherIsNotSequentialOneByteStrings(
|
||||
Register first, Register second, Register scratch1, Register scratch2,
|
||||
Label* failure, SmiCheckType smi_check) {
|
||||
if (smi_check == DO_SMI_CHECK) {
|
||||
JumpIfEitherSmi(first, second, failure);
|
||||
} else if (emit_debug_code()) {
|
||||
DCHECK(smi_check == DONT_DO_SMI_CHECK);
|
||||
Label not_smi;
|
||||
JumpIfEitherSmi(first, second, NULL, ¬_smi);
|
||||
|
||||
// At least one input is a smi, but the flags indicated a smi check wasn't
|
||||
// needed.
|
||||
Abort(kUnexpectedSmi);
|
||||
|
||||
Bind(¬_smi);
|
||||
}
|
||||
|
||||
// Test that both first and second are sequential one-byte strings.
|
||||
Ldr(scratch1, FieldMemOperand(first, HeapObject::kMapOffset));
|
||||
Ldr(scratch2, FieldMemOperand(second, HeapObject::kMapOffset));
|
||||
Ldrb(scratch1, FieldMemOperand(scratch1, Map::kInstanceTypeOffset));
|
||||
Ldrb(scratch2, FieldMemOperand(scratch2, Map::kInstanceTypeOffset));
|
||||
|
||||
JumpIfEitherInstanceTypeIsNotSequentialOneByte(scratch1, scratch2, scratch1,
|
||||
scratch2, failure);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpIfEitherInstanceTypeIsNotSequentialOneByte(
|
||||
Register first, Register second, Register scratch1, Register scratch2,
|
||||
Label* failure) {
|
||||
DCHECK(!AreAliased(scratch1, second));
|
||||
DCHECK(!AreAliased(scratch1, scratch2));
|
||||
const int kFlatOneByteStringMask =
|
||||
kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask;
|
||||
const int kFlatOneByteStringTag =
|
||||
kStringTag | kOneByteStringTag | kSeqStringTag;
|
||||
And(scratch1, first, kFlatOneByteStringMask);
|
||||
And(scratch2, second, kFlatOneByteStringMask);
|
||||
Cmp(scratch1, kFlatOneByteStringTag);
|
||||
Ccmp(scratch2, kFlatOneByteStringTag, NoFlag, eq);
|
||||
B(ne, failure);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpIfInstanceTypeIsNotSequentialOneByte(Register type,
|
||||
Register scratch,
|
||||
Label* failure) {
|
||||
const int kFlatOneByteStringMask =
|
||||
kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask;
|
||||
const int kFlatOneByteStringTag =
|
||||
kStringTag | kOneByteStringTag | kSeqStringTag;
|
||||
And(scratch, type, kFlatOneByteStringMask);
|
||||
Cmp(scratch, kFlatOneByteStringTag);
|
||||
B(ne, failure);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialOneByte(
|
||||
Register first, Register second, Register scratch1, Register scratch2,
|
||||
Label* failure) {
|
||||
@ -3208,114 +3149,6 @@ void MacroAssembler::FastAllocate(Register object_size, Register result,
|
||||
ObjectTag(result, result);
|
||||
}
|
||||
|
||||
void MacroAssembler::AllocateTwoByteString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
DCHECK(!AreAliased(result, length, scratch1, scratch2, scratch3));
|
||||
// Calculate the number of bytes needed for the characters in the string while
|
||||
// observing object alignment.
|
||||
STATIC_ASSERT((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
||||
Add(scratch1, length, length); // Length in bytes, not chars.
|
||||
Add(scratch1, scratch1, kObjectAlignmentMask + SeqTwoByteString::kHeaderSize);
|
||||
Bic(scratch1, scratch1, kObjectAlignmentMask);
|
||||
|
||||
// Allocate two-byte string in new space.
|
||||
Allocate(scratch1, result, scratch2, scratch3, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
InitializeNewString(result,
|
||||
length,
|
||||
Heap::kStringMapRootIndex,
|
||||
scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
DCHECK(!AreAliased(result, length, scratch1, scratch2, scratch3));
|
||||
// Calculate the number of bytes needed for the characters in the string while
|
||||
// observing object alignment.
|
||||
STATIC_ASSERT((SeqOneByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
||||
STATIC_ASSERT(kCharSize == 1);
|
||||
Add(scratch1, length, kObjectAlignmentMask + SeqOneByteString::kHeaderSize);
|
||||
Bic(scratch1, scratch1, kObjectAlignmentMask);
|
||||
|
||||
// Allocate one-byte string in new space.
|
||||
Allocate(scratch1, result, scratch2, scratch3, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
InitializeNewString(result, length, Heap::kOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteConsString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result,
|
||||
length,
|
||||
Heap::kConsStringMapRootIndex,
|
||||
scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteConsString(Register result, Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result, length, Heap::kConsOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteSlicedString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
DCHECK(!AreAliased(result, length, scratch1, scratch2));
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result,
|
||||
length,
|
||||
Heap::kSlicedStringMapRootIndex,
|
||||
scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteSlicedString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
DCHECK(!AreAliased(result, length, scratch1, scratch2));
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result, length, Heap::kSlicedOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
|
||||
// Allocates a heap number or jumps to the need_gc label if the young space
|
||||
// is full and a scavenge is needed.
|
||||
void MacroAssembler::AllocateHeapNumber(Register result,
|
||||
|
@ -1101,24 +1101,6 @@ class MacroAssembler : public Assembler {
|
||||
|
||||
// ---- String Utilities ----
|
||||
|
||||
|
||||
// Jump to label if either object is not a sequential one-byte string.
|
||||
// Optionally perform a smi check on the objects first.
|
||||
void JumpIfEitherIsNotSequentialOneByteStrings(
|
||||
Register first, Register second, Register scratch1, Register scratch2,
|
||||
Label* failure, SmiCheckType smi_check = DO_SMI_CHECK);
|
||||
|
||||
// Check if instance type is sequential one-byte string and jump to label if
|
||||
// it is not.
|
||||
void JumpIfInstanceTypeIsNotSequentialOneByte(Register type, Register scratch,
|
||||
Label* failure);
|
||||
|
||||
// Checks if both instance types are sequential one-byte strings and jumps to
|
||||
// label if either is not.
|
||||
void JumpIfEitherInstanceTypeIsNotSequentialOneByte(
|
||||
Register first_object_instance_type, Register second_object_instance_type,
|
||||
Register scratch1, Register scratch2, Label* failure);
|
||||
|
||||
// Checks if both instance types are sequential one-byte strings and jumps to
|
||||
// label if either is not.
|
||||
void JumpIfBothInstanceTypesAreNotSequentialOneByte(
|
||||
@ -1360,32 +1342,6 @@ class MacroAssembler : public Assembler {
|
||||
void FastAllocate(int object_size, Register result, Register scratch1,
|
||||
Register scratch2, AllocationFlags flags);
|
||||
|
||||
void AllocateTwoByteString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3, Label* gc_required);
|
||||
void AllocateTwoByteConsString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteConsString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateTwoByteSlicedString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteSlicedString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required);
|
||||
|
||||
// Allocates a heap number or jumps to the gc_required label if the young
|
||||
// space is full and a scavenge is needed.
|
||||
// All registers are clobbered.
|
||||
|
@ -1593,139 +1593,6 @@ void MacroAssembler::AllocateHeapNumber(Register result,
|
||||
mov(FieldOperand(result, HeapObject::kMapOffset), Immediate(map));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
// Calculate the number of bytes needed for the characters in the string while
|
||||
// observing object alignment.
|
||||
DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
||||
DCHECK(kShortSize == 2);
|
||||
// scratch1 = length * 2 + kObjectAlignmentMask.
|
||||
lea(scratch1, Operand(length, length, times_1, kObjectAlignmentMask));
|
||||
and_(scratch1, Immediate(~kObjectAlignmentMask));
|
||||
|
||||
// Allocate two byte string in new space.
|
||||
Allocate(SeqTwoByteString::kHeaderSize, times_1, scratch1,
|
||||
REGISTER_VALUE_IS_INT32, result, scratch2, scratch3, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
mov(FieldOperand(result, HeapObject::kMapOffset),
|
||||
Immediate(isolate()->factory()->string_map()));
|
||||
mov(scratch1, length);
|
||||
SmiTag(scratch1);
|
||||
mov(FieldOperand(result, String::kLengthOffset), scratch1);
|
||||
mov(FieldOperand(result, String::kHashFieldOffset),
|
||||
Immediate(String::kEmptyHashField));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
// Calculate the number of bytes needed for the characters in the string while
|
||||
// observing object alignment.
|
||||
DCHECK((SeqOneByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
||||
mov(scratch1, length);
|
||||
DCHECK(kCharSize == 1);
|
||||
add(scratch1, Immediate(kObjectAlignmentMask));
|
||||
and_(scratch1, Immediate(~kObjectAlignmentMask));
|
||||
|
||||
// Allocate one-byte string in new space.
|
||||
Allocate(SeqOneByteString::kHeaderSize, times_1, scratch1,
|
||||
REGISTER_VALUE_IS_INT32, result, scratch2, scratch3, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
mov(FieldOperand(result, HeapObject::kMapOffset),
|
||||
Immediate(isolate()->factory()->one_byte_string_map()));
|
||||
mov(scratch1, length);
|
||||
SmiTag(scratch1);
|
||||
mov(FieldOperand(result, String::kLengthOffset), scratch1);
|
||||
mov(FieldOperand(result, String::kHashFieldOffset),
|
||||
Immediate(String::kEmptyHashField));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteString(Register result, int length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required) {
|
||||
DCHECK(length > 0);
|
||||
|
||||
// Allocate one-byte string in new space.
|
||||
Allocate(SeqOneByteString::SizeFor(length), result, scratch1, scratch2,
|
||||
gc_required, NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
mov(FieldOperand(result, HeapObject::kMapOffset),
|
||||
Immediate(isolate()->factory()->one_byte_string_map()));
|
||||
mov(FieldOperand(result, String::kLengthOffset),
|
||||
Immediate(Smi::FromInt(length)));
|
||||
mov(FieldOperand(result, String::kHashFieldOffset),
|
||||
Immediate(String::kEmptyHashField));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteConsString(Register result,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
// Allocate heap number in new space.
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map. The other fields are left uninitialized.
|
||||
mov(FieldOperand(result, HeapObject::kMapOffset),
|
||||
Immediate(isolate()->factory()->cons_string_map()));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteConsString(Register result,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map. The other fields are left uninitialized.
|
||||
mov(FieldOperand(result, HeapObject::kMapOffset),
|
||||
Immediate(isolate()->factory()->cons_one_byte_string_map()));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteSlicedString(Register result,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
// Allocate heap number in new space.
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map. The other fields are left uninitialized.
|
||||
mov(FieldOperand(result, HeapObject::kMapOffset),
|
||||
Immediate(isolate()->factory()->sliced_string_map()));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteSlicedString(Register result,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
// Allocate heap number in new space.
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map. The other fields are left uninitialized.
|
||||
mov(FieldOperand(result, HeapObject::kMapOffset),
|
||||
Immediate(isolate()->factory()->sliced_one_byte_string_map()));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateJSValue(Register result, Register constructor,
|
||||
Register value, Register scratch,
|
||||
Label* gc_required) {
|
||||
@ -2676,19 +2543,6 @@ void MacroAssembler::LoadPowerOf2(XMMRegister dst,
|
||||
psllq(dst, HeapNumber::kMantissaBits);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpIfInstanceTypeIsNotSequentialOneByte(
|
||||
Register instance_type, Register scratch, Label* failure) {
|
||||
if (!scratch.is(instance_type)) {
|
||||
mov(scratch, instance_type);
|
||||
}
|
||||
and_(scratch,
|
||||
kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask);
|
||||
cmp(scratch, kStringTag | kSeqStringTag | kOneByteStringTag);
|
||||
j(not_equal, failure);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpIfNotBothSequentialOneByteStrings(Register object1,
|
||||
Register object2,
|
||||
Register scratch1,
|
||||
|
@ -612,31 +612,6 @@ class MacroAssembler: public Assembler {
|
||||
void AllocateHeapNumber(Register result, Register scratch1, Register scratch2,
|
||||
Label* gc_required, MutableMode mode = IMMUTABLE);
|
||||
|
||||
// Allocate a sequential string. All the header fields of the string object
|
||||
// are initialized.
|
||||
void AllocateTwoByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3, Label* gc_required);
|
||||
void AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3, Label* gc_required);
|
||||
void AllocateOneByteString(Register result, int length, Register scratch1,
|
||||
Register scratch2, Label* gc_required);
|
||||
|
||||
// Allocate a raw cons string object. Only the map field of the result is
|
||||
// initialized.
|
||||
void AllocateTwoByteConsString(Register result, Register scratch1,
|
||||
Register scratch2, Label* gc_required);
|
||||
void AllocateOneByteConsString(Register result, Register scratch1,
|
||||
Register scratch2, Label* gc_required);
|
||||
|
||||
// Allocate a raw sliced string object. Only the map field of the result is
|
||||
// initialized.
|
||||
void AllocateTwoByteSlicedString(Register result, Register scratch1,
|
||||
Register scratch2, Label* gc_required);
|
||||
void AllocateOneByteSlicedString(Register result, Register scratch1,
|
||||
Register scratch2, Label* gc_required);
|
||||
|
||||
// Allocate and initialize a JSValue wrapper with the specified {constructor}
|
||||
// and {value}.
|
||||
void AllocateJSValue(Register result, Register constructor, Register value,
|
||||
@ -861,13 +836,6 @@ class MacroAssembler: public Assembler {
|
||||
// ---------------------------------------------------------------------------
|
||||
// String utilities.
|
||||
|
||||
// Check whether the instance type represents a flat one-byte string. Jump to
|
||||
// the label if not. If the instance type can be scratched specify same
|
||||
// register for both instance type and scratch.
|
||||
void JumpIfInstanceTypeIsNotSequentialOneByte(
|
||||
Register instance_type, Register scratch,
|
||||
Label* on_not_flat_one_byte_string);
|
||||
|
||||
// Checks if both objects are sequential one-byte strings, and jumps to label
|
||||
// if either is not.
|
||||
void JumpIfNotBothSequentialOneByteStrings(
|
||||
|
@ -4197,110 +4197,6 @@ void MacroAssembler::FastAllocate(Register object_size, Register result,
|
||||
Addu(result, result, Operand(kHeapObjectTag));
|
||||
}
|
||||
|
||||
void MacroAssembler::AllocateTwoByteString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
// Calculate the number of bytes needed for the characters in the string while
|
||||
// observing object alignment.
|
||||
DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
||||
sll(scratch1, length, 1); // Length in bytes, not chars.
|
||||
addiu(scratch1, scratch1,
|
||||
kObjectAlignmentMask + SeqTwoByteString::kHeaderSize);
|
||||
And(scratch1, scratch1, Operand(~kObjectAlignmentMask));
|
||||
|
||||
// Allocate two-byte string in new space.
|
||||
Allocate(scratch1, result, scratch2, scratch3, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
InitializeNewString(result,
|
||||
length,
|
||||
Heap::kStringMapRootIndex,
|
||||
scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
// Calculate the number of bytes needed for the characters in the string
|
||||
// while observing object alignment.
|
||||
DCHECK((SeqOneByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
||||
DCHECK(kCharSize == 1);
|
||||
addiu(scratch1, length, kObjectAlignmentMask + SeqOneByteString::kHeaderSize);
|
||||
And(scratch1, scratch1, Operand(~kObjectAlignmentMask));
|
||||
|
||||
// Allocate one-byte string in new space.
|
||||
Allocate(scratch1, result, scratch2, scratch3, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
InitializeNewString(result, length, Heap::kOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteConsString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
InitializeNewString(result,
|
||||
length,
|
||||
Heap::kConsStringMapRootIndex,
|
||||
scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteConsString(Register result, Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result, length, Heap::kConsOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteSlicedString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result,
|
||||
length,
|
||||
Heap::kSlicedStringMapRootIndex,
|
||||
scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteSlicedString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result, length, Heap::kSlicedOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpIfNotUniqueNameInstanceType(Register reg,
|
||||
Label* not_unique_name) {
|
||||
STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0);
|
||||
@ -6108,19 +6004,6 @@ void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialOneByte(
|
||||
Branch(failure, ne, scratch2, Operand(kFlatOneByteStringTag));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpIfInstanceTypeIsNotSequentialOneByte(Register type,
|
||||
Register scratch,
|
||||
Label* failure) {
|
||||
const int kFlatOneByteStringMask =
|
||||
kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask;
|
||||
const int kFlatOneByteStringTag =
|
||||
kStringTag | kOneByteStringTag | kSeqStringTag;
|
||||
And(scratch, type, Operand(kFlatOneByteStringMask));
|
||||
Branch(failure, ne, scratch, Operand(kFlatOneByteStringTag));
|
||||
}
|
||||
|
||||
|
||||
static const int kRegisterPassedArguments = 4;
|
||||
|
||||
int MacroAssembler::CalculateStackPassedWords(int num_reg_arguments,
|
||||
|
@ -555,32 +555,6 @@ class MacroAssembler: public Assembler {
|
||||
void FastAllocate(Register object_size, Register result, Register result_new,
|
||||
Register scratch, AllocationFlags flags);
|
||||
|
||||
void AllocateTwoByteString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3, Label* gc_required);
|
||||
void AllocateTwoByteConsString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteConsString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateTwoByteSlicedString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteSlicedString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required);
|
||||
|
||||
// Allocates a heap number or jumps to the gc_required label if the young
|
||||
// space is full and a scavenge is needed. All registers are clobbered also
|
||||
// when control continues at the gc_required label.
|
||||
@ -1620,11 +1594,6 @@ const Operand& rt = Operand(zero_reg), BranchDelaySlot bd = PROTECT
|
||||
Register first_object_instance_type, Register second_object_instance_type,
|
||||
Register scratch1, Register scratch2, Label* failure);
|
||||
|
||||
// Check if instance type is sequential one-byte string and jump to label if
|
||||
// it is not.
|
||||
void JumpIfInstanceTypeIsNotSequentialOneByte(Register type, Register scratch,
|
||||
Label* failure);
|
||||
|
||||
void JumpIfNotUniqueNameInstanceType(Register reg, Label* not_unique_name);
|
||||
|
||||
void EmitSeqStringSetCharCheck(Register string,
|
||||
|
@ -4322,111 +4322,6 @@ void MacroAssembler::FastAllocate(Register object_size, Register result,
|
||||
Daddu(result, result, Operand(kHeapObjectTag));
|
||||
}
|
||||
|
||||
void MacroAssembler::AllocateTwoByteString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
// Calculate the number of bytes needed for the characters in the string while
|
||||
// observing object alignment.
|
||||
DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
||||
dsll(scratch1, length, 1); // Length in bytes, not chars.
|
||||
daddiu(scratch1, scratch1,
|
||||
kObjectAlignmentMask + SeqTwoByteString::kHeaderSize);
|
||||
And(scratch1, scratch1, Operand(~kObjectAlignmentMask));
|
||||
|
||||
// Allocate two-byte string in new space.
|
||||
Allocate(scratch1, result, scratch2, scratch3, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
InitializeNewString(result,
|
||||
length,
|
||||
Heap::kStringMapRootIndex,
|
||||
scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
// Calculate the number of bytes needed for the characters in the string
|
||||
// while observing object alignment.
|
||||
DCHECK((SeqOneByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
||||
DCHECK(kCharSize == 1);
|
||||
daddiu(scratch1, length,
|
||||
kObjectAlignmentMask + SeqOneByteString::kHeaderSize);
|
||||
And(scratch1, scratch1, Operand(~kObjectAlignmentMask));
|
||||
|
||||
// Allocate one-byte string in new space.
|
||||
Allocate(scratch1, result, scratch2, scratch3, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
InitializeNewString(result, length, Heap::kOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteConsString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
InitializeNewString(result,
|
||||
length,
|
||||
Heap::kConsStringMapRootIndex,
|
||||
scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteConsString(Register result, Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result, length, Heap::kConsOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteSlicedString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result,
|
||||
length,
|
||||
Heap::kSlicedStringMapRootIndex,
|
||||
scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteSlicedString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result, length, Heap::kSlicedOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpIfNotUniqueNameInstanceType(Register reg,
|
||||
Label* not_unique_name) {
|
||||
STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0);
|
||||
@ -6518,18 +6413,6 @@ void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialOneByte(
|
||||
Branch(failure, ne, scratch2, Operand(kFlatOneByteStringTag));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpIfInstanceTypeIsNotSequentialOneByte(Register type,
|
||||
Register scratch,
|
||||
Label* failure) {
|
||||
const int kFlatOneByteStringMask =
|
||||
kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask;
|
||||
const int kFlatOneByteStringTag =
|
||||
kStringTag | kOneByteStringTag | kSeqStringTag;
|
||||
And(scratch, type, Operand(kFlatOneByteStringMask));
|
||||
Branch(failure, ne, scratch, Operand(kFlatOneByteStringTag));
|
||||
}
|
||||
|
||||
static const int kRegisterPassedArguments = 8;
|
||||
|
||||
int MacroAssembler::CalculateStackPassedWords(int num_reg_arguments,
|
||||
|
@ -588,32 +588,6 @@ class MacroAssembler: public Assembler {
|
||||
void FastAllocate(Register object_size, Register result, Register result_new,
|
||||
Register scratch, AllocationFlags flags);
|
||||
|
||||
void AllocateTwoByteString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3, Label* gc_required);
|
||||
void AllocateTwoByteConsString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteConsString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateTwoByteSlicedString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteSlicedString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required);
|
||||
|
||||
// Allocates a heap number or jumps to the gc_required label if the young
|
||||
// space is full and a scavenge is needed. All registers are clobbered also
|
||||
// when control continues at the gc_required label.
|
||||
@ -1763,11 +1737,6 @@ const Operand& rt = Operand(zero_reg), BranchDelaySlot bd = PROTECT
|
||||
Register first_object_instance_type, Register second_object_instance_type,
|
||||
Register scratch1, Register scratch2, Label* failure);
|
||||
|
||||
// Check if instance type is sequential one-byte string and jump to label if
|
||||
// it is not.
|
||||
void JumpIfInstanceTypeIsNotSequentialOneByte(Register type, Register scratch,
|
||||
Label* failure);
|
||||
|
||||
void JumpIfNotUniqueNameInstanceType(Register reg, Label* not_unique_name);
|
||||
|
||||
void EmitSeqStringSetCharCheck(Register string,
|
||||
|
@ -1949,103 +1949,6 @@ void MacroAssembler::FastAllocate(int object_size, Register result,
|
||||
addi(result, result, Operand(kHeapObjectTag));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
// Calculate the number of bytes needed for the characters in the string while
|
||||
// observing object alignment.
|
||||
DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
||||
slwi(scratch1, length, Operand(1)); // Length in bytes, not chars.
|
||||
addi(scratch1, scratch1,
|
||||
Operand(kObjectAlignmentMask + SeqTwoByteString::kHeaderSize));
|
||||
mov(r0, Operand(~kObjectAlignmentMask));
|
||||
and_(scratch1, scratch1, r0);
|
||||
|
||||
// Allocate two-byte string in new space.
|
||||
Allocate(scratch1, result, scratch2, scratch3, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
InitializeNewString(result, length, Heap::kStringMapRootIndex, scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
// Calculate the number of bytes needed for the characters in the string while
|
||||
// observing object alignment.
|
||||
DCHECK((SeqOneByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
||||
DCHECK(kCharSize == 1);
|
||||
addi(scratch1, length,
|
||||
Operand(kObjectAlignmentMask + SeqOneByteString::kHeaderSize));
|
||||
li(r0, Operand(~kObjectAlignmentMask));
|
||||
and_(scratch1, scratch1, r0);
|
||||
|
||||
// Allocate one-byte string in new space.
|
||||
Allocate(scratch1, result, scratch2, scratch3, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
InitializeNewString(result, length, Heap::kOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteConsString(Register result, Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result, length, Heap::kConsStringMapRootIndex, scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteConsString(Register result, Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result, length, Heap::kConsOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteSlicedString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result, length, Heap::kSlicedStringMapRootIndex, scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteSlicedString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result, length, Heap::kSlicedOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::CompareObjectType(Register object, Register map,
|
||||
Register type_reg, InstanceType type) {
|
||||
const Register temp = type_reg.is(no_reg) ? r0 : type_reg;
|
||||
@ -3047,19 +2950,6 @@ void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialOneByte(
|
||||
bne(failure);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpIfInstanceTypeIsNotSequentialOneByte(Register type,
|
||||
Register scratch,
|
||||
Label* failure) {
|
||||
const int kFlatOneByteStringMask =
|
||||
kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask;
|
||||
const int kFlatOneByteStringTag =
|
||||
kStringTag | kOneByteStringTag | kSeqStringTag;
|
||||
andi(scratch, type, Operand(kFlatOneByteStringMask));
|
||||
cmpi(scratch, Operand(kFlatOneByteStringTag));
|
||||
bne(failure);
|
||||
}
|
||||
|
||||
static const int kRegisterPassedArguments = 8;
|
||||
|
||||
|
||||
|
@ -712,25 +712,6 @@ class MacroAssembler : public Assembler {
|
||||
void FastAllocate(Register object_size, Register result, Register result_end,
|
||||
Register scratch, AllocationFlags flags);
|
||||
|
||||
void AllocateTwoByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3, Label* gc_required);
|
||||
void AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3, Label* gc_required);
|
||||
void AllocateTwoByteConsString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteConsString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateTwoByteSlicedString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteSlicedString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required);
|
||||
|
||||
// Allocates a heap number or jumps to the gc_required label if the young
|
||||
// space is full and a scavenge is needed. All registers are clobbered also
|
||||
// when control continues at the gc_required label.
|
||||
@ -1404,11 +1385,6 @@ class MacroAssembler : public Assembler {
|
||||
Register first_object_instance_type, Register second_object_instance_type,
|
||||
Register scratch1, Register scratch2, Label* failure);
|
||||
|
||||
// Check if instance type is sequential one-byte string and jump to label if
|
||||
// it is not.
|
||||
void JumpIfInstanceTypeIsNotSequentialOneByte(Register type, Register scratch,
|
||||
Label* failure);
|
||||
|
||||
void JumpIfNotUniqueNameInstanceType(Register reg, Label* not_unique_name);
|
||||
|
||||
void EmitSeqStringSetCharCheck(Register string, Register index,
|
||||
|
@ -1847,95 +1847,6 @@ void MacroAssembler::FastAllocate(int object_size, Register result,
|
||||
AddP(result, result, Operand(kHeapObjectTag));
|
||||
}
|
||||
|
||||
void MacroAssembler::AllocateTwoByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
// Calculate the number of bytes needed for the characters in the string while
|
||||
// observing object alignment.
|
||||
DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
||||
|
||||
ShiftLeftP(scratch1, length, Operand(1)); // Length in bytes, not chars.
|
||||
AddP(scratch1, Operand(kObjectAlignmentMask + SeqTwoByteString::kHeaderSize));
|
||||
|
||||
AndP(scratch1, Operand(~kObjectAlignmentMask));
|
||||
|
||||
// Allocate two-byte string in new space.
|
||||
Allocate(scratch1, result, scratch2, scratch3, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
InitializeNewString(result, length, Heap::kStringMapRootIndex, scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
void MacroAssembler::AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
// Calculate the number of bytes needed for the characters in the string while
|
||||
// observing object alignment.
|
||||
DCHECK((SeqOneByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
||||
DCHECK(kCharSize == 1);
|
||||
AddP(scratch1, length,
|
||||
Operand(kObjectAlignmentMask + SeqOneByteString::kHeaderSize));
|
||||
AndP(scratch1, Operand(~kObjectAlignmentMask));
|
||||
|
||||
// Allocate one-byte string in new space.
|
||||
Allocate(scratch1, result, scratch2, scratch3, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
InitializeNewString(result, length, Heap::kOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
void MacroAssembler::AllocateTwoByteConsString(Register result, Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result, length, Heap::kConsStringMapRootIndex, scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
void MacroAssembler::AllocateOneByteConsString(Register result, Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result, length, Heap::kConsOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
void MacroAssembler::AllocateTwoByteSlicedString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result, length, Heap::kSlicedStringMapRootIndex, scratch1,
|
||||
scratch2);
|
||||
}
|
||||
|
||||
void MacroAssembler::AllocateOneByteSlicedString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
InitializeNewString(result, length, Heap::kSlicedOneByteStringMapRootIndex,
|
||||
scratch1, scratch2);
|
||||
}
|
||||
|
||||
void MacroAssembler::CompareObjectType(Register object, Register map,
|
||||
Register type_reg, InstanceType type) {
|
||||
const Register temp = type_reg.is(no_reg) ? r0 : type_reg;
|
||||
@ -2793,20 +2704,6 @@ void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialOneByte(
|
||||
bne(failure);
|
||||
}
|
||||
|
||||
void MacroAssembler::JumpIfInstanceTypeIsNotSequentialOneByte(Register type,
|
||||
Register scratch,
|
||||
Label* failure) {
|
||||
const int kFlatOneByteStringMask =
|
||||
kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask;
|
||||
const int kFlatOneByteStringTag =
|
||||
kStringTag | kOneByteStringTag | kSeqStringTag;
|
||||
|
||||
if (!scratch.is(type)) LoadRR(scratch, type);
|
||||
nilf(scratch, Operand(kFlatOneByteStringMask));
|
||||
CmpP(scratch, Operand(kFlatOneByteStringTag));
|
||||
bne(failure);
|
||||
}
|
||||
|
||||
static const int kRegisterPassedArguments = 5;
|
||||
|
||||
int MacroAssembler::CalculateStackPassedWords(int num_reg_arguments,
|
||||
|
@ -980,25 +980,6 @@ class MacroAssembler : public Assembler {
|
||||
void FastAllocate(Register object_size, Register result, Register result_end,
|
||||
Register scratch, AllocationFlags flags);
|
||||
|
||||
void AllocateTwoByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3, Label* gc_required);
|
||||
void AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3, Label* gc_required);
|
||||
void AllocateTwoByteConsString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteConsString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateTwoByteSlicedString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteSlicedString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required);
|
||||
|
||||
// Allocates a heap number or jumps to the gc_required label if the young
|
||||
// space is full and a scavenge is needed. All registers are clobbered also
|
||||
// when control continues at the gc_required label.
|
||||
@ -1665,11 +1646,6 @@ class MacroAssembler : public Assembler {
|
||||
Register first_object_instance_type, Register second_object_instance_type,
|
||||
Register scratch1, Register scratch2, Label* failure);
|
||||
|
||||
// Check if instance type is sequential one-byte string and jump to label if
|
||||
// it is not.
|
||||
void JumpIfInstanceTypeIsNotSequentialOneByte(Register type, Register scratch,
|
||||
Label* failure);
|
||||
|
||||
void JumpIfNotUniqueNameInstanceType(Register reg, Label* not_unique_name);
|
||||
|
||||
void EmitSeqStringSetCharCheck(Register string, Register index,
|
||||
|
@ -2547,23 +2547,6 @@ void MacroAssembler::JumpIfNotBothSequentialOneByteStrings(
|
||||
j(not_equal, on_fail, near_jump);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpIfInstanceTypeIsNotSequentialOneByte(
|
||||
Register instance_type, Register scratch, Label* failure,
|
||||
Label::Distance near_jump) {
|
||||
if (!scratch.is(instance_type)) {
|
||||
movl(scratch, instance_type);
|
||||
}
|
||||
|
||||
const int kFlatOneByteStringMask =
|
||||
kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
|
||||
|
||||
andl(scratch, Immediate(kFlatOneByteStringMask));
|
||||
cmpl(scratch, Immediate(kStringTag | kSeqStringTag | kOneByteStringTag));
|
||||
j(not_equal, failure, near_jump);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpIfBothInstanceTypesAreNotSequentialOneByte(
|
||||
Register first_object_instance_type, Register second_object_instance_type,
|
||||
Register scratch1, Register scratch2, Label* on_fail,
|
||||
@ -4898,125 +4881,6 @@ void MacroAssembler::AllocateHeapNumber(Register result,
|
||||
movp(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
// Calculate the number of bytes needed for the characters in the string while
|
||||
// observing object alignment.
|
||||
const int kHeaderAlignment = SeqTwoByteString::kHeaderSize &
|
||||
kObjectAlignmentMask;
|
||||
DCHECK(kShortSize == 2);
|
||||
// scratch1 = length * 2 + kObjectAlignmentMask.
|
||||
leap(scratch1, Operand(length, length, times_1, kObjectAlignmentMask +
|
||||
kHeaderAlignment));
|
||||
andp(scratch1, Immediate(~kObjectAlignmentMask));
|
||||
if (kHeaderAlignment > 0) {
|
||||
subp(scratch1, Immediate(kHeaderAlignment));
|
||||
}
|
||||
|
||||
// Allocate two byte string in new space.
|
||||
Allocate(SeqTwoByteString::kHeaderSize, times_1, scratch1, result, scratch2,
|
||||
scratch3, gc_required, NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
LoadRoot(kScratchRegister, Heap::kStringMapRootIndex);
|
||||
movp(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister);
|
||||
Integer32ToSmi(scratch1, length);
|
||||
movp(FieldOperand(result, String::kLengthOffset), scratch1);
|
||||
movp(FieldOperand(result, String::kHashFieldOffset),
|
||||
Immediate(String::kEmptyHashField));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
// Calculate the number of bytes needed for the characters in the string while
|
||||
// observing object alignment.
|
||||
const int kHeaderAlignment = SeqOneByteString::kHeaderSize &
|
||||
kObjectAlignmentMask;
|
||||
movl(scratch1, length);
|
||||
DCHECK(kCharSize == 1);
|
||||
addp(scratch1, Immediate(kObjectAlignmentMask + kHeaderAlignment));
|
||||
andp(scratch1, Immediate(~kObjectAlignmentMask));
|
||||
if (kHeaderAlignment > 0) {
|
||||
subp(scratch1, Immediate(kHeaderAlignment));
|
||||
}
|
||||
|
||||
// Allocate one-byte string in new space.
|
||||
Allocate(SeqOneByteString::kHeaderSize, times_1, scratch1, result, scratch2,
|
||||
scratch3, gc_required, NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
LoadRoot(kScratchRegister, Heap::kOneByteStringMapRootIndex);
|
||||
movp(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister);
|
||||
Integer32ToSmi(scratch1, length);
|
||||
movp(FieldOperand(result, String::kLengthOffset), scratch1);
|
||||
movp(FieldOperand(result, String::kHashFieldOffset),
|
||||
Immediate(String::kEmptyHashField));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteConsString(Register result,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
// Allocate heap number in new space.
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map. The other fields are left uninitialized.
|
||||
LoadRoot(kScratchRegister, Heap::kConsStringMapRootIndex);
|
||||
movp(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteConsString(Register result,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map. The other fields are left uninitialized.
|
||||
LoadRoot(kScratchRegister, Heap::kConsOneByteStringMapRootIndex);
|
||||
movp(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteSlicedString(Register result,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
// Allocate heap number in new space.
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map. The other fields are left uninitialized.
|
||||
LoadRoot(kScratchRegister, Heap::kSlicedStringMapRootIndex);
|
||||
movp(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteSlicedString(Register result,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
// Allocate heap number in new space.
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map. The other fields are left uninitialized.
|
||||
LoadRoot(kScratchRegister, Heap::kSlicedOneByteStringMapRootIndex);
|
||||
movp(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateJSValue(Register result, Register constructor,
|
||||
Register value, Register scratch,
|
||||
Label* gc_required) {
|
||||
|
@ -1321,36 +1321,6 @@ class MacroAssembler: public Assembler {
|
||||
Label* gc_required,
|
||||
MutableMode mode = IMMUTABLE);
|
||||
|
||||
// Allocate a sequential string. All the header fields of the string object
|
||||
// are initialized.
|
||||
void AllocateTwoByteString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3, Label* gc_required);
|
||||
|
||||
// Allocate a raw cons string object. Only the map field of the result is
|
||||
// initialized.
|
||||
void AllocateTwoByteConsString(Register result,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteConsString(Register result, Register scratch1,
|
||||
Register scratch2, Label* gc_required);
|
||||
|
||||
// Allocate a raw sliced string object. Only the map field of the result is
|
||||
// initialized.
|
||||
void AllocateTwoByteSlicedString(Register result,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required);
|
||||
void AllocateOneByteSlicedString(Register result, Register scratch1,
|
||||
Register scratch2, Label* gc_required);
|
||||
|
||||
// Allocate and initialize a JSValue wrapper with the specified {constructor}
|
||||
// and {value}.
|
||||
void AllocateJSValue(Register result, Register constructor, Register value,
|
||||
|
@ -1536,139 +1536,6 @@ void MacroAssembler::AllocateHeapNumber(Register result,
|
||||
mov(FieldOperand(result, HeapObject::kMapOffset), Immediate(map));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteString(Register result,
|
||||
Register length,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
// Calculate the number of bytes needed for the characters in the string while
|
||||
// observing object alignment.
|
||||
DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
||||
DCHECK(kShortSize == 2);
|
||||
// scratch1 = length * 2 + kObjectAlignmentMask.
|
||||
lea(scratch1, Operand(length, length, times_1, kObjectAlignmentMask));
|
||||
and_(scratch1, Immediate(~kObjectAlignmentMask));
|
||||
|
||||
// Allocate two byte string in new space.
|
||||
Allocate(SeqTwoByteString::kHeaderSize, times_1, scratch1,
|
||||
REGISTER_VALUE_IS_INT32, result, scratch2, scratch3, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
mov(FieldOperand(result, HeapObject::kMapOffset),
|
||||
Immediate(isolate()->factory()->string_map()));
|
||||
mov(scratch1, length);
|
||||
SmiTag(scratch1);
|
||||
mov(FieldOperand(result, String::kLengthOffset), scratch1);
|
||||
mov(FieldOperand(result, String::kHashFieldOffset),
|
||||
Immediate(String::kEmptyHashField));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3,
|
||||
Label* gc_required) {
|
||||
// Calculate the number of bytes needed for the characters in the string while
|
||||
// observing object alignment.
|
||||
DCHECK((SeqOneByteString::kHeaderSize & kObjectAlignmentMask) == 0);
|
||||
mov(scratch1, length);
|
||||
DCHECK(kCharSize == 1);
|
||||
add(scratch1, Immediate(kObjectAlignmentMask));
|
||||
and_(scratch1, Immediate(~kObjectAlignmentMask));
|
||||
|
||||
// Allocate one-byte string in new space.
|
||||
Allocate(SeqOneByteString::kHeaderSize, times_1, scratch1,
|
||||
REGISTER_VALUE_IS_INT32, result, scratch2, scratch3, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
mov(FieldOperand(result, HeapObject::kMapOffset),
|
||||
Immediate(isolate()->factory()->one_byte_string_map()));
|
||||
mov(scratch1, length);
|
||||
SmiTag(scratch1);
|
||||
mov(FieldOperand(result, String::kLengthOffset), scratch1);
|
||||
mov(FieldOperand(result, String::kHashFieldOffset),
|
||||
Immediate(String::kEmptyHashField));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteString(Register result, int length,
|
||||
Register scratch1, Register scratch2,
|
||||
Label* gc_required) {
|
||||
DCHECK(length > 0);
|
||||
|
||||
// Allocate one-byte string in new space.
|
||||
Allocate(SeqOneByteString::SizeFor(length), result, scratch1, scratch2,
|
||||
gc_required, NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map, length and hash field.
|
||||
mov(FieldOperand(result, HeapObject::kMapOffset),
|
||||
Immediate(isolate()->factory()->one_byte_string_map()));
|
||||
mov(FieldOperand(result, String::kLengthOffset),
|
||||
Immediate(Smi::FromInt(length)));
|
||||
mov(FieldOperand(result, String::kHashFieldOffset),
|
||||
Immediate(String::kEmptyHashField));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteConsString(Register result,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
// Allocate heap number in new space.
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map. The other fields are left uninitialized.
|
||||
mov(FieldOperand(result, HeapObject::kMapOffset),
|
||||
Immediate(isolate()->factory()->cons_string_map()));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteConsString(Register result,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
Allocate(ConsString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map. The other fields are left uninitialized.
|
||||
mov(FieldOperand(result, HeapObject::kMapOffset),
|
||||
Immediate(isolate()->factory()->cons_one_byte_string_map()));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateTwoByteSlicedString(Register result,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
// Allocate heap number in new space.
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map. The other fields are left uninitialized.
|
||||
mov(FieldOperand(result, HeapObject::kMapOffset),
|
||||
Immediate(isolate()->factory()->sliced_string_map()));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateOneByteSlicedString(Register result,
|
||||
Register scratch1,
|
||||
Register scratch2,
|
||||
Label* gc_required) {
|
||||
// Allocate heap number in new space.
|
||||
Allocate(SlicedString::kSize, result, scratch1, scratch2, gc_required,
|
||||
NO_ALLOCATION_FLAGS);
|
||||
|
||||
// Set the map. The other fields are left uninitialized.
|
||||
mov(FieldOperand(result, HeapObject::kMapOffset),
|
||||
Immediate(isolate()->factory()->sliced_one_byte_string_map()));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::AllocateJSValue(Register result, Register constructor,
|
||||
Register value, Register scratch,
|
||||
Label* gc_required) {
|
||||
@ -2525,19 +2392,6 @@ void MacroAssembler::LoadAccessor(Register dst, Register holder,
|
||||
mov(dst, FieldOperand(dst, offset));
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpIfInstanceTypeIsNotSequentialOneByte(
|
||||
Register instance_type, Register scratch, Label* failure) {
|
||||
if (!scratch.is(instance_type)) {
|
||||
mov(scratch, instance_type);
|
||||
}
|
||||
and_(scratch,
|
||||
kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask);
|
||||
cmp(scratch, kStringTag | kSeqStringTag | kOneByteStringTag);
|
||||
j(not_equal, failure);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpIfNotBothSequentialOneByteStrings(Register object1,
|
||||
Register object2,
|
||||
Register scratch1,
|
||||
|
@ -602,31 +602,6 @@ class MacroAssembler: public Assembler {
|
||||
void AllocateHeapNumber(Register result, Register scratch1, Register scratch2,
|
||||
Label* gc_required, MutableMode mode = IMMUTABLE);
|
||||
|
||||
// Allocate a sequential string. All the header fields of the string object
|
||||
// are initialized.
|
||||
void AllocateTwoByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3, Label* gc_required);
|
||||
void AllocateOneByteString(Register result, Register length,
|
||||
Register scratch1, Register scratch2,
|
||||
Register scratch3, Label* gc_required);
|
||||
void AllocateOneByteString(Register result, int length, Register scratch1,
|
||||
Register scratch2, Label* gc_required);
|
||||
|
||||
// Allocate a raw cons string object. Only the map field of the result is
|
||||
// initialized.
|
||||
void AllocateTwoByteConsString(Register result, Register scratch1,
|
||||
Register scratch2, Label* gc_required);
|
||||
void AllocateOneByteConsString(Register result, Register scratch1,
|
||||
Register scratch2, Label* gc_required);
|
||||
|
||||
// Allocate a raw sliced string object. Only the map field of the result is
|
||||
// initialized.
|
||||
void AllocateTwoByteSlicedString(Register result, Register scratch1,
|
||||
Register scratch2, Label* gc_required);
|
||||
void AllocateOneByteSlicedString(Register result, Register scratch1,
|
||||
Register scratch2, Label* gc_required);
|
||||
|
||||
// Allocate and initialize a JSValue wrapper with the specified {constructor}
|
||||
// and {value}.
|
||||
void AllocateJSValue(Register result, Register constructor, Register value,
|
||||
@ -841,13 +816,6 @@ class MacroAssembler: public Assembler {
|
||||
// ---------------------------------------------------------------------------
|
||||
// String utilities.
|
||||
|
||||
// Check whether the instance type represents a flat one-byte string. Jump to
|
||||
// the label if not. If the instance type can be scratched specify same
|
||||
// register for both instance type and scratch.
|
||||
void JumpIfInstanceTypeIsNotSequentialOneByte(
|
||||
Register instance_type, Register scratch,
|
||||
Label* on_not_flat_one_byte_string);
|
||||
|
||||
// Checks if both objects are sequential one-byte strings, and jumps to label
|
||||
// if either is not.
|
||||
void JumpIfNotBothSequentialOneByteStrings(
|
||||
|
Loading…
Reference in New Issue
Block a user