mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1135707 - Fix interaction between Arm NOP fill and calculation of IonCache rejoin label r=jandem
This commit is contained in:
parent
641e3df01f
commit
17532fcc85
@ -264,7 +264,7 @@ class RepatchIonCache::RepatchStubAppender : public IonCache::StubAttacher
|
||||
|
||||
public:
|
||||
explicit RepatchStubAppender(RepatchIonCache& cache)
|
||||
: StubAttacher(cache.rejoinLabel()),
|
||||
: StubAttacher(cache.rejoinLabel_),
|
||||
cache_(cache)
|
||||
{
|
||||
}
|
||||
@ -302,6 +302,9 @@ RepatchIonCache::emitInitialJump(MacroAssembler& masm, AddCacheState& addState)
|
||||
{
|
||||
initialJump_ = masm.jumpWithPatch(&addState.repatchEntry);
|
||||
lastJump_ = initialJump_;
|
||||
Label label;
|
||||
masm.bind(&label);
|
||||
rejoinLabel_ = CodeOffsetLabel(label.offset());
|
||||
}
|
||||
|
||||
void
|
||||
@ -316,6 +319,7 @@ RepatchIonCache::updateBaseAddress(JitCode* code, MacroAssembler& masm)
|
||||
IonCache::updateBaseAddress(code, masm);
|
||||
initialJump_.repoint(code, &masm);
|
||||
lastJump_.repoint(code, &masm);
|
||||
rejoinLabel_.repoint(code, &masm);
|
||||
}
|
||||
|
||||
class DispatchIonCache::DispatchStubPrepender : public IonCache::StubAttacher
|
||||
|
@ -354,26 +354,7 @@ class RepatchIonCache : public IonCache
|
||||
|
||||
CodeLocationJump initialJump_;
|
||||
CodeLocationJump lastJump_;
|
||||
|
||||
// Offset from the initial jump to the rejoin label.
|
||||
#ifdef JS_CODEGEN_ARM
|
||||
static const size_t REJOIN_LABEL_OFFSET = 4;
|
||||
#elif defined(JS_CODEGEN_MIPS)
|
||||
// The size of jump created by MacroAssemblerMIPSCompat::jumpWithPatch.
|
||||
static const size_t REJOIN_LABEL_OFFSET = 4 * sizeof(void*);
|
||||
#else
|
||||
static const size_t REJOIN_LABEL_OFFSET = 0;
|
||||
#endif
|
||||
|
||||
CodeLocationLabel rejoinLabel() const {
|
||||
uint8_t* ptr = initialJump_.raw();
|
||||
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS)
|
||||
uint32_t i = 0;
|
||||
while (i < REJOIN_LABEL_OFFSET)
|
||||
ptr = Assembler::NextInstruction(ptr, &i);
|
||||
#endif
|
||||
return CodeLocationLabel(ptr);
|
||||
}
|
||||
CodeLocationLabel rejoinLabel_;
|
||||
|
||||
public:
|
||||
RepatchIonCache()
|
||||
@ -395,7 +376,7 @@ class RepatchIonCache : public IonCache
|
||||
void updateBaseAddress(JitCode* code, MacroAssembler& masm) override;
|
||||
|
||||
virtual void* rejoinAddress() override {
|
||||
return rejoinLabel().raw();
|
||||
return rejoinLabel_.raw();
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user