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

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

Issue 9148006: [objects] seed NumberDictionary (only ia32 now) Base URL: gh:v8/v8@master
Patch Set: fixed linter issues, use pseudo-random function in test 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
« no previous file with comments | « src/profile-generator.h ('k') | src/utils.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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 void CodeEntry::CopyData(const CodeEntry& source) { 174 void CodeEntry::CopyData(const CodeEntry& source) {
175 tag_ = source.tag_; 175 tag_ = source.tag_;
176 name_prefix_ = source.name_prefix_; 176 name_prefix_ = source.name_prefix_;
177 name_ = source.name_; 177 name_ = source.name_;
178 resource_name_ = source.resource_name_; 178 resource_name_ = source.resource_name_;
179 line_number_ = source.line_number_; 179 line_number_ = source.line_number_;
180 } 180 }
181 181
182 182
183 uint32_t CodeEntry::GetCallUid() const { 183 uint32_t CodeEntry::GetCallUid() const {
184 uint32_t hash = ComputeIntegerHash(tag_); 184 uint32_t hash = ComputeIntegerHash(tag_, v8::internal::kZeroHashSeed);
185 if (shared_id_ != 0) { 185 if (shared_id_ != 0) {
186 hash ^= ComputeIntegerHash( 186 hash ^= ComputeIntegerHash(static_cast<uint32_t>(shared_id_),
187 static_cast<uint32_t>(shared_id_)); 187 v8::internal::kZeroHashSeed);
188 } else { 188 } else {
189 hash ^= ComputeIntegerHash( 189 hash ^= ComputeIntegerHash(
190 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name_prefix_))); 190 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name_prefix_)),
191 v8::internal::kZeroHashSeed);
191 hash ^= ComputeIntegerHash( 192 hash ^= ComputeIntegerHash(
192 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name_))); 193 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name_)),
194 v8::internal::kZeroHashSeed);
193 hash ^= ComputeIntegerHash( 195 hash ^= ComputeIntegerHash(
194 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(resource_name_))); 196 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(resource_name_)),
195 hash ^= ComputeIntegerHash(line_number_); 197 v8::internal::kZeroHashSeed);
198 hash ^= ComputeIntegerHash(line_number_, v8::internal::kZeroHashSeed);
196 } 199 }
197 return hash; 200 return hash;
198 } 201 }
199 202
200 203
201 bool CodeEntry::IsSameAs(CodeEntry* entry) const { 204 bool CodeEntry::IsSameAs(CodeEntry* entry) const {
202 return this == entry 205 return this == entry
203 || (tag_ == entry->tag_ 206 || (tag_ == entry->tag_
204 && shared_id_ == entry->shared_id_ 207 && shared_id_ == entry->shared_id_
205 && (shared_id_ != 0 208 && (shared_id_ != 0
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 1505
1503 1506
1504 uint64_t HeapObjectsMap::GenerateId(v8::RetainedObjectInfo* info) { 1507 uint64_t HeapObjectsMap::GenerateId(v8::RetainedObjectInfo* info) {
1505 uint64_t id = static_cast<uint64_t>(info->GetHash()); 1508 uint64_t id = static_cast<uint64_t>(info->GetHash());
1506 const char* label = info->GetLabel(); 1509 const char* label = info->GetLabel();
1507 id ^= HashSequentialString(label, 1510 id ^= HashSequentialString(label,
1508 static_cast<int>(strlen(label)), 1511 static_cast<int>(strlen(label)),
1509 HEAP->StringHashSeed()); 1512 HEAP->StringHashSeed());
1510 intptr_t element_count = info->GetElementCount(); 1513 intptr_t element_count = info->GetElementCount();
1511 if (element_count != -1) 1514 if (element_count != -1)
1512 id ^= ComputeIntegerHash(static_cast<uint32_t>(element_count)); 1515 id ^= ComputeIntegerHash(static_cast<uint32_t>(element_count),
1516 v8::internal::kZeroHashSeed);
1513 return id << 1; 1517 return id << 1;
1514 } 1518 }
1515 1519
1516 1520
1517 HeapSnapshotsCollection::HeapSnapshotsCollection() 1521 HeapSnapshotsCollection::HeapSnapshotsCollection()
1518 : is_tracking_objects_(false), 1522 : is_tracking_objects_(false),
1519 snapshots_uids_(HeapSnapshotsMatch), 1523 snapshots_uids_(HeapSnapshotsMatch),
1520 token_enumerator_(new TokenEnumerator()) { 1524 token_enumerator_(new TokenEnumerator()) {
1521 } 1525 }
1522 1526
(...skipping 2111 matching lines...) Expand 10 before | Expand all | Expand 10 after
3634 3638
3635 3639
3636 void HeapSnapshotJSONSerializer::SortHashMap( 3640 void HeapSnapshotJSONSerializer::SortHashMap(
3637 HashMap* map, List<HashMap::Entry*>* sorted_entries) { 3641 HashMap* map, List<HashMap::Entry*>* sorted_entries) {
3638 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))
3639 sorted_entries->Add(p); 3643 sorted_entries->Add(p);
3640 sorted_entries->Sort(SortUsingEntryValue); 3644 sorted_entries->Sort(SortUsingEntryValue);
3641 } 3645 }
3642 3646
3643 } } // namespace v8::internal 3647 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/profile-generator.h ('k') | src/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698