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

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

Issue 141046: Added descriptor lookup cache to eliminate some search overhead.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »
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 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 const int kMaxElementsForLinearSearch = 8; 1292 const int kMaxElementsForLinearSearch = 8;
1293 if (StringShape(name).IsSymbol() && nof < kMaxElementsForLinearSearch) { 1293 if (StringShape(name).IsSymbol() && nof < kMaxElementsForLinearSearch) {
1294 return LinearSearch(name, nof); 1294 return LinearSearch(name, nof);
1295 } 1295 }
1296 1296
1297 // Slow case: perform binary search. 1297 // Slow case: perform binary search.
1298 return BinarySearch(name, 0, nof - 1); 1298 return BinarySearch(name, 0, nof - 1);
1299 } 1299 }
1300 1300
1301 1301
1302
1303 String* DescriptorArray::GetKey(int descriptor_number) { 1302 String* DescriptorArray::GetKey(int descriptor_number) {
1304 ASSERT(descriptor_number < number_of_descriptors()); 1303 ASSERT(descriptor_number < number_of_descriptors());
1305 return String::cast(get(ToKeyIndex(descriptor_number))); 1304 return String::cast(get(ToKeyIndex(descriptor_number)));
1306 } 1305 }
1307 1306
1308 1307
1309 Object* DescriptorArray::GetValue(int descriptor_number) { 1308 Object* DescriptorArray::GetValue(int descriptor_number) {
1310 ASSERT(descriptor_number < number_of_descriptors()); 1309 ASSERT(descriptor_number < number_of_descriptors());
1311 return GetContentArray()->get(ToValueIndex(descriptor_number)); 1310 return GetContentArray()->get(ToValueIndex(descriptor_number));
1312 } 1311 }
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after
2676 #undef WRITE_INT_FIELD 2675 #undef WRITE_INT_FIELD
2677 #undef READ_SHORT_FIELD 2676 #undef READ_SHORT_FIELD
2678 #undef WRITE_SHORT_FIELD 2677 #undef WRITE_SHORT_FIELD
2679 #undef READ_BYTE_FIELD 2678 #undef READ_BYTE_FIELD
2680 #undef WRITE_BYTE_FIELD 2679 #undef WRITE_BYTE_FIELD
2681 2680
2682 2681
2683 } } // namespace v8::internal 2682 } } // namespace v8::internal
2684 2683
2685 #endif // V8_OBJECTS_INL_H_ 2684 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698