Skip to content

Commit 162d6c5

Browse files
zichanggcommit-bot@chromium.org
authored andcommitted
Revert "[vm] Add support for real unboxed floating point fields in AOT"
This reverts commit 9eb531b. Reason for revert: Bots are red. Some tests are failing. https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-obfuscate-linux-release-x64/6039 https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-android-release-arm_x64/957 Original change's description: > [vm] Add support for real unboxed floating point fields in AOT > > Non-nullable floating point fields (double, Float32x4, Float64x2) > are fully unboxed in their classes. > > A bitmap for each class was added to the shared class table in order to keep > track of the pointers of the classes. Since all classes in Flutter Gallery > have less than 64 fields, the bitmap is represented by a 64 bit integer and > fields whose offset is more than 64 words are not unboxed. > > The instance sizes and field offsets might change between target and host > in cross-compilation, since the number of words used to store unboxed fields > may differ. > > dart-aot Xeon > > SplayLatency -4.62% > SplayHarderLatency -4.17% > NavierStokes -2.20% > Tracer 8.72% > ParticleSystemPaint 2.90% > NBodySIMD 8.35% > NBody 25.59% > > With hack TFA to make doubles in Rect/Offset/Size classes in flutter non-nullable: > > flutter arm-v8: > > gallery total size: -1% > > matrix_utils_transform_rect_perspective -16.70% (less is better) > matrix_utils_transform_rect_affine -31.82% (less is better) > matrix_utils_transform_point_perspective -24.90% (less is better) > matrix_utils_transform_point_affine) -27.26% (less is better) > rrect_contains_bench -4.719% (less is better) > > Change-Id: I9ae09c9c3167d99f9efd071a92937aa51093fd1d > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131824 > Commit-Queue: Victor Agnez Lima <[email protected]> > Reviewed-by: Martin Kustermann <[email protected]> > Reviewed-by: Ryan Macnak <[email protected]> > Reviewed-by: Samir Jindel <[email protected]> [email protected],[email protected],[email protected],[email protected] Change-Id: Ic73858f6adb7f55c4129d4f46ff4731b378cb634 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134020 Reviewed-by: Zichang Guo <[email protected]> Commit-Queue: Zichang Guo <[email protected]>
1 parent d67fbe5 commit 162d6c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+535
-3632
lines changed

runtime/observatory/tests/service/dominator_tree_vm_with_double_field_test.dart

Lines changed: 0 additions & 151 deletions
This file was deleted.

runtime/platform/globals.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,6 @@ typedef simd128_value_t fpu_register_t;
417417
#define DUAL_MAPPING_SUPPORTED 1
418418
#endif
419419

420-
#if defined(DART_PRECOMPILED_RUNTIME) || defined(DART_PRECOMPILER)
421-
#define SUPPORT_UNBOXED_INSTANCE_FIELDS
422-
#endif
423-
424420
// Short form printf format specifiers
425421
#define Pd PRIdPTR
426422
#define Pu PRIuPTR

runtime/platform/utils.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Utils {
2121
}
2222

