Reviewers: Mads Ager, Description: Fix a GC issue.
When descriptor arrays where allocated with the initial map the handling of allocation failures was not correct. This could cause the map returned could possible have been collected. Please review this at http://codereview.chromium.org/173188 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/heap.cc Index: src/heap.cc =================================================================== --- src/heap.cc (revision 2735) +++ src/heap.cc (working copy) @@ -2089,8 +2089,9 @@ if (count > in_object_properties) { count = in_object_properties; } - DescriptorArray* descriptors = *Factory::NewDescriptorArray(count); - if (descriptors->IsFailure()) return descriptors; + Object* descriptors_obj = DescriptorArray::Allocate(count); + if (descriptors_obj->IsFailure()) return descriptors_obj; + DescriptorArray* descriptors = DescriptorArray::cast(descriptors_obj); for (int i = 0; i < count; i++) { String* name = fun->shared()->GetThisPropertyAssignmentName(i); ASSERT(name->IsSymbol()); --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
