Add js_CheckForStringIndex call to trace recorder path for JSOP_INITPROP, to match what the interpreter does. Bug 626345, r=Waldo.
authorJason Orendorff <jorendorff@mozilla.com>
Fri, 21 Jan 2011 13:20:45 -0600
changeset 61209 34359bdfcde48e5765b8806c20343174aa909da6
parent 61208 74190651d91a9744f73b6ebf0360bf3f8580f0c0
child 61210 33f07113de5fcf6bbe59ce554402b22c91cfebcb
push id18277
push usercleary@mozilla.com
push dateTue, 25 Jan 2011 03:52:51 +0000
treeherdermozilla-central@7ee91bd90e7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs626345
milestone2.0b10pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Add js_CheckForStringIndex call to trace recorder path for JSOP_INITPROP, to match what the interpreter does. Bug 626345, r=Waldo.
js/src/jit-test/tests/basic/testInitPropWithIntName.js
js/src/jstracer.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testInitPropWithIntName.js
@@ -0,0 +1,2 @@
+for (var j=0; j<HOTLOOP; ++j)
+    ({'0': 0});
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -12453,17 +12453,17 @@ TraceRecorder::recordInitPropertyOp(jsby
     JSObject* obj = &l.toObject();
     LIns* obj_ins = get(&l);
     JS_ASSERT(obj->getClass() == &js_ObjectClass);
 
     Value& v = stackval(-1);
     LIns* v_ins = get(&v);
 
     JSAtom* atom = atoms[GET_INDEX(cx->regs->pc)];
-    jsid id = ATOM_TO_JSID(atom);
+    jsid id = js_CheckForStringIndex(ATOM_TO_JSID(atom));
 
     // If obj already has this property (because JSOP_NEWOBJECT already set its
     // shape or because the id appears more than once in the initializer), just
     // set it. The existing property can't be an accessor property: we wouldn't
     // get here, as JSOP_SETTER can't be recorded.
     if (const Shape* shape = obj->nativeLookup(id)) {
         // Don't assign a bare (non-cloned) function to an ordinary or method
         // property. The opposite case, assigning some other value to a method,