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

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

Issue 1233903003: MIPS64: Fix string stubs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/code-stubs-mips64.cc
diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc
index b8204b332f7cb97d143cd32e00cfbb18e37c5be8..b182330d1be27e5ce2193fa272702a9e07b84e57 100644
--- a/src/mips64/code-stubs-mips64.cc
+++ b/src/mips64/code-stubs-mips64.cc
@@ -3200,25 +3200,17 @@ void StringCharCodeAtGenerator::GenerateSlow(
void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) {
// Fast case of Heap::LookupSingleCharacterStringFromCode.
-
- DCHECK(!a4.is(result_));
- DCHECK(!a4.is(code_));
-
- STATIC_ASSERT(kSmiTag == 0);
- DCHECK(base::bits::IsPowerOfTwo32(String::kMaxOneByteCharCodeU + 1));
- __ And(a4, code_, Operand(kSmiTagMask |
- ((~String::kMaxOneByteCharCodeU) << kSmiTagSize)));
- __ Branch(&slow_case_, ne, a4, Operand(zero_reg));
-
+ __ JumpIfNotSmi(code_, &slow_case_);
+ __ Branch(&slow_case_, hi, code_,
+ Operand(Smi::FromInt(String::kMaxOneByteCharCode)));
__ LoadRoot(result_, Heap::kSingleCharacterStringCacheRootIndex);
// At this point code register contains smi tagged one_byte char code.
- STATIC_ASSERT(kSmiTag == 0);
- __ SmiScale(a4, code_, kPointerSizeLog2);
- __ Daddu(result_, result_, a4);
+ __ SmiScale(at, code_, kPointerSizeLog2);
+ __ Daddu(result_, result_, at);
__ ld(result_, FieldMemOperand(result_, FixedArray::kHeaderSize));
- __ LoadRoot(a4, Heap::kUndefinedValueRootIndex);
- __ Branch(&slow_case_, eq, result_, Operand(a4));
+ __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
+ __ Branch(&slow_case_, eq, result_, Operand(at));
__ bind(&exit_);
}
@@ -3306,11 +3298,8 @@ void SubStringStub::Generate(MacroAssembler* masm) {
__ ld(a2, MemOperand(sp, kToOffset));
__ ld(a3, MemOperand(sp, kFromOffset));
-// Does not needed?
-// STATIC_ASSERT(kFromOffset == kToOffset + 4);
+
STATIC_ASSERT(kSmiTag == 0);
-// Does not needed?
-// STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 1);
// Utilize delay slots. SmiUntag doesn't emit a jump, everything else is
// safe in this case.
@@ -3503,6 +3492,7 @@ void SubStringStub::Generate(MacroAssembler* masm) {
// a1: instance type
// a2: length
// a3: from index (untagged)
+ __ SmiTag(a3);
StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime,
STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING);
generator.GenerateFast(masm);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698