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 14773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14784 Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it); | 14784 Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it); |
14785 return maybe_result.IsJust() ? Just(it.state() == LookupIterator::ACCESSOR) | 14785 return maybe_result.IsJust() ? Just(it.state() == LookupIterator::ACCESSOR) |
14786 : Nothing<bool>(); | 14786 : Nothing<bool>(); |
14787 } | 14787 } |
14788 | 14788 |
14789 | 14789 |
14790 int JSObject::NumberOfOwnProperties(PropertyAttributes filter) { | 14790 int JSObject::NumberOfOwnProperties(PropertyAttributes filter) { |
14791 if (HasFastProperties()) { | 14791 if (HasFastProperties()) { |
14792 Map* map = this->map(); | 14792 Map* map = this->map(); |
14793 if (filter == NONE) return map->NumberOfOwnDescriptors(); | 14793 if (filter == NONE) return map->NumberOfOwnDescriptors(); |
14794 if (filter & DONT_ENUM) { | 14794 if (filter == DONT_SHOW) { |
| 14795 // The cached enum length was computed with filter == DONT_SHOW, so |
| 14796 // that's the only filter for which it's valid to retrieve it. |
14795 int result = map->EnumLength(); | 14797 int result = map->EnumLength(); |
14796 if (result != kInvalidEnumCacheSentinel) return result; | 14798 if (result != kInvalidEnumCacheSentinel) return result; |
14797 } | 14799 } |
14798 return map->NumberOfDescribedProperties(OWN_DESCRIPTORS, filter); | 14800 return map->NumberOfDescribedProperties(OWN_DESCRIPTORS, filter); |
14799 } else if (IsGlobalObject()) { | 14801 } else if (IsGlobalObject()) { |
14800 return global_dictionary()->NumberOfElementsFilterAttributes(filter); | 14802 return global_dictionary()->NumberOfElementsFilterAttributes(filter); |
14801 } else { | 14803 } else { |
14802 return property_dictionary()->NumberOfElementsFilterAttributes(filter); | 14804 return property_dictionary()->NumberOfElementsFilterAttributes(filter); |
14803 } | 14805 } |
14804 } | 14806 } |
(...skipping 3128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17933 if (cell->value() != *new_value) { | 17935 if (cell->value() != *new_value) { |
17934 cell->set_value(*new_value); | 17936 cell->set_value(*new_value); |
17935 Isolate* isolate = cell->GetIsolate(); | 17937 Isolate* isolate = cell->GetIsolate(); |
17936 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 17938 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
17937 isolate, DependentCode::kPropertyCellChangedGroup); | 17939 isolate, DependentCode::kPropertyCellChangedGroup); |
17938 } | 17940 } |
17939 } | 17941 } |
17940 | 17942 |
17941 } // namespace internal | 17943 } // namespace internal |
17942 } // namespace v8 | 17944 } // namespace v8 |
OLD | NEW |