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

Side by Side Diff: src/profile-generator.cc

Issue 9174023: Split NumberDictionary into a randomly seeded and an unseeded (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 11 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-inl.h ('k') | src/runtime.cc » ('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 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 type_(type), 1224 type_(type),
1225 title_(title), 1225 title_(title),
1226 uid_(uid), 1226 uid_(uid),
1227 root_entry_(NULL), 1227 root_entry_(NULL),
1228 gc_roots_entry_(NULL), 1228 gc_roots_entry_(NULL),
1229 natives_root_entry_(NULL), 1229 natives_root_entry_(NULL),
1230 raw_entries_(NULL), 1230 raw_entries_(NULL),
1231 entries_sorted_(false) { 1231 entries_sorted_(false) {
1232 STATIC_ASSERT( 1232 STATIC_ASSERT(
1233 sizeof(HeapGraphEdge) == 1233 sizeof(HeapGraphEdge) ==
1234 SnapshotSizeConstants<sizeof(void*)>::kExpectedHeapGraphEdgeSize); // NOL INT 1234 SnapshotSizeConstants<kPointerSize>::kExpectedHeapGraphEdgeSize);
1235 STATIC_ASSERT( 1235 STATIC_ASSERT(
1236 sizeof(HeapEntry) == 1236 sizeof(HeapEntry) ==
1237 SnapshotSizeConstants<sizeof(void*)>::kExpectedHeapEntrySize); // NOLINT 1237 SnapshotSizeConstants<kPointerSize>::kExpectedHeapEntrySize);
1238 for (int i = 0; i < VisitorSynchronization::kNumberOfSyncTags; ++i) { 1238 for (int i = 0; i < VisitorSynchronization::kNumberOfSyncTags; ++i) {
1239 gc_subroot_entries_[i] = NULL; 1239 gc_subroot_entries_[i] = NULL;
1240 } 1240 }
1241 } 1241 }
1242 1242
1243 HeapSnapshot::~HeapSnapshot() { 1243 HeapSnapshot::~HeapSnapshot() {
1244 DeleteArray(raw_entries_); 1244 DeleteArray(raw_entries_);
1245 } 1245 }
1246 1246
1247 1247
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
2282 FixedArray* elements = FixedArray::cast(js_obj->elements()); 2282 FixedArray* elements = FixedArray::cast(js_obj->elements());
2283 int length = js_obj->IsJSArray() ? 2283 int length = js_obj->IsJSArray() ?
2284 Smi::cast(JSArray::cast(js_obj)->length())->value() : 2284 Smi::cast(JSArray::cast(js_obj)->length())->value() :
2285 elements->length(); 2285 elements->length();
2286 for (int i = 0; i < length; ++i) { 2286 for (int i = 0; i < length; ++i) {
2287 if (!elements->get(i)->IsTheHole()) { 2287 if (!elements->get(i)->IsTheHole()) {
2288 SetElementReference(js_obj, entry, i, elements->get(i)); 2288 SetElementReference(js_obj, entry, i, elements->get(i));
2289 } 2289 }
2290 } 2290 }
2291 } else if (js_obj->HasDictionaryElements()) { 2291 } else if (js_obj->HasDictionaryElements()) {
2292 NumberDictionary* dictionary = js_obj->element_dictionary(); 2292 SeededNumberDictionary* dictionary = js_obj->element_dictionary();
2293 int length = dictionary->Capacity(); 2293 int length = dictionary->Capacity();
2294 for (int i = 0; i < length; ++i) { 2294 for (int i = 0; i < length; ++i) {
2295 Object* k = dictionary->KeyAt(i); 2295 Object* k = dictionary->KeyAt(i);
2296 if (dictionary->IsKey(k)) { 2296 if (dictionary->IsKey(k)) {
2297 ASSERT(k->IsNumber()); 2297 ASSERT(k->IsNumber());
2298 uint32_t index = static_cast<uint32_t>(k->Number()); 2298 uint32_t index = static_cast<uint32_t>(k->Number());
2299 SetElementReference(js_obj, entry, index, dictionary->ValueAt(i)); 2299 SetElementReference(js_obj, entry, index, dictionary->ValueAt(i));
2300 } 2300 }
2301 } 2301 }
2302 } 2302 }
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after
3638 3638
3639 3639
3640 void HeapSnapshotJSONSerializer::SortHashMap( 3640 void HeapSnapshotJSONSerializer::SortHashMap(
3641 HashMap* map, List<HashMap::Entry*>* sorted_entries) { 3641 HashMap* map, List<HashMap::Entry*>* sorted_entries) {
3642 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) 3642 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p))
3643 sorted_entries->Add(p); 3643 sorted_entries->Add(p);
3644 sorted_entries->Sort(SortUsingEntryValue); 3644 sorted_entries->Sort(SortUsingEntryValue);
3645 } 3645 }
3646 3646
3647 } } // namespace v8::internal 3647 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698