Revision: 5453
Author: [email protected]
Date: Tue Sep 14 08:16:32 2010
Log: 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
http://code.google.com/p/v8/source/detail?r=5453

Modified:
 /branches/bleeding_edge/src/profile-generator.cc
 /branches/bleeding_edge/src/runtime.cc

=======================================
--- /branches/bleeding_edge/src/profile-generator.cc Tue Sep 14 08:11:24 2010 +++ /branches/bleeding_edge/src/profile-generator.cc Tue Sep 14 08:16:32 2010
@@ -2465,9 +2465,17 @@

 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) {
=======================================
--- /branches/bleeding_edge/src/runtime.cc      Tue Sep 14 07:52:53 2010
+++ /branches/bleeding_edge/src/runtime.cc      Tue Sep 14 08:16:32 2010
@@ -10106,9 +10106,6 @@
 };


-const int Runtime::kNotFound;
-
-
 Object* Runtime::InitializeIntrinsicFunctionNames(Object* dictionary) {
   ASSERT(dictionary != NULL);
   ASSERT(StringDictionary::cast(dictionary)->NumberOfElements() == 0);

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to