From b844e5f32618373b9c94b07fb153731d89c801a0 Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Tue, 10 Jul 2012 15:34:12 -0700 Subject: [PATCH] Bug 772285 - rm JSPD_ARGUMENT/JSPD_VARIABLE (r=sfink) --HG-- extra : rebase_source : 7be9ea3e5e90be9abd65f7d5268741e453cc717b --- js/jsd/idl/jsdIDebuggerService.idl | 4 +-- js/jsd/jsd.h | 4 --- js/jsd/jsd_val.c | 9 +---- js/jsd/jsd_xpc.cpp | 7 ---- js/jsd/jsdebug.c | 8 ----- js/jsd/jsdebug.h | 9 ----- js/src/jsdbgapi.cpp | 9 ----- js/src/jsdbgapi.h | 3 -- js/src/shell/js.cpp | 2 -- js/xpconnect/src/XPCDebug.cpp | 56 ++++++++++++++---------------- 10 files changed, 28 insertions(+), 83 deletions(-) diff --git a/js/jsd/idl/jsdIDebuggerService.idl b/js/jsd/idl/jsdIDebuggerService.idl index b9978e4818f..16e8dfb3524 100644 --- a/js/jsd/idl/jsdIDebuggerService.idl +++ b/js/jsd/idl/jsdIDebuggerService.idl @@ -1211,7 +1211,7 @@ interface jsdIObject : nsISupports * Representation of a property of an object. When an instance is invalid, all * method and property access will result in a NS_UNAVAILABLE error. */ -[scriptable, uuid(09332485-1419-42bc-ba1f-070815ed4b82)] +[scriptable, uuid(acf1329e-aaf6-4d6a-a1eb-f75858566f09)] interface jsdIProperty : jsdIEphemeral { /** Internal use only. */ @@ -1250,6 +1250,4 @@ interface jsdIProperty : jsdIEphemeral readonly attribute jsdIValue name; /** value of this property. */ readonly attribute jsdIValue value; - /** slot number if this property is a local variable or parameter. */ - readonly attribute unsigned long varArgSlot; }; diff --git a/js/jsd/jsd.h b/js/jsd/jsd.h index 7aca054e2d3..edc3af2fd39 100644 --- a/js/jsd/jsd.h +++ b/js/jsd/jsd.h @@ -255,7 +255,6 @@ struct JSDProperty JSDValue* val; JSDValue* name; JSDValue* alias; - unsigned slot; unsigned flags; }; @@ -991,9 +990,6 @@ jsd_GetPropertyAlias(JSDContext* jsdc, JSDProperty* jsdprop); extern unsigned jsd_GetPropertyFlags(JSDContext* jsdc, JSDProperty* jsdprop); -extern unsigned -jsd_GetPropertyVarArgSlot(JSDContext* jsdc, JSDProperty* jsdprop); - /**************************************************/ /* Stepping Functions */ diff --git a/js/jsd/jsd_val.c b/js/jsd/jsd_val.c index 81629fd0d0c..0d7cacca926 100644 --- a/js/jsd/jsd_val.c +++ b/js/jsd/jsd_val.c @@ -375,7 +375,6 @@ static JSDProperty* _newProperty(JSDContext* jsdc, JSPropertyDesc* pd, JS_INIT_CLIST(&jsdprop->links); jsdprop->nref = 1; jsdprop->flags = pd->flags | additionalFlags; - jsdprop->slot = pd->slot; if(!(jsdprop->name = jsd_NewValue(jsdc, pd->id))) goto new_prop_fail; @@ -625,7 +624,7 @@ jsd_GetValueProperty(JSDContext* jsdc, JSDValue* jsdval, JSString* name) return NULL; } - pd.slot = pd.spare = 0; + pd.spare = 0; pd.alias = JSVAL_NULL; pd.flags |= (attrs & JSPROP_ENUMERATE) ? JSPD_ENUMERATE : 0 | (attrs & JSPROP_READONLY) ? JSPD_READONLY : 0 @@ -847,12 +846,6 @@ jsd_GetPropertyFlags(JSDContext* jsdc, JSDProperty* jsdprop) return jsdprop->flags; } -unsigned -jsd_GetPropertyVarArgSlot(JSDContext* jsdc, JSDProperty* jsdprop) -{ - return jsdprop->slot; -} - void jsd_DropProperty(JSDContext* jsdc, JSDProperty* jsdprop) { diff --git a/js/jsd/jsd_xpc.cpp b/js/jsd/jsd_xpc.cpp index a11615bcb5e..86589f263d8 100644 --- a/js/jsd/jsd_xpc.cpp +++ b/js/jsd/jsd_xpc.cpp @@ -911,13 +911,6 @@ jsdProperty::GetValue(jsdIValue **_rval) return NS_OK; } -NS_IMETHODIMP -jsdProperty::GetVarArgSlot(PRUint32 *_rval) -{ - *_rval = JSD_GetPropertyVarArgSlot (mCx, mProperty); - return NS_OK; -} - /* Scripts */ NS_IMPL_THREADSAFE_ISUPPORTS2(jsdScript, jsdIScript, jsdIEphemeral) diff --git a/js/jsd/jsdebug.c b/js/jsd/jsdebug.c index 947ff0841fc..19ff815eba0 100644 --- a/js/jsd/jsdebug.c +++ b/js/jsd/jsdebug.c @@ -1226,14 +1226,6 @@ JSD_GetPropertyFlags(JSDContext* jsdc, JSDProperty* jsdprop) return jsd_GetPropertyFlags(jsdc, jsdprop); } -JSD_PUBLIC_API(unsigned) -JSD_GetPropertyVarArgSlot(JSDContext* jsdc, JSDProperty* jsdprop) -{ - JSD_ASSERT_VALID_CONTEXT(jsdc); - JSD_ASSERT_VALID_PROPERTY(jsdprop); - return jsd_GetPropertyVarArgSlot(jsdc, jsdprop); -} - /**************************************************/ /* Object Functions */ diff --git a/js/jsd/jsdebug.h b/js/jsd/jsdebug.h index 044c85f0e7e..f801d948d40 100644 --- a/js/jsd/jsdebug.h +++ b/js/jsd/jsdebug.h @@ -1370,8 +1370,6 @@ JSD_GetScriptForValue(JSDContext* jsdc, JSDValue* jsdval); #define JSDPD_READONLY JSPD_READONLY /* assignment is error */ #define JSDPD_PERMANENT JSPD_PERMANENT /* property cannot be deleted */ #define JSDPD_ALIAS JSPD_ALIAS /* property has an alias id */ -#define JSDPD_ARGUMENT JSPD_ARGUMENT /* argument to function */ -#define JSDPD_VARIABLE JSPD_VARIABLE /* local variable in function */ #define JSDPD_EXCEPTION JSPD_EXCEPTION /* exception occurred looking up */ /* proprety, value is exception */ #define JSDPD_ERROR JSPD_ERROR /* native getter returned JS_FALSE */ @@ -1417,13 +1415,6 @@ JSD_GetPropertyAlias(JSDContext* jsdc, JSDProperty* jsdprop); extern JSD_PUBLIC_API(unsigned) JSD_GetPropertyFlags(JSDContext* jsdc, JSDProperty* jsdprop); -/* -* Get Variable or Argument slot number (if JSDPD_ARGUMENT or JSDPD_VARIABLE set) -* *** new for version 1.1 **** -*/ -extern JSD_PUBLIC_API(unsigned) -JSD_GetPropertyVarArgSlot(JSDContext* jsdc, JSDProperty* jsdprop); - /***************************************************************************/ /* Object Functions --- All NEW for 1.1 --- */ diff --git a/js/src/jsdbgapi.cpp b/js/src/jsdbgapi.cpp index 17a938c6bc1..0f53d91802f 100644 --- a/js/src/jsdbgapi.cpp +++ b/js/src/jsdbgapi.cpp @@ -818,15 +818,6 @@ GetPropertyDesc(JSContext *cx, JSObject *obj_, Shape *shape, JSPropertyDesc *pd) | (!shape->writable() ? JSPD_READONLY : 0) | (!shape->configurable() ? JSPD_PERMANENT : 0); pd->spare = 0; - if (shape->setter() == CallObject::setArgOp) { - pd->slot = shape->shortid(); - pd->flags |= JSPD_ARGUMENT; - } else if (shape->setter() == CallObject::setVarOp) { - pd->slot = shape->shortid(); - pd->flags |= JSPD_VARIABLE; - } else { - pd->slot = 0; - } pd->alias = JSVAL_VOID; return JS_TRUE; diff --git a/js/src/jsdbgapi.h b/js/src/jsdbgapi.h index 6fa6e2793bf..b256f5962b0 100644 --- a/js/src/jsdbgapi.h +++ b/js/src/jsdbgapi.h @@ -336,7 +336,6 @@ typedef struct JSPropertyDesc { jsval value; /* property value */ uint8_t flags; /* flags, see below */ uint8_t spare; /* unused */ - uint16_t slot; /* argument/variable slot */ jsval alias; /* alias id if JSPD_ALIAS flag */ } JSPropertyDesc; @@ -344,8 +343,6 @@ typedef struct JSPropertyDesc { #define JSPD_READONLY 0x02 /* assignment is error */ #define JSPD_PERMANENT 0x04 /* property cannot be deleted */ #define JSPD_ALIAS 0x08 /* property has an alias id */ -#define JSPD_ARGUMENT 0x10 /* argument to function */ -#define JSPD_VARIABLE 0x20 /* local variable in function */ #define JSPD_EXCEPTION 0x40 /* exception occurred fetching the property, */ /* value is exception */ #define JSPD_ERROR 0x80 /* native getter returned JS_FALSE without */ diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index f7649e6293f..ff5570c204c 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -2368,8 +2368,6 @@ GetPDA(JSContext *cx, unsigned argc, jsval *vp) JS_SetProperty(cx, pdobj, "value", &pd->value) && (v = INT_TO_JSVAL(pd->flags), JS_SetProperty(cx, pdobj, "flags", &v)) && - (v = INT_TO_JSVAL(pd->slot), - JS_SetProperty(cx, pdobj, "slot", &v)) && JS_SetProperty(cx, pdobj, "alias", &pd->alias); if (!ok) break; diff --git a/js/xpconnect/src/XPCDebug.cpp b/js/xpconnect/src/XPCDebug.cpp index 59369acc64e..26e8acb7ec0 100644 --- a/js/xpconnect/src/XPCDebug.cpp +++ b/js/xpconnect/src/XPCDebug.cpp @@ -96,24 +96,22 @@ static char* FormatJSFrame(JSContext* cx, JSStackFrame* fp, if (showArgs && callObj) { for (uint32_t i = 0; i < callProps.length; i++) { JSPropertyDesc* desc = &callProps.array[i]; - if (desc->flags & JSPD_ARGUMENT) { - JSAutoByteString nameBytes; - const char* name = JSVAL2String(cx, desc->id, &isString, &nameBytes); - if (!isString) - name = nsnull; - JSAutoByteString valueBytes; - const char* value = JSVAL2String(cx, desc->value, &isString, &valueBytes); + JSAutoByteString nameBytes; + const char* name = JSVAL2String(cx, desc->id, &isString, &nameBytes); + if (!isString) + name = nsnull; + JSAutoByteString valueBytes; + const char* value = JSVAL2String(cx, desc->value, &isString, &valueBytes); - buf = JS_sprintf_append(buf, "%s%s%s%s%s%s", - namedArgCount ? ", " : "", - name ? name :"", - name ? " = " : "", - isString ? "\"" : "", - value ? value : "?unknown?", - isString ? "\"" : ""); - if (!buf) goto out; - namedArgCount++; - } + buf = JS_sprintf_append(buf, "%s%s%s%s%s%s", + namedArgCount ? ", " : "", + name ? name :"", + name ? " = " : "", + isString ? "\"" : "", + value ? value : "?unknown?", + isString ? "\"" : ""); + if (!buf) goto out; + namedArgCount++; } // print any unnamed trailing args (found in 'arguments' object) @@ -157,20 +155,18 @@ static char* FormatJSFrame(JSContext* cx, JSStackFrame* fp, if (showLocals && callProps.array) { for (uint32_t i = 0; i < callProps.length; i++) { JSPropertyDesc* desc = &callProps.array[i]; - if (desc->flags & JSPD_VARIABLE) { - JSAutoByteString nameBytes; - JSAutoByteString valueBytes; - const char *name = JSVAL2String(cx, desc->id, nsnull, &nameBytes); - const char *value = JSVAL2String(cx, desc->value, &isString, &valueBytes); + JSAutoByteString nameBytes; + JSAutoByteString valueBytes; + const char *name = JSVAL2String(cx, desc->id, nsnull, &nameBytes); + const char *value = JSVAL2String(cx, desc->value, &isString, &valueBytes); - if (name && value) { - buf = JS_sprintf_append(buf, TAB "%s = %s%s%s\n", - name, - isString ? "\"" : "", - value, - isString ? "\"" : ""); - if (!buf) goto out; - } + if (name && value) { + buf = JS_sprintf_append(buf, TAB "%s = %s%s%s\n", + name, + isString ? "\"" : "", + value, + isString ? "\"" : ""); + if (!buf) goto out; } } }