Commit aaf18129 authored by verwaest@chromium.org's avatar verwaest@chromium.org

Remove Factory::CopyMap(map) in favor of Map::Copy(map)

BUG=
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/219963009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20411 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 19c354b7
......@@ -3597,8 +3597,7 @@ void v8::Object::TurnOnAccessCheck() {
// 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);
}
......
......@@ -328,9 +328,8 @@ Handle<Context> Bootstrapper::CreateEnvironment(
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 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
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 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
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 @@ void Genesis::InitializeExperimentalGlobal() {
// 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 @@ Handle<JSFunction> Genesis::InstallInternalArray(
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 @@ void Genesis::TransferObject(Handle<JSObject> from, Handle<JSObject> to) {
// 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);
}
......
......@@ -845,11 +845,6 @@ Handle<Map> Factory::CopyMap(Handle<Map> src,
}
Handle<Map> Factory::CopyMap(Handle<Map> src) {
CALL_HEAP_FUNCTION(isolate(), src->Copy(), Map);
}
Handle<FixedArray> Factory::CopyFixedArray(Handle<FixedArray> array) {
CALL_HEAP_FUNCTION(isolate(), array->Copy(), FixedArray);
}
......
......@@ -261,7 +261,6 @@ class Factory V8_FINAL {
// 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);
......
......@@ -3087,9 +3087,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetExpectedNumberOfProperties) {
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 @@ RUNTIME_FUNCTION(MaybeObject*, RuntimeHidden_NewArgumentsFast) {
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
......
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