| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 16446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16457 if (key->FilterKey(filter)) continue; | 16457 if (key->FilterKey(filter)) continue; |
| 16458 keys->AddKey(key, DO_NOT_CONVERT); | 16458 keys->AddKey(key, DO_NOT_CONVERT); |
| 16459 } | 16459 } |
| 16460 } else if (IsJSGlobalObject()) { | 16460 } else if (IsJSGlobalObject()) { |
| 16461 GlobalDictionary::CollectKeysTo(handle(global_dictionary()), keys, filter); | 16461 GlobalDictionary::CollectKeysTo(handle(global_dictionary()), keys, filter); |
| 16462 } else { | 16462 } else { |
| 16463 NameDictionary::CollectKeysTo(handle(property_dictionary()), keys, filter); | 16463 NameDictionary::CollectKeysTo(handle(property_dictionary()), keys, filter); |
| 16464 } | 16464 } |
| 16465 } | 16465 } |
| 16466 | 16466 |
| 16467 bool JSObject::WasConstructedFromApiFunction() { |
| 16468 Object* maybe_constructor = map()->GetConstructor(); |
| 16469 if (!maybe_constructor->IsJSFunction()) return false; |
| 16470 JSFunction* constructor = JSFunction::cast(maybe_constructor); |
| 16471 return constructor->shared()->IsApiFunction(); |
| 16472 } |
| 16467 | 16473 |
| 16468 int JSObject::NumberOfOwnElements(PropertyFilter filter) { | 16474 int JSObject::NumberOfOwnElements(PropertyFilter filter) { |
| 16469 // Fast case for objects with no elements. | 16475 // Fast case for objects with no elements. |
| 16470 if (!IsJSValue() && HasFastElements()) { | 16476 if (!IsJSValue() && HasFastElements()) { |
| 16471 uint32_t length = | 16477 uint32_t length = |
| 16472 IsJSArray() | 16478 IsJSArray() |
| 16473 ? static_cast<uint32_t>( | 16479 ? static_cast<uint32_t>( |
| 16474 Smi::cast(JSArray::cast(this)->length())->value()) | 16480 Smi::cast(JSArray::cast(this)->length())->value()) |
| 16475 : static_cast<uint32_t>(FixedArrayBase::cast(elements())->length()); | 16481 : static_cast<uint32_t>(FixedArrayBase::cast(elements())->length()); |
| 16476 if (length == 0) return 0; | 16482 if (length == 0) return 0; |
| (...skipping 3277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19754 if (cell->value() != *new_value) { | 19760 if (cell->value() != *new_value) { |
| 19755 cell->set_value(*new_value); | 19761 cell->set_value(*new_value); |
| 19756 Isolate* isolate = cell->GetIsolate(); | 19762 Isolate* isolate = cell->GetIsolate(); |
| 19757 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19763 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 19758 isolate, DependentCode::kPropertyCellChangedGroup); | 19764 isolate, DependentCode::kPropertyCellChangedGroup); |
| 19759 } | 19765 } |
| 19760 } | 19766 } |
| 19761 | 19767 |
| 19762 } // namespace internal | 19768 } // namespace internal |
| 19763 } // namespace v8 | 19769 } // namespace v8 |
| OLD | NEW |