[INFER] Monitor property type for JSOP_INITELEM in methodjit, bug 640098, r=bhackett

This commit is contained in:
Jan de Mooij 2011-03-09 07:02:05 -08:00
parent 2580fc4b31
commit 77a48952fa
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,15 @@
eval("(function(){({6953421313:0})})")();
function f() {
var x = {6953421313: 123};
assertEq(x[6953421313], 123);
x[6953421313] = "a";
assertEq(x[6953421313], "a");
var y = {3.3: true};
assertEq(y[3.3], true);
}
f();

View File

@ -1459,6 +1459,8 @@ stubs::InitElem(VMFrame &f, uint32 last)
if (last && !js_SetLengthProperty(cx, obj, (jsuint) (JSID_TO_INT(id) + 1)))
THROW();
} else {
if (!cx->typeMonitorAssign(obj, id, rref))
THROW();
if (!obj->defineProperty(cx, id, rref, NULL, NULL, JSPROP_ENUMERATE))
THROW();
}