Commit cc17d6dc authored by verwaest@chromium.org's avatar verwaest@chromium.org

Only regenerate enumeration indices if properties were deleted.

This indicated by the NextEnumerationIndex diverging from the actual
NumberOfElements.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12422 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 9b7a673d
......@@ -12534,10 +12534,13 @@ MaybeObject* StringDictionary::TransformPropertiesToFastFor(
JSObject* obj, int unused_property_fields) {
// Make sure we preserve dictionary representation if there are too many
// descriptors.
if (NumberOfElements() > DescriptorArray::kMaxNumberOfDescriptors) return obj;
int number_of_elements = NumberOfElements();
if (number_of_elements > DescriptorArray::kMaxNumberOfDescriptors) return obj;
MaybeObject* maybe_result = GenerateNewEnumerationIndices();
if (maybe_result->IsFailure()) return maybe_result;
if (number_of_elements != NextEnumerationIndex()) {
MaybeObject* maybe_result = GenerateNewEnumerationIndices();
if (maybe_result->IsFailure()) return maybe_result;
}
int instance_descriptor_length = 0;
int number_of_fields = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment