Last Comment Bug 564094 - more dslots encapsulation
: more dslots encapsulation
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: x86 Mac OS X
-- normal (vote)
: ---
Assigned To: Nicholas Nethercote [:njn]
: Jason Orendorff [:jorendorff]
Depends on:
Blocks: 558262
  Show dependency treegraph
Reported: 2010-05-05 19:38 PDT by Nicholas Nethercote [:njn]
Modified: 2011-07-27 22:03 PDT (History)
1 user (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (20.88 KB, patch)
2010-05-05 19:38 PDT, Nicholas Nethercote [:njn]
no flags Details | Diff | Splinter Review

Description User image Nicholas Nethercote [:njn] 2010-05-05 19:38:30 PDT
Created attachment 443787 [details] [diff] [review]

Draft patch, requiring feedback for further progress:

- js_FunctionClass doesn't have any JSSLOT_* values, which is odd,
  an XPConnect thing?  I see this comment:

     * Reserve two slots in all function objects for XPConnect.  Note that
     * this does not bloat every instance, only those on which reserved slots
     * are set, and those on which ad-hoc properties are defined.
    JS_FRIEND_DATA(JSClass) js_FunctionClass = { 

- The following function names are based on the equivalent functions for
  Arrays.  Better names should be used but I don't know what they are because
  I'm still not sure what the dslots hold for Function and Call objects.

  getFunctionElements() // are the elements upvars?  what are upvars?

  getCallElements()     // getCallArgsAndVars()?

- For js_ArgumentsClass we have getters/setters with names like
  getArgsLength().  I wonder if that should become getArgumentsLength().  The
  rationale would be that we use the full "Arguments" when talking about the
  Arguments object (eg. getCallArguments()) and the shorter "Args" for
  non-Arguments "arguments" (eg. getCallArgsAndVars(), if we go with that name).
Comment 1 User image Brendan Eich [:brendan] 2010-05-16 15:08:56 PDT
Nick, sorry I didn't see the feedback request here before patching bug 558451. At this point I'd like to defer this encapsulation until that bug is fixed. Can you stand it, or would you rather I fold this patch (with necessary changes) into the queue for that bug? See the patch there I'm about to attach.

Comment 2 User image Nicholas Nethercote [:njn] 2010-05-16 15:13:08 PDT
This bug can wait, bug 558451 is more important.
Comment 3 User image Nicholas Nethercote [:njn] 2011-07-27 22:03:52 PDT
Bug 673451 made JSObject::slots private, so there's nothing left to do here.

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