From ac659f388286a7c8e70cb2450dc2e08073c80a7f Mon Sep 17 00:00:00 2001 From: "verwaest@chromium.org" Date: Fri, 11 Apr 2014 13:48:52 +0000 Subject: [PATCH] Handlify Map::RawCopy BUG= R=mvstanton@chromium.org Review URL: https://codereview.chromium.org/235183002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20693 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/objects.cc | 29 +++++++++-------------------- src/objects.h | 1 - 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/objects.cc b/src/objects.cc index 85ca44ee44..aaa03203ae 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -6765,31 +6765,20 @@ Object* JSObject::SlowReverseLookup(Object* value) { } -Handle Map::RawCopy(Handle map, - int instance_size) { - CALL_HEAP_FUNCTION(map->GetIsolate(), - map->RawCopy(instance_size), - Map); -} - - -MaybeObject* Map::RawCopy(int instance_size) { - Map* result; - MaybeObject* maybe_result = - GetHeap()->AllocateMap(instance_type(), instance_size); - if (!maybe_result->To(&result)) return maybe_result; - - result->set_prototype(prototype()); - result->set_constructor(constructor()); - result->set_bit_field(bit_field()); - result->set_bit_field2(bit_field2()); - int new_bit_field3 = bit_field3(); +Handle Map::RawCopy(Handle map, int instance_size) { + Handle result = map->GetIsolate()->factory()->NewMap( + map->instance_type(), instance_size); + result->set_prototype(map->prototype()); + result->set_constructor(map->constructor()); + result->set_bit_field(map->bit_field()); + result->set_bit_field2(map->bit_field2()); + int new_bit_field3 = map->bit_field3(); new_bit_field3 = OwnsDescriptors::update(new_bit_field3, true); new_bit_field3 = NumberOfOwnDescriptorsBits::update(new_bit_field3, 0); new_bit_field3 = EnumLengthBits::update(new_bit_field3, kInvalidEnumCacheSentinel); new_bit_field3 = Deprecated::update(new_bit_field3, false); - if (!is_dictionary_map()) { + if (!map->is_dictionary_map()) { new_bit_field3 = IsUnstable::update(new_bit_field3, false); } result->set_bit_field3(new_bit_field3); diff --git a/src/objects.h b/src/objects.h index 634fbcd6ae..1f656bc0b5 100644 --- a/src/objects.h +++ b/src/objects.h @@ -6412,7 +6412,6 @@ class Map: public HeapObject { static Handle CurrentMapForDeprecatedInternal(Handle map); static Handle RawCopy(Handle map, int instance_size); - MUST_USE_RESULT MaybeObject* RawCopy(int instance_size); static Handle CopyDropDescriptors(Handle map); static Handle CopyReplaceDescriptors( Handle map,