Backport: Fix Object.entries/values with changing elements

Bug: 111274046
Test: m -j proxy_resolver_v8_unittest && adb sync && adb shell \
/data/nativetest64/proxy_resolver_v8_unittest/proxy_resolver_v8_unittest
Change-Id: I705fc512cc5837e9364ed187559cc75d079aa5cb
(cherry picked from commit d8be9a10287afed07705ac8af027d6a46d4def99)

 static void TryTransitionResultArrayToPacked(Handle<JSArray> array) {
 if (!IsHoleyElementsKind(kind())) return;
 int length = Smi::cast(array->length())->value();
 Handle<FixedArrayBase> backing_store(array->elements());
 if (!Subclass::IsPackedImpl(array, backing_store, 0, length)) {
 return;
 }
 ElementsKind packed_kind = GetPackedElementsKind(kind());
 Handle<Map> new_map =
 JSObject::GetElementsTransitionMap(array, packed_kind);
 JSObject::MigrateToMap(array, new_map);
 if (FLAG_trace_elements_transitions) {
 JSObject::PrintElementsTransition(stdout, array, kind(), backing_store,
                                        packed_kind, backing_store);
 }
 }

 static void TryTransitionResultArrayToPacked(Handle<JSArray> array) {
 if (!IsHoleyElementsKind(kind())) return;
 int length = Smi::cast(array->length())->value();
 Handle<FixedArrayBase> backing_store(array->elements());
 if (!Subclass::IsPackedImpl(array, backing_store, 0, length)) {
 return;
 }
 ElementsKind packed_kind = GetPackedElementsKind(kind());
 Handle<Map> new_map =
 JSObject::GetElementsTransitionMap(array, packed_kind);
 JSObject::MigrateToMap(array, new_map);
 if (FLAG_trace_elements_transitions) {
 JSObject::PrintElementsTransition(stdout, array, kind(), backing_store,
                                        packed_kind, backing_store);
 }
 }
