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

Unified Diff: src/mips/code-stubs-mips.cc

Issue 542193003: MIPS: Rename ascii to one-byte where applicable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips/code-stubs-mips.h ('k') | src/mips/codegen-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/code-stubs-mips.cc
diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc
index 899f278f42374d2004fce21dccdd77a76ce162f9..a66d7407fa76d421db9a2168bdc065096bea802b 100644
--- a/src/mips/code-stubs-mips.cc
+++ b/src/mips/code-stubs-mips.cc
@@ -745,19 +745,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, t0);
+ StringHelper::GenerateFlatOneByteStringEquals(masm, lhs, rhs, a2, a3, t0);
} else {
- StringHelper::GenerateCompareFlatAsciiStrings(masm, lhs, rhs, a2, a3, t0,
- t1);
+ StringHelper::GenerateCompareFlatOneByteStrings(masm, lhs, rhs, a2, a3, t0,
+ t1);
}
// Never falls through to here.
@@ -2157,7 +2157,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
STATIC_ASSERT(kOneByteStringTag == 4);
STATIC_ASSERT(kTwoByteStringTag == 0);
__ And(a0, a0, Operand(kStringEncodingMask)); // Non-zero for ASCII.
paul.l... 2014/09/10 19:12:56 nit: ascii in comment.
- __ lw(t9, FieldMemOperand(regexp_data, JSRegExp::kDataAsciiCodeOffset));
+ __ lw(t9, FieldMemOperand(regexp_data, JSRegExp::kDataOneByteCodeOffset));
__ sra(a3, a0, 2); // a3 is 1 for ASCII, 0 for UC16 (used below).
__ lw(t1, FieldMemOperand(regexp_data, JSRegExp::kDataUC16CodeOffset));
__ Movz(t9, t1, a0); // If UC16 (a0 is 0), replace t9 w/kDataUC16CodeOffset.
@@ -2170,7 +2170,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)
@@ -2225,7 +2225,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
__ sw(a0, MemOperand(sp, 1 * kPointerSize));
// 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).
+ // calculate the shift of the index (0 for one-byte and 1 for two-byte).
__ Addu(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
@@ -2860,11 +2860,6 @@ void CallICStub::GenerateMiss(MacroAssembler* masm, IC::UtilityId id) {
// StringCharCodeAtGenerator.
void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) {
- Label flat_string;
- Label ascii_string;
- Label got_char_code;
- Label sliced_string;
-
DCHECK(!t0.is(index_));
DCHECK(!t0.is(result_));
DCHECK(!t0.is(object_));
@@ -2976,7 +2971,7 @@ void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) {
__ Branch(&slow_case_, ne, t0, Operand(zero_reg));
__ 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);
__ sll(t0, code_, kPointerSizeLog2 - kSmiTagSize);
__ Addu(result_, result_, t0);
@@ -3005,10 +3000,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,
@@ -3172,7 +3164,7 @@ void SubStringStub::Generate(MacroAssembler* masm) {
STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0);
__ And(t0, a1, Operand(kStringEncodingMask));
__ Branch(&two_byte_slice, eq, t0, Operand(zero_reg));
- __ AllocateAsciiSlicedString(v0, a2, t2, t3, &runtime);
+ __ AllocateOneByteSlicedString(v0, a2, t2, t3, &runtime);
__ jmp(&set_slice_header);
__ bind(&two_byte_slice);
__ AllocateTwoByteSlicedString(v0, a2, t2, t3, &runtime);
@@ -3216,7 +3208,7 @@ void SubStringStub::Generate(MacroAssembler* masm) {
__ Branch(&two_byte_sequential, eq, t0, Operand(zero_reg));
// Allocate and copy the resulting ASCII string.
- __ AllocateAsciiString(v0, a2, t0, t2, t3, &runtime);
+ __ AllocateOneByteString(v0, a2, t0, t2, t3, &runtime);
// Locate first character of substring to copy.
__ Addu(t1, t1, a3);
@@ -3275,11 +3267,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.
@@ -3304,9 +3294,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);
@@ -3314,7 +3303,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;
@@ -3330,9 +3319,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);
@@ -3355,7 +3343,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) {
@@ -3405,13 +3393,13 @@ void StringCompareStub::Generate(MacroAssembler* masm) {
__ bind(&not_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.
__ IncrementCounter(counters->string_compare_native(), 1, a2, a3);
__ Addu(sp, sp, Operand(2 * kPointerSize));
- StringHelper::GenerateCompareFlatAsciiStrings(masm, a1, a0, a2, a3, t0, t1);
+ StringHelper::GenerateCompareFlatOneByteStrings(masm, a1, a0, a2, a3, t0, t1);
__ bind(&runtime);
__ TailCallRuntime(Runtime::kStringCompare, 2, 1);
@@ -3704,18 +3692,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.
« no previous file with comments | « src/mips/code-stubs-mips.h ('k') | src/mips/codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698