| Index: src/objects-inl.h
|
| diff --git a/src/objects-inl.h b/src/objects-inl.h
|
| index 9840e670aaa09dfee4aaf174691edbff5d63e1d7..58c8e06a73ffeb36b4b8eb9f99b8e141c101b948 100644
|
| --- a/src/objects-inl.h
|
| +++ b/src/objects-inl.h
|
| @@ -1134,6 +1134,20 @@ MUST_USE_RESULT MaybeHandle<FixedArray> JSReceiver::OwnPropertyKeys(
|
| GetKeysConversion::kConvertToString);
|
| }
|
|
|
| +bool JSObject::PrototypeHasNoElements(Isolate* isolate, JSObject* object) {
|
| + DisallowHeapAllocation no_gc;
|
| + HeapObject* prototype = HeapObject::cast(object->map()->prototype());
|
| + HeapObject* null = isolate->heap()->null_value();
|
| + HeapObject* empty = isolate->heap()->empty_fixed_array();
|
| + while (prototype != null) {
|
| + Map* map = prototype->map();
|
| + if (map->instance_type() <= LAST_CUSTOM_ELEMENTS_RECEIVER) return false;
|
| + if (JSObject::cast(prototype)->elements() != empty) return false;
|
| + prototype = HeapObject::cast(map->prototype());
|
| + }
|
| + return true;
|
| +}
|
| +
|
| #define FIELD_ADDR(p, offset) \
|
| (reinterpret_cast<byte*>(p) + offset - kHeapObjectTag)
|
|
|
|
|