| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
| 10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
| (...skipping 11778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11789 if (value->IsJSObject()) { | 11789 if (value->IsJSObject()) { |
| 11790 PrototypeOptimizationMode mode = | 11790 PrototypeOptimizationMode mode = |
| 11791 from_javascript ? REGULAR_PROTOTYPE : FAST_PROTOTYPE; | 11791 from_javascript ? REGULAR_PROTOTYPE : FAST_PROTOTYPE; |
| 11792 JSObject::OptimizeAsPrototype(Handle<JSObject>::cast(value), mode); | 11792 JSObject::OptimizeAsPrototype(Handle<JSObject>::cast(value), mode); |
| 11793 } | 11793 } |
| 11794 | 11794 |
| 11795 Handle<Map> new_map = Map::TransitionToPrototype(map, value); | 11795 Handle<Map> new_map = Map::TransitionToPrototype(map, value); |
| 11796 DCHECK(new_map->prototype() == *value); | 11796 DCHECK(new_map->prototype() == *value); |
| 11797 JSObject::MigrateToMap(real_receiver, new_map); | 11797 JSObject::MigrateToMap(real_receiver, new_map); |
| 11798 | 11798 |
| 11799 if (!dictionary_elements_in_chain && | 11799 if (from_javascript && !dictionary_elements_in_chain && |
| 11800 new_map->DictionaryElementsInPrototypeChainOnly()) { | 11800 new_map->DictionaryElementsInPrototypeChainOnly()) { |
| 11801 // If the prototype chain didn't previously have element callbacks, then | 11801 // If the prototype chain didn't previously have element callbacks, then |
| 11802 // KeyedStoreICs need to be cleared to ensure any that involve this | 11802 // KeyedStoreICs need to be cleared to ensure any that involve this |
| 11803 // map go generic. | 11803 // map go generic. |
| 11804 object->GetHeap()->ClearAllICsByKind(Code::KEYED_STORE_IC); | 11804 object->GetHeap()->ClearAllICsByKind(Code::KEYED_STORE_IC); |
| 11805 } | 11805 } |
| 11806 | 11806 |
| 11807 heap->ClearInstanceofCache(); | 11807 heap->ClearInstanceofCache(); |
| 11808 DCHECK(size == object->Size()); | 11808 DCHECK(size == object->Size()); |
| 11809 return value; | 11809 return value; |
| (...skipping 4659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16469 Handle<DependentCode> codes = | 16469 Handle<DependentCode> codes = |
| 16470 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16470 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
| 16471 DependentCode::kPropertyCellChangedGroup, | 16471 DependentCode::kPropertyCellChangedGroup, |
| 16472 info->object_wrapper()); | 16472 info->object_wrapper()); |
| 16473 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16473 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
| 16474 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16474 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
| 16475 cell, info->zone()); | 16475 cell, info->zone()); |
| 16476 } | 16476 } |
| 16477 | 16477 |
| 16478 } } // namespace v8::internal | 16478 } } // namespace v8::internal |
| OLD | NEW |