mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[vm] Fix gcc build.
TEST=local build Change-Id: I9503dfbb1b9ba6ef2b5fb8423c13d5066e5af98b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206140 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Tess Strickland <sstrickl@google.com>
This commit is contained in:
parent
408e4c2a1f
commit
2642c7c9ce
|
@ -226,22 +226,6 @@ class BitField<S,
|
|||
void>::type>
|
||||
: public BitField<typename S::ContainedType, T, position, size, false> {};
|
||||
|
||||
template <typename S, typename T, int position>
|
||||
class BitField<S,
|
||||
T,
|
||||
position,
|
||||
(sizeof(S) * kBitsPerByte) - position,
|
||||
false,
|
||||
typename std::enable_if<
|
||||
std::is_base_of<AtomicBitFieldContainerBase, S>::value,
|
||||
void>::type>
|
||||
: public BitField<typename S::ContainedType,
|
||||
T,
|
||||
position,
|
||||
(sizeof(typename S::ContainedType) * kBitsPerByte) -
|
||||
position,
|
||||
false> {};
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // RUNTIME_VM_BITFIELD_H_
|
||||
|
|
|
@ -22,7 +22,9 @@ class BitmapBuilder : public ZoneAllocated {
|
|||
}
|
||||
|
||||
BitmapBuilder(const BitmapBuilder& other)
|
||||
: length_(other.length_), data_size_in_bytes_(other.data_size_in_bytes_) {
|
||||
: ZoneAllocated(),
|
||||
length_(other.length_),
|
||||
data_size_in_bytes_(other.data_size_in_bytes_) {
|
||||
if (data_size_in_bytes_ == kInlineCapacityInBytes) {
|
||||
memmove(data_.inline_, other.data_.inline_, kInlineCapacityInBytes);
|
||||
} else {
|
||||
|
|
|
@ -301,6 +301,7 @@ char* Dart::Init(const uint8_t* vm_isolate_snapshot,
|
|||
vm_isolate_->isolate_object_store()->Init();
|
||||
TargetCPUFeatures::Init();
|
||||
Object::Init(vm_isolate_->group());
|
||||
OffsetsTable::Init();
|
||||
ArgumentsDescriptor::Init();
|
||||
ICData::Init();
|
||||
SubtypeTestCache::Init();
|
||||
|
@ -635,6 +636,7 @@ char* Dart::Cleanup() {
|
|||
ICData::Cleanup();
|
||||
SubtypeTestCache::Cleanup();
|
||||
ArgumentsDescriptor::Cleanup();
|
||||
OffsetsTable::Cleanup();
|
||||
TargetCPUFeatures::Cleanup();
|
||||
MarkingStack::Cleanup();
|
||||
StoreBuffer::Cleanup();
|
||||
|
|
|
@ -1162,11 +1162,10 @@ void HeapSnapshotWriter::Write() {
|
|||
|
||||
intptr_t field_count = 0;
|
||||
intptr_t min_offset = kIntptrMax;
|
||||
for (intptr_t j = 0; OffsetsTable::offsets_table[j].class_id != -1;
|
||||
j++) {
|
||||
if (OffsetsTable::offsets_table[j].class_id == cid) {
|
||||
for (const auto& entry : OffsetsTable::offsets_table()) {
|
||||
if (entry.class_id == cid) {
|
||||
field_count++;
|
||||
intptr_t offset = OffsetsTable::offsets_table[j].offset;
|
||||
intptr_t offset = entry.offset;
|
||||
min_offset = Utils::Minimum(min_offset, offset);
|
||||
}
|
||||
}
|
||||
|
@ -1187,16 +1186,15 @@ void HeapSnapshotWriter::Write() {
|
|||
}
|
||||
|
||||
WriteUnsigned(field_count);
|
||||
for (intptr_t j = 0; OffsetsTable::offsets_table[j].class_id != -1;
|
||||
j++) {
|
||||
if (OffsetsTable::offsets_table[j].class_id == cid) {
|
||||
for (const auto& entry : OffsetsTable::offsets_table()) {
|
||||
if (entry.class_id == cid) {
|
||||
intptr_t flags = 1; // Strong.
|
||||
WriteUnsigned(flags);
|
||||
intptr_t offset = OffsetsTable::offsets_table[j].offset;
|
||||
intptr_t offset = entry.offset;
|
||||
intptr_t index = (offset - min_offset) / kCompressedWordSize;
|
||||
ASSERT(index >= 0);
|
||||
WriteUnsigned(index);
|
||||
WriteUtf8(OffsetsTable::offsets_table[j].field_name);
|
||||
WriteUtf8(entry.field_name);
|
||||
WriteUtf8(""); // Reserved
|
||||
}
|
||||
}
|
||||
|
|
|
@ -231,8 +231,7 @@ namespace dart {
|
|||
#define NON_HEADER_HASH_CLASSES_AND_FIELDS(F) F(String, hash_)
|
||||
|
||||
OffsetsTable::OffsetsTable(Zone* zone) : cached_offsets_(zone) {
|
||||
for (intptr_t i = 0; offsets_table[i].class_id != -1; ++i) {
|
||||
OffsetsTableEntry entry = offsets_table[i];
|
||||
for (const OffsetsTableEntry& entry : OffsetsTable::offsets_table()) {
|
||||
cached_offsets_.Insert({{entry.class_id, entry.offset}, entry.field_name});
|
||||
}
|
||||
}
|
||||
|
@ -242,37 +241,46 @@ const char* OffsetsTable::FieldNameForOffset(intptr_t class_id,
|
|||
return cached_offsets_.LookupValue({class_id, offset});
|
||||
}
|
||||
|
||||
#define DEFINE_OFFSETS_TABLE_ENTRY(class_name, field_name) \
|
||||
{class_name::kClassId, #field_name, \
|
||||
OFFSET_OF(Untagged##class_name, field_name)},
|
||||
static MallocGrowableArray<OffsetsTable::OffsetsTableEntry> field_offsets_table;
|
||||
|
||||
// clang-format off
|
||||
const OffsetsTable::OffsetsTableEntry OffsetsTable::offsets_table[] = {
|
||||
COMMON_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
|
||||
const MallocGrowableArray<OffsetsTable::OffsetsTableEntry>&
|
||||
OffsetsTable::offsets_table() {
|
||||
ASSERT(field_offsets_table.length() > 0); // Initialized.
|
||||
return field_offsets_table;
|
||||
}
|
||||
|
||||
void OffsetsTable::Init() {
|
||||
#define DEFINE_OFFSETS_TABLE_ENTRY(class_name, field_name) \
|
||||
field_offsets_table.Add({class_name::kClassId, #field_name, \
|
||||
OFFSET_OF(Untagged##class_name, field_name)});
|
||||
|
||||
COMMON_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
|
||||
#if !defined(PRODUCT)
|
||||
NON_PRODUCT_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
|
||||
NON_PRODUCT_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
|
||||
#endif
|
||||
|
||||
#if !defined(HASH_IN_OBJECT_HEADER)
|
||||
NON_HEADER_HASH_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
|
||||
NON_HEADER_HASH_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
|
||||
#endif
|
||||
|
||||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
AOT_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
|
||||
AOT_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
|
||||
#if !defined(PRODUCT)
|
||||
AOT_NON_PRODUCT_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
|
||||
AOT_NON_PRODUCT_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
|
||||
#endif
|
||||
#else
|
||||
JIT_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
|
||||
JIT_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
|
||||
#if !defined(PRODUCT)
|
||||
JIT_NON_PRODUCT_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
|
||||
JIT_NON_PRODUCT_CLASSES_AND_FIELDS(DEFINE_OFFSETS_TABLE_ENTRY)
|
||||
#endif
|
||||
#endif
|
||||
{-1, nullptr, -1}
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
#undef DEFINE_OFFSETS_TABLE_ENTRY
|
||||
}
|
||||
|
||||
void OffsetsTable::Cleanup() {
|
||||
field_offsets_table.Clear();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -30,12 +30,14 @@ class OffsetsTable : public ZoneAllocated {
|
|||
const char* FieldNameForOffset(intptr_t cid, intptr_t offset);
|
||||
|
||||
struct OffsetsTableEntry {
|
||||
const intptr_t class_id;
|
||||
const char* const field_name;
|
||||
const intptr_t offset;
|
||||
intptr_t class_id;
|
||||
const char* field_name;
|
||||
intptr_t offset;
|
||||
};
|
||||
|
||||
static const OffsetsTableEntry offsets_table[];
|
||||
static const MallocGrowableArray<OffsetsTableEntry>& offsets_table();
|
||||
static void Init();
|
||||
static void Cleanup();
|
||||
|
||||
private:
|
||||
struct IntAndIntToStringMapTraits {
|
||||
|
@ -71,6 +73,9 @@ class OffsetsTable : public ZoneAllocated {
|
|||
const char* FieldNameForOffset(intptr_t cid, intptr_t offset) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static void Init() {}
|
||||
static void Cleanup() {}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1727,11 +1727,44 @@
|
|||
},
|
||||
"steps": [
|
||||
{
|
||||
"name": "build dart",
|
||||
"name": "build dart ia32",
|
||||
"script": "tools/build.py",
|
||||
"arguments": [
|
||||
"--mode=all",
|
||||
"--arch=all",
|
||||
"--arch=ia32",
|
||||
"--no-clang",
|
||||
"--no-goma",
|
||||
"runtime"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "build dart x64",
|
||||
"script": "tools/build.py",
|
||||
"arguments": [
|
||||
"--mode=all",
|
||||
"--arch=x64",
|
||||
"--no-clang",
|
||||
"--no-goma",
|
||||
"runtime"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "build dart simarm",
|
||||
"script": "tools/build.py",
|
||||
"arguments": [
|
||||
"--mode=all",
|
||||
"--arch=simarm",
|
||||
"--no-clang",
|
||||
"--no-goma",
|
||||
"runtime"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "build dart simarm64",
|
||||
"script": "tools/build.py",
|
||||
"arguments": [
|
||||
"--mode=all",
|
||||
"--arch=simarm64",
|
||||
"--no-clang",
|
||||
"--no-goma",
|
||||
"runtime"
|
||||
|
|
Loading…
Reference in a new issue