From f9e0f0df545905a7bb801060ceffaf8af88e7d6e Mon Sep 17 00:00:00 2001 From: Terrence Cole Date: Thu, 1 Sep 2011 16:56:58 +0100 Subject: [PATCH] Bug 683654 - Make TraceVis compile and run again; r=dmandelin --- js/src/jsdbgapi.cpp | 10 ++++++---- js/src/jstracer.cpp | 2 +- js/src/shell/js.cpp | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/js/src/jsdbgapi.cpp b/js/src/jsdbgapi.cpp index 5081352f0e7..36f7322413a 100644 --- a/js/src/jsdbgapi.cpp +++ b/js/src/jsdbgapi.cpp @@ -1712,6 +1712,7 @@ js_ResumeVtune() #else #include #endif +#include "jstracer.h" #define ETHOGRAM_BUF_SIZE 65536 @@ -1867,7 +1868,7 @@ public: static char jstv_empty[] = ""; inline char * -jstv_Filename(JSStackFrame *fp) +jstv_Filename(StackFrame *fp) { while (fp && !fp->isScriptFrame()) fp = fp->prev(); @@ -1876,11 +1877,12 @@ jstv_Filename(JSStackFrame *fp) : 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 */ @@ -1977,7 +1979,7 @@ ethogram_addScript(JSContext *cx, uintN argc, jsval *vp) } 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; } diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index b3809cf4168..99c9c4d2e6c 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -16562,7 +16562,7 @@ StartTraceVisNative(JSContext *cx, uintN argc, jsval *vp) 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); diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 962ba52280e..1452979b033 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -73,6 +73,7 @@ #include "jsreflect.h" #include "jsscope.h" #include "jsscript.h" +#include "jstracer.h" #include "jstypedarray.h" #include "jstypedarrayinlines.h" #include "jsxml.h"