зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1447578 part 5 - Assert WasmMacroAssembler does not have GC relocation data. r=jonco
--HG-- extra : rebase_source : 15025caf91306f9ec456fc393035d41b87bcab33
This commit is contained in:
Родитель
d151471127
Коммит
74b08e1309
|
@ -2650,6 +2650,9 @@ class MOZ_RAII WasmMacroAssembler : public MacroAssembler
|
|||
explicit WasmMacroAssembler(TempAllocator& alloc)
|
||||
: MacroAssembler(WasmToken(), alloc)
|
||||
{}
|
||||
~WasmMacroAssembler() {
|
||||
assertNoGCThings();
|
||||
}
|
||||
};
|
||||
|
||||
// Heap-allocated MacroAssembler used for Ion off-thread code generation.
|
||||
|
|
|
@ -1764,6 +1764,14 @@ class Assembler : public AssemblerShared
|
|||
static void TraceJumpRelocations(JSTracer* trc, JitCode* code, CompactBufferReader& reader);
|
||||
static void TraceDataRelocations(JSTracer* trc, JitCode* code, CompactBufferReader& reader);
|
||||
|
||||
void assertNoGCThings() const {
|
||||
#ifdef DEBUG
|
||||
MOZ_ASSERT(dataRelocations_.length() == 0);
|
||||
for (auto& j : jumps_)
|
||||
MOZ_ASSERT(j.kind() == Relocation::HARDCODED);
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool SupportsFloatingPoint() {
|
||||
return HasVFP();
|
||||
}
|
||||
|
|
|
@ -334,6 +334,14 @@ class Assembler : public vixl::Assembler
|
|||
static void TraceJumpRelocations(JSTracer* trc, JitCode* code, CompactBufferReader& reader);
|
||||
static void TraceDataRelocations(JSTracer* trc, JitCode* code, CompactBufferReader& reader);
|
||||
|
||||
void assertNoGCThings() const {
|
||||
#ifdef DEBUG
|
||||
MOZ_ASSERT(dataRelocations_.length() == 0);
|
||||
for (auto& j : pendingJumps_)
|
||||
MOZ_ASSERT(j.kind == Relocation::HARDCODED);
|
||||
#endif
|
||||
}
|
||||
|
||||
public:
|
||||
// A Jump table entry is 2 instructions, with 8 bytes of raw data
|
||||
static const size_t SizeOfJumpTableEntry = 16;
|
||||
|
|
|
@ -911,6 +911,14 @@ class AssemblerMIPSShared : public AssemblerShared
|
|||
}
|
||||
}
|
||||
|
||||
void assertNoGCThings() const {
|
||||
#ifdef DEBUG
|
||||
MOZ_ASSERT(dataRelocations_.length() == 0);
|
||||
for (auto& j : jumps_)
|
||||
MOZ_ASSERT(j.kind == Relocation::HARDCODED);
|
||||
#endif
|
||||
}
|
||||
|
||||
public:
|
||||
bool oom() const;
|
||||
|
||||
|
|
|
@ -201,6 +201,8 @@ class MacroAssemblerNone : public Assembler
|
|||
bool appendRawCode(const uint8_t* code, size_t numBytes) { MOZ_CRASH(); }
|
||||
bool swapBuffer(wasm::Bytes& bytes) { MOZ_CRASH(); }
|
||||
|
||||
void assertNoGCThings() const { MOZ_CRASH(); }
|
||||
|
||||
static void TraceJumpRelocations(JSTracer*, JitCode*, CompactBufferReader&) { MOZ_CRASH(); }
|
||||
static void TraceDataRelocations(JSTracer*, JitCode*, CompactBufferReader&) { MOZ_CRASH(); }
|
||||
|
||||
|
|
|
@ -395,6 +395,14 @@ class AssemblerX86Shared : public AssemblerShared
|
|||
|
||||
static void TraceDataRelocations(JSTracer* trc, JitCode* code, CompactBufferReader& reader);
|
||||
|
||||
void assertNoGCThings() const {
|
||||
#ifdef DEBUG
|
||||
MOZ_ASSERT(dataRelocations_.length() == 0);
|
||||
for (auto& j : jumps_)
|
||||
MOZ_ASSERT(j.kind == Relocation::HARDCODED);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool oom() const {
|
||||
return AssemblerShared::oom() ||
|
||||
masm.oom() ||
|
||||
|
|
Загрузка…
Ссылка в новой задаче