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

Migrate to current map if deprecated in SetProperty

BUG=
R=jkummerow@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22485 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6e824b60
......@@ -7325,6 +7325,13 @@ Handle<Map> Map::PrepareForDataProperty(Handle<Map> map, int descriptor,
// Dictionaries can store any property value.
if (map->is_dictionary_map()) return map;
// Migrate to the newest map before storing the property.
if (map->is_deprecated()) {
map = GeneralizeRepresentation(map, 0, Representation::None(),
HeapType::None(map->GetIsolate()),
ALLOW_AS_CONSTANT);
}
Handle<DescriptorArray> descriptors(map->instance_descriptors());
if (descriptors->CanHoldValue(descriptor, *value)) return map;
......@@ -7342,11 +7349,16 @@ Handle<Map> Map::TransitionToDataProperty(Handle<Map> map, Handle<Name> name,
Handle<Object> value,
PropertyAttributes attributes,
StoreFromKeyed store_mode) {
// Cannot currently handle deprecated maps.
ASSERT(!map->is_deprecated());
// Dictionary maps can always have additional data properties.
if (map->is_dictionary_map()) return map;
// Migrate to the newest map before transitioning to the new property.
if (map->is_deprecated()) {
map = GeneralizeRepresentation(map, 0, Representation::None(),
HeapType::None(map->GetIsolate()),
ALLOW_AS_CONSTANT);
}
int index = map->SearchTransition(*name);
if (index != TransitionArray::kNotFound) {
Handle<Map> transition(map->GetTransition(index));
......
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