Bug 876366 - Avoid pointer to long casts in PerfSpewer::writeProfile. r=nmatsakis
authorJacek Caban <jacek@codeweavers.com>
Thu, 30 May 2013 11:51:49 +0200
changeset 133428 7c0c49dd4e913f6d0f0a5db493587c8061f3d1f7
parent 133427 06c206f9a94a513c9776e9047e3899d9f2ac1f0d
child 133429 4e28042c1b97f0b1837ace07e865e9446e409e64
push id24751
push userryanvm@gmail.com
push dateThu, 30 May 2013 15:43:11 +0000
treeherdermozilla-central@75407626ba46 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnmatsakis
bugs876366
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 876366 - Avoid pointer to long casts in PerfSpewer::writeProfile. r=nmatsakis
js/src/ion/PerfSpewer.cpp
--- a/js/src/ion/PerfSpewer.cpp
+++ b/js/src/ion/PerfSpewer.cpp
@@ -132,31 +132,31 @@ PerfSpewer::writeProfile(JSScript *scrip
     if (!fp_)
         return;
 
     uint32_t thisFunctionIndex = nextFunctionIndex++;
 
     if (PerfFuncEnabled()) {
         fprintf(fp_,
                 "%lx %lx %s:%d: Func%02d\n",
-                (unsigned long) code->raw(),
+                reinterpret_cast<uintptr_t>(code->raw()),
                 (unsigned long) code->instructionsSize(),
                 script->filename(),
                 script->lineno,
                 thisFunctionIndex);
     } else if (PerfBlockEnabled()) {
-        unsigned long funcStart = (unsigned long) code->raw();
-        unsigned long funcEnd = funcStart + code->instructionsSize();
+        uintptr_t funcStart = uintptr_t(code->raw());
+        uintptr_t funcEnd = funcStart + code->instructionsSize();
 
-        unsigned long cur = funcStart;
+        uintptr_t cur = funcStart;
         for (uint32_t i = 0; i < basicBlocks_.length(); i++) {
             Record &r = basicBlocks_[i];
 
-            unsigned long blockStart = funcStart + masm.actualOffset(r.start.offset());
-            unsigned long blockEnd = funcStart + masm.actualOffset(r.end.offset());
+            uintptr_t blockStart = funcStart + masm.actualOffset(r.start.offset());
+            uintptr_t blockEnd = funcStart + masm.actualOffset(r.end.offset());
 
             JS_ASSERT(cur <= blockStart);
             if (cur < blockStart) {
                 fprintf(fp_,
                         "%lx %lx %s:%d: Func%02d-Block?\n",
                         cur, blockStart - cur,
                         script->filename(), script->lineno,
                         thisFunctionIndex);