Hi,

I'm looking closely at shapes and property trees. I've been using the
dump() and dumpSubtree() methods, among other things, and I'm seeing
some strange things.

Here's some reasonable-looking output:

class Array emptyShape
 id "length" g/s 0x7f06ae61fb10/0x7f06ae61fbf0 slot -1 attrs 44
(permanent shared) flags 0  nkids=1
  id "toSource" g/s (nil)/(nil) slot 0 attrs 0 flags 0  nkids=1
   id "toString" g/s (nil)/(nil) slot 1 attrs 0 flags 0  nkids=1
    id "toLocaleString" g/s (nil)/(nil) slot 2 attrs 0 flags 0  nkids=1
     id "join" g/s (nil)/(nil) slot 3 attrs 0 flags 0  nkids=1
      id "reverse" g/s (nil)/(nil) slot 4 attrs 0 flags 0  nkids=1
       id "sort" g/s (nil)/(nil) slot 5 attrs 0 flags 0  nkids=1
        id "push" g/s (nil)/(nil) slot 6 attrs 0 flags 0  nkids=1
         id "pop" g/s (nil)/(nil) slot 7 attrs 0 flags 0  nkids=1
          id "shift" g/s (nil)/(nil) slot 8 attrs 0 flags 0  nkids=1
           id "unshift" g/s (nil)/(nil) slot 9 attrs 0 flags 0  nkids=1

We have a property tree for |Array|, and it looks reasonable.

Here's part of a stranger one:

class Array emptyShape
 id "length" g/s 0x7f06ae61fb10/0x7f06ae61fbf0 slot -1 attrs 44
(permanent shared) flags 0  nkids=0
 id "length" g/s 0x7f06ae61fb10/0x7f06ae61fbf0 slot -1 attrs 44
(permanent shared) flags 0  nkids=1
  id "toSource" g/s (nil)/(nil) slot 0 attrs 0 flags 0  nkids=1
   id "toString" g/s (nil)/(nil) slot 1 attrs 0 flags 0  nkids=1
    id "toLocaleString" g/s (nil)/(nil) slot 2 attrs 0 flags 0  nkids=1
     id "join" g/s (nil)/(nil) slot 3 attrs 0 flags 0  nkids=1
      id "reverse" g/s (nil)/(nil) slot 4 attrs 0 flags 0  nkids=1
       id "sort" g/s (nil)/(nil) slot 5 attrs 0 flags 0  nkids=1
        id "push" g/s (nil)/(nil) slot 6 attrs 0 flags 0  nkids=1
         id "pop" g/s (nil)/(nil) slot 7 attrs 0 flags 0  nkids=1

Two seemingly identical |length| shapes, both at depth 1. How does that happen?

Here's part of another strange one:

class Function emptyShape
 id "length" g/s (nil)/(nil) slot 0 attrs 6 (readonly permanent) flags
0  nkids=1
  id "name" g/s (nil)/(nil) slot 1 attrs 6 (readonly permanent) flags 0  nkids=1
   id "arguments" g/s 0x7f06ae9175b0/(nil) slot -1 attrs 44 (permanent
shared) flags 0  nkids=2
    id "caller" g/s 0x7f06ae9175b0/(nil) slot -1 attrs 44 (permanent
shared) flags 0  nkids=0
    id "caller" g/s 0x7f06ae9175b0/(nil) slot -1 attrs 44 (permanent
shared) flags 0  nkids=0
 id "join" g/s (nil)/(nil) slot 0 attrs 0 flags 0  nkids=1
  id "reverse" g/s (nil)/(nil) slot 1 attrs 0 flags 0  nkids=1
   id "sort" g/s (nil)/(nil) slot 2 attrs 0 flags 0  nkids=1
    id "push" g/s (nil)/(nil) slot 3 attrs 0 flags 0  nkids=1
     id "pop" g/s (nil)/(nil) slot 4 attrs 0 flags 0  nkids=1
      id "shift" g/s (nil)/(nil) slot 5 attrs 0 flags 0  nkids=1
       id "unshift" g/s (nil)/(nil) slot 6 attrs 0 flags 0  nkids=1

The sub-tree containing |length|, |name|, |arguments| and |caller|
seems reasonable (well, except for the duplication of |caller|). But
the next subtree contains all the Array methods! And this tree goes on
to include additional sub-trees containing methods for typed arrays,
iterators, Math, RegExp, String, Date, and others. How does that
happen?

Thanks.

Nick
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to