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

Unified Diff: src/profile-generator.cc

Issue 3424002: Allow List::sort, with an integer comparison function, to sort 64-bit pointer... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 3 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/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profile-generator.cc
===================================================================
--- src/profile-generator.cc (revision 5451)
+++ src/profile-generator.cc (working copy)
@@ -2449,10 +2449,18 @@
template<typename T>
inline static int SortUsingEntryValue(const T* x, const T* y) {
- return reinterpret_cast<intptr_t>((*x)->value) -
- reinterpret_cast<intptr_t>((*y)->value);
+ uintptr_t x_uint = reinterpret_cast<uintptr_t>((*x)->value);
+ uintptr_t y_uint = reinterpret_cast<uintptr_t>((*y)->value);
+ if (x_uint > y_uint) {
+ return 1;
+ } else if (x_uint == y_uint) {
+ return 0;
+ } else {
+ return -1;
+ }
}
+
void HeapSnapshotJSONSerializer::SortHashMap(
HashMap* map, List<HashMap::Entry*>* sorted_entries) {
for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p))
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698