bug 891992 - remove LIVEWIRE from jsd r=timeless

This commit is contained in:
David Keeler 2013-07-10 13:53:11 -07:00
parent c52be22933
commit 593fac08cf
7 changed files with 2 additions and 233 deletions

View File

@ -43,13 +43,6 @@
#include <stdlib.h>
#include <string.h>
#ifdef LIVEWIRE
#include <base/pblock.h>
#include <base/session.h>
#include <frame/log.h>
#include <frame/req.h>
#endif /* LIVEWIRE */
#define JSD_MAJOR_VERSION 1
#define JSD_MINOR_VERSION 1
@ -147,11 +140,6 @@ struct JSDScript
void* data;
JSDProfileData *profileData;
#ifdef LIVEWIRE
LWDBGApp* app;
LWDBGScript* lwscript;
#endif
};
struct JSDProfileData
@ -1066,44 +1054,4 @@ struct AutoSaveExceptionState {
JSExceptionState *mState;
};
/***************************************************************************/
/* Livewire specific API */
#ifdef LIVEWIRE
extern LWDBGScript*
jsdlw_GetLWScript(JSDContext* jsdc, JSDScript* jsdscript);
extern char*
jsdlw_BuildAppRelativeFilename(LWDBGApp* app, const char* filename);
extern JSDSourceText*
jsdlw_PreLoadSource(JSDContext* jsdc, LWDBGApp* app,
const char* filename, JSBool clear);
extern JSDSourceText*
jsdlw_ForceLoadSource(JSDContext* jsdc, JSDSourceText* jsdsrc);
extern JSBool
jsdlw_UserCodeAtPC(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc);
extern JSBool
jsdlw_RawToProcessedLineNumber(JSDContext* jsdc, JSDScript* jsdscript,
unsigned lineIn, unsigned* lineOut);
extern JSBool
jsdlw_ProcessedToRawLineNumber(JSDContext* jsdc, JSDScript* jsdscript,
unsigned lineIn, unsigned* lineOut);
#if 0
/* our hook proc for LiveWire app start/stop */
extern void
jsdlw_AppHookProc(LWDBGApp* app,
JSBool created,
void *callerdata);
#endif
#endif
/***************************************************************************/
#endif /* jsd_h___ */

View File

