Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Fully split up deleteProperty into property/element/special/generic forms

RESOLVED FIXED in mozilla10

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Waldo, Assigned: Waldo)

Tracking

unspecified
mozilla10
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Created attachment 564723 [details] [diff] [review]
Patch

More dreariness.

This one in particular would be much nicer, generally, if the opcode format were split such that we had delprop, delelem, delval -- that is, we had specific bytecodes for deleting named properties and deleting index properties.  I tend to think that sort of bytecode mucking is better left to later on in API changes, so for now we get a bunch of deleteGeneric.
Attachment #564723 - Flags: review?(bhackett1024)
Comment on attachment 564723 [details] [diff] [review]
Patch

I don't understand the opcode format comment.  There are separate bytecodes already for DELNAME, DELPROP and DELELEM, and for DELELEM there is no way for the parser to tell ahead of time whether the property being deleted is named or indexed.
Attachment #564723 - Flags: review?(bhackett1024) → review+
What I suggest is that DELELEM be split into a variant that deletes using a value on the stack to indicate the property to delete, and a variant that deletes using a constant index included in the bytecode stream:

  delete a.b  => delprop "b"
  delete a[2] => delelem 2
  delete a[c] => delval #(slot for c)

Or something like that.

It's possible there might not be the payoff in splitting up delelem that way, since delete is kind of uncommon.  But if there were such a split, delelem could use obj->deleteElement, delprop could use obj->deleteProperty, and delval could use obj->deleteGeneric (or longer-run something to disambiguate the val into an element, property, or special, then use delete{not Generic}).
https://hg.mozilla.org/integration/mozilla-inbound/rev/9291abf9fd17
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla10
https://hg.mozilla.org/mozilla-central/rev/9291abf9fd17
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.