diff --git a/runtime/tests/vm/dart/isolates/fast_object_copy2_test.dart b/runtime/tests/vm/dart/isolates/fast_object_copy2_test.dart index 76e5679df3f..8ec58da1dca 100644 --- a/runtime/tests/vm/dart/isolates/fast_object_copy2_test.dart +++ b/runtime/tests/vm/dart/isolates/fast_object_copy2_test.dart @@ -7,9 +7,6 @@ // VMOptions=--no-enable-fast-object-copy --gc-on-foc-slow-path --force-evacuation // VMOptions=--enable-fast-object-copy --gc-on-foc-slow-path --force-evacuation -// The tests in this file will only succeed when isolate groups are enabled -// (hence the VMOptions above). - import 'dart:async'; import 'dart:isolate'; import 'dart:typed_data'; @@ -75,6 +72,8 @@ final sharableObjects = [ const {1, 2, 3}, Isolate.current.pauseCapability, Int32x4(1, 2, 3, 4), + Float32x4(1.0, 2.0, 3.0, 4.0), + Float64x2(1.0, 2.0), StackTrace.current, ]; diff --git a/runtime/tests/vm/dart_2/isolates/fast_object_copy2_test.dart b/runtime/tests/vm/dart_2/isolates/fast_object_copy2_test.dart index 0c48bc018b2..a52bd160e87 100644 --- a/runtime/tests/vm/dart_2/isolates/fast_object_copy2_test.dart +++ b/runtime/tests/vm/dart_2/isolates/fast_object_copy2_test.dart @@ -9,9 +9,6 @@ // VMOptions=--no-enable-fast-object-copy --gc-on-foc-slow-path --force-evacuation // VMOptions=--enable-fast-object-copy --gc-on-foc-slow-path --force-evacuation -// The tests in this file will only succeed when isolate groups are enabled -// (hence the VMOptions above). - import 'dart:async'; import 'dart:isolate'; import 'dart:typed_data'; @@ -76,6 +73,8 @@ final sharableObjects = [ const {1, 2, 3}, Isolate.current.pauseCapability, Int32x4(1, 2, 3, 4), + Float32x4(1.0, 2.0, 3.0, 4.0), + Float64x2(1.0, 2.0), StackTrace.current, ]; diff --git a/runtime/vm/object_graph_copy.cc b/runtime/vm/object_graph_copy.cc index b6e102d3f02..2fc3446cd6e 100644 --- a/runtime/vm/object_graph_copy.cc +++ b/runtime/vm/object_graph_copy.cc @@ -159,15 +159,10 @@ static bool CanShareObject(ObjectPtr obj, uword tags) { if (cid == kNeverCid) return true; if (cid == kSentinelCid) return true; if (cid == kStackTraceCid) return true; -#if defined(DART_PRECOMPILED_RUNTIME) - // In JIT mode we have field guards enabled which means - // double/float32x4/float64x2 boxes can be mutable and we therefore cannot - // share them. - if (cid == kDoubleCid || cid == kFloat32x4Cid || cid == kFloat64x2Cid) { + if (cid == kDoubleCid || cid == kFloat32x4Cid || cid == kFloat64x2Cid || + cid == kInt32x4Cid) { return true; } -#endif - if (cid == kInt32x4Cid) return true; // No field guards here. if (cid == kSendPortCid) return true; if (cid == kCapabilityCid) return true; @@ -227,13 +222,6 @@ static bool MightNeedReHashing(ObjectPtr object) { #endif if (cid == kInt32x4Cid) return false; - // We copy those (instead of sharing them) - see [CanShareObjct]. They rely - // on the default hashCode implementation which uses identity hash codes - // (instead of structural hash code). - if (cid == kFloat32x4Cid || cid == kFloat64x2Cid) { - return !kDartPrecompiledRuntime; - } - // If the [tags] indicates this is a canonical object we'll share it instead // of copying it. That would suggest we don't have to re-hash maps/sets // containing this object on the receiver side.