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 10350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10361 | 10361 |
10362 // If the function is used as the global Array function, cache the | 10362 // If the function is used as the global Array function, cache the |
10363 // updated initial maps (and transitioned versions) in the native context. | 10363 // updated initial maps (and transitioned versions) in the native context. |
10364 Handle<Context> native_context(function->context()->native_context(), | 10364 Handle<Context> native_context(function->context()->native_context(), |
10365 isolate); | 10365 isolate); |
10366 Handle<Object> array_function( | 10366 Handle<Object> array_function( |
10367 native_context->get(Context::ARRAY_FUNCTION_INDEX), isolate); | 10367 native_context->get(Context::ARRAY_FUNCTION_INDEX), isolate); |
10368 if (array_function->IsJSFunction() && | 10368 if (array_function->IsJSFunction() && |
10369 *function == JSFunction::cast(*array_function)) { | 10369 *function == JSFunction::cast(*array_function)) { |
10370 CacheInitialJSArrayMaps(native_context, new_map); | 10370 CacheInitialJSArrayMaps(native_context, new_map); |
10371 Handle<Map> new_strong_map = | 10371 Handle<Map> new_strong_map = Map::Copy(new_map, "SetInstancePrototype"); |
10372 Map::Copy(initial_map, "SetInstancePrototype"); | |
10373 new_strong_map->set_is_strong(); | 10372 new_strong_map->set_is_strong(); |
10374 CacheInitialJSArrayMaps(native_context, new_strong_map); | 10373 CacheInitialJSArrayMaps(native_context, new_strong_map); |
10375 } | 10374 } |
10376 } | 10375 } |
10377 | 10376 |
10378 // Deoptimize all code that embeds the previous initial map. | 10377 // Deoptimize all code that embeds the previous initial map. |
10379 initial_map->dependent_code()->DeoptimizeDependentCodeGroup( | 10378 initial_map->dependent_code()->DeoptimizeDependentCodeGroup( |
10380 isolate, DependentCode::kInitialMapChangedGroup); | 10379 isolate, DependentCode::kInitialMapChangedGroup); |
10381 } else { | 10380 } else { |
10382 // Put the value in the initial map field until an initial map is | 10381 // Put the value in the initial map field until an initial map is |
(...skipping 6964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17347 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, | 17346 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, |
17348 Handle<Object> new_value) { | 17347 Handle<Object> new_value) { |
17349 if (cell->value() != *new_value) { | 17348 if (cell->value() != *new_value) { |
17350 cell->set_value(*new_value); | 17349 cell->set_value(*new_value); |
17351 Isolate* isolate = cell->GetIsolate(); | 17350 Isolate* isolate = cell->GetIsolate(); |
17352 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 17351 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
17353 isolate, DependentCode::kPropertyCellChangedGroup); | 17352 isolate, DependentCode::kPropertyCellChangedGroup); |
17354 } | 17353 } |
17355 } | 17354 } |
17356 } } // namespace v8::internal | 17355 } } // namespace v8::internal |
OLD | NEW |