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 "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 10806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10817 // Copy the map so this does not affect unrelated functions. | 10817 // Copy the map so this does not affect unrelated functions. |
10818 // Remove map transitions because they point to maps with a | 10818 // Remove map transitions because they point to maps with a |
10819 // different prototype. | 10819 // different prototype. |
10820 Handle<Map> new_map = Map::Copy(handle(function->map()), "SetPrototype"); | 10820 Handle<Map> new_map = Map::Copy(handle(function->map()), "SetPrototype"); |
10821 | 10821 |
10822 JSObject::MigrateToMap(function, new_map); | 10822 JSObject::MigrateToMap(function, new_map); |
10823 new_map->SetConstructor(*value); | 10823 new_map->SetConstructor(*value); |
10824 new_map->set_non_instance_prototype(true); | 10824 new_map->set_non_instance_prototype(true); |
10825 Isolate* isolate = new_map->GetIsolate(); | 10825 Isolate* isolate = new_map->GetIsolate(); |
10826 construct_prototype = handle( | 10826 construct_prototype = handle( |
10827 isolate->context()->native_context()->initial_object_prototype(), | 10827 function->context()->native_context()->initial_object_prototype(), |
10828 isolate); | 10828 isolate); |
10829 } else { | 10829 } else { |
10830 function->map()->set_non_instance_prototype(false); | 10830 function->map()->set_non_instance_prototype(false); |
10831 } | 10831 } |
10832 | 10832 |
10833 return SetInstancePrototype(function, construct_prototype); | 10833 return SetInstancePrototype(function, construct_prototype); |
10834 } | 10834 } |
10835 | 10835 |
10836 | 10836 |
10837 bool JSFunction::RemovePrototype() { | 10837 bool JSFunction::RemovePrototype() { |
(...skipping 6017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16855 if (cell->value() != *new_value) { | 16855 if (cell->value() != *new_value) { |
16856 cell->set_value(*new_value); | 16856 cell->set_value(*new_value); |
16857 Isolate* isolate = cell->GetIsolate(); | 16857 Isolate* isolate = cell->GetIsolate(); |
16858 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16858 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
16859 isolate, DependentCode::kPropertyCellChangedGroup); | 16859 isolate, DependentCode::kPropertyCellChangedGroup); |
16860 } | 16860 } |
16861 } | 16861 } |
16862 | 16862 |
16863 } // namespace internal | 16863 } // namespace internal |
16864 } // namespace v8 | 16864 } // namespace v8 |
OLD | NEW |