Move element/property/special-specific handling for a few classes out of getGeneric methods into specific get* methods

RESOLVED FIXED in mozilla12

Status

()

RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: Waldo, Assigned: Waldo)

Tracking

(Blocks: 1 bug)

unspecified
mozilla12
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
Posted patch PatchSplinter Review
Attachment #584904 - Flags: review?(bhackett1024)
Comment on attachment 584904 [details] [diff] [review]
Patch

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

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

Will the getGeneric hooks be going away entirely soon?
Attachment #584904 - Flags: review?(bhackett1024) → review+
Comment on attachment 584904 [details] [diff] [review]
Patch

> 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()) {
    vp->setUndefined();
    return true;
}

?
(Assignee)

Comment 3

7 years ago
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.
https://hg.mozilla.org/mozilla-central/rev/be81e5f7850f
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.