mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[vm] Update offsets
Make the offsets extracted reflect changes in classes that have fields that do not exist in product mode, since it affects the entity size. Change-Id: I0ec277663ba3ddc956ca651ccc0395e39ba185f9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133229 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
This commit is contained in:
parent
3efd623849
commit
3fa4194008
|
@ -189,6 +189,7 @@ executable("offsets_extractor") {
|
|||
configs += [
|
||||
"..:dart_arch_config",
|
||||
"..:dart_config",
|
||||
"..:dart_maybe_product_config",
|
||||
":libdart_vm_config",
|
||||
]
|
||||
sources = [
|
||||
|
@ -202,6 +203,7 @@ executable("offsets_extractor_precompiled_runtime") {
|
|||
"..:dart_arch_config",
|
||||
"..:dart_config",
|
||||
"..:dart_precompiled_runtime_config",
|
||||
"..:dart_maybe_product_config",
|
||||
":libdart_vm_config",
|
||||
]
|
||||
sources = [
|
||||
|
|
|
@ -82,8 +82,6 @@ class OffsetsExtractor : public AllStatic {
|
|||
|
||||
#define PRECOMP_NO_CHECK(Code)
|
||||
|
||||
#define PRECOMP_CALCULATE(Code) Code
|
||||
|
||||
#else // defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
#define PRINT_FIELD_OFFSET(Class, Name) \
|
||||
|
@ -129,14 +127,11 @@ class OffsetsExtractor : public AllStatic {
|
|||
|
||||
#define PRECOMP_NO_CHECK(Code) Code
|
||||
|
||||
#define PRECOMP_CALCULATE(Code) Code
|
||||
|
||||
#endif // defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
OFFSETS_LIST_EXTENDED(PRINT_FIELD_OFFSET, PRINT_ARRAY_LAYOUT,
|
||||
PRINT_ARRAY_STRUCTFIELD_OFFSET, PRINT_SIZEOF,
|
||||
PRINT_RANGE, PRINT_CONSTANT, PRECOMP_NO_CHECK,
|
||||
PRECOMP_CALCULATE)
|
||||
OFFSETS_LIST(PRINT_FIELD_OFFSET, PRINT_ARRAY_LAYOUT,
|
||||
PRINT_ARRAY_STRUCTFIELD_OFFSET, PRINT_SIZEOF, PRINT_RANGE,
|
||||
PRINT_CONSTANT, PRECOMP_NO_CHECK)
|
||||
|
||||
#undef PRINT_FIELD_OFFSET
|
||||
#undef PRINT_ARRAY_LAYOUT
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -29,11 +29,8 @@
|
|||
// Class::Name() if Filter returns true for that value.
|
||||
// CONSTANT(Class, Name) Miscellaneous constant.
|
||||
// PRECOMP_NO_CHECK(Code) Don't check this offset in the precompiled runtime.
|
||||
// PRECOMP_CALCULATE_BUT_NO_CHECK(Code) Same as PRECOMP_NO_CHECK, but generates
|
||||
// the offset
|
||||
#define OFFSETS_LIST_EXTENDED(FIELD, ARRAY, ARRAY_STRUCTFIELD, SIZEOF, RANGE, \
|
||||
CONSTANT, PRECOMP_NO_CHECK, \
|
||||
PRECOMP_CALCULATE_BUT_NO_CHECK) \
|
||||
#define OFFSETS_LIST(FIELD, ARRAY, ARRAY_STRUCTFIELD, SIZEOF, RANGE, CONSTANT, \
|
||||
PRECOMP_NO_CHECK) \
|
||||
ARRAY(ObjectPool, element_offset) \
|
||||
CONSTANT(Array, kMaxElements) \
|
||||
CONSTANT(Array, kMaxNewSpaceElements) \
|
||||
|
@ -272,9 +269,4 @@
|
|||
SIZEOF(Instance, InstanceSize, RawInstance) \
|
||||
SIZEOF(LinkedHashMap, InstanceSize, RawLinkedHashMap)
|
||||
|
||||
#define OFFSETS_LIST(FIELD, ARRAY, ARRAY_STRUCTFIELD, SIZEOF, RANGE, CONSTANT, \
|
||||
PRECOMP_NO_CHECK) \
|
||||
OFFSETS_LIST_EXTENDED(FIELD, ARRAY, ARRAY_STRUCTFIELD, SIZEOF, RANGE, \
|
||||
CONSTANT, PRECOMP_NO_CHECK, PRECOMP_NO_CHECK)
|
||||
|
||||
#endif // RUNTIME_VM_COMPILER_RUNTIME_OFFSETS_LIST_H_
|
||||
|
|
|
@ -113,8 +113,15 @@ static void CheckOffsets() {
|
|||
Class##_elements_start_offset) \
|
||||
CHECK_OFFSET(Class::ArrayLayout::kElementSize, Class##_element_size)
|
||||
#define CHECK_ARRAY_STRUCTFIELD(Class, Name, ElementOffsetName, FieldOffset)
|
||||
|
||||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
#define CHECK_SIZEOF(Class, Name, What) \
|
||||
CHECK_OFFSET(sizeof(What), AOT_##Class##_##Name)
|
||||
#else
|
||||
#define CHECK_SIZEOF(Class, Name, What) \
|
||||
CHECK_OFFSET(sizeof(What), Class##_##Name)
|
||||
#endif
|
||||
|
||||
#define CHECK_RANGE(Class, Name, Type, First, Last, Filter)
|
||||
#define CHECK_CONSTANT(Class, Name) CHECK_OFFSET(Class::Name, Class##_##Name)
|
||||
|
||||
|
|
|
@ -2607,13 +2607,13 @@ class RawDynamicLibrary : public RawInstance {
|
|||
};
|
||||
|
||||
// VM implementations of the basic types in the isolate.
|
||||
class RawCapability : public RawInstance {
|
||||
class alignas(8) RawCapability : public RawInstance {
|
||||
RAW_HEAP_OBJECT_IMPLEMENTATION(Capability);
|
||||
VISIT_NOTHING();
|
||||
uint64_t id_;
|
||||
};
|
||||
|
||||
class RawSendPort : public RawInstance {
|
||||
class alignas(8) RawSendPort : public RawInstance {
|
||||
RAW_HEAP_OBJECT_IMPLEMENTATION(SendPort);
|
||||
VISIT_NOTHING();
|
||||
Dart_Port id_;
|
||||
|
|
|
@ -16,7 +16,7 @@ fi
|
|||
|
||||
# We're regenerating the file, but we want to keep all the comments etc at the
|
||||
# top of the file. So just delete everything after the first "#if defined".
|
||||
LINE=$(grep "#if defined" "$FILE" -n | head -n 1 | sed "s/^\([0-9]*\):.*/\1/")
|
||||
LINE=$(grep "#if " "$FILE" -n | head -n 1 | sed "s/^\([0-9]*\):.*/\1/")
|
||||
TEMP="${FILE}.temp"
|
||||
TEMP_HEADER="${FILE}.header.temp"
|
||||
TEMP_JIT="${FILE}.jit.temp"
|
||||
|
@ -25,19 +25,34 @@ head -n $(expr $LINE - 1) "$FILE" >"$TEMP_HEADER"
|
|||
|
||||
# Run offsets_extractor for every architecture and append the results.
|
||||
run() {
|
||||
tools/gn.py --mode=release --arch=$1
|
||||
tools/build.py --mode=release --arch=$1 offsets_extractor offsets_extractor_precompiled_runtime
|
||||
tools/gn.py --mode=$1 --arch=$2
|
||||
tools/build.py --mode=$1 --arch=$2 offsets_extractor offsets_extractor_precompiled_runtime
|
||||
echo "" >>"$TEMP_JIT"
|
||||
out/$2/offsets_extractor >>"$TEMP_JIT"
|
||||
out/$3/offsets_extractor >>"$TEMP_JIT"
|
||||
echo "" >>"$TEMP_AOT"
|
||||
out/$2/offsets_extractor_precompiled_runtime >>"$TEMP_AOT"
|
||||
out/$3/offsets_extractor_precompiled_runtime >>"$TEMP_AOT"
|
||||
}
|
||||
run simarm ReleaseSIMARM
|
||||
run x64 ReleaseX64
|
||||
run ia32 ReleaseIA32
|
||||
run simarm64 ReleaseSIMARM64
|
||||
echo "" >>"$TEMP_JIT"
|
||||
echo "" >>"$TEMP_AOT"
|
||||
echo "#if !defined(PRODUCT)" >>"$TEMP_JIT"
|
||||
echo "#if !defined(PRODUCT)" >>"$TEMP_AOT"
|
||||
run release simarm ReleaseSIMARM
|
||||
run release x64 ReleaseX64
|
||||
run release ia32 ReleaseIA32
|
||||
run release simarm64 ReleaseSIMARM64
|
||||
echo "" >>"$TEMP_JIT"
|
||||
echo "" >>"$TEMP_AOT"
|
||||
echo "#else // !defined(PRODUCT)" >>"$TEMP_JIT"
|
||||
echo "#else // !defined(PRODUCT)" >>"$TEMP_AOT"
|
||||
run product simarm ProductSIMARM
|
||||
run product x64 ProductX64
|
||||
run product ia32 ProductIA32
|
||||
run product simarm64 ProductSIMARM64
|
||||
echo "" >>"$TEMP_JIT"
|
||||
echo "" >>"$TEMP_AOT"
|
||||
echo "#endif // !defined(PRODUCT)" >>"$TEMP_JIT"
|
||||
echo "#endif // !defined(PRODUCT)" >>"$TEMP_AOT"
|
||||
|
||||
# Cleanup.
|
||||
cat $TEMP_HEADER >>"$TEMP"
|
||||
cat $TEMP_JIT >>"$TEMP"
|
||||
cat $TEMP_AOT >>"$TEMP"
|
||||
|
@ -45,6 +60,8 @@ cat $TEMP_AOT >>"$TEMP"
|
|||
echo "" >>"$TEMP"
|
||||
echo "#endif // RUNTIME_VM_COMPILER_RUNTIME_OFFSETS_EXTRACTED_H_" >>"$TEMP"
|
||||
mv "$TEMP" "$FILE"
|
||||
|
||||
# Cleanup.
|
||||
git cl format "$FILE"
|
||||
rm "$TEMP_HEADER"
|
||||
rm "$TEMP_JIT"
|
||||
|
|
Loading…
Reference in a new issue