Chromium Code Reviews| 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 <iomanip> | 5 #include <iomanip> |
| 6 #include <sstream> | 6 #include <sstream> |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
| (...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1795 // the descriptor array without using an explicit. | 1795 // the descriptor array without using an explicit. |
| 1796 old_map->InitializeDescriptors( | 1796 old_map->InitializeDescriptors( |
| 1797 old_map->GetHeap()->empty_descriptor_array(), | 1797 old_map->GetHeap()->empty_descriptor_array(), |
| 1798 LayoutDescriptor::FastPointerLayout()); | 1798 LayoutDescriptor::FastPointerLayout()); |
| 1799 // Ensure that no transition was inserted for prototype migrations. | 1799 // Ensure that no transition was inserted for prototype migrations. |
| 1800 DCHECK_EQ(0, TransitionArray::NumberOfTransitions( | 1800 DCHECK_EQ(0, TransitionArray::NumberOfTransitions( |
| 1801 old_map->raw_transitions())); | 1801 old_map->raw_transitions())); |
| 1802 DCHECK(new_map->GetBackPointer()->IsUndefined()); | 1802 DCHECK(new_map->GetBackPointer()->IsUndefined()); |
| 1803 } | 1803 } |
| 1804 } else { | 1804 } else { |
| 1805 DCHECK(!object->IsGlobalObject()); | |
| 1805 MigrateFastToSlow(object, new_map, expected_additional_properties); | 1806 MigrateFastToSlow(object, new_map, expected_additional_properties); |
| 1806 } | 1807 } |
| 1807 } else { | 1808 } else { |
| 1809 if (object->IsGlobalObject()) { | |
|
Toon Verwaest
2015/07/01 09:28:55
What case is this needed for?
Add a comment at lea
Igor Sheludko
2015/07/02 16:50:13
Done.
| |
| 1810 Handle<Context> native_context( | |
| 1811 GlobalObject::cast(*object)->native_context()); | |
| 1812 Handle<ScriptContextTable> script_contexts( | |
| 1813 native_context->script_context_table()); | |
| 1814 for (int i = 0; i < script_contexts->used(); i++) { | |
| 1815 Handle<Context> context = | |
| 1816 ScriptContextTable::GetContext(script_contexts, i); | |
| 1817 context->InvalidateGlobalSlots(); | |
| 1818 } | |
| 1819 } | |
| 1808 // For slow-to-fast migrations JSObject::MigrateSlowToFast() | 1820 // For slow-to-fast migrations JSObject::MigrateSlowToFast() |
| 1809 // must be used instead. | 1821 // must be used instead. |
| 1810 CHECK(new_map->is_dictionary_map()); | 1822 CHECK(new_map->is_dictionary_map()); |
| 1811 | 1823 |
| 1812 // Slow-to-slow migration is trivial. | 1824 // Slow-to-slow migration is trivial. |
| 1813 object->set_map(*new_map); | 1825 object->set_map(*new_map); |
| 1814 } | 1826 } |
| 1815 | 1827 |
| 1816 // Careful: Don't allocate here! | 1828 // Careful: Don't allocate here! |
| 1817 // For some callers of this method, |object| might be in an inconsistent | 1829 // For some callers of this method, |object| might be in an inconsistent |
| (...skipping 14332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 16150 Handle<Object> new_value) { | 16162 Handle<Object> new_value) { |
| 16151 if (cell->value() != *new_value) { | 16163 if (cell->value() != *new_value) { |
| 16152 cell->set_value(*new_value); | 16164 cell->set_value(*new_value); |
| 16153 Isolate* isolate = cell->GetIsolate(); | 16165 Isolate* isolate = cell->GetIsolate(); |
| 16154 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16166 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 16155 isolate, DependentCode::kPropertyCellChangedGroup); | 16167 isolate, DependentCode::kPropertyCellChangedGroup); |
| 16156 } | 16168 } |
| 16157 } | 16169 } |
| 16158 } // namespace internal | 16170 } // namespace internal |
| 16159 } // namespace v8 | 16171 } // namespace v8 |
| OLD | NEW |