Remove over-eager gvar optimization for JSOP_DEFFUN (451678, r=shaver).
authorBrendan Eich <brendan@mozilla.org>
Fri, 22 Aug 2008 18:11:47 -0700
changeset 18336 a81c9fa9a583dcf2ae2877297cd8092be05be06f
parent 18335 20db232d795e77175d9a4ba932bf7b3aad2d48b8
child 18337 2989d7b99db3372d7093a83050d218b5c755b660
push idunknown
push userunknown
push dateunknown
reviewersshaver
bugs451678
milestone1.9.1a2pre
Remove over-eager gvar optimization for JSOP_DEFFUN (451678, r=shaver).
js/src/jsinterp.cpp
--- a/js/src/jsinterp.cpp
+++ b/js/src/jsinterp.cpp
@@ -5746,40 +5746,17 @@ js_Interpret(JSContext *cx)
                     ok = OBJ_DEFINE_PROPERTY(cx, parent, id, rval,
                                              (flags & JSPROP_GETTER)
                                              ? JS_EXTENSION (JSPropertyOp) obj
                                              : JS_PropertyStub,
                                              (flags & JSPROP_SETTER)
                                              ? JS_EXTENSION (JSPropertyOp) obj
                                              : JS_PropertyStub,
                                              attrs,
-                                             &prop);
-
-                    /*
-                     * Try to optimize a property we either just created, or
-                     * found directly in the global object, that is permanent,
-                     * has a slot, and has stub getter and setter, into a
-                     * "fast global" accessed by the JSOP_*GVAR opcodes.
-                     */
-                    if (ok && index < script->nfixed) {
-                        JS_ASSERT(OBJ_IS_NATIVE(obj));
-                        sprop = (JSScopeProperty *) prop;
-                        if (SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(obj)) &&
-                            SPROP_HAS_STUB_GETTER(sprop) &&
-                            SPROP_HAS_STUB_SETTER(sprop)) {
-                            /*
-                             * Fast globals use fp->slots to map the global
-                             * name's atom index to the permanent fp->varobj
-                             * slot number, tagged as a jsval. The atom index
-                             * for the global's name literal is identical to
-                             * its fp->slots index.
-                             */
-                            fp->slots[index] = INT_TO_JSVAL(sprop->slot);
-                        }
-                    }
+                                             NULL);
                 }
             }
 
             /* Restore fp->scopeChain now that obj is defined in fp->varobj. */
             fp->scopeChain = obj2;
             if (!ok) {
                 cx->weakRoots.newborn[GCX_OBJECT] = NULL;
                 goto error;