Last Comment Bug 714218 - Move element/property/special-specific handling for a few classes out of getGeneric methods into specific get* methods
: Move element/property/special-specific handling for a few classes out of getG...
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla12
Assigned To: Jeff Walden [:Waldo] (remove +bmo to email)
: Jason Orendorff [:jorendorff]
Depends on:
Blocks: 586842
  Show dependency treegraph
Reported: 2011-12-29 18:55 PST by Jeff Walden [:Waldo] (remove +bmo to email)
Modified: 2012-01-04 04:51 PST (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Patch (10.92 KB, patch)
2011-12-29 18:55 PST, Jeff Walden [:Waldo] (remove +bmo to email)
bhackett1024: review+
Details | Diff | Splinter Review

Description Jeff Walden [:Waldo] (remove +bmo to email) 2011-12-29 18:55:07 PST
Created attachment 584904 [details] [diff] [review]
Comment 1 Brian Hackett (:bhackett) 2012-01-02 07:53:23 PST
Comment on attachment 584904 [details] [diff] [review]

Review of attachment 584904 [details] [diff] [review]:

::: js/src/jsarray.cpp
@@ +871,1 @@
>  }

Will the getGeneric hooks be going away entirely soon?
Comment 2 :Ms2ger (⌚ UTC+1/+2) 2012-01-02 08:11:15 PST
Comment on attachment 584904 [details] [diff] [review]

> array_getSpecial(JSContext *cx, JSObject *obj, JSObject *receiver, SpecialId sid, Value *vp)
> {
>-    return array_getGeneric(cx, obj, receiver, SPECIALID_TO_JSID(sid), vp);
>+    if (obj->isDenseArray()) {
>+        JSObject *proto = obj->getProto();
>+        if (!proto) {
>+            vp->setUndefined();
>+            return true;
>+        }
>+    }

Perhaps rewrite this as

if (obj->isDenseArray() && !obj->getProto()) {
    return true;

Comment 3 Jeff Walden [:Waldo] (remove +bmo to email) 2012-01-03 08:53:26 PST
All the generic hooks will be going away "soon".  I'm not sure exactly what will replace them.  v8 just has all callsites convert to string, then fork on index-or-name at that point.  With our special junk, we can't do that so tersely.  It's an ugly problem I plan to think about today and hopefully come to some idea of a solution.
Comment 4 Jeff Walden [:Waldo] (remove +bmo to email) 2012-01-03 20:31:33 PST
Comment 5 Marco Bonardo [::mak] 2012-01-04 04:51:54 PST

Note You need to log in before you can comment on or make changes to this bug.