Commit 88588df8 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

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.
Review URL: http://codereview.chromium.org/173188

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2736 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 77204cb3
...@@ -2089,8 +2089,9 @@ Object* Heap::AllocateInitialMap(JSFunction* fun) { ...@@ -2089,8 +2089,9 @@ Object* Heap::AllocateInitialMap(JSFunction* fun) {
if (count > in_object_properties) { if (count > in_object_properties) {
count = in_object_properties; count = in_object_properties;
} }
DescriptorArray* descriptors = *Factory::NewDescriptorArray(count); Object* descriptors_obj = DescriptorArray::Allocate(count);
if (descriptors->IsFailure()) return descriptors; if (descriptors_obj->IsFailure()) return descriptors_obj;
DescriptorArray* descriptors = DescriptorArray::cast(descriptors_obj);
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
String* name = fun->shared()->GetThisPropertyAssignmentName(i); String* name = fun->shared()->GetThisPropertyAssignmentName(i);
ASSERT(name->IsSymbol()); ASSERT(name->IsSymbol());
......
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