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

Unified Diff: src/mips/macro-assembler-mips.cc

Issue 1335193002: [builtins] Simplify String constructor code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address Jaro's comments. Created 5 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/macro-assembler-mips.h ('k') | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/macro-assembler-mips.cc
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc
index 8e3bc03d37e40ef2e6cad9e756e9950cc4a20dc7..e66fad9092c7a1e62f74c35e44308a29d7573a28 100644
--- a/src/mips/macro-assembler-mips.cc
+++ b/src/mips/macro-assembler-mips.cc
@@ -5199,86 +5199,6 @@ void MacroAssembler::JumpIfNotHeapNumber(Register object,
}
-void MacroAssembler::LookupNumberStringCache(Register object,
- Register result,
- Register scratch1,
- Register scratch2,
- Register scratch3,
- Label* not_found) {
- // Use of registers. Register result is used as a temporary.
- Register number_string_cache = result;
- Register mask = scratch3;
-
- // Load the number string cache.
- LoadRoot(number_string_cache, Heap::kNumberStringCacheRootIndex);
-
- // Make the hash mask from the length of the number string cache. It
- // contains two elements (number and string) for each cache entry.
- lw(mask, FieldMemOperand(number_string_cache, FixedArray::kLengthOffset));
- // Divide length by two (length is a smi).
- sra(mask, mask, kSmiTagSize + 1);
- Addu(mask, mask, -1); // Make mask.
-
- // Calculate the entry in the number string cache. The hash value in the
- // number string cache for smis is just the smi value, and the hash for
- // doubles is the xor of the upper and lower words. See
- // Heap::GetNumberStringCache.
- Label is_smi;
- Label load_result_from_cache;
- JumpIfSmi(object, &is_smi);
- CheckMap(object,
- scratch1,
- Heap::kHeapNumberMapRootIndex,
- not_found,
- DONT_DO_SMI_CHECK);
-
- STATIC_ASSERT(8 == kDoubleSize);
- Addu(scratch1,
- object,
- Operand(HeapNumber::kValueOffset - kHeapObjectTag));
- lw(scratch2, MemOperand(scratch1, kPointerSize));
- lw(scratch1, MemOperand(scratch1, 0));
- Xor(scratch1, scratch1, Operand(scratch2));
- And(scratch1, scratch1, Operand(mask));
-
- // Calculate address of entry in string cache: each entry consists
- // of two pointer sized fields.
- sll(scratch1, scratch1, kPointerSizeLog2 + 1);
- Addu(scratch1, number_string_cache, scratch1);
-
- Register probe = mask;
- lw(probe, FieldMemOperand(scratch1, FixedArray::kHeaderSize));
- JumpIfSmi(probe, not_found);
- ldc1(f12, FieldMemOperand(object, HeapNumber::kValueOffset));
- ldc1(f14, FieldMemOperand(probe, HeapNumber::kValueOffset));
- BranchF(&load_result_from_cache, NULL, eq, f12, f14);
- Branch(not_found);
-
- bind(&is_smi);
- Register scratch = scratch1;
- sra(scratch, object, 1); // Shift away the tag.
- And(scratch, mask, Operand(scratch));
-
- // Calculate address of entry in string cache: each entry consists
- // of two pointer sized fields.
- sll(scratch, scratch, kPointerSizeLog2 + 1);
- Addu(scratch, number_string_cache, scratch);
-
- // Check if the entry is the smi we are looking for.
- lw(probe, FieldMemOperand(scratch, FixedArray::kHeaderSize));
- Branch(not_found, ne, object, Operand(probe));
-
- // Get the result from the cache.
- bind(&load_result_from_cache);
- lw(result, FieldMemOperand(scratch, FixedArray::kHeaderSize + kPointerSize));
-
- IncrementCounter(isolate()->counters()->number_to_string_native(),
- 1,
- scratch1,
- scratch2);
-}
-
-
void MacroAssembler::JumpIfNonSmisNotBothSequentialOneByteStrings(
Register first, Register second, Register scratch1, Register scratch2,
Label* failure) {
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698