Chromium Code Reviews| Index: src/lookup.cc |
| diff --git a/src/lookup.cc b/src/lookup.cc |
| index 7cc2666f964f7eca3f3ad3e4d521ab9f2362b82f..6c73244843908b6396f58afd3175d9c1b8763a13 100644 |
| --- a/src/lookup.cc |
| +++ b/src/lookup.cc |
| @@ -370,11 +370,10 @@ void LookupIterator::Delete() { |
| state_ = NOT_FOUND; |
| } |
| - |
| void LookupIterator::TransitionToAccessorProperty( |
| - AccessorComponent component, Handle<Object> accessor, |
| + Handle<Object> getter, Handle<Object> setter, |
| PropertyAttributes attributes) { |
| - DCHECK(!accessor->IsNull()); |
| + DCHECK(!getter->IsNull() || !setter->IsNull()); |
| // Can only be called when the receiver is a JSObject. JSProxy has to be |
| // handled via a trap. Adding properties to primitive values is not |
| // observable. |
| @@ -393,7 +392,7 @@ void LookupIterator::TransitionToAccessorProperty( |
| IsFound() ? static_cast<int>(number_) : DescriptorArray::kNotFound; |
| Handle<Map> new_map = Map::TransitionToAccessorProperty( |
| - old_map, name_, descriptor, component, accessor, attributes); |
| + isolate_, old_map, name_, descriptor, getter, setter, attributes); |
| bool simple_transition = new_map->GetBackPointer() == receiver->map(); |
| JSObject::MigrateToMap(receiver, new_map); |
| @@ -413,18 +412,18 @@ void LookupIterator::TransitionToAccessorProperty( |
| if (state() == ACCESSOR && GetAccessors()->IsAccessorPair()) { |
| pair = Handle<AccessorPair>::cast(GetAccessors()); |
| // If the component and attributes are identical, nothing has to be done. |
| - if (pair->get(component) == *accessor) { |
| + if (pair->Equals(*getter, *setter)) { |
| if (property_details().attributes() == attributes) { |
| if (!IsElement()) JSObject::ReoptimizeIfPrototype(receiver); |
| return; |
| } |
| } else { |
| pair = AccessorPair::Copy(pair); |
| - pair->set(component, *accessor); |
| + pair->SetComponents(*getter, *setter); |
|
Toon Verwaest
2016/05/04 09:32:42
There's no point in copying the pair if you're the
jochen (gone - plz use gerrit)
2016/05/04 09:36:37
SetComponents only overwrites something if the com
|
| } |
| } else { |
| pair = factory()->NewAccessorPair(); |
| - pair->set(component, *accessor); |
| + pair->SetComponents(*getter, *setter); |
| } |
| TransitionToAccessorPair(pair, attributes); |