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

Side by Side Diff: src/objects-inl.h

Issue 6269: KMP string search using direct memory access and templates for type specialization. (Closed)
Patch Set: Created 12 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/objects.h ('k') | src/runtime.cc » ('j') | src/runtime.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 WRITE_BYTE_FIELD(this, kHeaderSize + index * kCharSize, 1347 WRITE_BYTE_FIELD(this, kHeaderSize + index * kCharSize,
1348 static_cast<byte>(value)); 1348 static_cast<byte>(value));
1349 } 1349 }
1350 1350
1351 1351
1352 Address AsciiString::GetCharsAddress() { 1352 Address AsciiString::GetCharsAddress() {
1353 return FIELD_ADDR(this, kHeaderSize); 1353 return FIELD_ADDR(this, kHeaderSize);
1354 } 1354 }
1355 1355
1356 1356
1357 Address TwoByteString::GetCharsAddress() {
1358 return FIELD_ADDR(this, kHeaderSize);
1359 }
1360
1361
1357 uint16_t TwoByteString::TwoByteStringGet(int index) { 1362 uint16_t TwoByteString::TwoByteStringGet(int index) {
1358 ASSERT(index >= 0 && index < length()); 1363 ASSERT(index >= 0 && index < length());
1359 return READ_SHORT_FIELD(this, kHeaderSize + index * kShortSize); 1364 return READ_SHORT_FIELD(this, kHeaderSize + index * kShortSize);
1360 } 1365 }
1361 1366
1362 1367
1363 void TwoByteString::TwoByteStringSet(int index, uint16_t value) { 1368 void TwoByteString::TwoByteStringSet(int index, uint16_t value) {
1364 ASSERT(index >= 0 && index < length()); 1369 ASSERT(index >= 0 && index < length());
1365 WRITE_SHORT_FIELD(this, kHeaderSize + index * kShortSize, value); 1370 WRITE_SHORT_FIELD(this, kHeaderSize + index * kShortSize, value);
1366 } 1371 }
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
2174 #undef WRITE_INT_FIELD 2179 #undef WRITE_INT_FIELD
2175 #undef READ_SHORT_FIELD 2180 #undef READ_SHORT_FIELD
2176 #undef WRITE_SHORT_FIELD 2181 #undef WRITE_SHORT_FIELD
2177 #undef READ_BYTE_FIELD 2182 #undef READ_BYTE_FIELD
2178 #undef WRITE_BYTE_FIELD 2183 #undef WRITE_BYTE_FIELD
2179 2184
2180 2185
2181 } } // namespace v8::internal 2186 } } // namespace v8::internal
2182 2187
2183 #endif // V8_OBJECTS_INL_H_ 2188 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/runtime.cc » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698