@ -201,9 +201,7 @@ jsd_DebuggerOnForUser(JSRuntime* jsrt,
JS_SetNewScriptHookProc(jsdc->jsrt, jsd_NewScriptHookProc, jsdc);
JS_SetDestroyScriptHookProc(jsdc->jsrt, jsd_DestroyScriptHookProc, jsdc);
jsd_DebuggerUnpause(jsdc);
#ifdef LIVEWIRE
LWDBG_SetNewScriptHookProc(jsd_NewScriptHookProc, jsdc);
#endif
if( jsdc->userCallbacks.setContext )
jsdc->userCallbacks.setContext(jsdc, jsdc->user);
return jsdc;
@ -224,9 +222,6 @@ jsd_DebuggerOff(JSDContext* jsdc)
/* clear hooks here */
JS_SetNewScriptHookProc(jsdc->jsrt, NULL, NULL);
JS_SetDestroyScriptHookProc(jsdc->jsrt, NULL, NULL);
#ifdef LIVEWIRE
LWDBG_SetNewScriptHookProc(NULL,NULL);
#endif
/* clean up */
JSD_LockScriptSubsystem(jsdc);

View File

@ -40,11 +40,6 @@ jsd_InterruptHandler(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rva
if( ! jsdscript )
return JSTRAP_CONTINUE;
#ifdef LIVEWIRE
if( ! jsdlw_UserCodeAtPC(jsdc, jsdscript, (uintptr_t)pc) )
return JSTRAP_CONTINUE;
#endif
return jsd_CallExecutionHook(jsdc, cx, JSD_HOOK_INTERRUPTED,
hook, hookData, rval);
}

View File

@ -38,28 +38,6 @@ void JSD_ASSERT_VALID_EXEC_HOOK(JSDExecHook* jsdhook)
}
#endif
#ifdef LIVEWIRE
static JSBool
HasFileExtention(const char* name, const char* ext)
{
int i;
int len = strlen(ext);
const char* p = strrchr(name,'.');
if( !p )
return JS_FALSE;
p++;
for(i = 0; i < len; i++ )
{
JS_ASSERT(islower(ext[i]));
if( 0 == p[i] || tolower(p[i]) != ext[i] )
return JS_FALSE;
}
if( 0 != p[i] )
return JS_FALSE;
return JS_TRUE;
}
#endif /* LIVEWIRE */
static JSDScript*
_newJSDScript(JSDContext* jsdc,
JSContext *cx,
@ -93,45 +71,7 @@ _newJSDScript(JSDContext* jsdc,
jsdscript->lineBase = lineno;
jsdscript->lineExtent = (unsigned)NOT_SET_YET;
jsdscript->data = NULL;
#ifndef LIVEWIRE
jsdscript->url = (char*) jsd_BuildNormalizedURL(raw_filename);
#else
jsdscript->app = LWDBG_GetCurrentApp();
if( jsdscript->app && raw_filename )
{
jsdscript->url = jsdlw_BuildAppRelativeFilename(jsdscript->app, raw_filename);
if( function )
{
JSString* funid = JS_GetFunctionId(function);
char* funbytes;
const char* funnanme;
if( fuinid )
{
funbytes = JS_EncodeString(cx, funid);
funname = funbytes ? funbytes : "";
}
else
{
funbytes = NULL;
funname = "anonymous";
}
jsdscript->lwscript =
LWDBG_GetScriptOfFunction(jsdscript->app,funname);
JS_Free(cx, funbytes);
/* also, make sure this file is added to filelist if is .js file */
if( HasFileExtention(raw_filename,"js") ||
HasFileExtention(raw_filename,"sjs") )
{
jsdlw_PreLoadSource(jsdc, jsdscript->app, raw_filename, JS_FALSE);
}
}
else
{
jsdscript->lwscript = LWDBG_GetCurrentTopLevelScript();
}
}
#endif
JS_INIT_CLIST(&jsdscript->hooks);
@ -513,15 +453,6 @@ jsd_GetClosestPC(JSDContext* jsdc, JSDScript* jsdscript, unsigned line)
if( !jsdscript )
return 0;
#ifdef LIVEWIRE
if( jsdscript->lwscript )
{
unsigned newline;
jsdlw_RawToProcessedLineNumber(jsdc, jsdscript, line, &newline);
if( line != newline )
line = newline;
}
#endif
AutoSafeJSContext cx;
JSAutoCompartment ac(cx, jsdscript->script);
@ -547,15 +478,6 @@ jsd_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, uintptr_t pc)
if( line > last )
return last;
#ifdef LIVEWIRE
if( jsdscript && jsdscript->lwscript )
{
unsigned newline;
jsdlw_ProcessedToRawLineNumber(jsdc, jsdscript, line, &newline);
line = newline;
}
#endif
return line;
}
@ -786,7 +708,6 @@ jsd_TrapHandler(JSContext *cx, JSScript *script_, jsbytecode *pc, jsval *rval,
JSD_ExecutionHookProc hook;
void* hookData;
JSDContext* jsdc;
JSDScript* jsdscript;
JSD_LOCK();
@ -804,7 +725,6 @@ jsd_TrapHandler(JSContext *cx, JSScript *script_, jsbytecode *pc, jsval *rval,
hook = jsdhook->hook;
hookData = jsdhook->callerdata;
jsdscript = jsdhook->jsdscript;
/* do not use jsdhook-> after this point */
JSD_UNLOCK();
@ -815,11 +735,6 @@ jsd_TrapHandler(JSContext *cx, JSScript *script_, jsbytecode *pc, jsval *rval,
if( JSD_IS_DANGEROUS_THREAD(jsdc) )
return JSTRAP_CONTINUE;
#ifdef LIVEWIRE
if( ! jsdlw_UserCodeAtPC(jsdc, jsdscript, (uintptr_t)pc) )
return JSTRAP_CONTINUE;
#endif
return jsd_CallExecutionHook(jsdc, cx, JSD_HOOK_BREAKPOINT,
hook, hookData, rval);
}

View File

@ -344,11 +344,8 @@ jsd_NewSourceText(JSDContext* jsdc, const char* url)
JSD_LOCK_SOURCE_TEXT(jsdc);
#ifdef LIVEWIRE
new_url_string = url; /* we take ownership of alloc'd string */
#else
new_url_string = jsd_BuildNormalizedURL(url);
#endif
if( ! new_url_string )
return NULL;

View File

@ -1318,54 +1318,3 @@ JSD_GetValueForObject(JSDContext* jsdc, JSDObject* jsdobj)
JSD_ASSERT_VALID_OBJECT(jsdobj);
return jsd_GetValueForObject(jsdc, jsdobj);
}
/***************************************************************************/
/* Livewire specific API */
#ifdef LIVEWIRE
JSD_PUBLIC_API(LWDBGScript*)
JSDLW_GetLWScript(JSDContext* jsdc, JSDScript* jsdscript)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SCRIPT(jsdscript);
return jsdlw_GetLWScript(jsdc, jsdscript);
}
JSD_PUBLIC_API(JSDSourceText*)
JSDLW_PreLoadSource( JSDContext* jsdc, LWDBGApp* app,
const char* filename, JSBool clear )
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JS_ASSERT(app);
JS_ASSERT(filename);
return jsdlw_PreLoadSource(jsdc, app, filename, clear);
}
JSD_PUBLIC_API(JSDSourceText*)
JSDLW_ForceLoadSource( JSDContext* jsdc, JSDSourceText* jsdsrc )
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
return jsdlw_ForceLoadSource(jsdc, jsdsrc);
}
JSD_PUBLIC_API(JSBool)
JSDLW_RawToProcessedLineNumber(JSDContext* jsdc, JSDScript* jsdscript,
unsigned lineIn, unsigned* lineOut)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SCRIPT(jsdscript);
return jsdlw_RawToProcessedLineNumber(jsdc, jsdscript, lineIn, lineOut);
}
JSD_PUBLIC_API(JSBool)
JSDLW_ProcessedToRawLineNumber(JSDContext* jsdc, JSDScript* jsdscript,
unsigned lineIn, unsigned* lineOut)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SCRIPT(jsdscript);
return jsdlw_ProcessedToRawLineNumber(jsdc, jsdscript, lineIn, lineOut);
}
#endif
/***************************************************************************/

