From 18a5298a6cc0e377a9af3b9afee748580c8b7c84 Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Wed, 16 May 2012 07:52:41 +0000 Subject: [PATCH] Fix CreateEmptyFunction to not share descriptor array. R=ulan@chromium.org BUG=v8:1465 Review URL: https://chromiumcodereview.appspot.com/10388158 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11571 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/bootstrapper.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index c65c68c..048a027 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -484,8 +484,8 @@ Handle Genesis::CreateEmptyFunction(Isolate* isolate) { global_context()->set_initial_object_prototype(*prototype); SetPrototype(object_fun, prototype); - object_function_map-> - set_instance_descriptors(heap->empty_descriptor_array()); + object_function_map->set_instance_descriptors( + heap->empty_descriptor_array()); } // Allocate the empty function as the prototype for function ECMAScript @@ -516,12 +516,10 @@ Handle Genesis::CreateEmptyFunction(Isolate* isolate) { function_instance_map_writable_prototype_->set_prototype(*empty_function); // Allocate the function map first and then patch the prototype later - Handle empty_fm = factory->CopyMapDropDescriptors( - function_without_prototype_map); - empty_fm->set_instance_descriptors( - function_without_prototype_map->instance_descriptors()); - empty_fm->set_prototype(global_context()->object_function()->prototype()); - empty_function->set_map(*empty_fm); + Handle empty_function_map = CreateFunctionMap(DONT_ADD_PROTOTYPE); + empty_function_map->set_prototype( + global_context()->object_function()->prototype()); + empty_function->set_map(*empty_function_map); return empty_function; } -- 2.7.4