Revision: 20411
Author:   [email protected]
Date:     Tue Apr  1 17:43:20 2014 UTC
Log:      Remove Factory::CopyMap(map) in favor of Map::Copy(map)

BUG=
[email protected]

Review URL: https://codereview.chromium.org/219963009
http://code.google.com/p/v8/source/detail?r=20411

Modified:
 /branches/bleeding_edge/src/api.cc
 /branches/bleeding_edge/src/bootstrapper.cc
 /branches/bleeding_edge/src/factory.cc
 /branches/bleeding_edge/src/factory.h
 /branches/bleeding_edge/src/runtime.cc

=======================================
--- /branches/bleeding_edge/src/api.cc  Tue Apr  1 08:57:48 2014 UTC
+++ /branches/bleeding_edge/src/api.cc  Tue Apr  1 17:43:20 2014 UTC
@@ -3597,8 +3597,7 @@
   // as optimized code does not always handle access checks.
   i::Deoptimizer::DeoptimizeGlobalObject(*obj);

-  i::Handle<i::Map> new_map =
-      isolate->factory()->CopyMap(i::Handle<i::Map>(obj->map()));
+  i::Handle<i::Map> new_map = i::Map::Copy(i::Handle<i::Map>(obj->map()));
   new_map->set_is_access_check_needed(true);
   obj->set_map(*new_map);
 }
=======================================
--- /branches/bleeding_edge/src/bootstrapper.cc Tue Apr  1 08:57:48 2014 UTC
+++ /branches/bleeding_edge/src/bootstrapper.cc Tue Apr  1 17:43:20 2014 UTC
@@ -328,9 +328,8 @@

static void SetObjectPrototype(Handle<JSObject> object, Handle<Object> proto) {
   // object.__proto__ = proto;
-  Factory* factory = object->GetIsolate()->factory();
   Handle<Map> old_to_map = Handle<Map>(object->map());
-  Handle<Map> new_to_map = factory->CopyMap(old_to_map);
+  Handle<Map> new_to_map = Map::Copy(old_to_map);
   new_to_map->set_prototype(*proto);
   object->set_map(*new_to_map);
 }
@@ -1017,7 +1016,7 @@
initial_map->set_visitor_id(StaticVisitorBase::GetVisitorId(*initial_map));

     // RegExp prototype object is itself a RegExp.
-    Handle<Map> proto_map = factory->CopyMap(initial_map);
+    Handle<Map> proto_map = Map::Copy(initial_map);
     proto_map->set_prototype(native_context()->initial_object_prototype());
     Handle<JSObject> proto = factory->NewJSObjectFromMap(proto_map);
     proto->InObjectPropertyAtPut(JSRegExp::kSourceFieldIndex,
@@ -1150,7 +1149,7 @@

     Handle<Map> old_map(
         native_context()->sloppy_arguments_boilerplate()->map());
-    Handle<Map> new_map = factory->CopyMap(old_map);
+    Handle<Map> new_map = Map::Copy(old_map);
     new_map->set_pre_allocated_property_fields(2);
     Handle<JSObject> result = factory->NewJSObjectFromMap(new_map);
     // Set elements kind after allocating the object because
@@ -1359,15 +1358,15 @@
// Create maps for generator functions and their prototypes. Store those
     // maps in the native context.
     Handle<Map> function_map(native_context()->sloppy_function_map());
-    Handle<Map> generator_function_map = factory()->CopyMap(function_map);
+    Handle<Map> generator_function_map = Map::Copy(function_map);
     generator_function_map->set_prototype(*generator_function_prototype);
     native_context()->set_sloppy_generator_function_map(
         *generator_function_map);

     Handle<Map> strict_mode_function_map(
         native_context()->strict_function_map());
-    Handle<Map> strict_mode_generator_function_map = factory()->CopyMap(
-        strict_mode_function_map);
+    Handle<Map> strict_mode_generator_function_map =
+        Map::Copy(strict_mode_function_map);
     strict_mode_generator_function_map->set_prototype(
         *generator_function_prototype);
     native_context()->set_strict_generator_function_map(
@@ -1612,7 +1611,7 @@
   array_function->shared()->DontAdaptArguments();

   Handle<Map> original_map(array_function->initial_map());
-  Handle<Map> initial_map = factory()->CopyMap(original_map);
+  Handle<Map> initial_map = Map::Copy(original_map);
   initial_map->set_elements_kind(elements_kind);
   array_function->set_initial_map(*initial_map);

@@ -2524,7 +2523,7 @@

   // Transfer the prototype (new map is needed).
   Handle<Map> old_to_map = Handle<Map>(to->map());
-  Handle<Map> new_to_map = factory()->CopyMap(old_to_map);
+  Handle<Map> new_to_map = Map::Copy(old_to_map);
   new_to_map->set_prototype(from->map()->prototype());
   to->set_map(*new_to_map);
 }
=======================================
--- /branches/bleeding_edge/src/factory.cc      Mon Mar 31 12:01:02 2014 UTC
+++ /branches/bleeding_edge/src/factory.cc      Tue Apr  1 17:43:20 2014 UTC
@@ -843,11 +843,6 @@
   copy->set_visitor_id(StaticVisitorBase::GetVisitorId(*copy));
   return copy;
 }
-
-
-Handle<Map> Factory::CopyMap(Handle<Map> src) {
-  CALL_HEAP_FUNCTION(isolate(), src->Copy(), Map);
-}


 Handle<FixedArray> Factory::CopyFixedArray(Handle<FixedArray> array) {
=======================================
--- /branches/bleeding_edge/src/factory.h       Mon Mar 31 12:01:02 2014 UTC
+++ /branches/bleeding_edge/src/factory.h       Tue Apr  1 17:43:20 2014 UTC
@@ -261,7 +261,6 @@
   // Copy the map adding more inobject properties if possible without
   // overflowing the instance size.
   Handle<Map> CopyMap(Handle<Map> map, int extra_inobject_props);
-  Handle<Map> CopyMap(Handle<Map> map);

   Handle<FixedArray> CopyFixedArray(Handle<FixedArray> array);

=======================================
--- /branches/bleeding_edge/src/runtime.cc      Tue Apr  1 11:04:37 2014 UTC
+++ /branches/bleeding_edge/src/runtime.cc      Tue Apr  1 17:43:20 2014 UTC
@@ -3087,9 +3087,7 @@
   if (!func->shared()->live_objects_may_exist()) {
     func->shared()->set_expected_nof_properties(num);
     if (func->has_initial_map()) {
-      Handle<Map> new_initial_map =
-          func->GetIsolate()->factory()->CopyMap(
-              Handle<Map>(func->initial_map()));
+      Handle<Map> new_initial_map = Map::Copy(handle(func->initial_map()));
       new_initial_map->set_unused_property_fields(num);
       func->set_initial_map(*new_initial_map);
     }
@@ -7993,11 +7991,10 @@
       parameter_map->set_map(
           isolate->heap()->sloppy_arguments_elements_map());

-      Handle<Map> old_map(result->map());
-      Handle<Map> new_map = isolate->factory()->CopyMap(old_map);
-      new_map->set_elements_kind(SLOPPY_ARGUMENTS_ELEMENTS);
+      Handle<Map> map = Map::Copy(handle(result->map()));
+      map->set_elements_kind(SLOPPY_ARGUMENTS_ELEMENTS);

-      result->set_map(*new_map);
+      result->set_map(*map);
       result->set_elements(*parameter_map);

       // Store the context and the arguments array at the beginning of the

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to