Bug 1447578 part 4 - Move MacroAssembler constructors out-of-line. r=luke

--HG--
extra : rebase_source : a2e2146219a1b7f4360cdff8628a43d544af3136
This commit is contained in:
Jan de Mooij 2018-03-21 16:58:28 +01:00
Родитель e8dc00e48a
Коммит d151471127
2 изменённых файлов: 49 добавлений и 45 удалений

Просмотреть файл

@ -2822,6 +2822,53 @@ MacroAssembler::MacroAssembler(JSContext* cx)
#endif
}
MacroAssembler::MacroAssembler()
: framePushed_(0),
#ifdef DEBUG
inCall_(false),
#endif
emitProfilingInstrumentation_(false)
{
JitContext* jcx = GetJitContext();
if (!jcx->temp) {
JSContext* cx = jcx->cx;
MOZ_ASSERT(cx);
alloc_.emplace(cx);
}
moveResolver_.setAllocator(*jcx->temp);
#if defined(JS_CODEGEN_ARM)
initWithAllocator();
m_buffer.id = jcx->getNextAssemblerId();
#elif defined(JS_CODEGEN_ARM64)
initWithAllocator();
armbuffer_.id = jcx->getNextAssemblerId();
#endif
}
MacroAssembler::MacroAssembler(WasmToken, TempAllocator& alloc)
: framePushed_(0),
#ifdef DEBUG
inCall_(false),
#endif
emitProfilingInstrumentation_(false)
{
moveResolver_.setAllocator(alloc);
#if defined(JS_CODEGEN_ARM)
initWithAllocator();
m_buffer.id = 0;
#elif defined(JS_CODEGEN_ARM64)
initWithAllocator();
// Stubs + builtins + the baseline compiler all require the native SP,
// not the PSP.
SetStackPointer64(sp);
armbuffer_.id = 0;
#endif
}
bool
MacroAssembler::icBuildOOLFakeExitFrame(void* fakeReturnAddr, AutoSaveLiveRegisters& save)
{

Просмотреть файл

@ -321,31 +321,7 @@ class MacroAssembler : public MacroAssemblerSpecific
protected:
// Constructors are protected. Use one of the derived classes!
MacroAssembler()
: framePushed_(0),
#ifdef DEBUG
inCall_(false),
#endif
emitProfilingInstrumentation_(false)
{
JitContext* jcx = GetJitContext();
if (!jcx->temp) {
JSContext* cx = jcx->cx;
MOZ_ASSERT(cx);
alloc_.emplace(cx);
}
moveResolver_.setAllocator(*jcx->temp);
#if defined(JS_CODEGEN_ARM)
initWithAllocator();
m_buffer.id = jcx->getNextAssemblerId();
#elif defined(JS_CODEGEN_ARM64)
initWithAllocator();
armbuffer_.id = jcx->getNextAssemblerId();
#endif
}
MacroAssembler();
// This constructor should only be used when there is no JitContext active
// (for example, Trampoline-$(ARCH).cpp and IonCaches.cpp).
@ -353,26 +329,7 @@ class MacroAssembler : public MacroAssemblerSpecific
// wasm compilation handles its own JitContext-pushing
struct WasmToken {};
explicit MacroAssembler(WasmToken, TempAllocator& alloc)
: framePushed_(0),
#ifdef DEBUG
inCall_(false),
#endif
emitProfilingInstrumentation_(false)
{
moveResolver_.setAllocator(alloc);
#if defined(JS_CODEGEN_ARM)
initWithAllocator();
m_buffer.id = 0;
#elif defined(JS_CODEGEN_ARM64)
initWithAllocator();
// Stubs + builtins + the baseline compiler all require the native SP,
// not the PSP.
SetStackPointer64(sp);
armbuffer_.id = 0;
#endif
}
explicit MacroAssembler(WasmToken, TempAllocator& alloc);
public:
MoveResolver& moveResolver() {