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