From 76a2c11580c24c4cca5862e9f83e70907f9ee89a Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Tue, 24 May 2011 16:53:07 -0700 Subject: [PATCH] Backout 8d39d7a5b85c --- js/jsd/idl/jsdIDebuggerService.idl | 19 +++-------- js/jsd/jsd.h | 5 --- js/jsd/jsd_scpt.c | 38 --------------------- js/jsd/jsd_xpc.cpp | 52 ----------------------------- js/jsd/jsdebug.c | 10 ------ js/jsd/jsdebug.h | 11 ------- js/src/jsdbgapi.cpp | 53 ------------------------------ js/src/jsdbgapi.h | 5 --- 8 files changed, 4 insertions(+), 189 deletions(-) diff --git a/js/jsd/idl/jsdIDebuggerService.idl b/js/jsd/idl/jsdIDebuggerService.idl index e5833e85e93..a047bfcc40c 100644 --- a/js/jsd/idl/jsdIDebuggerService.idl +++ b/js/jsd/idl/jsdIDebuggerService.idl @@ -542,7 +542,7 @@ interface jsdIContextEnumerator : nsISupports /** * Set jsdIDebuggerService::scriptHook to an instance of one of these. */ -[scriptable, uuid(d030d1a2-a58a-4f19-b9e3-96da4e2cdd09)] +[scriptable, uuid(bb722893-0f63-45c5-b547-7a0947c7b6b6)] interface jsdIScriptHook : nsISupports { /** @@ -811,7 +811,7 @@ interface jsdIContext : jsdIEphemeral * interface. Once a jsdIStackFrame has been invalidated all method and * property accesses will throw a NS_ERROR_NOT_AVAILABLE exception. */ -[scriptable, uuid(7c95422c-7579-4a6f-8ef7-e5b391552ee5)] +[scriptable, uuid(0633ca73-105e-4e8e-bcc5-13405d61754a)] interface jsdIStackFrame : jsdIEphemeral { /** Internal use only. */ @@ -884,7 +884,7 @@ interface jsdIStackFrame : jsdIEphemeral * Script object. In JavaScript engine terms, there's a single script for each * function, and one for the top level script. */ -[scriptable, uuid(721724e0-7716-4bf4-b48f-92b78d056141)] +[scriptable, uuid(e7935220-7def-4c8e-832f-fbc948a97490)] interface jsdIScript : jsdIEphemeral { /** Internal use only. */ @@ -1030,17 +1030,6 @@ interface jsdIScript : jsdIEphemeral * The |pcmap| argument specifies which pc to source line map to use. */ boolean isLineExecutable(in unsigned long line, in unsigned long pcmap); - - /** - * Return a list of all executable lines in a script. - * |pcmap| specifies which pc to source line map to use. - * |startLine| and |maxLines| may be used to retrieve a chunk at a time. - */ - void getExecutableLines(in unsigned long pcmap, - in unsigned long startLine, in unsigned long maxLines, - out unsigned long count, - [array, size_is(count), retval] out unsigned long executableLines); - /** * Set a breakpoint at a PC in this script. */ @@ -1065,7 +1054,7 @@ interface jsdIScript : jsdIEphemeral * jsdIValue adds a root for the underlying JavaScript value, so don't keep it * if you don't need to. */ -[scriptable, uuid(861c4d37-e115-4a52-9f76-273cb6b21c3b)] +[scriptable, uuid(fd1311f7-096c-44a3-847b-9d478c8176c3)] interface jsdIValue : jsdIEphemeral { /** Internal use only. */ diff --git a/js/jsd/jsd.h b/js/jsd/jsd.h index aec7fba9c14..c1894d2a9ff 100644 --- a/js/jsd/jsd.h +++ b/js/jsd/jsd.h @@ -481,11 +481,6 @@ jsd_GetClosestPC(JSDContext* jsdc, JSDScript* jsdscript, uintN line); extern uintN jsd_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, jsuword pc); -extern JSBool -jsd_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript, - uintN startLine, uintN maxLines, - uintN* count, uintN** lines, jsuword** pcs); - extern void jsd_NewScriptHookProc( JSContext *cx, diff --git a/js/jsd/jsd_scpt.c b/js/jsd/jsd_scpt.c index 584ea54f39c..237db062fc7 100644 --- a/js/jsd/jsd_scpt.c +++ b/js/jsd/jsd_scpt.c @@ -580,44 +580,6 @@ jsd_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, jsuword pc) return line; } -JSBool -jsd_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript, - uintN startLine, uintN maxLines, - uintN* count, uintN** retLines, jsuword** retPCs) -{ - JSCrossCompartmentCall *call; - uintN first = jsdscript->lineBase; - uintN last = first + jsd_GetScriptLineExtent(jsdc, jsdscript) - 1; - JSBool ok; - uintN *lines; - jsbytecode **pcs; - uintN i; - - if (last < startLine) - return JS_TRUE; - - call = JS_EnterCrossCompartmentCallScript(jsdc->dumbContext, jsdscript->script); - if (!call) - return JS_FALSE; - - ok = JS_GetLinePCs(jsdc->dumbContext, jsdscript->script, - startLine, maxLines, - count, retLines, &pcs); - - if (ok) { - if (retPCs) { - for (i = 0; i < *count; ++i) { - (*retPCs)[i] = (*pcs)[i]; - } - } - - JS_free(jsdc->dumbContext, pcs); - } - - JS_LeaveCrossCompartmentCall(call); - return ok; -} - JSBool jsd_SetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc hook, void* callerdata) { diff --git a/js/jsd/jsd_xpc.cpp b/js/jsd/jsd_xpc.cpp index 26703382335..ca0552ee6b6 100644 --- a/js/jsd/jsd_xpc.cpp +++ b/js/jsd/jsd_xpc.cpp @@ -1541,58 +1541,6 @@ jsdScript::EnableSingleStepInterrupts(PRBool enable) return (JSD_EnableSingleStepInterrupts(mCx, mScript, enable) ? NS_OK : NS_ERROR_FAILURE); } -NS_IMETHODIMP -jsdScript::GetExecutableLines(PRUint32 aPcmap, PRUint32 aStartLine, PRUint32 aMaxLines, - PRUint32* aCount, PRUint32** aExecutableLines) -{ - ASSERT_VALID_EPHEMERAL; - if (aPcmap == PCMAP_SOURCETEXT) { - jsuword start = JSD_GetClosestPC(mCx, mScript, 0); - uintN lastLine = JSD_GetScriptBaseLineNumber(mCx, mScript) - + JSD_GetScriptLineExtent(mCx, mScript) - 1; - jsuword end = JSD_GetClosestPC(mCx, mScript, lastLine + 1); - - *aExecutableLines = static_cast(NS_Alloc((end - start + 1) * sizeof(PRUint32))); - if (!JSD_GetLinePCs(mCx, mScript, aStartLine, aMaxLines, aCount, aExecutableLines, NULL)) - return NS_ERROR_OUT_OF_MEMORY; - - return NS_OK; - } - - if (aPcmap == PCMAP_PRETTYPRINT) { - if (!mPPLineMap) { - if (!CreatePPLineMap()) - return NS_ERROR_OUT_OF_MEMORY; - } - - nsTArray lines; - PRUint32 i; - - for (i = 0; i < mPCMapSize; ++i) { - if (mPPLineMap[i].line >= aStartLine) - break; - } - - for (; i < mPCMapSize && lines.Length() < aMaxLines; ++i) { - lines.AppendElement(mPPLineMap[i].line); - } - - if (aCount) - *aCount = lines.Length(); - - *aExecutableLines = static_cast(NS_Alloc(lines.Length() * sizeof(PRUint32))); - if (!*aExecutableLines) - return NS_ERROR_OUT_OF_MEMORY; - - for (i = 0; i < lines.Length(); ++i) - (*aExecutableLines)[i] = lines[i]; - - return NS_OK; - } - - return NS_ERROR_INVALID_ARG; -} - NS_IMETHODIMP jsdScript::IsLineExecutable(PRUint32 aLine, PRUint32 aPcmap, PRBool *_rval) { diff --git a/js/jsd/jsdebug.c b/js/jsd/jsdebug.c index daaf15c342d..6ae9c5801b0 100644 --- a/js/jsd/jsdebug.c +++ b/js/jsd/jsdebug.c @@ -356,16 +356,6 @@ JSD_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, jsuword pc) return jsd_GetClosestLine(jsdc, jsdscript, pc); } -JSD_PUBLIC_API(JSBool) -JSD_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript, - uintN startLine, uintN maxLines, - uintN* count, uintN** lines, jsuword** pcs) -{ - JSD_ASSERT_VALID_CONTEXT(jsdc); - JSD_ASSERT_VALID_SCRIPT(jsdscript); - return jsd_GetLinePCs(jsdc, jsdscript, startLine, maxLines, count, lines, pcs); -} - JSD_PUBLIC_API(void) JSD_ScriptCreated(JSDContext* jsdc, JSContext *cx, diff --git a/js/jsd/jsdebug.h b/js/jsd/jsdebug.h index 7cd4c0a9332..ce0a3dc4e7a 100644 --- a/js/jsd/jsdebug.h +++ b/js/jsd/jsdebug.h @@ -496,17 +496,6 @@ JSD_GetClosestPC(JSDContext* jsdc, JSDScript* jsdscript, uintN line); extern JSD_PUBLIC_API(uintN) JSD_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, jsuword pc); -/* - * Get a list of lines and the corresponding earliest PC for each (see - * JSD_GetClosestPC). Lines with no PCs associated will not be returned. NULL - * may be passed for either lines or pcs to avoid filling anything in for that - * argument. - */ -extern JSD_PUBLIC_API(JSBool) -JSD_GetLinePCs(JSDContext* jsdc, JSDScript* jsdscript, - uintN startLine, uintN maxLines, - uintN* count, uintN** lines, jsuword** pcs); - /* these are only used in cases where scripts are created outside of JS*/ /* diff --git a/js/src/jsdbgapi.cpp b/js/src/jsdbgapi.cpp index 2c89a271254..5a9406010d0 100644 --- a/js/src/jsdbgapi.cpp +++ b/js/src/jsdbgapi.cpp @@ -1299,59 +1299,6 @@ JS_EndPC(JSContext *cx, JSScript *script) return script->code + script->length; } -JS_PUBLIC_API(JSBool) -JS_GetLinePCs(JSContext *cx, JSScript *script, - uintN startLine, uintN maxLines, - uintN* count, uintN** retLines, jsbytecode*** retPCs) -{ - uintN* lines; - jsbytecode** pcs; - size_t len = (script->length > maxLines ? maxLines : script->length); - lines = (uintN*) cx->malloc_(len * sizeof(uintN)); - if (!lines) - return JS_FALSE; - - pcs = (jsbytecode**) cx->malloc_(len * sizeof(jsbytecode*)); - if (!pcs) { - cx->free_(lines); - return JS_FALSE; - } - - uintN lineno = script->lineno; - uintN offset = 0; - uintN i = 0; - for (jssrcnote *sn = script->notes(); !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) { - offset += SN_DELTA(sn); - JSSrcNoteType type = (JSSrcNoteType) SN_TYPE(sn); - if (type == SRC_SETLINE || type == SRC_NEWLINE) { - if (type == SRC_SETLINE) - lineno = (uintN) js_GetSrcNoteOffset(sn, 0); - else - lineno++; - - if (lineno >= startLine) { - lines[i] = lineno; - pcs[i] = script->code + offset; - if (++i >= maxLines) - break; - } - } - } - - *count = i; - if (retLines) - *retLines = lines; - else - cx->free_(lines); - - if (retPCs) - *retPCs = pcs; - else - cx->free_(pcs); - - return JS_TRUE; -} - JS_PUBLIC_API(uintN) JS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun) { diff --git a/js/src/jsdbgapi.h b/js/src/jsdbgapi.h index 1cf35996151..6016e968aff 100644 --- a/js/src/jsdbgapi.h +++ b/js/src/jsdbgapi.h @@ -217,11 +217,6 @@ JS_LineNumberToPC(JSContext *cx, JSScript *script, uintN lineno); extern JS_PUBLIC_API(jsbytecode *) JS_EndPC(JSContext *cx, JSScript *script); -extern JS_PUBLIC_API(JSBool) -JS_GetLinePCs(JSContext *cx, JSScript *script, - uintN startLine, uintN maxLines, - uintN* count, uintN** lines, jsbytecode*** pcs); - extern JS_PUBLIC_API(uintN) JS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun);