On 07/25/2013 11:30 AM, Boris Zbarsky wrote:
On 7/24/13 12:16 PM, Josh Matthews wrote:
All DOM objects are represented with |JSManaged<Whatever> whatever|.
When you want to access a property owner_document of Whatever, you use
|do whatever.with_imm |whatever| { whatever.owner_document }|, and |do
whatever.with_mut |whatever| { whatever.owner_document = other_document
}| to modify it.
Hmm. That looks pretty annoying to write for every single property
access, or am I just misunderstanding?
Well, you can open a block and do whatever accesses and other code you
want inside of it. We do similar things all over the place for DOM nodes
already when accessing fields of derived classes like Element.
The limit for non-proxies is 16 words, for proxies it's 13.
That's what I thought. 16 words is 128 bytes, right? If each "pointer"
member is effectively two words because of the COW stuff, that still
means we should be able to fit in 6 or so of them plus a few other
bits... What does the memory layout of a Node look like in our setup
right now?
wrapper: 8 bytes
type_id: 16 bytes
abstract: 16 bytes
out_of_line: 8 bytes
layout_data: 8 bytes
The layout of out_of_line is as follows:
parent_node: 16 bytes
first_child: 16 bytes
last_child: 16 bytes
next_sibling: 16 bytes
prev_sibling: 16 bytes
owner_doc: 16 bytes
It's totally possible for rearrange stuff. I just chose the simplest,
consistent arrangement for convenience's sake.
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo