Revision: 11571
Author:   [email protected]
Date:     Wed May 16 00:52:41 2012
Log:      Fix CreateEmptyFunction to not share descriptor array.

[email protected]
BUG=v8:1465

Review URL: https://chromiumcodereview.appspot.com/10388158
http://code.google.com/p/v8/source/detail?r=11571

Modified:
 /branches/bleeding_edge/src/bootstrapper.cc

=======================================
--- /branches/bleeding_edge/src/bootstrapper.cc Mon Apr 23 06:59:43 2012
+++ /branches/bleeding_edge/src/bootstrapper.cc Wed May 16 00:52:41 2012
@@ -484,8 +484,8 @@

     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 @@
function_instance_map_writable_prototype_->set_prototype(*empty_function);

   // Allocate the function map first and then patch the prototype later
-  Handle<Map> 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<Map> 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;
 }

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to