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

Unified Diff: src/objects-inl.h

Issue 126201: - Changed fast case for computing object size based on usage histogram.... (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/string.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
===================================================================
--- src/objects-inl.h (revision 2190)
+++ src/objects-inl.h (working copy)
@@ -1786,11 +1786,17 @@
int HeapObject::SizeFromMap(Map* map) {
InstanceType instance_type = map->instance_type();
- // Only inline the two most frequent cases.
- if (instance_type == JS_OBJECT_TYPE) return map->instance_size();
+ // Only inline the most frequent cases.
+ if (instance_type == JS_OBJECT_TYPE ||
+ (instance_type & (kIsNotStringMask | kStringRepresentationMask)) ==
+ (kStringTag | kConsStringTag) ||
+ instance_type == JS_ARRAY_TYPE) return map->instance_size();
if (instance_type == FIXED_ARRAY_TYPE) {
return reinterpret_cast<FixedArray*>(this)->FixedArraySize();
}
+ if (instance_type == BYTE_ARRAY_TYPE) {
+ return reinterpret_cast<ByteArray*>(this)->ByteArraySize();
+ }
// Otherwise do the general size computation.
return SlowSizeFromMap(map);
}
« no previous file with comments | « no previous file | src/string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698