2323
template <typename T>
24-
static constexpr inline T Maximum(T x, T y) {
24+
static inline T Maximum(T x, T y) {
2525
return x > y ? x : y;
2626
}
2727

@@ -352,18 +352,12 @@ class Utils {
352352
return bit_cast<word>(mask);
353353
}
354354

355-
template <typename T = uword>
356-
static T Bit(uint32_t n) {
357-
ASSERT(n < sizeof(T) * kBitsPerByte);
358-
T bit = 1;
355+
static uword Bit(uint32_t n) {
356+
ASSERT(n < kBitsPerWord);
357+
uword bit = 1;
359358
return bit << n;
360359
}
361360

362-
template <typename T>
363-
DART_FORCE_INLINE static bool TestBit(T mask, intptr_t position) {
364-
return ((mask >> position) & 1) != 0;
365-
}
366-
367361
// Decode integer in SLEB128 format from |data| and update |byte_index|.
368362
template <typename ValueType>
369363
static ValueType DecodeSLEB128(const uint8_t* data,

runtime/tests/vm/dart/unboxed_fields_type_args_test.dart

Lines changed: 0 additions & 59 deletions
This file was deleted.

runtime/vm/bootstrap.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@ static void Finish(Thread* thread) {
7171
// Verify that closure field offsets are identical in Dart and C++.
7272
ASSERT(fields.Length() == 6);
7373
field ^= fields.At(0);
74-
ASSERT(field.HostOffset() == Closure::instantiator_type_arguments_offset());
74+
ASSERT(field.Offset() == Closure::instantiator_type_arguments_offset());
7575
field ^= fields.At(1);
76-
ASSERT(field.HostOffset() == Closure::function_type_arguments_offset());
76+
ASSERT(field.Offset() == Closure::function_type_arguments_offset());
7777
field ^= fields.At(2);
78-
ASSERT(field.HostOffset() == Closure::delayed_type_arguments_offset());
78+
ASSERT(field.Offset() == Closure::delayed_type_arguments_offset());
7979
field ^= fields.At(3);
80-
ASSERT(field.HostOffset() == Closure::function_offset());
80+
ASSERT(field.Offset() == Closure::function_offset());
8181
field ^= fields.At(4);
82-
ASSERT(field.HostOffset() == Closure::context_offset());
82+
ASSERT(field.Offset() == Closure::context_offset());
8383
field ^= fields.At(5);
84-
ASSERT(field.HostOffset() == Closure::hash_offset());
84+
ASSERT(field.Offset() == Closure::hash_offset());
8585
#endif // defined(DEBUG)
8686

8787
// Eagerly compile Bool class, bool constants are used from within compiler.

runtime/vm/class_finalizer.cc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -240,33 +240,33 @@ void ClassFinalizer::VerifyBootstrapClasses() {
240240
#if defined(DEBUG)
241241
// Basic checking.
242242
cls = object_store->object_class();
243-
ASSERT(Instance::InstanceSize() == cls.host_instance_size());
243+
ASSERT(Instance::InstanceSize() == cls.instance_size());
244244
cls = object_store->integer_implementation_class();
245-
ASSERT(Integer::InstanceSize() == cls.host_instance_size());
245+
ASSERT(Integer::InstanceSize() == cls.instance_size());
246246
cls = object_store->smi_class();
247-
ASSERT(Smi::InstanceSize() == cls.host_instance_size());
247+
ASSERT(Smi::InstanceSize() == cls.instance_size());
248248
cls = object_store->mint_class();
249-
ASSERT(Mint::InstanceSize() == cls.host_instance_size());
249+
ASSERT(Mint::InstanceSize() == cls.instance_size());
250250
cls = object_store->one_byte_string_class();
251-
ASSERT(OneByteString::InstanceSize() == cls.host_instance_size());
251+
ASSERT(OneByteString::InstanceSize() == cls.instance_size());
252252
cls = object_store->two_byte_string_class();
253-
ASSERT(TwoByteString::InstanceSize() == cls.host_instance_size());
253+
ASSERT(TwoByteString::InstanceSize() == cls.instance_size());
254254
cls = object_store->external_one_byte_string_class();
255-
ASSERT(ExternalOneByteString::InstanceSize() == cls.host_instance_size());
255+
ASSERT(ExternalOneByteString::InstanceSize() == cls.instance_size());
256256
cls = object_store->external_two_byte_string_class();
257-
ASSERT(ExternalTwoByteString::InstanceSize() == cls.host_instance_size());
257+
ASSERT(ExternalTwoByteString::InstanceSize() == cls.instance_size());
258258
cls = object_store->double_class();
259-
ASSERT(Double::InstanceSize() == cls.host_instance_size());
259+
ASSERT(Double::InstanceSize() == cls.instance_size());
260260
cls = object_store->bool_class();
261-
ASSERT(Bool::InstanceSize() == cls.host_instance_size());
261+
ASSERT(Bool::InstanceSize() == cls.instance_size());
262262
cls = object_store->array_class();
263-
ASSERT(Array::InstanceSize() == cls.host_instance_size());
263+
ASSERT(Array::InstanceSize() == cls.instance_size());
264264
cls = object_store->immutable_array_class();
265-
ASSERT(ImmutableArray::InstanceSize() == cls.host_instance_size());
265+
ASSERT(ImmutableArray::InstanceSize() == cls.instance_size());
266266
cls = object_store->weak_property_class();
267-
ASSERT(WeakProperty::InstanceSize() == cls.host_instance_size());
267+
ASSERT(WeakProperty::InstanceSize() == cls.instance_size());
268268
cls = object_store->linked_hash_map_class();
269-
ASSERT(LinkedHashMap::InstanceSize() == cls.host_instance_size());
269+
ASSERT(LinkedHashMap::InstanceSize() == cls.instance_size());
270270
#endif // defined(DEBUG)
271271

272272
// Remember the currently pending classes.
@@ -1358,7 +1358,7 @@ void ClassFinalizer::VerifyImplicitFieldOffsets() {
13581358
fields_array ^= cls.fields();
13591359
ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields());
13601360
field ^= fields_array.At(0);
1361-
ASSERT(field.HostOffset() == ByteBuffer::data_offset());
1361+
ASSERT(field.Offset() == ByteBuffer::data_offset());
13621362
name ^= field.name();
13631363
expected_name ^= String::New("_data");
13641364
ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name));

0 commit comments

Comments
 (0)