239 {
242 for (intptr_t
i = 0;
i < before_.length();
i++) {
243 const Instance& before = *before_.At(
i);
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263 const bool is_canonical = before.IsCanonical();
266
267
268
269 if (is_canonical) {
270 after.SetCanonical();
271 }
272#if defined(HASH_IN_OBJECT_HEADER)
273 const uint32_t
hash = Object::GetCachedHash(before.ptr());
274 Object::SetCachedHashIfNotSet(after.ptr(),
hash);
275#endif
276
277
278 for (intptr_t
i = 0;
i < mapping_->
length();
i += 2) {
279 const auto& from = mapping_->
At(
i);
280 const auto& to = mapping_->
At(
i + 1);
284
286
287
288 ObjectPtr raw_value = before.RawGetFieldAtOffset(from.offset);
289 after.RawSetFieldAtOffset(to.offset, raw_value);
291
292 switch (from.box_cid) {
293 case kDoubleCid: {
294 const auto unboxed_value =
295 before.RawGetUnboxedFieldAtOffset<double>(from.offset);
297 break;
298 }
299 case kFloat32x4Cid: {
300 const auto unboxed_value =
301 before.RawGetUnboxedFieldAtOffset<simd128_value_t>(from.offset);
303 break;
304 }
305 case kFloat64x2Cid: {
306 const auto unboxed_value =
307 before.RawGetUnboxedFieldAtOffset<simd128_value_t>(from.offset);
309 break;
310 }
311 case kIntegerCid: {
312 const auto unboxed_value =
313 before.RawGetUnboxedFieldAtOffset<int64_t>(from.offset);
315 break;
316 }
317 }
318 if (is_canonical) {
320 }
321 after.RawSetFieldAtOffset(to.offset,
value);
322 } else {
323
324 ASSERT(to.box_cid == from.box_cid);
325 switch (from.box_cid) {
326 case kDoubleCid: {
327 const auto unboxed_value =
328 before.RawGetUnboxedFieldAtOffset<double>(from.offset);
329 after.RawSetUnboxedFieldAtOffset<double>(to.offset, unboxed_value);
330 break;
331 }
332 case kFloat32x4Cid:
333 case kFloat64x2Cid: {
334 const auto unboxed_value =
335 before.RawGetUnboxedFieldAtOffset<simd128_value_t>(from.offset);
336 after.RawSetUnboxedFieldAtOffset<simd128_value_t>(to.offset,
337 unboxed_value);
338 break;
339 }
340 case kIntegerCid: {
341 const auto unboxed_value =
342 before.RawGetUnboxedFieldAtOffset<int64_t>(from.offset);
343 after.RawSetUnboxedFieldAtOffset<int64_t>(to.offset, unboxed_value);
344 break;
345 }
346 }
347 }
348 }
349
350 for (intptr_t
i = 0;
i < new_fields_offsets_->
length();
i++) {
351 const auto& field_offset = new_fields_offsets_->
At(
i);
352 after.RawSetFieldAtOffset(field_offset, Object::sentinel());
353 }
354
355
356
357
359
360 become->Add(before, after);
361 }
362}
static uint32_t hash(const SkShaderBase::GradientInfo &v)
static void MakeDummyObject(const Instance &instance)
static DoublePtr New(double d, Heap::Space space=Heap::kNew)
static Float32x4Ptr New(float value0, float value1, float value2, float value3, Heap::Space space=Heap::kNew)
static Float64x2Ptr New(double value0, double value1, Heap::Space space=Heap::kNew)
static InstancePtr NewAlreadyFinalized(const Class &cls, Heap::Space space=Heap::kNew)
static IntegerPtr New(const String &str, Heap::Space space=Heap::kNew)
static Thread * Current()