Bug 1861078: apply code formatting via Lando
# ignore-this-changeset
This commit is contained in:
@@ -16284,8 +16284,7 @@ bool CodeGenerator::generateWasm(wasm::CallIndirectId callIndirectId,
|
||||
MOZ_ASSERT(functionEntryStackMap);
|
||||
|
||||
if (functionEntryStackMap &&
|
||||
!stackMaps->add(trapInsnOffset.offset(),
|
||||
functionEntryStackMap)) {
|
||||
!stackMaps->add(trapInsnOffset.offset(), functionEntryStackMap)) {
|
||||
functionEntryStackMap->destroy();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -318,11 +318,11 @@ bool wasm::IsPlausibleStackMapKey(const uint8_t* nextPC) {
|
||||
|
||||
void StackMaps::checkInvariants(const uint8_t* base) const {
|
||||
#ifdef DEBUG
|
||||
// Chech that each entry points from the stackmap structure points
|
||||
// to a plausible instruction.
|
||||
for (auto iter = mapping_.iter(); !iter.done(); iter.next()) {
|
||||
MOZ_ASSERT(IsPlausibleStackMapKey(base + iter.get().key()),
|
||||
"wasm stackmap does not reference a valid insn");
|
||||
}
|
||||
#endif
|
||||
// Chech that each entry points from the stackmap structure points
|
||||
// to a plausible instruction.
|
||||
for (auto iter = mapping_.iter(); !iter.done(); iter.next()) {
|
||||
MOZ_ASSERT(IsPlausibleStackMapKey(base + iter.get().key()),
|
||||
"wasm stackmap does not reference a valid insn");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -247,29 +247,28 @@ struct StackMap final {
|
||||
static_assert(sizeof(StackMap) == 12, "wasm::StackMap has unexpected size");
|
||||
|
||||
// A map from an offset relative to the beginning of a code block to a StackMap
|
||||
using StackMapHashMap = HashMap<uint32_t, StackMap*, DefaultHasher<uint32_t>, SystemAllocPolicy>;
|
||||
using StackMapHashMap =
|
||||
HashMap<uint32_t, StackMap*, DefaultHasher<uint32_t>, SystemAllocPolicy>;
|
||||
|
||||
class StackMaps {
|
||||
private:
|
||||
// Map for finding a stack map at a specific code offset.
|
||||
StackMapHashMap mapping_;
|
||||
private:
|
||||
// Map for finding a stack map at a specific code offset.
|
||||
StackMapHashMap mapping_;
|
||||
|
||||
public:
|
||||
StackMaps() {}
|
||||
~StackMaps() {
|
||||
for (auto iter = mapping_.modIter(); !iter.done(); iter.next()) {
|
||||
StackMap* stackmap = iter.getMutable().value();
|
||||
stackmap->destroy();
|
||||
}
|
||||
mapping_.clear();
|
||||
public:
|
||||
StackMaps() {}
|
||||
~StackMaps() {
|
||||
for (auto iter = mapping_.modIter(); !iter.done(); iter.next()) {
|
||||
StackMap* stackmap = iter.getMutable().value();
|
||||
stackmap->destroy();
|
||||
}
|
||||
mapping_.clear();
|
||||
}
|
||||
|
||||
[[nodiscard]] bool add(uint32_t codeOffset, StackMap* map) {
|
||||
return mapping_.put(codeOffset, map);
|
||||
}
|
||||
void clear() {
|
||||
mapping_.clear();
|
||||
}
|
||||
void clear() { mapping_.clear(); }
|
||||
bool empty() const { return mapping_.empty(); }
|
||||
// Return the number of stack maps contained in this.
|
||||
size_t length() const { return mapping_.count(); }
|
||||
|
||||
@@ -1892,8 +1892,7 @@ static bool AddStackCheckForImportFunctionEntry(jit::MacroAssembler& masm,
|
||||
// In debug builds, we'll always have a stack map, even if there are no
|
||||
// refs to track.
|
||||
MOZ_ASSERT(stackMap);
|
||||
if (stackMap &&
|
||||
!stackMaps->add(trapInsnOffset.offset(), stackMap)) {
|
||||
if (stackMap && !stackMaps->add(trapInsnOffset.offset(), stackMap)) {
|
||||
stackMap->destroy();
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user