View File

@ -13,9 +13,6 @@
#include "jsapi.h"
#include "jsdbgapi.h"
#ifdef LIVEWIRE
#include "lwdbgapi.h"
#endif
extern "C" {
@ -643,8 +640,6 @@ JSD_DestroyAllSources( JSDContext* jsdc );
* Add a new item for a given URL. If an iten already exists for the given URL
* then the old item is removed.
* 'url' may not be NULL.
*
* ifdef LIVEWIRE url is treated as a char* and ownership is claimed by jsd
*/
extern JSD_PUBLIC_API(JSDSourceText*)
JSD_NewSourceText(JSDContext* jsdc, const char* url);
@ -1522,31 +1517,6 @@ JSD_GetObjectForValue(JSDContext* jsdc, JSDValue* jsdval);
extern JSD_PUBLIC_API(JSDValue*)
JSD_GetValueForObject(JSDContext* jsdc, JSDObject* jsdobj);
/***************************************************************************/
/* Livewire specific API */
#ifdef LIVEWIRE
extern JSD_PUBLIC_API(LWDBGScript*)
JSDLW_GetLWScript(JSDContext* jsdc, JSDScript* jsdscript);
extern JSD_PUBLIC_API(JSDSourceText*)
JSDLW_PreLoadSource(JSDContext* jsdc, LWDBGApp* app,
const char* filename, JSBool clear);
extern JSD_PUBLIC_API(JSDSourceText*)
JSDLW_ForceLoadSource(JSDContext* jsdc, JSDSourceText* jsdsrc);
extern JSD_PUBLIC_API(JSBool)
JSDLW_RawToProcessedLineNumber(JSDContext* jsdc, JSDScript* jsdscript,
unsigned lineIn, unsigned* lineOut);
extern JSD_PUBLIC_API(JSBool)
JSDLW_ProcessedToRawLineNumber(JSDContext* jsdc, JSDScript* jsdscript,
unsigned lineIn, unsigned* lineOut);
#endif
/***************************************************************************/
} // extern "C"
#endif /* jsdebug_h___ */