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 15970 matching lines...) Loading... | |
15981 if (key->FilterKey(filter)) continue; | 15981 if (key->FilterKey(filter)) continue; |
15982 keys->AddKey(key, DO_NOT_CONVERT); | 15982 keys->AddKey(key, DO_NOT_CONVERT); |
15983 } | 15983 } |
15984 } else if (IsJSGlobalObject()) { | 15984 } else if (IsJSGlobalObject()) { |
15985 GlobalDictionary::CollectKeysTo(handle(global_dictionary()), keys, filter); | 15985 GlobalDictionary::CollectKeysTo(handle(global_dictionary()), keys, filter); |
15986 } else { | 15986 } else { |
15987 NameDictionary::CollectKeysTo(handle(property_dictionary()), keys, filter); | 15987 NameDictionary::CollectKeysTo(handle(property_dictionary()), keys, filter); |
15988 } | 15988 } |
15989 } | 15989 } |
15990 | 15990 |
15991 bool JSObject::WasConstructedFromApiFunction() { | |
Toon Verwaest
2016/04/06 14:07:47
can't we now just check == JS_API... || JS_SPECIAL
Marcel Hlopko
2016/04/07 08:09:53
Yes indeed. I left the slow path hidden behind FLA
| |
15992 Object* maybe_constructor = map()->GetConstructor(); | |
15993 if (!maybe_constructor->IsJSFunction()) return false; | |
15994 JSFunction* constructor = JSFunction::cast(maybe_constructor); | |
15995 return constructor->shared()->IsApiFunction(); | |
15996 } | |
15991 | 15997 |
15992 int JSObject::NumberOfOwnElements(PropertyFilter filter) { | 15998 int JSObject::NumberOfOwnElements(PropertyFilter filter) { |
15993 // Fast case for objects with no elements. | 15999 // Fast case for objects with no elements. |
15994 if (!IsJSValue() && HasFastElements()) { | 16000 if (!IsJSValue() && HasFastElements()) { |
15995 uint32_t length = | 16001 uint32_t length = |
15996 IsJSArray() | 16002 IsJSArray() |
15997 ? static_cast<uint32_t>( | 16003 ? static_cast<uint32_t>( |
15998 Smi::cast(JSArray::cast(this)->length())->value()) | 16004 Smi::cast(JSArray::cast(this)->length())->value()) |
15999 : static_cast<uint32_t>(FixedArrayBase::cast(elements())->length()); | 16005 : static_cast<uint32_t>(FixedArrayBase::cast(elements())->length()); |
16000 if (length == 0) return 0; | 16006 if (length == 0) return 0; |
(...skipping 3285 matching lines...) Loading... | |
19286 if (cell->value() != *new_value) { | 19292 if (cell->value() != *new_value) { |
19287 cell->set_value(*new_value); | 19293 cell->set_value(*new_value); |
19288 Isolate* isolate = cell->GetIsolate(); | 19294 Isolate* isolate = cell->GetIsolate(); |
19289 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19295 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
19290 isolate, DependentCode::kPropertyCellChangedGroup); | 19296 isolate, DependentCode::kPropertyCellChangedGroup); |
19291 } | 19297 } |
19292 } | 19298 } |
19293 | 19299 |
19294 } // namespace internal | 19300 } // namespace internal |
19295 } // namespace v8 | 19301 } // namespace v8 |
OLD | NEW |