Commits

Andrew Sutherland  committed 9a1a771

bitrot fix for bug 721579 which removed some gc state stats

  • Participants
  • Parent commits 4f72e87

Comments (0)

Files changed (2)

File add-jsprobes-core-definitions

 # HG changeset patch
-# Parent c50673071389499e5a6e836f19f69854591b6e0b
+# Parent 63c6a32bd458746a753183b038f06a16c26e9c61
 Add the jsprobes.tbl data, as well as core structs in jsprobedefs.h such as ProbeType, ProbeValue, and other useful data.
 
 diff --git a/js/src/Makefile.in b/js/src/Makefile.in
 --- a/js/src/Makefile.in
 +++ b/js/src/Makefile.in
-@@ -140,6 +140,7 @@
+@@ -130,16 +130,17 @@ CPPSRCS		= \
+ 		jsnativestack.cpp \
+ 		jsnum.cpp \
+ 		jsobj.cpp \
+ 		json.cpp \
+ 		jsonparser.cpp \
  		jsopcode.cpp \
  		jsproxy.cpp \
  		jsprf.cpp \
  		jsprobes.cpp \
  		jspropertycache.cpp \
  		jspropertytree.cpp \
-@@ -208,6 +209,8 @@
- 		jsopcode.h \
+ 		jsreflect.cpp \
+ 		jsscope.cpp \
+ 		jsscript.cpp \
+ 		jsstr.cpp \
+ 		jstypedarray.cpp \
+@@ -194,16 +195,18 @@ INSTALLED_HEADERS = \
+ 		jsgc.h \
+ 		jscell.h \
+ 		jsgcstats.h \
+ 		jshash.h \
+ 		jslock.h \
+ 		json.h \
  		jsproxy.h \
  		jsprf.h \
 +		jsprobedefs.h \
  		jsproto.tbl \
  		jsprvtd.h \
  		jspubtd.h \
+ 		jstypedarray.h \
+ 		jstypes.h \
+ 		jsutil.h \
+ 		jsversion.h \
+ 		jswrapper.h \
 diff --git a/js/src/jsprobedefs.cpp b/js/src/jsprobedefs.cpp
 new file mode 100644
 --- /dev/null
 +++ b/js/src/jsprobedefs.cpp
-@@ -0,0 +1,287 @@
+@@ -0,0 +1,267 @@
 +/* -*- Mode: c++; c-basic-offset: 4; tab-width: 40; indent-tabs-mode: nil -*- */
 +/* vim: set ts=40 sw=4 et tw=99: */
 +/* ***** BEGIN LICENSE BLOCK *****
 +}
 +
 +bool
-+runtime_gcTriggerBytes(JSRuntime *rt, ProbeValue *arg)
-+{
-+    JS_ASSERT(arg);
-+    JS_ASSERT(arg->ty == ProbeType_JSRuntimePtr);
-+    JS_ASSERT(arg->data.as_JSRuntimePtr);
-+    PROBE_VALUE_SET(arg, size_t, arg->data.as_JSRuntimePtr->gcTriggerBytes);
-+    return true;
-+}
-+
-+bool
-+runtime_gcLastBytes(JSRuntime *rt, ProbeValue *arg)
-+{
-+    JS_ASSERT(arg);
-+    JS_ASSERT(arg->ty == ProbeType_JSRuntimePtr);
-+    JS_ASSERT(arg->data.as_JSRuntimePtr);
-+    PROBE_VALUE_SET(arg, size_t, arg->data.as_JSRuntimePtr->gcLastBytes);
-+    return true;
-+}
-+
-+bool
 +runtime_gcMaxBytes(JSRuntime *rt, ProbeValue *arg)
 +{
 +    JS_ASSERT(arg);
 new file mode 100644
 --- /dev/null
 +++ b/js/src/jsprobedefs.h
-@@ -0,0 +1,171 @@
+@@ -0,0 +1,169 @@
 +/* -*- Mode: c++; c-basic-offset: 4; tab-width: 40; indent-tabs-mode: nil -*- */
 +/* vim: set ts=40 sw=4 et tw=99: */
 +/* ***** BEGIN LICENSE BLOCK *****
 +};
 +
 +bool runtime_gcBytes(JSRuntime *rt, ProbeValue *val);
-+bool runtime_gcTriggerBytes(JSRuntime *rt, ProbeValue *val);
-+bool runtime_gcLastBytes(JSRuntime *rt, ProbeValue *val);
 +bool runtime_gcMaxBytes(JSRuntime *rt, ProbeValue *val);
 +bool runtime_gcMaxMallocBytes(JSRuntime *rt, ProbeValue *val);
 +bool compartment_runtime(JSRuntime *rt, ProbeValue *val);
 new file mode 100644
 --- /dev/null
 +++ b/js/src/jsprobes.tbl
-@@ -0,0 +1,232 @@
+@@ -0,0 +1,230 @@
 +/* -*- Mode: c++; c-basic-offset: 4; tab-width: 40; indent-tabs-mode: nil -*- */
 +/* vim: set ts=40 sw=4 et tw=99: */
 +/* ***** BEGIN LICENSE BLOCK *****
 +
 +/* legend:  tranformFn,                    apiname,           id,  in_type,             out_type */
 +PROBE_TRANS(runtime_gcBytes,               gcBytes,            1,  JSRuntimePtr,        size_t)
