Closed Bug 560774 Opened 14 years ago Closed 14 years ago

encapsulate array-related dslots accesses

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

Attached patch patchSplinter Review
This patch encapsulates dslots accesses for dense arrays.  Mostly 
straightforward, except for:

- ResizeSlots() and EnsureCapacity() both got pulled into JSObject, because
  they deal directly with 'dslots'.  Actually the latter () doesn't
  directly access 'dslots', but it knows about the dslots[-1] slot holding 
  the capacity and acts accordingly, so I put it into JSObject.
  
- Changed ResizeSlots() argnames from oldlen/newlen to oldcap/newcap, to 
  match terminology used elsewhere
Attachment #440418 - Flags: review?(brendan)
Attachment #440418 - Flags: review?(brendan) → review+
Comment on attachment 440418 [details] [diff] [review]
patch

getDenseArrayCapacity
getDenseArrayElem

Seems a bit crufty to drop -ents (or -ent, even shorter than -city) and not match name style by spelling out Element{,s}. r=me with that.

/be
(In reply to comment #1)
> (From update of attachment 440418 [details] [diff] [review])
> getDenseArrayCapacity
> getDenseArrayElem
> 
> Seems a bit crufty to drop -ents (or -ent, even shorter than -city) and not
> match name style by spelling out Element{,s}. r=me with that.

So you want me to change *Elem to Element, and *Elems to *Elements?  (Double-checking because I found that sentence difficult to parse.)
Yes -- sorry for mixing -rest and {,s} notations ;-).

/be
OS: Mac OS X → All
Hardware: x86 → All
Pushed with "Elem" changed to "Element" throughout.

http://hg.mozilla.org/tracemonkey/rev/7ead08c80a8a
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/7ead08c80a8a
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Depends on: 575024
You need to log in before you can comment on or make changes to this bug.