Go to file
verwaest@chromium.org 6f649aaece MIPS: Sharing of descriptor arrays.
Port r12492 (479be376)

Original commit message:
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.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10918287
Patch from Akos Palfi <palfia@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12549 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-19 14:29:27 +00:00
benchmarks More fixes for V8 benchmark version 7. 2012-03-15 17:13:50 +00:00
build Replace VFP by VFP2 in common.gypi 2012-09-14 07:41:55 +00:00
include Throw a more descriptive exception when blocking 'eval' via CSP. 2012-09-17 09:58:22 +00:00
preparser Fix a bunch of implicit casts detected by the Win64 compiler 2012-06-19 13:45:30 +00:00
samples Fix compilation when disabling debugger support. 2012-07-05 16:23:14 +00:00
src MIPS: Sharing of descriptor arrays. 2012-09-19 14:29:27 +00:00
test Fixed minus zero test (fixes v8:2133). 2012-09-19 12:48:49 +00:00
tools Add support for running low level profiler on Android. 2012-09-06 15:01:20 +00:00
.gitignore Add jsfunfuzz to gitignore file. 2012-09-17 14:50:51 +00:00
AUTHORS Fix path to d8 and properly quote strings so it works with dash(1) 2012-07-26 10:03:30 +00:00
ChangeLog Prepare push to trunk. Now working on version 3.13.8. 2012-09-11 13:19:02 +00:00
DEPS Prepare for using GYP build on buildbots 2012-05-11 12:18:09 +00:00
LICENSE Update LICENSE file 2012-01-03 16:38:42 +00:00
LICENSE.strongtalk Add LICENSE.v8, LICENSE.strongtalk and LICENSE.valgrind to the v8 2011-02-03 07:10:06 +00:00
LICENSE.v8 Add LICENSE.v8, LICENSE.strongtalk and LICENSE.valgrind to the v8 2011-02-03 07:10:06 +00:00
LICENSE.valgrind Add LICENSE.v8, LICENSE.strongtalk and LICENSE.valgrind to the v8 2011-02-03 07:10:06 +00:00
Makefile Add build system infrastructure for ENABLE_EXTRA_CHECKS flag (not used yet) 2012-09-05 09:24:37 +00:00
Makefile.android Fix android.gypi to provide correct include and library paths when using standalone Android toolchain. 2012-09-03 11:27:09 +00:00
SConstruct Fix shared library build errors. 2012-05-18 11:15:14 +00:00