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 14659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14670 // Clamp undefined to NaN (default). All other types have been | 14670 // Clamp undefined to NaN (default). All other types have been |
14671 // converted to a number type further up in the call chain. | 14671 // converted to a number type further up in the call chain. |
14672 DCHECK(value->IsUndefined()); | 14672 DCHECK(value->IsUndefined()); |
14673 } | 14673 } |
14674 array->set(index, double_value); | 14674 array->set(index, double_value); |
14675 } | 14675 } |
14676 return array->GetIsolate()->factory()->NewNumber(double_value); | 14676 return array->GetIsolate()->factory()->NewNumber(double_value); |
14677 } | 14677 } |
14678 | 14678 |
14679 | 14679 |
| 14680 void GlobalObject::InvalidatePropertyCell(Handle<GlobalObject> global, |
| 14681 Handle<Name> name) { |
| 14682 DCHECK(!global->HasFastProperties()); |
| 14683 Isolate* isolate = global->GetIsolate(); |
| 14684 int entry = global->property_dictionary()->FindEntry(name); |
| 14685 if (entry != NameDictionary::kNotFound) { |
| 14686 Handle<PropertyCell> cell( |
| 14687 PropertyCell::cast(global->property_dictionary()->ValueAt(entry))); |
| 14688 |
| 14689 Handle<Object> value(cell->value(), isolate); |
| 14690 Handle<PropertyCell> new_cell = isolate->factory()->NewPropertyCell(value); |
| 14691 global->property_dictionary()->ValueAtPut(entry, *new_cell); |
| 14692 |
| 14693 Handle<Object> hole = global->GetIsolate()->factory()->the_hole_value(); |
| 14694 PropertyCell::SetValueInferType(cell, hole); |
| 14695 } |
| 14696 } |
| 14697 |
| 14698 |
14680 Handle<PropertyCell> JSGlobalObject::EnsurePropertyCell( | 14699 Handle<PropertyCell> JSGlobalObject::EnsurePropertyCell( |
14681 Handle<JSGlobalObject> global, | 14700 Handle<JSGlobalObject> global, |
14682 Handle<Name> name) { | 14701 Handle<Name> name) { |
14683 DCHECK(!global->HasFastProperties()); | 14702 DCHECK(!global->HasFastProperties()); |
14684 int entry = global->property_dictionary()->FindEntry(name); | 14703 int entry = global->property_dictionary()->FindEntry(name); |
14685 if (entry == NameDictionary::kNotFound) { | 14704 if (entry == NameDictionary::kNotFound) { |
14686 Isolate* isolate = global->GetIsolate(); | 14705 Isolate* isolate = global->GetIsolate(); |
14687 Handle<PropertyCell> cell = isolate->factory()->NewPropertyCell( | 14706 Handle<PropertyCell> cell = isolate->factory()->NewPropertyCell( |
14688 isolate->factory()->the_hole_value()); | 14707 isolate->factory()->the_hole_value()); |
14689 PropertyDetails details(NONE, NORMAL, 0); | 14708 PropertyDetails details(NONE, NORMAL, 0); |
(...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16567 Handle<DependentCode> codes = | 16586 Handle<DependentCode> codes = |
16568 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), | 16587 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), |
16569 DependentCode::kPropertyCellChangedGroup, | 16588 DependentCode::kPropertyCellChangedGroup, |
16570 info->object_wrapper()); | 16589 info->object_wrapper()); |
16571 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 16590 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
16572 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 16591 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
16573 cell, info->zone()); | 16592 cell, info->zone()); |
16574 } | 16593 } |
16575 | 16594 |
16576 } } // namespace v8::internal | 16595 } } // namespace v8::internal |
OLD | NEW |