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

Side by Side Diff: src/mips/macro-assembler-mips.cc

Issue 8568013: Introduce read buffer for external strings when using charAt (ia32). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4874 matching lines...) Expand 10 before | Expand all | Expand 10 after
4885 // Otherwise it's String::kHeaderSize + string->length() * (1 or 2). 4885 // Otherwise it's String::kHeaderSize + string->length() * (1 or 2).
4886 // External strings are the only ones with the kExternalStringTag bit 4886 // External strings are the only ones with the kExternalStringTag bit
4887 // set. 4887 // set.
4888 ASSERT_EQ(0, kSeqStringTag & kExternalStringTag); 4888 ASSERT_EQ(0, kSeqStringTag & kExternalStringTag);
4889 ASSERT_EQ(0, kConsStringTag & kExternalStringTag); 4889 ASSERT_EQ(0, kConsStringTag & kExternalStringTag);
4890 And(t8, instance_type, Operand(kExternalStringTag)); 4890 And(t8, instance_type, Operand(kExternalStringTag));
4891 { 4891 {
4892 Label skip; 4892 Label skip;
4893 Branch(&skip, eq, t8, Operand(zero_reg)); 4893 Branch(&skip, eq, t8, Operand(zero_reg));
4894 li(length, ExternalString::kSize); 4894 li(length, ExternalString::kSize);
4895 And(t8, instance_type, Operand(kBufferedStringTag));
4896 Branch(&is_data_object, eq, t8, Operand(zero_reg));
4897 li(length, ExternalString::kExtendedSize);
4895 Branch(&is_data_object); 4898 Branch(&is_data_object);
4896 bind(&skip); 4899 bind(&skip);
4897 } 4900 }
4898 4901
4899 // Sequential string, either ASCII or UC16. 4902 // Sequential string, either ASCII or UC16.
4900 // For ASCII (char-size of 1) we shift the smi tag away to get the length. 4903 // For ASCII (char-size of 1) we shift the smi tag away to get the length.
4901 // For UC16 (char-size of 2) we just leave the smi tag in place, thereby 4904 // For UC16 (char-size of 2) we just leave the smi tag in place, thereby
4902 // getting the length multiplied by 2. 4905 // getting the length multiplied by 2.
4903 ASSERT(kAsciiStringTag == 4 && kStringEncodingMask == 4); 4906 ASSERT(kAsciiStringTag == 4 && kStringEncodingMask == 4);
4904 ASSERT(kSmiTag == 0 && kSmiTagSize == 1); 4907 ASSERT(kSmiTag == 0 && kSmiTagSize == 1);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
5044 opcode == BGTZL); 5047 opcode == BGTZL);
5045 opcode = (cond == eq) ? BEQ : BNE; 5048 opcode = (cond == eq) ? BEQ : BNE;
5046 instr = (instr & ~kOpcodeMask) | opcode; 5049 instr = (instr & ~kOpcodeMask) | opcode;
5047 masm_.emit(instr); 5050 masm_.emit(instr);
5048 } 5051 }
5049 5052
5050 5053
5051 } } // namespace v8::internal 5054 } } // namespace v8::internal
5052 5055
5053 #endif // V8_TARGET_ARCH_MIPS 5056 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698