Bug 757908 - Remove JSRESOLVE_DECLARING. r=dmandelin

--HG--
extra : rebase_source : 0aa62ffa45751a55708f904079d901347e6dc9ea
This commit is contained in:
Jeff Walden 2012-05-23 10:22:46 -07:00
parent 4759734498
commit eca45b8933
7 changed files with 10 additions and 15 deletions

View File

@ -5369,11 +5369,10 @@ nsWindowSH::GlobalScopePolluterNewResolve(JSContext *cx, JSHandleObject obj,
JSHandleId id, unsigned flags,
JSObject **objp)
{
if (flags & (JSRESOLVE_ASSIGNING | JSRESOLVE_DECLARING |
JSRESOLVE_QUALIFIED) ||
if (flags & (JSRESOLVE_ASSIGNING | JSRESOLVE_QUALIFIED) ||
!JSID_IS_STRING(id)) {
// Nothing to do here if we're either assigning or declaring,
// doing a qualified resolve, or resolving a number.
// Nothing to do here if we're assigning, doing a qualified resolve, or
// resolving a non-string property.
return JS_TRUE;
}

View File

@ -371,8 +371,8 @@ ResolveWorkerClasses(JSContext* aCx, JSHandleObject aObj, JSHandleId aId, unsign
{
AssertIsOnMainThread();
// Don't care about assignments or declarations, bail now.
if (aFlags & (JSRESOLVE_ASSIGNING | JSRESOLVE_DECLARING)) {
// Don't care about assignments, bail now.
if (aFlags & JSRESOLVE_ASSIGNING) {
*aObjp = nsnull;
return true;
}

View File

@ -3710,7 +3710,7 @@ DefinePropertyById(JSContext *cx, HandleObject obj, HandleId id, HandleValue val
? JS_FUNC_TO_DATA_PTR(JSObject *, setter)
: NULL);
JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED | JSRESOLVE_DECLARING);
JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED);
if (flags != 0 && obj->isNative()) {
return !!DefineNativeProperty(cx, obj, id, value, getter, setter,
attrs, flags, tinyid);

View File

@ -1404,7 +1404,6 @@ typedef JSBool
* JSRESOLVE_QUALIFIED a qualified property id: obj.id or obj[id], not id
* JSRESOLVE_ASSIGNING obj[id] is on the left-hand side of an assignment
* JSRESOLVE_DETECTING 'if (o.p)...' or similar detection opcode sequence
* JSRESOLVE_DECLARING var, const, or function prolog declaration opcode
*
* The *objp out parameter, on success, should be null to indicate that id
* was not resolved; and non-null, referring to obj or one of its prototypes,
@ -3799,7 +3798,6 @@ JS_IdToValue(JSContext *cx, jsid id, jsval *vp);
#define JSRESOLVE_QUALIFIED 0x01 /* resolve a qualified property id */
#define JSRESOLVE_ASSIGNING 0x02 /* resolve on the left of assignment */
#define JSRESOLVE_DETECTING 0x04 /* 'if (o.p)...' or '(o.p) ?...:...' */
#define JSRESOLVE_DECLARING 0x08 /* var, const, or function prolog op */
/*
* Invoke the [[DefaultValue]] hook (see ES5 8.6.2) with the provided hint on

View File

@ -3146,8 +3146,6 @@ js_InferFlags(JSContext *cx, unsigned defaultFlags)
if (pc < script->code + script->length && Detecting(cx, pc))
flags |= JSRESOLVE_DETECTING;
}
if (format & JOF_DECLARING)
flags |= JSRESOLVE_DECLARING;
return flags;
}

View File

@ -79,7 +79,7 @@ typedef enum JSOp {
#define JOF_DETECTING (1U<<14) /* object detection for JSNewResolveOp */
#define JOF_BACKPATCH (1U<<15) /* backpatch placeholder during codegen */
#define JOF_LEFTASSOC (1U<<16) /* left-associative operator */
#define JOF_DECLARING (1U<<17) /* var, const, or function declaration op */
/* (1U<<17) is unused */
/* (1U<<18) is unused */
#define JOF_PARENHEAD (1U<<20) /* opcode consumes value of expression in
parenthesized statement head */

View File

@ -305,9 +305,9 @@ OPDEF(JSOP_SETTER, 126,js_setter_str,NULL, 1, 0, 0, 0, JOF_BYTE)
/*
* Prolog bytecodes for defining function, var, and const names.
*/
OPDEF(JSOP_DEFFUN, 127,"deffun", NULL, 5, 0, 0, 0, JOF_OBJECT|JOF_DECLARING)
OPDEF(JSOP_DEFCONST, 128,"defconst", NULL, 5, 0, 0, 0, JOF_ATOM|JOF_DECLARING)
OPDEF(JSOP_DEFVAR, 129,"defvar", NULL, 5, 0, 0, 0, JOF_ATOM|JOF_DECLARING)
OPDEF(JSOP_DEFFUN, 127,"deffun", NULL, 5, 0, 0, 0, JOF_OBJECT)
OPDEF(JSOP_DEFCONST, 128,"defconst", NULL, 5, 0, 0, 0, JOF_ATOM)
OPDEF(JSOP_DEFVAR, 129,"defvar", NULL, 5, 0, 0, 0, JOF_ATOM)
/* Push a closure for a named or anonymous function expression. */
OPDEF(JSOP_LAMBDA, 130, "lambda", NULL, 5, 0, 1, 19, JOF_OBJECT)