v8/src/ia32
verwaest@chromium.org ebd3241b05 Sharing of descriptor arrays.
This CL adds multiple things:
Transition arrays do not directly point at their descriptor array anymore, but rather do so via an indirect pointer (a JSGlobalPropertyCell).

An ownership bit is added to maps indicating whether it owns its own descriptor array or not.

Maps owning a descriptor array can pass on ownership if a transition from that map is generated; but only if the descriptor array stays exactly the same; or if a descriptor is added.

Maps that don't have ownership get ownership back if their direct child to which ownership was passed is cleared in ClearNonLiveTransitions.

To detect which descriptors in an array are valid, each map knows its own NumberOfOwnDescriptors. Since the descriptors are sorted in order of addition, if we search and find a descriptor with index bigger than this number, it is not valid for the given map.

We currently still build up an enumeration cache (although this may disappear). The enumeration cache is always built for the entire descriptor array, even if not all descriptors are owned by the map. Once a descriptor array has an enumeration cache for a given map; this invariant will always be true, even if the descriptor array was extended. The extended array will inherit the enumeration cache from the smaller descriptor array. If a map with more descriptors needs an enumeration cache, it's EnumLength will still be set to invalid, so it will have to recompute the enumeration cache. This new cache will also be valid for smaller maps since they have their own enumlength; and use this to loop over the cache. If the EnumLength is still invalid, but there is already a cache present that is big enough; we just initialize the EnumLength field for the map.

When we apply ClearNonLiveTransitions and descriptor ownership is passed back to a parent map, the descriptor array is trimmed in-place and resorted. At the same time, the enumeration cache is trimmed in-place.

Only transition arrays contain descriptor arrays. If we transition to a map and pass ownership of the descriptor array along, the child map will not store the descriptor array it owns. Rather its parent will keep the pointer. So for every leaf-map, we find the descriptor array by following the back pointer, reading out the transition array, and fetching the descriptor array from the JSGlobalPropertyCell. If a map has a transition array, we fetch it from there. If a map has undefined as its back-pointer and has no transition array; it is considered to have an empty descriptor array.

When we modify properties, we cannot share the descriptor array. To accommodate this, the child map will get its own transition array; even if there are not necessarily any transitions leaving from the child map. This is necessary since it's the only way to store its own descriptor array.

Review URL: https://chromiumcodereview.appspot.com/10909007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12492 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-12 16:43:57 +00:00
..
assembler-ia32-inl.h Introduced TypeFeedbackId and BailoutId types. 2012-08-06 14:13:09 +00:00
assembler-ia32.cc Fix rounding in Uint8ClampedArray setter. 2012-08-22 14:27:11 +00:00
assembler-ia32.h Fix rounding in Uint8ClampedArray setter. 2012-08-22 14:27:11 +00:00
builtins-ia32.cc Rename Context::global to Context::global_object, 2012-08-17 12:59:00 +00:00
code-stubs-ia32.cc Reland regexp global optimizations. 2012-08-28 09:37:41 +00:00
code-stubs-ia32.h Reland r10908 (Ensure consistent result of transcendental function0.) 2012-03-05 08:17:16 +00:00
codegen-ia32.cc Implement tracking and optimizations of packed arrays 2012-05-23 14:24:29 +00:00
codegen-ia32.h Porting r10023 and r10054 to x64 (pointer cache for external strings). 2011-11-24 10:16:39 +00:00
cpu-ia32.cc Cosmetic changes ("set up" is a verb, "setup" is a noun). 2012-01-13 13:09:52 +00:00
debug-ia32.cc Fix issue 825 (LiveEdit vs. function with no locals) for x64. 2012-05-16 21:15:24 +00:00
deoptimizer-ia32.cc Fixed deoptimization of inlined getters. 2012-09-07 09:01:54 +00:00
disasm-ia32.cc Fix rounding in Uint8ClampedArray setter. 2012-08-22 14:27:11 +00:00
frames-ia32.cc Enhance SafeStackFrameIterator to avoid triggering assertions in debug mode. 2010-09-16 08:23:34 +00:00
frames-ia32.h Reimplement dynamic frame alignment for frames that are compiled via OSR or have more than 2 double spill slots. 2012-06-12 10:22:33 +00:00
full-codegen-ia32.cc Sharing of descriptor arrays. 2012-09-12 16:43:57 +00:00
ic-ia32.cc Separate stub types from property types. 2012-06-25 11:35:23 +00:00
lithium-codegen-ia32.cc Fix arguments object materialization during deopt. 2012-09-12 12:28:42 +00:00
lithium-codegen-ia32.h Fix arguments object materialization during deopt. 2012-09-12 12:28:42 +00:00
lithium-gap-resolver-ia32.cc Remove TLS access for current Zone. 2012-06-11 12:42:31 +00:00
lithium-gap-resolver-ia32.h Move LOperand class to lithium.h and move implementations out of .h into .cc files. 2011-01-19 13:55:56 +00:00
lithium-ia32.cc Fix arguments object materialization during deopt. 2012-09-12 12:28:42 +00:00
lithium-ia32.h Use a special EnumLength field to indicate number of valid enum cache values. 2012-08-28 14:20:50 +00:00
macro-assembler-ia32.cc Sharing of descriptor arrays. 2012-09-12 16:43:57 +00:00
macro-assembler-ia32.h Sharing of descriptor arrays. 2012-09-12 16:43:57 +00:00
regexp-macro-assembler-ia32.cc Add missing string length check in regexp engine. 2012-06-14 13:59:48 +00:00
regexp-macro-assembler-ia32.h Unbreak interpreted regexp. 2012-06-14 17:06:16 +00:00
simulator-ia32.cc Move backend specific files to separate directories. 2009-04-23 12:06:38 +00:00
simulator-ia32.h Implement loop for global regexps in regexp assembler. 2012-05-22 14:05:44 +00:00
stub-cache-ia32.cc Fixed deoptimization of inlined getters. 2012-09-07 09:01:54 +00:00