Bug 985687 - Remove vestigial tinyid/shortid references, as well as the field in JSPropertySpec. Followup to bug 975069. r=luke

--HG--
extra : rebase_source : 4a9d1d783e658648c4ff210760b38f8353631458
This commit is contained in:
Jeff Walden 2014-03-11 12:03:56 -07:00
Родитель 03d118d71c
Коммит b44fa4bf74
7 изменённых файлов: 51 добавлений и 31 удалений

Просмотреть файл

@ -1830,7 +1830,7 @@ class AttrDefiner(PropertyDefiner):
return self.generatePrefableArray(
array, name,
' { "%s", 0, %s, %s, %s}',
' { "%s", %s, %s, %s}',
' JS_PS_END',
'JSPropertySpec',
PropertyDefiner.getControllingCondition, specData, doIdArrays)

Просмотреть файл

@ -2693,10 +2693,6 @@ Parser<FullParseHandler>::bindLet(BindData<FullParseHandler> *data,
Rooted<StaticBlockObject *> blockObj(cx, data->let.blockObj);
unsigned index = blockObj->numVariables();
if (index >= StaticBlockObject::LOCAL_INDEX_LIMIT) {
parser->report(ParseError, false, pn, data->let.overflow);
return false;
}
/*
* Assign block-local index to pn->pn_cookie right away, encoding it as an

Просмотреть файл

@ -2395,7 +2395,6 @@ struct JSPropertySpec {
};
const char *name;
int8_t tinyid;
uint8_t flags;
union {
JSPropertyOpWrapper propertyOp;
@ -2449,26 +2448,26 @@ CheckIsCharacterLiteral(const char (&arr)[N]);
* JSNatives.
*/
#define JS_PSG(name, getter, flags) \
{name, 0, \
{name, \
uint8_t(JS_CHECK_ACCESSOR_FLAGS(flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS), \
JSOP_WRAPPER(JS_CAST_NATIVE_TO(getter, JSPropertyOp)), \
JSOP_NULLWRAPPER}
#define JS_PSGS(name, getter, setter, flags) \
{name, 0, \
{name, \
uint8_t(JS_CHECK_ACCESSOR_FLAGS(flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS), \
JSOP_WRAPPER(JS_CAST_NATIVE_TO(getter, JSPropertyOp)), \
JSOP_WRAPPER(JS_CAST_NATIVE_TO(setter, JSStrictPropertyOp))}
#define JS_SELF_HOSTED_GET(name, getterName, flags) \
{name, 0, \
{name, \
uint8_t(JS_CHECK_ACCESSOR_FLAGS(flags) | JSPROP_SHARED | JSPROP_GETTER), \
{ nullptr, JS_CAST_STRING_TO(getterName, const JSJitInfo *) }, \
JSOP_NULLWRAPPER }
#define JS_SELF_HOSTED_GETSET(name, getterName, setterName, flags) \
{name, 0, \
{name, \
uint8_t(JS_CHECK_ACCESSOR_FLAGS(flags) | JSPROP_SHARED | JSPROP_GETTER | JSPROP_SETTER), \
{ nullptr, JS_CAST_STRING_TO(getterName, const JSJitInfo *) }, \
{ nullptr, JS_CAST_STRING_TO(setterName, const JSJitInfo *) } }
#define JS_PS_END {0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER }
#define JS_PS_END { nullptr, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER }
/*
* To define a native function, set call to a JSNativeWrapper. To define a

Просмотреть файл

@ -5159,7 +5159,7 @@ static const JSJitInfo doFoo_methodinfo = {
};
static const JSPropertySpec dom_props[] = {
{"x", 0,
{"x",
JSPROP_SHARED | JSPROP_ENUMERATE | JSPROP_NATIVE_ACCESSORS,
{ { (JSPropertyOp)dom_genericGetter, &dom_x_getterinfo } },
{ { (JSStrictPropertyOp)dom_genericSetter, &dom_x_setterinfo } }

Просмотреть файл

@ -0,0 +1,39 @@
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/licenses/publicdomain/
//-----------------------------------------------------------------------------
var BUGNUMBER = 999999;
var summary =
"Allow defining more than 2**16 let-variables in a single scope";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
print("Creating binding string...");
var bindings = [];
var codeStr = "let ";
for (var i = 0; i < Math.pow(2, 20); i++)
bindings.push("x" + i + " = " + i);
var codeStr = "let " + bindings.join(", ") + ";";
print("Binding string created, testing with global eval...");
eval(codeStr);
print("Testing with Function...");
Function(codeStr)();
print("Testing inside a function...");
eval("function q() { " + codeStr + " }; q();");
if (typeof reportCompare === "function")
reportCompare(true, true);
print("Tests complete");

Просмотреть файл

@ -684,7 +684,6 @@ StaticBlockObject::addVar(ExclusiveContext *cx, Handle<StaticBlockObject*> block
unsigned index, bool *redeclared)
{
JS_ASSERT(JSID_IS_ATOM(id));
JS_ASSERT(index < LOCAL_INDEX_LIMIT);
*redeclared = false;
@ -755,19 +754,19 @@ js::XDRStaticBlockObject(XDRState<mode> *xdr, HandleObject enclosingScope,
if (!xdr->codeUint32(&offset))
return false;
/*
* XDR the block object's properties. We know that there are 'count'
* properties to XDR, stored as id/aliased pairs. (The empty string as
* id indicates an int id.)
*/
if (mode == XDR_DECODE) {
obj->setLocalOffset(offset);
/*
* XDR the block object's properties. We know that there are 'count'
* properties to XDR, stored as id/shortid pairs.
*/
for (unsigned i = 0; i < count; i++) {
RootedAtom atom(cx);
if (!XDRAtom(xdr, &atom))
return false;
/* The empty string indicates an int id. */
RootedId id(cx, atom != cx->runtime()->emptyString
? AtomToId(atom)
: INT_TO_JSID(i));
@ -793,10 +792,6 @@ js::XDRStaticBlockObject(XDRState<mode> *xdr, HandleObject enclosingScope,
for (Shape::Range<NoGC> r(obj->lastProperty()); !r.empty(); r.popFront())
shapes[obj->shapeToIndex(r.front())] = &r.front();
/*
* XDR the block object's properties. We know that there are 'count'
* properties to XDR, stored as id/shortid pairs.
*/
RootedShape shape(cx);
RootedId propid(cx);
RootedAtom atom(cx);
@ -808,7 +803,6 @@ js::XDRStaticBlockObject(XDRState<mode> *xdr, HandleObject enclosingScope,
propid = shape->propid();
JS_ASSERT(JSID_IS_ATOM(propid) || JSID_IS_INT(propid));
/* The empty string indicates an int id. */
atom = JSID_IS_ATOM(propid)
? JSID_TO_ATOM(propid)
: cx->runtime()->emptyString;

Просмотреть файл

@ -532,14 +532,6 @@ class StaticBlockObject : public BlockObject
return reinterpret_cast<frontend::Definition *>(v.toPrivate());
}
/*
* While ScopeCoordinate can generally reference up to 2^24 slots, block objects have an
* additional limitation that all slot indices must be storable as uint16_t short-ids in the
* associated Shape. If we could remove the block dependencies on shape->shortid, we could
* remove INDEX_LIMIT.
*/
static const unsigned LOCAL_INDEX_LIMIT = JS_BIT(16);
static Shape *addVar(ExclusiveContext *cx, Handle<StaticBlockObject*> block, HandleId id,
unsigned index, bool *redeclared);
};