Make kAsciiDataHintTag have correct semantics for all both 1 and 2 byte string types.
BUG= Review URL: https://chromiumcodereview.appspot.com/11361171 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12937 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
693ee09cf3
commit
ce884e13e3
@ -6498,11 +6498,6 @@ void StringAddStub::Generate(MacroAssembler* masm) {
|
|||||||
__ tst(r4, Operand(kAsciiDataHintMask));
|
__ tst(r4, Operand(kAsciiDataHintMask));
|
||||||
__ tst(r5, Operand(kAsciiDataHintMask), ne);
|
__ tst(r5, Operand(kAsciiDataHintMask), ne);
|
||||||
__ b(ne, &ascii_data);
|
__ b(ne, &ascii_data);
|
||||||
__ eor(r4, r4, Operand(r5));
|
|
||||||
STATIC_ASSERT(kOneByteStringTag != 0 && kAsciiDataHintTag != 0);
|
|
||||||
__ and_(r4, r4, Operand(kOneByteStringTag | kAsciiDataHintTag));
|
|
||||||
__ cmp(r4, Operand(kOneByteStringTag | kAsciiDataHintTag));
|
|
||||||
__ b(eq, &ascii_data);
|
|
||||||
|
|
||||||
// Allocate a two byte cons string.
|
// Allocate a two byte cons string.
|
||||||
__ AllocateTwoByteConsString(r7, r6, r4, r5, &call_runtime);
|
__ AllocateTwoByteConsString(r7, r6, r4, r5, &call_runtime);
|
||||||
|
@ -5748,13 +5748,6 @@ void StringAddStub::Generate(MacroAssembler* masm) {
|
|||||||
// edi: second instance type.
|
// edi: second instance type.
|
||||||
__ test(ecx, Immediate(kAsciiDataHintMask));
|
__ test(ecx, Immediate(kAsciiDataHintMask));
|
||||||
__ j(not_zero, &ascii_data);
|
__ j(not_zero, &ascii_data);
|
||||||
__ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset));
|
|
||||||
__ movzx_b(ecx, FieldOperand(ecx, Map::kInstanceTypeOffset));
|
|
||||||
__ xor_(edi, ecx);
|
|
||||||
STATIC_ASSERT(kOneByteStringTag != 0 && kAsciiDataHintTag != 0);
|
|
||||||
__ and_(edi, kOneByteStringTag | kAsciiDataHintTag);
|
|
||||||
__ cmp(edi, kOneByteStringTag | kAsciiDataHintTag);
|
|
||||||
__ j(equal, &ascii_data);
|
|
||||||
// Allocate a two byte cons string.
|
// Allocate a two byte cons string.
|
||||||
__ AllocateTwoByteConsString(ecx, edi, no_reg, &call_runtime);
|
__ AllocateTwoByteConsString(ecx, edi, no_reg, &call_runtime);
|
||||||
__ jmp(&allocated);
|
__ jmp(&allocated);
|
||||||
|
@ -333,8 +333,7 @@ bool String::IsTwoByteRepresentationUnderneath() {
|
|||||||
|
|
||||||
bool String::HasOnlyAsciiChars() {
|
bool String::HasOnlyAsciiChars() {
|
||||||
uint32_t type = map()->instance_type();
|
uint32_t type = map()->instance_type();
|
||||||
return (type & kStringEncodingMask) == kOneByteStringTag ||
|
return (type & kAsciiDataHintMask) == kAsciiDataHintTag;
|
||||||
(type & kAsciiDataHintMask) == kAsciiDataHintTag;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -530,39 +530,46 @@ const uint32_t kShortcutTypeTag = kConsStringTag;
|
|||||||
enum InstanceType {
|
enum InstanceType {
|
||||||
// String types.
|
// String types.
|
||||||
SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kSeqStringTag,
|
SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kSeqStringTag,
|
||||||
ASCII_SYMBOL_TYPE = kOneByteStringTag | kSymbolTag | kSeqStringTag,
|
ASCII_SYMBOL_TYPE = kOneByteStringTag | kAsciiDataHintTag | kSymbolTag |
|
||||||
|
kSeqStringTag,
|
||||||
CONS_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kConsStringTag,
|
CONS_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kConsStringTag,
|
||||||
CONS_ASCII_SYMBOL_TYPE = kOneByteStringTag | kSymbolTag | kConsStringTag,
|
CONS_ASCII_SYMBOL_TYPE = kOneByteStringTag | kAsciiDataHintTag | kSymbolTag |
|
||||||
|
kConsStringTag,
|
||||||
SHORT_EXTERNAL_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag |
|
SHORT_EXTERNAL_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag |
|
||||||
kExternalStringTag | kShortExternalStringTag,
|
kExternalStringTag | kShortExternalStringTag,
|
||||||
SHORT_EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE =
|
SHORT_EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE =
|
||||||
kTwoByteStringTag | kSymbolTag | kExternalStringTag |
|
kTwoByteStringTag | kSymbolTag | kExternalStringTag |
|
||||||
kAsciiDataHintTag | kShortExternalStringTag,
|
kAsciiDataHintTag | kShortExternalStringTag,
|
||||||
SHORT_EXTERNAL_ASCII_SYMBOL_TYPE = kOneByteStringTag | kExternalStringTag |
|
SHORT_EXTERNAL_ASCII_SYMBOL_TYPE = kOneByteStringTag | kAsciiDataHintTag |
|
||||||
kSymbolTag | kShortExternalStringTag,
|
kExternalStringTag | kSymbolTag |
|
||||||
|
kShortExternalStringTag,
|
||||||
EXTERNAL_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kExternalStringTag,
|
EXTERNAL_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kExternalStringTag,
|
||||||
EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE =
|
EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE =
|
||||||
kTwoByteStringTag | kSymbolTag | kExternalStringTag | kAsciiDataHintTag,
|
kTwoByteStringTag | kSymbolTag | kExternalStringTag | kAsciiDataHintTag,
|
||||||
EXTERNAL_ASCII_SYMBOL_TYPE =
|
EXTERNAL_ASCII_SYMBOL_TYPE =
|
||||||
kOneByteStringTag | kSymbolTag | kExternalStringTag,
|
kOneByteStringTag | kAsciiDataHintTag | kSymbolTag | kExternalStringTag,
|
||||||
STRING_TYPE = kTwoByteStringTag | kSeqStringTag,
|
STRING_TYPE = kTwoByteStringTag | kSeqStringTag,
|
||||||
ASCII_STRING_TYPE = kOneByteStringTag | kSeqStringTag,
|
ASCII_STRING_TYPE = kOneByteStringTag | kAsciiDataHintTag | kSeqStringTag,
|
||||||
CONS_STRING_TYPE = kTwoByteStringTag | kConsStringTag,
|
CONS_STRING_TYPE = kTwoByteStringTag | kConsStringTag,
|
||||||
CONS_ASCII_STRING_TYPE = kOneByteStringTag | kConsStringTag,
|
CONS_ASCII_STRING_TYPE =
|
||||||
|
kOneByteStringTag | kAsciiDataHintTag | kConsStringTag,
|
||||||
SLICED_STRING_TYPE = kTwoByteStringTag | kSlicedStringTag,
|
SLICED_STRING_TYPE = kTwoByteStringTag | kSlicedStringTag,
|
||||||
SLICED_ASCII_STRING_TYPE = kOneByteStringTag | kSlicedStringTag,
|
SLICED_ASCII_STRING_TYPE =
|
||||||
|
kOneByteStringTag | kAsciiDataHintTag | kSlicedStringTag,
|
||||||
SHORT_EXTERNAL_STRING_TYPE =
|
SHORT_EXTERNAL_STRING_TYPE =
|
||||||
kTwoByteStringTag | kExternalStringTag | kShortExternalStringTag,
|
kTwoByteStringTag | kExternalStringTag | kShortExternalStringTag,
|
||||||
SHORT_EXTERNAL_STRING_WITH_ASCII_DATA_TYPE =
|
SHORT_EXTERNAL_STRING_WITH_ASCII_DATA_TYPE =
|
||||||
kTwoByteStringTag | kExternalStringTag |
|
kTwoByteStringTag | kExternalStringTag |
|
||||||
kAsciiDataHintTag | kShortExternalStringTag,
|
kAsciiDataHintTag | kShortExternalStringTag,
|
||||||
SHORT_EXTERNAL_ASCII_STRING_TYPE =
|
SHORT_EXTERNAL_ASCII_STRING_TYPE =
|
||||||
kOneByteStringTag | kExternalStringTag | kShortExternalStringTag,
|
kOneByteStringTag | kAsciiDataHintTag |
|
||||||
|
kExternalStringTag | kShortExternalStringTag,
|
||||||
EXTERNAL_STRING_TYPE = kTwoByteStringTag | kExternalStringTag,
|
EXTERNAL_STRING_TYPE = kTwoByteStringTag | kExternalStringTag,
|
||||||
EXTERNAL_STRING_WITH_ASCII_DATA_TYPE =
|
EXTERNAL_STRING_WITH_ASCII_DATA_TYPE =
|
||||||
kTwoByteStringTag | kExternalStringTag | kAsciiDataHintTag,
|
kTwoByteStringTag | kExternalStringTag | kAsciiDataHintTag,
|
||||||
// LAST_STRING_TYPE
|
// LAST_STRING_TYPE
|
||||||
EXTERNAL_ASCII_STRING_TYPE = kOneByteStringTag | kExternalStringTag,
|
EXTERNAL_ASCII_STRING_TYPE =
|
||||||
|
kOneByteStringTag | kAsciiDataHintTag | kExternalStringTag,
|
||||||
PRIVATE_EXTERNAL_ASCII_STRING_TYPE = EXTERNAL_ASCII_STRING_TYPE,
|
PRIVATE_EXTERNAL_ASCII_STRING_TYPE = EXTERNAL_ASCII_STRING_TYPE,
|
||||||
|
|
||||||
// Objects allocated in their own spaces (never in new space).
|
// Objects allocated in their own spaces (never in new space).
|
||||||
|
@ -4765,11 +4765,6 @@ void StringAddStub::Generate(MacroAssembler* masm) {
|
|||||||
// r9: second instance type.
|
// r9: second instance type.
|
||||||
__ testb(rcx, Immediate(kAsciiDataHintMask));
|
__ testb(rcx, Immediate(kAsciiDataHintMask));
|
||||||
__ j(not_zero, &ascii_data);
|
__ j(not_zero, &ascii_data);
|
||||||
__ xor_(r8, r9);
|
|
||||||
STATIC_ASSERT(kOneByteStringTag != 0 && kAsciiDataHintTag != 0);
|
|
||||||
__ andb(r8, Immediate(kOneByteStringTag | kAsciiDataHintTag));
|
|
||||||
__ cmpb(r8, Immediate(kOneByteStringTag | kAsciiDataHintTag));
|
|
||||||
__ j(equal, &ascii_data);
|
|
||||||
// Allocate a two byte cons string.
|
// Allocate a two byte cons string.
|
||||||
__ AllocateTwoByteConsString(rcx, rdi, no_reg, &call_runtime);
|
__ AllocateTwoByteConsString(rcx, rdi, no_reg, &call_runtime);
|
||||||
__ jmp(&allocated);
|
__ jmp(&allocated);
|
||||||
|
Loading…
Reference in New Issue
Block a user