From 141e82b31e373d35e5c639f7170b815ad9badf33 Mon Sep 17 00:00:00 2001 From: "whesse@chromium.org" Date: Tue, 14 Sep 2010 15:16:32 +0000 Subject: [PATCH] Allow List::sort, with an integer comparison function, to sort 64-bit pointers in profile-generator. Change a static const int member to be declared and defined only inside the class declaration in class Runtime. Review URL: http://codereview.chromium.org/3424002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5453 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/profile-generator.cc | 12 ++++++++++-- src/runtime.cc | 3 --- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/profile-generator.cc b/src/profile-generator.cc index 71eac3d..f8fa23d 100644 --- a/src/profile-generator.cc +++ b/src/profile-generator.cc @@ -2465,10 +2465,18 @@ void HeapSnapshotJSONSerializer::SerializeStrings() { template inline static int SortUsingEntryValue(const T* x, const T* y) { - return reinterpret_cast((*x)->value) - - reinterpret_cast((*y)->value); + uintptr_t x_uint = reinterpret_cast((*x)->value); + uintptr_t y_uint = reinterpret_cast((*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* sorted_entries) { for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) diff --git a/src/runtime.cc b/src/runtime.cc index a8a51d9..627ea12 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -10106,9 +10106,6 @@ Runtime::Function kIntrinsicFunctions[] = { }; -const int Runtime::kNotFound; - - Object* Runtime::InitializeIntrinsicFunctionNames(Object* dictionary) { ASSERT(dictionary != NULL); ASSERT(StringDictionary::cast(dictionary)->NumberOfElements() == 0); -- 2.7.4