Index: src/mips64/code-stubs-mips64.cc |
diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc |
index bb81a4f8c6a1957b02a3dc7d9b582580967075ef..29313a90a57b1f701c84ab65b7953266834dd015 100644 |
--- a/src/mips64/code-stubs-mips64.cc |
+++ b/src/mips64/code-stubs-mips64.cc |
@@ -740,19 +740,19 @@ void CompareICStub::GenerateGeneric(MacroAssembler* masm) { |
masm, lhs, rhs, &flat_string_check, &slow); |
} |
- // Check for both being sequential ASCII strings, and inline if that is the |
- // case. |
+ // Check for both being sequential one-byte strings, |
+ // and inline if that is the case. |
__ bind(&flat_string_check); |
- __ JumpIfNonSmisNotBothSequentialAsciiStrings(lhs, rhs, a2, a3, &slow); |
+ __ JumpIfNonSmisNotBothSequentialOneByteStrings(lhs, rhs, a2, a3, &slow); |
__ IncrementCounter(isolate()->counters()->string_compare_native(), 1, a2, |
a3); |
if (cc == eq) { |
- StringHelper::GenerateFlatAsciiStringEquals(masm, lhs, rhs, a2, a3, a4); |
+ StringHelper::GenerateFlatOneByteStringEquals(masm, lhs, rhs, a2, a3, a4); |
} else { |
- StringHelper::GenerateCompareFlatAsciiStrings(masm, lhs, rhs, a2, a3, a4, |
- a5); |
+ StringHelper::GenerateCompareFlatOneByteStrings(masm, lhs, rhs, a2, a3, a4, |
+ a5); |
} |
// Never falls through to here. |
@@ -2157,9 +2157,9 @@ void RegExpExecStub::Generate(MacroAssembler* masm) { |
STATIC_ASSERT(kStringEncodingMask == 4); |
STATIC_ASSERT(kOneByteStringTag == 4); |
STATIC_ASSERT(kTwoByteStringTag == 0); |
- __ And(a0, a0, Operand(kStringEncodingMask)); // Non-zero for ASCII. |
- __ ld(t9, FieldMemOperand(regexp_data, JSRegExp::kDataAsciiCodeOffset)); |
- __ dsra(a3, a0, 2); // a3 is 1 for ASCII, 0 for UC16 (used below). |
+ __ And(a0, a0, Operand(kStringEncodingMask)); // Non-zero for one_byte. |
+ __ ld(t9, FieldMemOperand(regexp_data, JSRegExp::kDataOneByteCodeOffset)); |
+ __ dsra(a3, a0, 2); // a3 is 1 for one_byte, 0 for UC16 (used below). |
__ ld(a5, FieldMemOperand(regexp_data, JSRegExp::kDataUC16CodeOffset)); |
__ Movz(t9, a5, a0); // If UC16 (a0 is 0), replace t9 w/kDataUC16CodeOffset. |
@@ -2171,7 +2171,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) { |
__ JumpIfSmi(t9, &runtime); |
// a1: previous index |
- // a3: encoding of subject string (1 if ASCII, 0 if two_byte); |
+ // a3: encoding of subject string (1 if one_byte, 0 if two_byte); |
// t9: code |
// subject: Subject string |
// regexp_data: RegExp data (FixedArray) |
@@ -2256,7 +2256,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) { |
} |
// For arguments 4 and 3 get string length, calculate start of string data |
- // and calculate the shift of the index (0 for ASCII and 1 for two byte). |
+ // and calculate the shift of the index (0 for one_byte and 1 for two byte). |
__ Daddu(t2, subject, Operand(SeqString::kHeaderSize - kHeapObjectTag)); |
__ Xor(a3, a3, Operand(1)); // 1 for 2-byte str, 0 for 1-byte. |
// Load the length from the original subject string from the previous stack |
@@ -2748,11 +2748,6 @@ void CallConstructStub::Generate(MacroAssembler* masm) { |
// StringCharCodeAtGenerator. |
void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) { |
- Label flat_string; |
- Label ascii_string; |
- Label got_char_code; |
- Label sliced_string; |
- |
DCHECK(!a4.is(index_)); |
DCHECK(!a4.is(result_)); |
DCHECK(!a4.is(object_)); |
@@ -3010,7 +3005,7 @@ void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { |
__ LoadRoot(result_, Heap::kSingleCharacterStringCacheRootIndex); |
- // At this point code register contains smi tagged ASCII char code. |
+ // At this point code register contains smi tagged one_byte char code. |
STATIC_ASSERT(kSmiTag == 0); |
__ SmiScale(a4, code_, kPointerSizeLog2); |
__ Daddu(result_, result_, a4); |
@@ -3039,10 +3034,7 @@ void StringCharFromCodeGenerator::GenerateSlow( |
} |
-enum CopyCharactersFlags { |
- COPY_ASCII = 1, |
- DEST_ALWAYS_ALIGNED = 2 |
-}; |
+enum CopyCharactersFlags { COPY_ONE_BYTE = 1, DEST_ALWAYS_ALIGNED = 2 }; |
void StringHelper::GenerateCopyCharacters(MacroAssembler* masm, |
@@ -3210,7 +3202,7 @@ void SubStringStub::Generate(MacroAssembler* masm) { |
STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); |
__ And(a4, a1, Operand(kStringEncodingMask)); |
__ Branch(&two_byte_slice, eq, a4, Operand(zero_reg)); |
- __ AllocateAsciiSlicedString(v0, a2, a6, a7, &runtime); |
+ __ AllocateOneByteSlicedString(v0, a2, a6, a7, &runtime); |
__ jmp(&set_slice_header); |
__ bind(&two_byte_slice); |
__ AllocateTwoByteSlicedString(v0, a2, a6, a7, &runtime); |
@@ -3253,8 +3245,8 @@ void SubStringStub::Generate(MacroAssembler* masm) { |
__ And(a4, a1, Operand(kStringEncodingMask)); |
__ Branch(&two_byte_sequential, eq, a4, Operand(zero_reg)); |
- // Allocate and copy the resulting ASCII string. |
- __ AllocateAsciiString(v0, a2, a4, a6, a7, &runtime); |
+ // Allocate and copy the resulting one_byte string. |
+ __ AllocateOneByteString(v0, a2, a4, a6, a7, &runtime); |
// Locate first character of substring to copy. |
__ Daddu(a5, a5, a3); |
@@ -3312,11 +3304,9 @@ void SubStringStub::Generate(MacroAssembler* masm) { |
} |
-void StringHelper::GenerateFlatAsciiStringEquals(MacroAssembler* masm, |
- Register left, Register right, |
- Register scratch1, |
- Register scratch2, |
- Register scratch3) { |
+void StringHelper::GenerateFlatOneByteStringEquals( |
+ MacroAssembler* masm, Register left, Register right, Register scratch1, |
+ Register scratch2, Register scratch3) { |
Register length = scratch1; |
// Compare lengths. |
@@ -3341,9 +3331,8 @@ void StringHelper::GenerateFlatAsciiStringEquals(MacroAssembler* masm, |
// Compare characters. |
__ bind(&compare_chars); |
- GenerateAsciiCharsCompareLoop(masm, |
- left, right, length, scratch2, scratch3, v0, |
- &strings_not_equal); |
+ GenerateOneByteCharsCompareLoop(masm, left, right, length, scratch2, scratch3, |
+ v0, &strings_not_equal); |
// Characters are equal. |
__ Ret(USE_DELAY_SLOT); |
@@ -3351,7 +3340,7 @@ void StringHelper::GenerateFlatAsciiStringEquals(MacroAssembler* masm, |
} |
-void StringHelper::GenerateCompareFlatAsciiStrings( |
+void StringHelper::GenerateCompareFlatOneByteStrings( |
MacroAssembler* masm, Register left, Register right, Register scratch1, |
Register scratch2, Register scratch3, Register scratch4) { |
Label result_not_equal, compare_lengths; |
@@ -3367,9 +3356,8 @@ void StringHelper::GenerateCompareFlatAsciiStrings( |
__ Branch(&compare_lengths, eq, min_length, Operand(zero_reg)); |
// Compare loop. |
- GenerateAsciiCharsCompareLoop(masm, |
- left, right, min_length, scratch2, scratch4, v0, |
- &result_not_equal); |
+ GenerateOneByteCharsCompareLoop(masm, left, right, min_length, scratch2, |
+ scratch4, v0, &result_not_equal); |
// Compare lengths - strings up to min-length are equal. |
__ bind(&compare_lengths); |
@@ -3392,7 +3380,7 @@ void StringHelper::GenerateCompareFlatAsciiStrings( |
} |
-void StringHelper::GenerateAsciiCharsCompareLoop( |
+void StringHelper::GenerateOneByteCharsCompareLoop( |
MacroAssembler* masm, Register left, Register right, Register length, |
Register scratch1, Register scratch2, Register scratch3, |
Label* chars_not_equal) { |
@@ -3442,13 +3430,13 @@ void StringCompareStub::Generate(MacroAssembler* masm) { |
__ bind(¬_same); |
- // Check that both objects are sequential ASCII strings. |
- __ JumpIfNotBothSequentialAsciiStrings(a1, a0, a2, a3, &runtime); |
+ // Check that both objects are sequential one_byte strings. |
+ __ JumpIfNotBothSequentialOneByteStrings(a1, a0, a2, a3, &runtime); |
- // Compare flat ASCII strings natively. Remove arguments from stack first. |
+ // Compare flat one_byte strings natively. Remove arguments from stack first. |
__ IncrementCounter(counters->string_compare_native(), 1, a2, a3); |
__ Daddu(sp, sp, Operand(2 * kPointerSize)); |
- StringHelper::GenerateCompareFlatAsciiStrings(masm, a1, a0, a2, a3, a4, a5); |
+ StringHelper::GenerateCompareFlatOneByteStrings(masm, a1, a0, a2, a3, a4, a5); |
__ bind(&runtime); |
__ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
@@ -3741,18 +3729,18 @@ void CompareICStub::GenerateStrings(MacroAssembler* masm) { |
__ bind(&is_symbol); |
} |
- // Check that both strings are sequential ASCII. |
+ // Check that both strings are sequential one_byte. |
Label runtime; |
- __ JumpIfBothInstanceTypesAreNotSequentialAscii( |
- tmp1, tmp2, tmp3, tmp4, &runtime); |
+ __ JumpIfBothInstanceTypesAreNotSequentialOneByte(tmp1, tmp2, tmp3, tmp4, |
+ &runtime); |
- // Compare flat ASCII strings. Returns when done. |
+ // Compare flat one_byte strings. Returns when done. |
if (equality) { |
- StringHelper::GenerateFlatAsciiStringEquals(masm, left, right, tmp1, tmp2, |
- tmp3); |
+ StringHelper::GenerateFlatOneByteStringEquals(masm, left, right, tmp1, tmp2, |
+ tmp3); |
} else { |
- StringHelper::GenerateCompareFlatAsciiStrings(masm, left, right, tmp1, tmp2, |
- tmp3, tmp4); |
+ StringHelper::GenerateCompareFlatOneByteStrings(masm, left, right, tmp1, |
+ tmp2, tmp3, tmp4); |
} |
// Handle more complex cases in runtime. |