Bug 683654 - Make TraceVis compile and run again; r=dmandelin
authorTerrence Cole <terrence@trainedmonkeystudios.org>
Thu, 01 Sep 2011 16:56:58 +0100
changeset 76384 bcc474c726aa89f2278ffebb1e65e80bc9d71468
parent 76383 7a50f9697fb2676af48bbf7d09fb8f39a0c2b024
child 76385 5dda9668493b2d7fbe05df3bf242ac494d78ab4f
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersdmandelin
bugs683654
milestone9.0a1
Bug 683654 - Make TraceVis compile and run again; r=dmandelin
js/src/jsdbgapi.cpp
js/src/jstracer.cpp
js/src/shell/js.cpp
--- a/js/src/jsdbgapi.cpp
+++ b/js/src/jsdbgapi.cpp
@@ -1707,16 +1707,17 @@ js_ResumeVtune()
  *           an organism or a species.
  *
  */
 #if defined(XP_WIN)
 #include "jswin.h"
 #else
 #include <sys/time.h>
 #endif
+#include "jstracer.h"
 
 #define ETHOGRAM_BUF_SIZE 65536
 
 static JSBool
 ethogram_construct(JSContext *cx, uintN argc, jsval *vp);
 static void
 ethogram_finalize(JSContext *cx, JSObject *obj);
 
@@ -1862,30 +1863,31 @@ public:
         else
             return mWritePos - mReadPos;
     }
 };
 
 static char jstv_empty[] = "<null>";
 
 inline char *
-jstv_Filename(JSStackFrame *fp)
+jstv_Filename(StackFrame *fp)
 {
     while (fp && !fp->isScriptFrame())
         fp = fp->prev();
     return (fp && fp->maybeScript() && fp->script()->filename)
            ? (char *)fp->script()->filename
            : jstv_empty;
 }
 inline uintN
-jstv_Lineno(JSContext *cx, JSStackFrame *fp)
+jstv_Lineno(JSContext *cx, StackFrame *fp)
 {
     while (fp && fp->pcQuadratic(cx->stack) == NULL)
         fp = fp->prev();
-    return (fp && fp->pcQuadratic(cx->stack)) ? js_FramePCToLineNumber(cx, fp) : 0;
+    jsbytecode *pc = fp->pcQuadratic(cx->stack);
+    return (fp && pc) ? js_FramePCToLineNumber(cx, fp, pc) : 0;
 }
 
 /* Collect states here and distribute to a matching buffer, if any */
 JS_FRIEND_API(void)
 js::StoreTraceVisState(JSContext *cx, TraceVisState s, TraceVisExitReason r)
 {
     StackFrame *fp = cx->fp();
 
@@ -1972,17 +1974,17 @@ ethogram_addScript(JSContext *cx, uintN 
         return false;
     if (argc < 1) {
         /* silently ignore no args */
         JS_SET_RVAL(cx, vp, JSVAL_VOID);
         return true;
     }
     if (JSVAL_IS_STRING(argv[0])) {
         str = JSVAL_TO_STRING(argv[0]);
-        filename = DeflateString(cx, str->chars(), str->length());
+        filename = DeflateString(cx, str->getChars(cx), str->length());
         if (!filename)
             return false;
     }
 
     EthogramEventBuffer *p = (EthogramEventBuffer *) JS_GetInstancePrivate(cx, obj, &ethogram_class, argv);
 
     p->addScript(cx, obj, filename, str);
     JS_SET_RVAL(cx, vp, JSVAL_VOID);
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -16557,17 +16557,17 @@ StartTraceVis(const char* filename = "tr
 
 JS_FRIEND_API(JSBool)
 StartTraceVisNative(JSContext *cx, uintN argc, jsval *vp)
 {
     JSBool ok;
 
     if (argc > 0 && JSVAL_IS_STRING(JS_ARGV(cx, vp)[0])) {
         JSString *str = JSVAL_TO_STRING(JS_ARGV(cx, vp)[0]);
-        char *filename = DeflateString(cx, str->chars(), str->length());
+        char *filename = DeflateString(cx, str->getChars(cx), str->length());
         if (!filename)
             goto error;
         ok = StartTraceVis(filename);
         cx->free_(filename);
     } else {
         ok = StartTraceVis();
     }
 
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -68,16 +68,17 @@
 #include "jslock.h"
 #include "jsnum.h"
 #include "jsobj.h"
 #include "json.h"
 #include "jsparse.h"
 #include "jsreflect.h"
 #include "jsscope.h"
 #include "jsscript.h"
+#include "jstracer.h"
 #include "jstypedarray.h"
 #include "jstypedarrayinlines.h"
 #include "jsxml.h"
 #include "jsperf.h"
 #include "jshashtable.h"
 
 #include "prmjtime.h"