Added handles to the mirror objects. When a mirror for an object is created
authorsgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 16 Jan 2009 09:54:46 +0000 (09:54 +0000)
committersgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 16 Jan 2009 09:54:46 +0000 (09:54 +0000)
commitc2c780bfc4e21b597b6c52b86d593147ee3640bf
treeb98bbc17c3aee7c46a6a6727ee4e389ecba14caa
parentbaa54768305c5160ec3e7cf9c323d5a3725f39a1
Added handles to the mirror objects. When a mirror for an object is created
it is assigned a numeric handle. Handles are used to make a 1:1
correspondence between objects and mirrors. Currently the mirrors are
cached in a JavaScript array and when creating a mirror this cache is
checked to see if a mirror already exists for the object. This cache is
cleared when leaving the debugger.

Changed the serialization format to take advantage of these handles. When
an object is serialized referenced objects are represented just by their
handle id serialized as '{ref:<handle>}'. During serialization the
referenced handles are collected and the serializer can provide a
serialization of all the referenced objects.

Removed the special handling of array properties. Indexed properties and
the length property are now rendered as named properties in the
serialization.

Removed the special serialization handling of RegExp properties. The
properties 'source', 'global', 'ignoreCase' and 'multiline' are serialized
with the rest of the properties.

Changed a lot of tests to handle the changed format.
Review URL: http://codereview.chromium.org/18092

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1093 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
20 files changed:
src/debug-delay.js
src/debug.cc
src/debug.h
src/mirror-delay.js
test/mjsunit/debug-backtrace.js
test/mjsunit/debug-mirror-cache.js [new file with mode: 0644]
test/mjsunit/mirror-array.js
test/mjsunit/mirror-boolean.js
test/mjsunit/mirror-date.js
test/mjsunit/mirror-error.js
test/mjsunit/mirror-function.js
test/mjsunit/mirror-null.js
test/mjsunit/mirror-number.js
test/mjsunit/mirror-object.js
test/mjsunit/mirror-regexp.js
test/mjsunit/mirror-script.js
test/mjsunit/mirror-string.js
test/mjsunit/mirror-undefined.js
test/mjsunit/mirror-unresolved-function.js
test/mjsunit/regress/regress-1081309.js