mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 20:25:44 +00:00
Bug 1447578 part 2 - Refactor MacroAssembler, add AutoCheckCannotGC for stack-allocated assemblers. r=jonco,luke
--HG-- extra : rebase_source : 5924c35057451fca9303d06a0282356bc40ac744
This commit is contained in:
parent
0ac9c5c200
commit
f56e39af61
@ -172,7 +172,7 @@ class MOZ_STACK_CLASS NativeRegExpMacroAssembler final : public RegExpMacroAssem
|
|||||||
void LoadCurrentCharacterUnchecked(int cp_offset, int characters);
|
void LoadCurrentCharacterUnchecked(int cp_offset, int characters);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
jit::MacroAssembler masm;
|
jit::StackMacroAssembler masm;
|
||||||
RegExpShared::JitCodeTables& tables;
|
RegExpShared::JitCodeTables& tables;
|
||||||
|
|
||||||
JSContext* cx;
|
JSContext* cx;
|
||||||
|
@ -1118,7 +1118,7 @@ EmitBaselineDebugModeOSRHandlerTail(MacroAssembler& masm, Register temp, bool re
|
|||||||
JitCode*
|
JitCode*
|
||||||
JitRuntime::generateBaselineDebugModeOSRHandler(JSContext* cx, uint32_t* noFrameRegPopOffsetOut)
|
JitRuntime::generateBaselineDebugModeOSRHandler(JSContext* cx, uint32_t* noFrameRegPopOffsetOut)
|
||||||
{
|
{
|
||||||
MacroAssembler masm(cx);
|
StackMacroAssembler masm(cx);
|
||||||
|
|
||||||
AllocatableGeneralRegisterSet regs(GeneralRegisterSet::All());
|
AllocatableGeneralRegisterSet regs(GeneralRegisterSet::All());
|
||||||
regs.take(BaselineFrameReg);
|
regs.take(BaselineFrameReg);
|
||||||
|
@ -539,7 +539,7 @@ class MOZ_RAII CacheIRCompiler
|
|||||||
JSContext* cx_;
|
JSContext* cx_;
|
||||||
CacheIRReader reader;
|
CacheIRReader reader;
|
||||||
const CacheIRWriter& writer_;
|
const CacheIRWriter& writer_;
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
|
|
||||||
CacheRegisterAllocator allocator;
|
CacheRegisterAllocator allocator;
|
||||||
Vector<FailurePath, 4, SystemAllocPolicy> failurePaths;
|
Vector<FailurePath, 4, SystemAllocPolicy> failurePaths;
|
||||||
|
@ -1915,7 +1915,7 @@ JitCompartment::generateRegExpMatcherStub(JSContext* cx)
|
|||||||
MOZ_ASSERT(ObjectElements::VALUES_PER_HEADER + RegExpObject::MaxPairCount ==
|
MOZ_ASSERT(ObjectElements::VALUES_PER_HEADER + RegExpObject::MaxPairCount ==
|
||||||
gc::GetGCKindSlots(templateObject->asTenured().getAllocKind()));
|
gc::GetGCKindSlots(templateObject->asTenured().getAllocKind()));
|
||||||
|
|
||||||
MacroAssembler masm(cx);
|
StackMacroAssembler masm(cx);
|
||||||
|
|
||||||
// The InputOutputData is placed above the return address on the stack.
|
// The InputOutputData is placed above the return address on the stack.
|
||||||
size_t inputOutputDataStartOffset = sizeof(void*);
|
size_t inputOutputDataStartOffset = sizeof(void*);
|
||||||
@ -2221,7 +2221,7 @@ JitCompartment::generateRegExpSearcherStub(JSContext* cx)
|
|||||||
Register temp2 = regs.takeAny();
|
Register temp2 = regs.takeAny();
|
||||||
Register temp3 = regs.takeAny();
|
Register temp3 = regs.takeAny();
|
||||||
|
|
||||||
MacroAssembler masm(cx);
|
StackMacroAssembler masm(cx);
|
||||||
|
|
||||||
// The InputOutputData is placed above the return address on the stack.
|
// The InputOutputData is placed above the return address on the stack.
|
||||||
size_t inputOutputDataStartOffset = sizeof(void*);
|
size_t inputOutputDataStartOffset = sizeof(void*);
|
||||||
@ -2360,7 +2360,7 @@ JitCompartment::generateRegExpTesterStub(JSContext* cx)
|
|||||||
Register lastIndex = RegExpTesterLastIndexReg;
|
Register lastIndex = RegExpTesterLastIndexReg;
|
||||||
Register result = ReturnReg;
|
Register result = ReturnReg;
|
||||||
|
|
||||||
MacroAssembler masm(cx);
|
StackMacroAssembler masm(cx);
|
||||||
|
|
||||||
#ifdef JS_USE_LINK_REGISTER
|
#ifdef JS_USE_LINK_REGISTER
|
||||||
masm.pushReturnAddress();
|
masm.pushReturnAddress();
|
||||||
@ -8390,7 +8390,7 @@ CodeGenerator::visitSubstr(LSubstr* lir)
|
|||||||
JitCode*
|
JitCode*
|
||||||
JitCompartment::generateStringConcatStub(JSContext* cx)
|
JitCompartment::generateStringConcatStub(JSContext* cx)
|
||||||
{
|
{
|
||||||
MacroAssembler masm(cx);
|
StackMacroAssembler masm(cx);
|
||||||
|
|
||||||
Register lhs = CallTempReg0;
|
Register lhs = CallTempReg0;
|
||||||
Register rhs = CallTempReg1;
|
Register rhs = CallTempReg1;
|
||||||
|
@ -251,7 +251,7 @@ JitRuntime::initialize(JSContext* cx, AutoLockForExclusiveAccess& lock)
|
|||||||
if (!functionWrappers_ || !functionWrappers_->init())
|
if (!functionWrappers_ || !functionWrappers_->init())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
|
|
||||||
Label bailoutTail;
|
Label bailoutTail;
|
||||||
JitSpew(JitSpew_Codegen, "# Emitting bailout tail stub");
|
JitSpew(JitSpew_Codegen, "# Emitting bailout tail stub");
|
||||||
|
@ -335,7 +335,8 @@ class MacroAssembler : public MacroAssemblerSpecific
|
|||||||
// Labels for handling exceptions and failures.
|
// Labels for handling exceptions and failures.
|
||||||
NonAssertingLabel failureLabel_;
|
NonAssertingLabel failureLabel_;
|
||||||
|
|
||||||
public:
|
protected:
|
||||||
|
// Constructors are protected. Use one of the derived classes!
|
||||||
MacroAssembler()
|
MacroAssembler()
|
||||||
: framePushed_(0),
|
: framePushed_(0),
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -391,6 +392,7 @@ class MacroAssembler : public MacroAssemblerSpecific
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
bool isRooted() const {
|
bool isRooted() const {
|
||||||
return autoRooter_.isSome();
|
return autoRooter_.isSome();
|
||||||
@ -2697,6 +2699,42 @@ class MacroAssembler : public MacroAssemblerSpecific
|
|||||||
Vector<ObjectGroup*, 0, SystemAllocPolicy> pendingObjectGroupReadBarriers_;
|
Vector<ObjectGroup*, 0, SystemAllocPolicy> pendingObjectGroupReadBarriers_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// StackMacroAssembler checks no GC will happen while it's on the stack.
|
||||||
|
class MOZ_RAII StackMacroAssembler : public MacroAssembler
|
||||||
|
{
|
||||||
|
JS::AutoCheckCannotGC nogc;
|
||||||
|
|
||||||
|
public:
|
||||||
|
StackMacroAssembler()
|
||||||
|
: MacroAssembler()
|
||||||
|
{}
|
||||||
|
explicit StackMacroAssembler(JSContext* cx)
|
||||||
|
: MacroAssembler(cx)
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
|
// WasmMacroAssembler does not contain GC pointers, so it doesn't need the no-GC
|
||||||
|
// checking StackMacroAssembler has.
|
||||||
|
class MOZ_RAII WasmMacroAssembler : public MacroAssembler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit WasmMacroAssembler(TempAllocator& alloc)
|
||||||
|
: MacroAssembler(WasmToken(), alloc)
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Heap-allocated MacroAssembler used for Ion off-thread code generation.
|
||||||
|
// GC cancels off-thread compilations.
|
||||||
|
class IonHeapMacroAssembler : public MacroAssembler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
IonHeapMacroAssembler()
|
||||||
|
: MacroAssembler()
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(CurrentThreadIsIonCompiling());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
//{{{ check_macroassembler_style
|
//{{{ check_macroassembler_style
|
||||||
inline uint32_t
|
inline uint32_t
|
||||||
MacroAssembler::framePushed() const
|
MacroAssembler::framePushed() const
|
||||||
|
@ -504,7 +504,7 @@ ICStubCompiler::getStubCode()
|
|||||||
|
|
||||||
// Compile new stubcode.
|
// Compile new stubcode.
|
||||||
JitContext jctx(cx, nullptr);
|
JitContext jctx(cx, nullptr);
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
#ifndef JS_USE_LINK_REGISTER
|
#ifndef JS_USE_LINK_REGISTER
|
||||||
// The first value contains the return addres,
|
// The first value contains the return addres,
|
||||||
// which we pull into ICTailCallReg for tail calls.
|
// which we pull into ICTailCallReg for tail calls.
|
||||||
@ -2759,7 +2759,7 @@ static JitCode*
|
|||||||
GenerateNewObjectWithTemplateCode(JSContext* cx, JSObject* templateObject)
|
GenerateNewObjectWithTemplateCode(JSContext* cx, JSObject* templateObject)
|
||||||
{
|
{
|
||||||
JitContext jctx(cx, nullptr);
|
JitContext jctx(cx, nullptr);
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
#ifdef JS_CODEGEN_ARM
|
#ifdef JS_CODEGEN_ARM
|
||||||
masm.setSecondScratchReg(BaselineSecondScratchReg);
|
masm.setSecondScratchReg(BaselineSecondScratchReg);
|
||||||
#endif
|
#endif
|
||||||
|
@ -952,7 +952,7 @@ static const VMFunction HandleDebugTrapInfo =
|
|||||||
JitCode*
|
JitCode*
|
||||||
JitRuntime::generateDebugTrapHandler(JSContext* cx)
|
JitRuntime::generateDebugTrapHandler(JSContext* cx)
|
||||||
{
|
{
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
|
|
||||||
Register scratch1 = r0;
|
Register scratch1 = r0;
|
||||||
Register scratch2 = r1;
|
Register scratch2 = r1;
|
||||||
|
@ -771,7 +771,7 @@ static const VMFunction HandleDebugTrapInfo =
|
|||||||
JitCode*
|
JitCode*
|
||||||
JitRuntime::generateDebugTrapHandler(JSContext* cx)
|
JitRuntime::generateDebugTrapHandler(JSContext* cx)
|
||||||
{
|
{
|
||||||
MacroAssembler masm(cx);
|
StackMacroAssembler masm(cx);
|
||||||
#ifndef JS_USE_LINK_REGISTER
|
#ifndef JS_USE_LINK_REGISTER
|
||||||
// The first value contains the return addres,
|
// The first value contains the return addres,
|
||||||
// which we pull into ICTailCallReg for tail calls.
|
// which we pull into ICTailCallReg for tail calls.
|
||||||
|
@ -927,7 +927,7 @@ static const VMFunction HandleDebugTrapInfo =
|
|||||||
JitCode*
|
JitCode*
|
||||||
JitRuntime::generateDebugTrapHandler(JSContext* cx)
|
JitRuntime::generateDebugTrapHandler(JSContext* cx)
|
||||||
{
|
{
|
||||||
MacroAssembler masm(cx);
|
StackMacroAssembler masm(cx);
|
||||||
|
|
||||||
Register scratch1 = t0;
|
Register scratch1 = t0;
|
||||||
Register scratch2 = t1;
|
Register scratch2 = t1;
|
||||||
|
@ -877,7 +877,7 @@ static const VMFunction HandleDebugTrapInfo =
|
|||||||
JitCode*
|
JitCode*
|
||||||
JitRuntime::generateDebugTrapHandler(JSContext* cx)
|
JitRuntime::generateDebugTrapHandler(JSContext* cx)
|
||||||
{
|
{
|
||||||
MacroAssembler masm(cx);
|
StackMacroAssembler masm(cx);
|
||||||
|
|
||||||
Register scratch1 = t0;
|
Register scratch1 = t0;
|
||||||
Register scratch2 = t1;
|
Register scratch2 = t1;
|
||||||
|
@ -21,7 +21,7 @@ class BaselineCompilerShared
|
|||||||
JSContext* cx;
|
JSContext* cx;
|
||||||
JSScript* script;
|
JSScript* script;
|
||||||
jsbytecode* pc;
|
jsbytecode* pc;
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
bool ionCompileable_;
|
bool ionCompileable_;
|
||||||
bool compileDebugInstrumentation_;
|
bool compileDebugInstrumentation_;
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ class CodeGeneratorShared : public LElementVisitor
|
|||||||
js::Vector<OutOfLineCode*, 0, SystemAllocPolicy> outOfLineCode_;
|
js::Vector<OutOfLineCode*, 0, SystemAllocPolicy> outOfLineCode_;
|
||||||
|
|
||||||
MacroAssembler& ensureMasm(MacroAssembler* masm);
|
MacroAssembler& ensureMasm(MacroAssembler* masm);
|
||||||
mozilla::Maybe<MacroAssembler> maybeMasm_;
|
mozilla::Maybe<IonHeapMacroAssembler> maybeMasm_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MacroAssembler& masm;
|
MacroAssembler& masm;
|
||||||
|
@ -832,7 +832,7 @@ static const VMFunction HandleDebugTrapInfo =
|
|||||||
JitCode*
|
JitCode*
|
||||||
JitRuntime::generateDebugTrapHandler(JSContext* cx)
|
JitRuntime::generateDebugTrapHandler(JSContext* cx)
|
||||||
{
|
{
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
#ifndef JS_USE_LINK_REGISTER
|
#ifndef JS_USE_LINK_REGISTER
|
||||||
// The first value contains the return addres,
|
// The first value contains the return addres,
|
||||||
// which we pull into ICTailCallReg for tail calls.
|
// which we pull into ICTailCallReg for tail calls.
|
||||||
|
@ -853,7 +853,7 @@ static const VMFunction HandleDebugTrapInfo =
|
|||||||
JitCode*
|
JitCode*
|
||||||
JitRuntime::generateDebugTrapHandler(JSContext* cx)
|
JitRuntime::generateDebugTrapHandler(JSContext* cx)
|
||||||
{
|
{
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
#ifndef JS_USE_LINK_REGISTER
|
#ifndef JS_USE_LINK_REGISTER
|
||||||
// The first value contains the return addres,
|
// The first value contains the return addres,
|
||||||
// which we pull into ICTailCallReg for tail calls.
|
// which we pull into ICTailCallReg for tail calls.
|
||||||
|
@ -519,7 +519,7 @@ BEGIN_TEST(testAssemblerBuffer_ARM64)
|
|||||||
TempAllocator alloc(&lifo);
|
TempAllocator alloc(&lifo);
|
||||||
JitContext jc(cx, &alloc);
|
JitContext jc(cx, &alloc);
|
||||||
cx->runtime()->getJitRuntime(cx);
|
cx->runtime()->getJitRuntime(cx);
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
|
|
||||||
// Branches to an unbound label.
|
// Branches to an unbound label.
|
||||||
Label lab1;
|
Label lab1;
|
||||||
|
@ -52,6 +52,7 @@ static bool Execute(JSContext* cx, MacroAssembler& masm)
|
|||||||
if (!ExecutableAllocator::makeExecutable(code->raw(), code->bufferSize()))
|
if (!ExecutableAllocator::makeExecutable(code->raw(), code->bufferSize()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
JS::AutoSuppressGCAnalysis suppress;
|
||||||
EnterTest test = code->as<EnterTest>();
|
EnterTest test = code->as<EnterTest>();
|
||||||
test();
|
test();
|
||||||
return true;
|
return true;
|
||||||
@ -59,7 +60,7 @@ static bool Execute(JSContext* cx, MacroAssembler& masm)
|
|||||||
|
|
||||||
BEGIN_TEST(testJitMacroAssembler_truncateDoubleToInt64)
|
BEGIN_TEST(testJitMacroAssembler_truncateDoubleToInt64)
|
||||||
{
|
{
|
||||||
MacroAssembler masm(cx);
|
StackMacroAssembler masm(cx);
|
||||||
|
|
||||||
if (!Prepare(masm))
|
if (!Prepare(masm))
|
||||||
return false;
|
return false;
|
||||||
@ -107,7 +108,7 @@ END_TEST(testJitMacroAssembler_truncateDoubleToInt64)
|
|||||||
|
|
||||||
BEGIN_TEST(testJitMacroAssembler_truncateDoubleToUInt64)
|
BEGIN_TEST(testJitMacroAssembler_truncateDoubleToUInt64)
|
||||||
{
|
{
|
||||||
MacroAssembler masm(cx);
|
StackMacroAssembler masm(cx);
|
||||||
|
|
||||||
if (!Prepare(masm))
|
if (!Prepare(masm))
|
||||||
return false;
|
return false;
|
||||||
@ -159,7 +160,7 @@ END_TEST(testJitMacroAssembler_truncateDoubleToUInt64)
|
|||||||
|
|
||||||
BEGIN_TEST(testJitMacroAssembler_branchDoubleNotInInt64Range)
|
BEGIN_TEST(testJitMacroAssembler_branchDoubleNotInInt64Range)
|
||||||
{
|
{
|
||||||
MacroAssembler masm(cx);
|
StackMacroAssembler masm(cx);
|
||||||
|
|
||||||
if (!Prepare(masm))
|
if (!Prepare(masm))
|
||||||
return false;
|
return false;
|
||||||
@ -213,7 +214,7 @@ END_TEST(testJitMacroAssembler_branchDoubleNotInInt64Range)
|
|||||||
|
|
||||||
BEGIN_TEST(testJitMacroAssembler_branchDoubleNotInUInt64Range)
|
BEGIN_TEST(testJitMacroAssembler_branchDoubleNotInUInt64Range)
|
||||||
{
|
{
|
||||||
MacroAssembler masm(cx);
|
StackMacroAssembler masm(cx);
|
||||||
|
|
||||||
if (!Prepare(masm))
|
if (!Prepare(masm))
|
||||||
return false;
|
return false;
|
||||||
@ -270,7 +271,7 @@ END_TEST(testJitMacroAssembler_branchDoubleNotInUInt64Range)
|
|||||||
|
|
||||||
BEGIN_TEST(testJitMacroAssembler_lshift64)
|
BEGIN_TEST(testJitMacroAssembler_lshift64)
|
||||||
{
|
{
|
||||||
MacroAssembler masm(cx);
|
StackMacroAssembler masm(cx);
|
||||||
|
|
||||||
if (!Prepare(masm))
|
if (!Prepare(masm))
|
||||||
return false;
|
return false;
|
||||||
@ -339,7 +340,7 @@ END_TEST(testJitMacroAssembler_lshift64)
|
|||||||
|
|
||||||
BEGIN_TEST(testJitMacroAssembler_rshift64Arithmetic)
|
BEGIN_TEST(testJitMacroAssembler_rshift64Arithmetic)
|
||||||
{
|
{
|
||||||
MacroAssembler masm(cx);
|
StackMacroAssembler masm(cx);
|
||||||
|
|
||||||
if (!Prepare(masm))
|
if (!Prepare(masm))
|
||||||
return false;
|
return false;
|
||||||
@ -407,7 +408,7 @@ END_TEST(testJitMacroAssembler_rshift64Arithmetic)
|
|||||||
|
|
||||||
BEGIN_TEST(testJitMacroAssembler_rshift64)
|
BEGIN_TEST(testJitMacroAssembler_rshift64)
|
||||||
{
|
{
|
||||||
MacroAssembler masm(cx);
|
StackMacroAssembler masm(cx);
|
||||||
|
|
||||||
if (!Prepare(masm))
|
if (!Prepare(masm))
|
||||||
return false;
|
return false;
|
||||||
|
@ -90,7 +90,7 @@ BEGIN_TEST(testJitMoveEmitterCycles_simple)
|
|||||||
JitContext jc(cx, &alloc);
|
JitContext jc(cx, &alloc);
|
||||||
AutoFlushICache afc("test");
|
AutoFlushICache afc("test");
|
||||||
|
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
MoveEmitter mover(masm);
|
MoveEmitter mover(masm);
|
||||||
MoveResolver mr;
|
MoveResolver mr;
|
||||||
mr.setAllocator(alloc);
|
mr.setAllocator(alloc);
|
||||||
@ -131,7 +131,7 @@ BEGIN_TEST(testJitMoveEmitterCycles_autogen)
|
|||||||
TempAllocator alloc(&lifo);
|
TempAllocator alloc(&lifo);
|
||||||
JitContext jc(cx, &alloc);
|
JitContext jc(cx, &alloc);
|
||||||
AutoFlushICache afc("test");
|
AutoFlushICache afc("test");
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
MoveEmitter mover(masm);
|
MoveEmitter mover(masm);
|
||||||
MoveResolver mr;
|
MoveResolver mr;
|
||||||
mr.setAllocator(alloc);
|
mr.setAllocator(alloc);
|
||||||
@ -218,7 +218,7 @@ BEGIN_TEST(testJitMoveEmitterCycles_autogen2)
|
|||||||
TempAllocator alloc(&lifo);
|
TempAllocator alloc(&lifo);
|
||||||
JitContext jc(cx, &alloc);
|
JitContext jc(cx, &alloc);
|
||||||
AutoFlushICache afc("test");
|
AutoFlushICache afc("test");
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
MoveEmitter mover(masm);
|
MoveEmitter mover(masm);
|
||||||
MoveResolver mr;
|
MoveResolver mr;
|
||||||
mr.setAllocator(alloc);
|
mr.setAllocator(alloc);
|
||||||
@ -317,7 +317,7 @@ BEGIN_TEST(testJitMoveEmitterCycles_autogen3)
|
|||||||
TempAllocator alloc(&lifo);
|
TempAllocator alloc(&lifo);
|
||||||
JitContext jc(cx, &alloc);
|
JitContext jc(cx, &alloc);
|
||||||
AutoFlushICache afc("test");
|
AutoFlushICache afc("test");
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
MoveEmitter mover(masm);
|
MoveEmitter mover(masm);
|
||||||
MoveResolver mr;
|
MoveResolver mr;
|
||||||
mr.setAllocator(alloc);
|
mr.setAllocator(alloc);
|
||||||
|
@ -73,7 +73,7 @@ BEGIN_TEST(testJitMoveEmitterCycles_simple)
|
|||||||
TempAllocator alloc(&lifo);
|
TempAllocator alloc(&lifo);
|
||||||
JitContext jc(cx, &alloc);
|
JitContext jc(cx, &alloc);
|
||||||
cx->runtime()->getJitRuntime(cx);
|
cx->runtime()->getJitRuntime(cx);
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
MoveEmitter mover(masm);
|
MoveEmitter mover(masm);
|
||||||
MoveResolver mr;
|
MoveResolver mr;
|
||||||
mr.setAllocator(alloc);
|
mr.setAllocator(alloc);
|
||||||
@ -122,7 +122,7 @@ BEGIN_TEST(testJitMoveEmitterCycles_autogen)
|
|||||||
TempAllocator alloc(&lifo);
|
TempAllocator alloc(&lifo);
|
||||||
JitContext jc(cx, &alloc);
|
JitContext jc(cx, &alloc);
|
||||||
cx->runtime()->getJitRuntime(cx);
|
cx->runtime()->getJitRuntime(cx);
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
MoveEmitter mover(masm);
|
MoveEmitter mover(masm);
|
||||||
MoveResolver mr;
|
MoveResolver mr;
|
||||||
mr.setAllocator(alloc);
|
mr.setAllocator(alloc);
|
||||||
@ -249,7 +249,7 @@ BEGIN_TEST(testJitMoveEmitterCycles_autogen2)
|
|||||||
TempAllocator alloc(&lifo);
|
TempAllocator alloc(&lifo);
|
||||||
JitContext jc(cx, &alloc);
|
JitContext jc(cx, &alloc);
|
||||||
cx->runtime()->getJitRuntime(cx);
|
cx->runtime()->getJitRuntime(cx);
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
MoveEmitter mover(masm);
|
MoveEmitter mover(masm);
|
||||||
MoveResolver mr;
|
MoveResolver mr;
|
||||||
mr.setAllocator(alloc);
|
mr.setAllocator(alloc);
|
||||||
@ -394,7 +394,7 @@ BEGIN_TEST(testJitMoveEmitterCycles_autogen3)
|
|||||||
TempAllocator alloc(&lifo);
|
TempAllocator alloc(&lifo);
|
||||||
JitContext jc(cx, &alloc);
|
JitContext jc(cx, &alloc);
|
||||||
cx->runtime()->getJitRuntime(cx);
|
cx->runtime()->getJitRuntime(cx);
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
MoveEmitter mover(masm);
|
MoveEmitter mover(masm);
|
||||||
MoveResolver mr;
|
MoveResolver mr;
|
||||||
mr.setAllocator(alloc);
|
mr.setAllocator(alloc);
|
||||||
@ -537,7 +537,7 @@ BEGIN_TEST(testJitMoveEmitterCycles_bug1299147_1)
|
|||||||
TempAllocator alloc(&lifo);
|
TempAllocator alloc(&lifo);
|
||||||
JitContext jc(cx, &alloc);
|
JitContext jc(cx, &alloc);
|
||||||
cx->runtime()->getJitRuntime(cx);
|
cx->runtime()->getJitRuntime(cx);
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
MoveEmitter mover(masm);
|
MoveEmitter mover(masm);
|
||||||
MoveResolver mr;
|
MoveResolver mr;
|
||||||
mr.setAllocator(alloc);
|
mr.setAllocator(alloc);
|
||||||
@ -589,7 +589,7 @@ BEGIN_TEST(testJitMoveEmitterCycles_bug1299147)
|
|||||||
TempAllocator alloc(&lifo);
|
TempAllocator alloc(&lifo);
|
||||||
JitContext jc(cx, &alloc);
|
JitContext jc(cx, &alloc);
|
||||||
cx->runtime()->getJitRuntime(cx);
|
cx->runtime()->getJitRuntime(cx);
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
MoveEmitter mover(masm);
|
MoveEmitter mover(masm);
|
||||||
MoveResolver mr;
|
MoveResolver mr;
|
||||||
mr.setAllocator(alloc);
|
mr.setAllocator(alloc);
|
||||||
|
@ -81,7 +81,7 @@ UnboxedLayout::makeConstructorCode(JSContext* cx, HandleObjectGroup group)
|
|||||||
|
|
||||||
JitContext jitContext(cx, nullptr);
|
JitContext jitContext(cx, nullptr);
|
||||||
|
|
||||||
MacroAssembler masm;
|
StackMacroAssembler masm;
|
||||||
|
|
||||||
Register propertiesReg, newKindReg;
|
Register propertiesReg, newKindReg;
|
||||||
#ifdef JS_CODEGEN_X86
|
#ifdef JS_CODEGEN_X86
|
||||||
|
@ -9877,7 +9877,7 @@ js::wasm::BaselineCompileFunctions(const ModuleEnvironment& env, LifoAlloc& lifo
|
|||||||
TempAllocator alloc(&lifo);
|
TempAllocator alloc(&lifo);
|
||||||
JitContext jitContext(&alloc);
|
JitContext jitContext(&alloc);
|
||||||
MOZ_ASSERT(IsCompilingWasm());
|
MOZ_ASSERT(IsCompilingWasm());
|
||||||
MacroAssembler masm(MacroAssembler::WasmToken(), alloc);
|
WasmMacroAssembler masm(alloc);
|
||||||
|
|
||||||
// Swap in already-allocated empty vectors to avoid malloc/free.
|
// Swap in already-allocated empty vectors to avoid malloc/free.
|
||||||
MOZ_ASSERT(code->empty());
|
MOZ_ASSERT(code->empty());
|
||||||
|
@ -936,7 +936,7 @@ wasm::EnsureBuiltinThunksInitialized()
|
|||||||
|
|
||||||
LifoAlloc lifo(BUILTIN_THUNK_LIFO_SIZE);
|
LifoAlloc lifo(BUILTIN_THUNK_LIFO_SIZE);
|
||||||
TempAllocator tempAlloc(&lifo);
|
TempAllocator tempAlloc(&lifo);
|
||||||
MacroAssembler masm(MacroAssembler::WasmToken(), tempAlloc);
|
WasmMacroAssembler masm(tempAlloc);
|
||||||
|
|
||||||
for (auto sym : MakeEnumeratedRange(SymbolicAddress::Limit)) {
|
for (auto sym : MakeEnumeratedRange(SymbolicAddress::Limit)) {
|
||||||
if (!NeedsBuiltinThunk(sym)) {
|
if (!NeedsBuiltinThunk(sym)) {
|
||||||
|
@ -678,7 +678,7 @@ LazyStubTier::createMany(const Uint32Vector& funcExportIndices, const CodeTier&
|
|||||||
LifoAlloc lifo(LAZY_STUB_LIFO_DEFAULT_CHUNK_SIZE);
|
LifoAlloc lifo(LAZY_STUB_LIFO_DEFAULT_CHUNK_SIZE);
|
||||||
TempAllocator alloc(&lifo);
|
TempAllocator alloc(&lifo);
|
||||||
JitContext jitContext(&alloc);
|
JitContext jitContext(&alloc);
|
||||||
MacroAssembler masm(MacroAssembler::WasmToken(), alloc);
|
WasmMacroAssembler masm(alloc);
|
||||||
|
|
||||||
const CodeRangeVector& moduleRanges = codeTier.metadata().codeRanges;
|
const CodeRangeVector& moduleRanges = codeTier.metadata().codeRanges;
|
||||||
const FuncExportVector& funcExports = codeTier.metadata().funcExports;
|
const FuncExportVector& funcExports = codeTier.metadata().funcExports;
|
||||||
|
@ -77,7 +77,7 @@ ModuleGenerator::ModuleGenerator(const CompileArgs& args, ModuleEnvironment* env
|
|||||||
taskState_(mutexid::WasmCompileTaskState),
|
taskState_(mutexid::WasmCompileTaskState),
|
||||||
lifo_(GENERATOR_LIFO_DEFAULT_CHUNK_SIZE),
|
lifo_(GENERATOR_LIFO_DEFAULT_CHUNK_SIZE),
|
||||||
masmAlloc_(&lifo_),
|
masmAlloc_(&lifo_),
|
||||||
masm_(MacroAssembler::WasmToken(), masmAlloc_),
|
masm_(masmAlloc_),
|
||||||
oldTrapCodeOffsets_(),
|
oldTrapCodeOffsets_(),
|
||||||
debugTrapCodeOffset_(),
|
debugTrapCodeOffset_(),
|
||||||
lastPatchedCallSite_(0),
|
lastPatchedCallSite_(0),
|
||||||
|
@ -168,7 +168,7 @@ class MOZ_STACK_CLASS ModuleGenerator
|
|||||||
LifoAlloc lifo_;
|
LifoAlloc lifo_;
|
||||||
jit::JitContext jcx_;
|
jit::JitContext jcx_;
|
||||||
jit::TempAllocator masmAlloc_;
|
jit::TempAllocator masmAlloc_;
|
||||||
jit::MacroAssembler masm_;
|
jit::WasmMacroAssembler masm_;
|
||||||
Uint32Vector funcToCodeRange_;
|
Uint32Vector funcToCodeRange_;
|
||||||
OldTrapOffsetArray oldTrapCodeOffsets_;
|
OldTrapOffsetArray oldTrapCodeOffsets_;
|
||||||
uint32_t debugTrapCodeOffset_;
|
uint32_t debugTrapCodeOffset_;
|
||||||
|
@ -4371,7 +4371,7 @@ wasm::IonCompileFunctions(const ModuleEnvironment& env, LifoAlloc& lifo,
|
|||||||
TempAllocator alloc(&lifo);
|
TempAllocator alloc(&lifo);
|
||||||
JitContext jitContext(&alloc);
|
JitContext jitContext(&alloc);
|
||||||
MOZ_ASSERT(IsCompilingWasm());
|
MOZ_ASSERT(IsCompilingWasm());
|
||||||
MacroAssembler masm(MacroAssembler::WasmToken(), alloc);
|
WasmMacroAssembler masm(alloc);
|
||||||
|
|
||||||
// Swap in already-allocated empty vectors to avoid malloc/free.
|
// Swap in already-allocated empty vectors to avoid malloc/free.
|
||||||
MOZ_ASSERT(code->empty());
|
MOZ_ASSERT(code->empty());
|
||||||
|
@ -1010,7 +1010,7 @@ wasm::GenerateImportFunctions(const ModuleEnvironment& env, const FuncImportVect
|
|||||||
{
|
{
|
||||||
LifoAlloc lifo(STUBS_LIFO_DEFAULT_CHUNK_SIZE);
|
LifoAlloc lifo(STUBS_LIFO_DEFAULT_CHUNK_SIZE);
|
||||||
TempAllocator alloc(&lifo);
|
TempAllocator alloc(&lifo);
|
||||||
MacroAssembler masm(MacroAssembler::WasmToken(), alloc);
|
WasmMacroAssembler masm(alloc);
|
||||||
|
|
||||||
for (uint32_t funcIndex = 0; funcIndex < imports.length(); funcIndex++) {
|
for (uint32_t funcIndex = 0; funcIndex < imports.length(); funcIndex++) {
|
||||||
const FuncImport& fi = imports[funcIndex];
|
const FuncImport& fi = imports[funcIndex];
|
||||||
@ -1772,7 +1772,7 @@ wasm::GenerateStubs(const ModuleEnvironment& env, const FuncImportVector& import
|
|||||||
{
|
{
|
||||||
LifoAlloc lifo(STUBS_LIFO_DEFAULT_CHUNK_SIZE);
|
LifoAlloc lifo(STUBS_LIFO_DEFAULT_CHUNK_SIZE);
|
||||||
TempAllocator alloc(&lifo);
|
TempAllocator alloc(&lifo);
|
||||||
MacroAssembler masm(MacroAssembler::WasmToken(), alloc);
|
WasmMacroAssembler masm(alloc);
|
||||||
|
|
||||||
// Swap in already-allocated empty vectors to avoid malloc/free.
|
// Swap in already-allocated empty vectors to avoid malloc/free.
|
||||||
if (!code->swap(masm))
|
if (!code->swap(masm))
|
||||||
|
Loading…
Reference in New Issue
Block a user