Bug 1102637 - [e10s] Log the address of objects sent using CPOWs (r=mrbkap)
authorBill McCloskey <wmccloskey@mozilla.com>
Thu, 18 Dec 2014 17:34:24 -0800
changeset 246354 c68a69cdae8a582d922ea2a15d242007e602cfb0
parent 246353 aefbe199f9a39386d3a98882901eda969d25956b
child 246355 d67f1c2a7cbe404553f804b4e75286dff99c9479
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs1102637
milestone37.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 1102637 - [e10s] Log the address of objects sent using CPOWs (r=mrbkap)
js/ipc/JavaScriptLogging.h
--- a/js/ipc/JavaScriptLogging.h
+++ b/js/ipc/JavaScriptLogging.h
@@ -6,16 +6,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_jsipc_JavaScriptLogging__
 #define mozilla_jsipc_JavaScriptLogging__
 
 #include "nsString.h"
 #include "nsPrintfCString.h"
 #include "jsfriendapi.h"
+#include "jswrapper.h"
 
 namespace mozilla {
 namespace jsipc {
 
 #define LOG(...)						               \
     PR_BEGIN_MACRO                                                             \
     if (LoggingEnabled()) {                                                    \
 	Logging log(this, cx);					               \
@@ -93,34 +94,37 @@ class Logging
     }
 
     void format(const nsString &str, nsCString &out) {
         out = NS_ConvertUTF16toUTF8(str);
     }
 
     void formatObject(bool incoming, bool local, ObjectId id, nsCString &out) {
         const char *side, *objDesc;
+        void *ptr;
 
         if (local == incoming) {
             JS::RootedObject obj(cx);
             obj = shared->objects_.find(id);
             if (obj) {
                 JSAutoCompartment ac(cx, obj);
                 objDesc = js_ObjectClassName(cx, obj);
             } else {
                 objDesc = "<dead object>";
             }
 
             side = shared->isParent() ? "parent" : "child";
+            ptr = js::UncheckedUnwrap(obj, true);
         } else {
             objDesc = "<cpow>";
             side = shared->isParent() ? "child" : "parent";
+            ptr = nullptr;
         }
 
-        out = nsPrintfCString("<%s %s:%d>", side, objDesc, id);
+        out = nsPrintfCString("<%s %s:%d:%p>", side, objDesc, id, ptr);
     }
 
 
     void format(const ReceiverObj &obj, nsCString &out) {
         formatObject(true, true, obj.id, out);
     }
 
     void format(const nsTArray<JSParam> &values, nsCString &out) {