-+PROBE_TRANS(runtime_gcTriggerBytes,        gcTriggerBytes,     2,  JSRuntimePtr,        size_t)
-+PROBE_TRANS(runtime_gcLastBytes,           gcLastBytes,        3,  JSRuntimePtr,        size_t)
-+PROBE_TRANS(runtime_gcMaxBytes,            gcMaxBytes,         4,  JSRuntimePtr,        size_t)
-+PROBE_TRANS(runtime_gcMaxMallocBytes,      gcMaxMallocBytes,   5,  JSRuntimePtr,        size_t)
-+PROBE_TRANS(compartment_runtime,           runtime,            6,  JSCompartmentPtr,    JSRuntimePtr)
-+PROBE_TRANS(compartment_gcBytes,           gcBytes,            7,  JSCompartmentPtr,    size_t)
-+PROBE_TRANS(compartment_gcTriggerBytes,    gcTriggerBytes,     8,  JSCompartmentPtr,    size_t)
-+PROBE_TRANS(compartment_gcLastBytes,       gcLastBytes,        9,  JSCompartmentPtr,    size_t)
-+PROBE_TRANS(compartment_id,                id,                10,  JSCompartmentPtr,    intptr_t)
-+PROBE_TRANS(env_currentTimeMS,             currentTimeMS,     11,  DummyGlobal,         double)
++PROBE_TRANS(runtime_gcMaxBytes,            gcMaxBytes,         2,  JSRuntimePtr,        size_t)
++PROBE_TRANS(runtime_gcMaxMallocBytes,      gcMaxMallocBytes,   3,  JSRuntimePtr,        size_t)
++PROBE_TRANS(compartment_runtime,           runtime,            4,  JSCompartmentPtr,    JSRuntimePtr)
++PROBE_TRANS(compartment_gcBytes,           gcBytes,            5,  JSCompartmentPtr,    size_t)
++PROBE_TRANS(compartment_gcTriggerBytes,    gcTriggerBytes,     6,  JSCompartmentPtr,    size_t)
++PROBE_TRANS(compartment_gcLastBytes,       gcLastBytes,        7,  JSCompartmentPtr,    size_t)
++PROBE_TRANS(compartment_id,                id,                 8,  JSCompartmentPtr,    intptr_t)
++PROBE_TRANS(env_currentTimeMS,             currentTimeMS,      9,  DummyGlobal,         double)
 +
 +/* teardown PROBE_POINT helpers */
 +#undef _NO_ARGS

File js-run-probes

 # HG changeset patch
-# Parent 78e429f3ec6891c2a39a8672532a5850bc8863fb
+# Parent f083cea597c9dd89209302d6739c18a648620b12
 
 diff --git a/js/src/jsinterp.cpp b/js/src/jsinterp.cpp
 --- a/js/src/jsinterp.cpp
 +++ b/js/src/jsinterp.cpp
