DescriptionAST nodes have at most one bailout/typefeedback ID now, saving lots of memory.
This is basically https://codereview.chromium.org/569573002/ done right:
During construction, each node type tells its parent how many IDs it
needs in addition to the parent's ones. This is done all the way up in
the class hierarchy until a node's parent doesn't need any ID. At that
point we know how many IDs in summary are needed, and we reserve the
whole range at once, saving only the base ID of that range. All IDs
are now calculated via simple offsets to that base ID. To all
performaniacs: The C++ compiler simplifies the constant calculation to
a simple load and the addition of a single constant.
Note that the actual code is much simpler than all that prose above. :-)
It's basically how compilers for OO languages figure out vtable entries.
We still have lots of holes due to padding in the AST nodes, but this
will be addressed in a separate CL.
BUG=chromium:417697
LOG=y
R=mvstanton@chromium.org
Committed: https://code.google.com/p/v8/source/detail?r=24524
Patch Set 1 #Patch Set 2 : Rebased. More node types handled. #Patch Set 3 : Removed reuse and GetNextId. #Patch Set 4 : rebased #Messages
Total messages: 8 (2 generated)
|