-@@ -514,7 +514,13 @@
+@@ -509,17 +509,23 @@ js::InvokeKernel(JSContext *cx, CallArgs
+     StackFrame *fp = ifg.fp();
+     if (!fp->functionPrologue(cx))
+         return false;
+ 
+     /* Run function until JSOP_STOP, JSOP_RETURN or error. */
      JSBool ok;
      {
          AutoPreserveEnumerators preserve(cx);
      }
  
      args.rval() = fp->returnValue();
+     JS_ASSERT_IF(ok && construct, !args.rval().isPrimitive());
+     return ok;
+ }
+ 
+ bool
 diff --git a/js/src/jsprobedefs.cpp b/js/src/jsprobedefs.cpp
 --- a/js/src/jsprobedefs.cpp
 +++ b/js/src/jsprobedefs.cpp
-@@ -238,6 +238,34 @@
+@@ -213,16 +213,44 @@ compartment_id(JSRuntime *rt, ProbeValue
+ bool
+ env_currentTimeMS(JSRuntime *rt, ProbeValue *arg)
+ {
+     JS_ASSERT(arg->ty == ProbeType_DummyGlobal);
+     PROBE_VALUE_SET(arg, double, (double)(PR_Now()/PR_USEC_PER_MSEC));
      return true;
  }
  
  js::Value
  deserialize_size_t(JSContext *cx, ProbeValue v)
  {
+     return js::DoubleValue((double)v.data.as_size_t);
+ }
+ 
+ js::Value
+ deserialize_intptr_t(JSContext *cx, ProbeValue v)
 diff --git a/js/src/jsprobedefs.h b/js/src/jsprobedefs.h
 --- a/js/src/jsprobedefs.h
 +++ b/js/src/jsprobedefs.h
-@@ -158,6 +158,9 @@
+@@ -151,16 +151,19 @@ bool runtime_gcBytes(JSRuntime *rt, Prob
+ bool runtime_gcMaxBytes(JSRuntime *rt, ProbeValue *val);
+ bool runtime_gcMaxMallocBytes(JSRuntime *rt, ProbeValue *val);
+ bool compartment_runtime(JSRuntime *rt, ProbeValue *val);
+ bool compartment_gcBytes(JSRuntime *rt, ProbeValue *val);
+ bool compartment_gcTriggerBytes(JSRuntime *rt, ProbeValue *val);
  bool compartment_gcLastBytes(JSRuntime *rt, ProbeValue *val);
  bool compartment_id(JSRuntime *rt, ProbeValue *val);
  bool env_currentTimeMS(JSRuntime *rt, ProbeValue *val);
  
  js::Value deserialize_size_t(JSContext *cx, ProbeValue val);
  js::Value deserialize_intptr_t(JSContext *cx, ProbeValue val);
+ js::Value deserialize_int(JSContext *cx, ProbeValue val);
+ js::Value deserialize_double(JSContext *cx, ProbeValue val);
+ js::Value deserialize_OwnedSCBufferPtr(JSContext *cx, ProbeValue val);    
+ js::Value deserialize_OwnedConstCharPtr(JSContext *cx, ProbeValue val);
+     
 diff --git a/js/src/jsprobes.h b/js/src/jsprobes.h
 --- a/js/src/jsprobes.h
 +++ b/js/src/jsprobes.h
-@@ -834,6 +834,13 @@
+@@ -829,16 +829,23 @@ Probes::startExecution(JSContext *cx, JS
+     if (JAVASCRIPT_EXECUTE_START_ENABLED())
+         JAVASCRIPT_EXECUTE_START((script->filename ? (char *)script->filename : nullName),
+                                  script->lineno);
+ #endif
+ #ifdef MOZ_ETW
      if (ProfilingActive && !ETWStartExecution(cx, script))
          ok = false;
  #endif
  
      return ok;
  }
-@@ -852,6 +859,13 @@
+ 
+ inline bool
+ Probes::stopExecution(JSContext *cx, JSScript *script)
+ {
+     bool ok = true;
+@@ -847,16 +854,23 @@ Probes::stopExecution(JSContext *cx, JSS
+     if (JAVASCRIPT_EXECUTE_DONE_ENABLED())
+         JAVASCRIPT_EXECUTE_DONE((script->filename ? (char *)script->filename : nullName),
+                                 script->lineno);
+ #endif
+ #ifdef MOZ_ETW
      if (ProfilingActive && !ETWStopExecution(cx, script))
          ok = false;
  #endif
  
      return ok;
  }
+ 
+ struct AutoFunctionCallProbe {
+     JSContext * const cx;
+     JSFunction *fun;
+     JSScript *script;
 diff --git a/js/src/jsprobes.tbl b/js/src/jsprobes.tbl
 --- a/js/src/jsprobes.tbl
 +++ b/js/src/jsprobes.tbl
-@@ -205,6 +205,10 @@
- PROBE_TRANS(compartment_gcLastBytes,       gcLastBytes,        9,  JSCompartmentPtr,    size_t)
- PROBE_TRANS(compartment_id,                id,                10,  JSCompartmentPtr,    intptr_t)
- PROBE_TRANS(env_currentTimeMS,             currentTimeMS,     11,  DummyGlobal,         double)
-+PROBE_TRANS(env_currentTimeUS,             currentTimeUS,     12,  DummyGlobal,         double)
-+PROBE_TRANS(env_threadId,                  threadId,          13,  DummyGlobal,
-+     intptr_t)
-+PROBE_TRANS(context_to_compartment,        compartment,       14,  JSContextPtr,        JSCompartmentPtr)
+@@ -198,16 +198,19 @@ PROBE_TRANS(runtime_gcBytes,            
+ PROBE_TRANS(runtime_gcMaxBytes,            gcMaxBytes,         2,  JSRuntimePtr,        size_t)
+ PROBE_TRANS(runtime_gcMaxMallocBytes,      gcMaxMallocBytes,   3,  JSRuntimePtr,        size_t)
+ PROBE_TRANS(compartment_runtime,           runtime,            4,  JSCompartmentPtr,    JSRuntimePtr)
+ PROBE_TRANS(compartment_gcBytes,           gcBytes,            5,  JSCompartmentPtr,    size_t)
+ PROBE_TRANS(compartment_gcTriggerBytes,    gcTriggerBytes,     6,  JSCompartmentPtr,    size_t)
+ PROBE_TRANS(compartment_gcLastBytes,       gcLastBytes,        7,  JSCompartmentPtr,    size_t)
+ PROBE_TRANS(compartment_id,                id,                 8,  JSCompartmentPtr,    intptr_t)
+ PROBE_TRANS(env_currentTimeMS,             currentTimeMS,      9,  DummyGlobal,         double)
++PROBE_TRANS(env_currentTimeUS,             currentTimeUS,     10,  DummyGlobal,         double)
++PROBE_TRANS(env_threadId,                  threadId,          11,  DummyGlobal,         intptr_t)
++PROBE_TRANS(context_to_compartment,        compartment,       12,  JSContextPtr,        JSCompartmentPtr)
  
  /* teardown PROBE_POINT helpers */
  #undef _NO_ARGS
+ #undef _ARG
+ #undef _ARG_1
+ #undef _ARG_2
+ #undef _ARG_3
+ #undef _ARG_4
 diff --git a/toolkit/components/probes/ProbeService.cpp b/toolkit/components/probes/ProbeService.cpp
 --- a/toolkit/components/probes/ProbeService.cpp
 +++ b/toolkit/components/probes/ProbeService.cpp
-@@ -401,7 +401,7 @@
+@@ -396,17 +396,17 @@ ProbeServiceImpl::AsyncQuery(const nsASt
+         return NS_ERROR_FAILURE;
+ 
+     nsIScriptContext *scriptCx = GetScriptContextFromJSContext(cx);
+     if (!scriptCx)
+         return NS_ERROR_FAILURE;
  
      mListeners.Put(codeCookie, listener);
      mListenerContexts.Put(codeCookie, scriptCx);
  
      return NS_OK;
  }
+ 
+ NS_IMPL_THREADSAFE_ISUPPORTS1(ProbeServiceImpl, nsIProbeService)
+ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIProbeService, ProbeServiceImpl::CreateInstance)
+ 
+ #define NS_PROBESERVICE_CID \