mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 931039 - Rename IonRuntime/IonCompartment to JitRuntime/JitCompartment. r=h4writer
--HG-- rename : js/src/jit/IonCompartment.h => js/src/jit/JitCompartment.h
This commit is contained in:
parent
54276f7449
commit
7a574949b8
@ -674,7 +674,7 @@ js::gc::MarkRuntime(JSTracer *trc, bool useSavedRoots)
|
||||
MarkAtoms(trc);
|
||||
rt->staticStrings.trace(trc);
|
||||
#ifdef JS_ION
|
||||
jit::IonRuntime::Mark(trc);
|
||||
jit::JitRuntime::Mark(trc);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#ifdef JS_ION
|
||||
#include "jit/BaselineJIT.h"
|
||||
#include "jit/Ion.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#endif
|
||||
#include "vm/Debugger.h"
|
||||
#include "vm/Runtime.h"
|
||||
@ -224,8 +224,8 @@ Zone::discardJitCode(FreeOp *fop)
|
||||
|
||||
for (CompartmentsInZoneIter comp(this); !comp.done(); comp.next()) {
|
||||
/* Free optimized baseline stubs. */
|
||||
if (comp->ionCompartment())
|
||||
comp->ionCompartment()->optimizedStubSpace()->free();
|
||||
if (comp->jitCompartment())
|
||||
comp->jitCompartment()->optimizedStubSpace()->free();
|
||||
|
||||
comp->types.clearCompilerOutputs(fop);
|
||||
}
|
||||
|
@ -481,7 +481,7 @@ HandleException(PEXCEPTION_POINTERS exception)
|
||||
return false;
|
||||
AutoSetHandlingSignal handling(rt);
|
||||
|
||||
if (rt->ionRuntime() && rt->ionRuntime()->handleAccessViolation(rt, faultingAddress))
|
||||
if (rt->jitRuntime() && rt->jitRuntime()->handleAccessViolation(rt, faultingAddress))
|
||||
return true;
|
||||
|
||||
AsmJSActivation *activation = InnermostAsmJSActivation();
|
||||
@ -678,7 +678,7 @@ HandleMachException(JSRuntime *rt, const ExceptionRequest &request)
|
||||
|
||||
void *faultingAddress = (void*)request.body.code[1];
|
||||
|
||||
if (rt->ionRuntime() && rt->ionRuntime()->handleAccessViolation(rt, faultingAddress))
|
||||
if (rt->jitRuntime() && rt->jitRuntime()->handleAccessViolation(rt, faultingAddress))
|
||||
return true;
|
||||
|
||||
AsmJSActivation *activation = rt->mainThread.asmJSActivationStackFromAnyThread();
|
||||
@ -912,7 +912,7 @@ HandleSignal(int signum, siginfo_t *info, void *ctx)
|
||||
return false;
|
||||
AutoSetHandlingSignal handling(rt);
|
||||
|
||||
if (rt->ionRuntime() && rt->ionRuntime()->handleAccessViolation(rt, faultingAddress))
|
||||
if (rt->jitRuntime() && rt->jitRuntime()->handleAccessViolation(rt, faultingAddress))
|
||||
return true;
|
||||
|
||||
AsmJSActivation *activation = InnermostAsmJSActivation();
|
||||
|
@ -16,7 +16,7 @@ struct JSRuntime;
|
||||
|
||||
namespace js {
|
||||
|
||||
// Returns whether signal handlers for asm.js and for IonRuntime access
|
||||
// Returns whether signal handlers for asm.js and for JitRuntime access
|
||||
// violations have been installed.
|
||||
bool
|
||||
EnsureAsmJSSignalHandlersInstalled(JSRuntime *rt);
|
||||
|
@ -10,8 +10,8 @@
|
||||
|
||||
#include "jit/BaselineJIT.h"
|
||||
#include "jit/Ion.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/IonSpewer.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#include "jit/SnapshotReader.h"
|
||||
|
||||
#include "jit/IonFrameIterator-inl.h"
|
||||
|
@ -103,7 +103,7 @@ static const uint32_t BAILOUT_RETURN_OK = 0;
|
||||
static const uint32_t BAILOUT_RETURN_FATAL_ERROR = 1;
|
||||
static const uint32_t BAILOUT_RETURN_OVERRECURSED = 2;
|
||||
|
||||
class IonCompartment;
|
||||
class JitCompartment;
|
||||
|
||||
// BailoutStack is an architecture specific pointer to the stack, given by the
|
||||
// bailout handler.
|
||||
|
@ -380,12 +380,12 @@ static inline void*
|
||||
GetStubReturnAddress(JSContext *cx, jsbytecode *pc)
|
||||
{
|
||||
if (IsGetPropPC(pc))
|
||||
return cx->compartment()->ionCompartment()->baselineGetPropReturnAddr();
|
||||
return cx->compartment()->jitCompartment()->baselineGetPropReturnAddr();
|
||||
if (IsSetPropPC(pc))
|
||||
return cx->compartment()->ionCompartment()->baselineSetPropReturnAddr();
|
||||
return cx->compartment()->jitCompartment()->baselineSetPropReturnAddr();
|
||||
// This should be a call op of some kind, now.
|
||||
JS_ASSERT(IsCallPC(pc));
|
||||
return cx->compartment()->ionCompartment()->baselineCallReturnAddr();
|
||||
return cx->compartment()->jitCompartment()->baselineCallReturnAddr();
|
||||
}
|
||||
|
||||
// For every inline frame, we write out the following data:
|
||||
@ -1179,7 +1179,7 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
|
||||
|
||||
// Push return address into the ArgumentsRectifier code, immediately after the ioncode
|
||||
// call.
|
||||
void *rectReturnAddr = cx->runtime()->ionRuntime()->getArgumentsRectifierReturnAddr();
|
||||
void *rectReturnAddr = cx->runtime()->jitRuntime()->getArgumentsRectifierReturnAddr();
|
||||
JS_ASSERT(rectReturnAddr);
|
||||
if (!builder.writePtr(rectReturnAddr, "ReturnAddr"))
|
||||
return false;
|
||||
|
@ -619,7 +619,7 @@ BaselineCompiler::emitDebugTrap()
|
||||
bool enabled = script->stepModeEnabled() || script->hasBreakpointsAt(pc);
|
||||
|
||||
// Emit patchable call to debug trap handler.
|
||||
IonCode *handler = cx->runtime()->ionRuntime()->debugTrapHandler(cx);
|
||||
IonCode *handler = cx->runtime()->jitRuntime()->debugTrapHandler(cx);
|
||||
mozilla::DebugOnly<CodeOffsetLabel> offset = masm.toggledCall(handler, enabled);
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -564,11 +564,11 @@ ICUpdatedStub::initUpdatingChain(JSContext *cx, ICStubSpace *space)
|
||||
IonCode *
|
||||
ICStubCompiler::getStubCode()
|
||||
{
|
||||
IonCompartment *ion = cx->compartment()->ionCompartment();
|
||||
JitCompartment *comp = cx->compartment()->jitCompartment();
|
||||
|
||||
// Check for existing cached stubcode.
|
||||
uint32_t stubKey = getKey();
|
||||
IonCode *stubCode = ion->getStubCode(stubKey);
|
||||
IonCode *stubCode = comp->getStubCode(stubKey);
|
||||
if (stubCode)
|
||||
return stubCode;
|
||||
|
||||
@ -578,7 +578,7 @@ ICStubCompiler::getStubCode()
|
||||
masm.setSecondScratchReg(BaselineSecondScratchReg);
|
||||
#endif
|
||||
|
||||
AutoFlushCache afc("ICStubCompiler::getStubCode", cx->runtime()->ionRuntime());
|
||||
AutoFlushCache afc("ICStubCompiler::getStubCode", cx->runtime()->jitRuntime());
|
||||
if (!generateStubCode(masm))
|
||||
return nullptr;
|
||||
Linker linker(masm);
|
||||
@ -595,7 +595,7 @@ ICStubCompiler::getStubCode()
|
||||
newStubCode->togglePreBarriers(true);
|
||||
|
||||
// Cache newly compiled stubcode.
|
||||
if (!ion->putStubCode(stubKey, newStubCode))
|
||||
if (!comp->putStubCode(stubKey, newStubCode))
|
||||
return nullptr;
|
||||
|
||||
JS_ASSERT(entersStubFrame_ == ICStub::CanMakeCalls(kind));
|
||||
@ -610,7 +610,7 @@ ICStubCompiler::getStubCode()
|
||||
bool
|
||||
ICStubCompiler::tailCallVM(const VMFunction &fun, MacroAssembler &masm)
|
||||
{
|
||||
IonCode *code = cx->runtime()->ionRuntime()->getVMWrapper(fun);
|
||||
IonCode *code = cx->runtime()->jitRuntime()->getVMWrapper(fun);
|
||||
if (!code)
|
||||
return false;
|
||||
|
||||
@ -622,7 +622,7 @@ ICStubCompiler::tailCallVM(const VMFunction &fun, MacroAssembler &masm)
|
||||
bool
|
||||
ICStubCompiler::callVM(const VMFunction &fun, MacroAssembler &masm)
|
||||
{
|
||||
IonCode *code = cx->runtime()->ionRuntime()->getVMWrapper(fun);
|
||||
IonCode *code = cx->runtime()->jitRuntime()->getVMWrapper(fun);
|
||||
if (!code)
|
||||
return false;
|
||||
|
||||
@ -633,7 +633,7 @@ ICStubCompiler::callVM(const VMFunction &fun, MacroAssembler &masm)
|
||||
bool
|
||||
ICStubCompiler::callTypeUpdateIC(MacroAssembler &masm, uint32_t objectOffset)
|
||||
{
|
||||
IonCode *code = cx->runtime()->ionRuntime()->getVMWrapper(DoTypeUpdateFallbackInfo);
|
||||
IonCode *code = cx->runtime()->jitRuntime()->getVMWrapper(DoTypeUpdateFallbackInfo);
|
||||
if (!code)
|
||||
return false;
|
||||
|
||||
@ -811,7 +811,7 @@ EnsureCanEnterIon(JSContext *cx, ICUseCount_Fallback *stub, BaselineFrame *frame
|
||||
|
||||
//
|
||||
// The following data is kept in a temporary heap-allocated buffer, stored in
|
||||
// IonRuntime (high memory addresses at top, low at bottom):
|
||||
// JitRuntime (high memory addresses at top, low at bottom):
|
||||
//
|
||||
// +----->+=================================+ -- <---- High Address
|
||||
// | | | |
|
||||
@ -856,7 +856,7 @@ PrepareOsrTempData(JSContext *cx, ICUseCount_Fallback *stub, BaselineFrame *fram
|
||||
size_t totalSpace = AlignBytes(frameSpace, sizeof(Value)) +
|
||||
AlignBytes(ionOsrTempDataSpace, sizeof(Value));
|
||||
|
||||
IonOsrTempData *info = (IonOsrTempData *)cx->runtime()->getIonRuntime(cx)->allocateOsrTempData(totalSpace);
|
||||
IonOsrTempData *info = (IonOsrTempData *)cx->runtime()->getJitRuntime(cx)->allocateOsrTempData(totalSpace);
|
||||
if (!info)
|
||||
return nullptr;
|
||||
|
||||
@ -4046,7 +4046,7 @@ ICGetElemNativeCompiler::emitCallScripted(MacroAssembler &masm, Register objReg)
|
||||
JS_ASSERT(ArgumentsRectifierReg != code);
|
||||
|
||||
IonCode *argumentsRectifier =
|
||||
cx->runtime()->ionRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
cx->runtime()->jitRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
|
||||
masm.movePtr(ImmGCPtr(argumentsRectifier), code);
|
||||
masm.loadPtr(Address(code, IonCode::offsetOfCode()), code);
|
||||
@ -6079,7 +6079,7 @@ ICGetProp_Fallback::Compiler::postGenerateStubCode(MacroAssembler &masm, Handle<
|
||||
{
|
||||
CodeOffsetLabel offset(returnOffset_);
|
||||
offset.fixup(&masm);
|
||||
cx->compartment()->ionCompartment()->initBaselineGetPropReturnAddr(code->raw() + offset.offset());
|
||||
cx->compartment()->jitCompartment()->initBaselineGetPropReturnAddr(code->raw() + offset.offset());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -6292,7 +6292,7 @@ ICGetProp_CallScripted::Compiler::generateStubCode(MacroAssembler &masm)
|
||||
JS_ASSERT(ArgumentsRectifierReg != code);
|
||||
|
||||
IonCode *argumentsRectifier =
|
||||
cx->runtime()->ionRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
cx->runtime()->jitRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
|
||||
masm.movePtr(ImmGCPtr(argumentsRectifier), code);
|
||||
masm.loadPtr(Address(code, IonCode::offsetOfCode()), code);
|
||||
@ -6927,7 +6927,7 @@ ICSetProp_Fallback::Compiler::postGenerateStubCode(MacroAssembler &masm, Handle<
|
||||
{
|
||||
CodeOffsetLabel offset(returnOffset_);
|
||||
offset.fixup(&masm);
|
||||
cx->compartment()->ionCompartment()->initBaselineSetPropReturnAddr(code->raw() + offset.offset());
|
||||
cx->compartment()->jitCompartment()->initBaselineSetPropReturnAddr(code->raw() + offset.offset());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -7199,7 +7199,7 @@ ICSetProp_CallScripted::Compiler::generateStubCode(MacroAssembler &masm)
|
||||
JS_ASSERT(ArgumentsRectifierReg != code);
|
||||
|
||||
IonCode *argumentsRectifier =
|
||||
cx->runtime()->ionRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
cx->runtime()->jitRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
|
||||
masm.movePtr(ImmGCPtr(argumentsRectifier), code);
|
||||
masm.loadPtr(Address(code, IonCode::offsetOfCode()), code);
|
||||
@ -7954,7 +7954,7 @@ ICCall_Fallback::Compiler::postGenerateStubCode(MacroAssembler &masm, Handle<Ion
|
||||
{
|
||||
CodeOffsetLabel offset(returnOffset_);
|
||||
offset.fixup(&masm);
|
||||
cx->compartment()->ionCompartment()->initBaselineCallReturnAddr(code->raw() + offset.offset());
|
||||
cx->compartment()->jitCompartment()->initBaselineCallReturnAddr(code->raw() + offset.offset());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -8123,7 +8123,7 @@ ICCallScriptedCompiler::generateStubCode(MacroAssembler &masm)
|
||||
JS_ASSERT(ArgumentsRectifierReg != argcReg);
|
||||
|
||||
IonCode *argumentsRectifier =
|
||||
cx->runtime()->ionRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
cx->runtime()->jitRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
|
||||
masm.movePtr(ImmGCPtr(argumentsRectifier), code);
|
||||
masm.loadPtr(Address(code, IonCode::offsetOfCode()), code);
|
||||
@ -8384,7 +8384,7 @@ ICCall_ScriptedApplyArray::Compiler::generateStubCode(MacroAssembler &masm)
|
||||
JS_ASSERT(ArgumentsRectifierReg != argcReg);
|
||||
|
||||
IonCode *argumentsRectifier =
|
||||
cx->runtime()->ionRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
cx->runtime()->jitRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
|
||||
masm.movePtr(ImmGCPtr(argumentsRectifier), target);
|
||||
masm.loadPtr(Address(target, IonCode::offsetOfCode()), target);
|
||||
@ -8495,7 +8495,7 @@ ICCall_ScriptedApplyArguments::Compiler::generateStubCode(MacroAssembler &masm)
|
||||
JS_ASSERT(ArgumentsRectifierReg != argcReg);
|
||||
|
||||
IonCode *argumentsRectifier =
|
||||
cx->runtime()->ionRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
cx->runtime()->jitRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
|
||||
masm.movePtr(ImmGCPtr(argumentsRectifier), target);
|
||||
masm.loadPtr(Address(target, IonCode::offsetOfCode()), target);
|
||||
|
@ -1074,7 +1074,7 @@ class ICStubCompiler
|
||||
ICStubSpace *getStubSpace(JSScript *script) {
|
||||
if (ICStub::CanMakeCalls(kind))
|
||||
return script->baselineScript()->fallbackStubSpace();
|
||||
return script->compartment()->ionCompartment()->optimizedStubSpace();
|
||||
return script->compartment()->jitCompartment()->optimizedStubSpace();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -99,7 +99,7 @@ EnterBaseline(JSContext *cx, EnterJitData &data)
|
||||
JS_ASSERT(jit::IsBaselineEnabled(cx));
|
||||
JS_ASSERT_IF(data.osrFrame, CheckFrame(data.osrFrame));
|
||||
|
||||
EnterIonCode enter = cx->runtime()->ionRuntime()->enterBaseline();
|
||||
EnterIonCode enter = cx->runtime()->jitRuntime()->enterBaseline();
|
||||
|
||||
// Caller must construct |this| before invoking the Ion function.
|
||||
JS_ASSERT_IF(data.constructing, data.maxArgv[0].isObject());
|
||||
@ -110,7 +110,7 @@ EnterBaseline(JSContext *cx, EnterJitData &data)
|
||||
IonContext ictx(cx, nullptr);
|
||||
JitActivation activation(cx, data.constructing);
|
||||
JSAutoResolveFlags rf(cx, RESOLVE_INFER);
|
||||
AutoFlushInhibitor afi(cx->runtime()->ionRuntime());
|
||||
AutoFlushInhibitor afi(cx->runtime()->jitRuntime());
|
||||
|
||||
if (data.osrFrame)
|
||||
data.osrFrame->setRunningInJit();
|
||||
@ -132,7 +132,7 @@ EnterBaseline(JSContext *cx, EnterJitData &data)
|
||||
data.result = data.maxArgv[0];
|
||||
|
||||
// Release temporary buffer used for OSR into Ion.
|
||||
cx->runtime()->getIonRuntime(cx)->freeOsrTempData();
|
||||
cx->runtime()->getJitRuntime(cx)->freeOsrTempData();
|
||||
|
||||
JS_ASSERT_IF(data.result.isMagic(), data.result.isMagic(JS_ION_ERROR));
|
||||
return data.result.isMagic() ? IonExec_Error : IonExec_Ok;
|
||||
@ -230,7 +230,7 @@ jit::BaselineCompile(JSContext *cx, HandleScript script)
|
||||
if (!compiler.init())
|
||||
return Method_Error;
|
||||
|
||||
AutoFlushCache afc("BaselineJIT", cx->runtime()->ionRuntime());
|
||||
AutoFlushCache afc("BaselineJIT", cx->runtime()->jitRuntime());
|
||||
MethodStatus status = compiler.compile();
|
||||
|
||||
JS_ASSERT_IF(status == Method_Compiled, script->hasBaselineScript());
|
||||
@ -258,7 +258,7 @@ CanEnterBaselineJIT(JSContext *cx, HandleScript script, bool osr)
|
||||
if (script->length > BaselineScript::MAX_JSSCRIPT_LENGTH)
|
||||
return Method_CantCompile;
|
||||
|
||||
if (!cx->compartment()->ensureIonCompartmentExists(cx))
|
||||
if (!cx->compartment()->ensureJitCompartmentExists(cx))
|
||||
return Method_Error;
|
||||
|
||||
if (script->hasBaselineScript())
|
||||
@ -750,7 +750,7 @@ BaselineScript::toggleDebugTraps(JSScript *script, jsbytecode *pc)
|
||||
|
||||
JSRuntime *rt = script->runtimeFromMainThread();
|
||||
IonContext ictx(rt, script->compartment(), nullptr);
|
||||
AutoFlushCache afc("DebugTraps", rt->ionRuntime());
|
||||
AutoFlushCache afc("DebugTraps", rt->jitRuntime());
|
||||
|
||||
for (uint32_t i = 0; i < numPCMappingIndexEntries(); i++) {
|
||||
PCMappingIndexEntry &entry = pcMappingIndexEntry(i);
|
||||
@ -885,7 +885,7 @@ jit::FinishDiscardBaselineScript(FreeOp *fop, JSScript *script)
|
||||
}
|
||||
|
||||
void
|
||||
jit::IonCompartment::toggleBaselineStubBarriers(bool enabled)
|
||||
jit::JitCompartment::toggleBaselineStubBarriers(bool enabled)
|
||||
{
|
||||
for (ICStubCodeMap::Enum e(*stubCodes_); !e.empty(); e.popFront()) {
|
||||
IonCode *code = *e.front().value.unsafeGet();
|
||||
|
@ -1858,7 +1858,7 @@ CodeGenerator::visitCallGeneric(LCallGeneric *call)
|
||||
JS_ASSERT(!call->hasSingleTarget());
|
||||
|
||||
// Generate an ArgumentsRectifier.
|
||||
IonCode *argumentsRectifier = gen->ionRuntime()->getArgumentsRectifier(executionMode);
|
||||
IonCode *argumentsRectifier = gen->jitRuntime()->getArgumentsRectifier(executionMode);
|
||||
|
||||
masm.checkStackAlignment();
|
||||
|
||||
@ -2238,7 +2238,7 @@ CodeGenerator::visitApplyArgsGeneric(LApplyArgsGeneric *apply)
|
||||
masm.bind(&underflow);
|
||||
|
||||
// Hardcode the address of the argumentsRectifier code.
|
||||
IonCode *argumentsRectifier = gen->ionRuntime()->getArgumentsRectifier(executionMode);
|
||||
IonCode *argumentsRectifier = gen->jitRuntime()->getArgumentsRectifier(executionMode);
|
||||
|
||||
JS_ASSERT(ArgumentsRectifierReg != objreg);
|
||||
masm.movePtr(ImmGCPtr(argumentsRectifier), objreg); // Necessary for GC marking.
|
||||
@ -4347,7 +4347,7 @@ CodeGenerator::emitConcat(LInstruction *lir, Register lhs, Register rhs, Registe
|
||||
return false;
|
||||
|
||||
ExecutionMode mode = gen->info().executionMode();
|
||||
IonCode *stringConcatStub = gen->ionCompartment()->stringConcatStub(mode);
|
||||
IonCode *stringConcatStub = gen->jitCompartment()->stringConcatStub(mode);
|
||||
masm.call(stringConcatStub);
|
||||
masm.branchTestPtr(Assembler::Zero, output, output, ool->entry());
|
||||
|
||||
@ -4421,7 +4421,7 @@ CopyStringChars(MacroAssembler &masm, Register to, Register from, Register len,
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonCompartment::generateStringConcatStub(JSContext *cx, ExecutionMode mode)
|
||||
JitCompartment::generateStringConcatStub(JSContext *cx, ExecutionMode mode)
|
||||
{
|
||||
MacroAssembler masm(cx);
|
||||
|
||||
@ -5674,7 +5674,7 @@ CodeGenerator::generate()
|
||||
return false;
|
||||
|
||||
if (frameClass_ != FrameSizeClass::None()) {
|
||||
deoptTable_ = gen->ionRuntime()->getBailoutTable(frameClass_);
|
||||
deoptTable_ = gen->jitRuntime()->getBailoutTable(frameClass_);
|
||||
if (!deoptTable_)
|
||||
return false;
|
||||
}
|
||||
@ -5763,7 +5763,7 @@ CodeGenerator::link(JSContext *cx, types::CompilerConstraintList *constraints)
|
||||
|
||||
// Make sure we don't segv while filling in the code, to avoid deadlocking
|
||||
// inside the signal handler.
|
||||
cx->runtime()->ionRuntime()->ensureIonCodeAccessible(cx->runtime());
|
||||
cx->runtime()->jitRuntime()->ensureIonCodeAccessible(cx->runtime());
|
||||
|
||||
// Implicit interrupts are used only for sequential code. In parallel mode
|
||||
// use the normal executable allocator so that we cannot segv during
|
||||
|
@ -27,8 +27,8 @@
|
||||
#include "jit/ExecutionModeInlines.h"
|
||||
#include "jit/IonAnalysis.h"
|
||||
#include "jit/IonBuilder.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/IonSpewer.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#include "jit/LICM.h"
|
||||
#include "jit/LinearScan.h"
|
||||
#include "jit/LIR.h"
|
||||
@ -168,7 +168,7 @@ jit::InitializeIon()
|
||||
return true;
|
||||
}
|
||||
|
||||
IonRuntime::IonRuntime()
|
||||
JitRuntime::JitRuntime()
|
||||
: execAlloc_(nullptr),
|
||||
ionAlloc_(nullptr),
|
||||
exceptionTail_(nullptr),
|
||||
@ -187,18 +187,18 @@ IonRuntime::IonRuntime()
|
||||
{
|
||||
}
|
||||
|
||||
IonRuntime::~IonRuntime()
|
||||
JitRuntime::~JitRuntime()
|
||||
{
|
||||
js_delete(functionWrappers_);
|
||||
freeOsrTempData();
|
||||
|
||||
// Note: the operation callback lock is not taken here as IonRuntime is
|
||||
// Note: the operation callback lock is not taken here as JitRuntime is
|
||||
// only destroyed along with its containing JSRuntime.
|
||||
js_delete(ionAlloc_);
|
||||
}
|
||||
|
||||
bool
|
||||
IonRuntime::initialize(JSContext *cx)
|
||||
JitRuntime::initialize(JSContext *cx)
|
||||
{
|
||||
JS_ASSERT(cx->runtime()->currentThreadOwnsOperationCallbackLock());
|
||||
|
||||
@ -206,13 +206,13 @@ IonRuntime::initialize(JSContext *cx)
|
||||
AutoCompartment ac(cx, cx->atomsCompartment());
|
||||
|
||||
IonContext ictx(cx, nullptr);
|
||||
AutoFlushCache afc("IonRuntime::initialize", this);
|
||||
AutoFlushCache afc("JitRuntime::initialize", this);
|
||||
|
||||
execAlloc_ = cx->runtime()->getExecAlloc(cx);
|
||||
if (!execAlloc_)
|
||||
return false;
|
||||
|
||||
if (!cx->compartment()->ensureIonCompartmentExists(cx))
|
||||
if (!cx->compartment()->ensureJitCompartmentExists(cx))
|
||||
return false;
|
||||
|
||||
functionWrappers_ = cx->new_<VMWrapperMap>(cx);
|
||||
@ -299,10 +299,10 @@ IonRuntime::initialize(JSContext *cx)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::debugTrapHandler(JSContext *cx)
|
||||
JitRuntime::debugTrapHandler(JSContext *cx)
|
||||
{
|
||||
if (!debugTrapHandler_) {
|
||||
// IonRuntime code stubs are shared across compartments and have to
|
||||
// JitRuntime code stubs are shared across compartments and have to
|
||||
// be allocated in the atoms compartment.
|
||||
AutoLockForExclusiveAccess lock(cx);
|
||||
AutoCompartment ac(cx, cx->runtime()->atomsCompartment());
|
||||
@ -312,21 +312,21 @@ IonRuntime::debugTrapHandler(JSContext *cx)
|
||||
}
|
||||
|
||||
uint8_t *
|
||||
IonRuntime::allocateOsrTempData(size_t size)
|
||||
JitRuntime::allocateOsrTempData(size_t size)
|
||||
{
|
||||
osrTempData_ = (uint8_t *)js_realloc(osrTempData_, size);
|
||||
return osrTempData_;
|
||||
}
|
||||
|
||||
void
|
||||
IonRuntime::freeOsrTempData()
|
||||
JitRuntime::freeOsrTempData()
|
||||
{
|
||||
js_free(osrTempData_);
|
||||
osrTempData_ = nullptr;
|
||||
}
|
||||
|
||||
JSC::ExecutableAllocator *
|
||||
IonRuntime::createIonAlloc(JSContext *cx)
|
||||
JitRuntime::createIonAlloc(JSContext *cx)
|
||||
{
|
||||
JS_ASSERT(cx->runtime()->currentThreadOwnsOperationCallbackLock());
|
||||
|
||||
@ -339,7 +339,7 @@ IonRuntime::createIonAlloc(JSContext *cx)
|
||||
}
|
||||
|
||||
void
|
||||
IonRuntime::ensureIonCodeProtected(JSRuntime *rt)
|
||||
JitRuntime::ensureIonCodeProtected(JSRuntime *rt)
|
||||
{
|
||||
JS_ASSERT(rt->currentThreadOwnsOperationCallbackLock());
|
||||
|
||||
@ -353,7 +353,7 @@ IonRuntime::ensureIonCodeProtected(JSRuntime *rt)
|
||||
}
|
||||
|
||||
bool
|
||||
IonRuntime::handleAccessViolation(JSRuntime *rt, void *faultingAddress)
|
||||
JitRuntime::handleAccessViolation(JSRuntime *rt, void *faultingAddress)
|
||||
{
|
||||
if (!rt->signalHandlersInstalled() || !ionAlloc_ || !ionAlloc_->codeContains((char *) faultingAddress))
|
||||
return false;
|
||||
@ -376,7 +376,7 @@ IonRuntime::handleAccessViolation(JSRuntime *rt, void *faultingAddress)
|
||||
}
|
||||
|
||||
void
|
||||
IonRuntime::ensureIonCodeAccessible(JSRuntime *rt)
|
||||
JitRuntime::ensureIonCodeAccessible(JSRuntime *rt)
|
||||
{
|
||||
JS_ASSERT(rt->currentThreadOwnsOperationCallbackLock());
|
||||
|
||||
@ -407,7 +407,7 @@ IonRuntime::ensureIonCodeAccessible(JSRuntime *rt)
|
||||
}
|
||||
|
||||
void
|
||||
IonRuntime::patchIonBackedges(JSRuntime *rt, BackedgeTarget target)
|
||||
JitRuntime::patchIonBackedges(JSRuntime *rt, BackedgeTarget target)
|
||||
{
|
||||
#ifndef XP_MACOSX
|
||||
JS_ASSERT(CurrentThreadCanAccessRuntime(rt));
|
||||
@ -430,8 +430,8 @@ void
|
||||
jit::TriggerOperationCallbackForIonCode(JSRuntime *rt,
|
||||
JSRuntime::OperationCallbackTrigger trigger)
|
||||
{
|
||||
IonRuntime *ion = rt->ionRuntime();
|
||||
if (!ion)
|
||||
JitRuntime *jitRuntime = rt->jitRuntime();
|
||||
if (!jitRuntime)
|
||||
return;
|
||||
|
||||
JS_ASSERT(rt->currentThreadOwnsOperationCallbackLock());
|
||||
@ -445,7 +445,7 @@ jit::TriggerOperationCallbackForIonCode(JSRuntime *rt,
|
||||
// patching the backedges, to avoid deadlocking inside the signal
|
||||
// handler.
|
||||
JS_ASSERT(CurrentThreadCanAccessRuntime(rt));
|
||||
ion->ensureIonCodeAccessible(rt);
|
||||
jitRuntime->ensureIonCodeAccessible(rt);
|
||||
break;
|
||||
|
||||
case JSRuntime::TriggerCallbackAnyThread:
|
||||
@ -454,7 +454,7 @@ jit::TriggerOperationCallbackForIonCode(JSRuntime *rt,
|
||||
// signal handler when trying to execute the code. The signal
|
||||
// handler will unprotect the code and patch loop backedges so
|
||||
// that the interrupt handler is invoked afterwards.
|
||||
ion->ensureIonCodeProtected(rt);
|
||||
jitRuntime->ensureIonCodeProtected(rt);
|
||||
break;
|
||||
|
||||
case JSRuntime::TriggerCallbackAnyThreadDontStopIon:
|
||||
@ -467,7 +467,7 @@ jit::TriggerOperationCallbackForIonCode(JSRuntime *rt,
|
||||
}
|
||||
}
|
||||
|
||||
IonCompartment::IonCompartment(IonRuntime *rt)
|
||||
JitCompartment::JitCompartment(JitRuntime *rt)
|
||||
: rt(rt),
|
||||
stubCodes_(nullptr),
|
||||
baselineCallReturnAddr_(nullptr),
|
||||
@ -478,13 +478,13 @@ IonCompartment::IonCompartment(IonRuntime *rt)
|
||||
{
|
||||
}
|
||||
|
||||
IonCompartment::~IonCompartment()
|
||||
JitCompartment::~JitCompartment()
|
||||
{
|
||||
js_delete(stubCodes_);
|
||||
}
|
||||
|
||||
bool
|
||||
IonCompartment::initialize(JSContext *cx)
|
||||
JitCompartment::initialize(JSContext *cx)
|
||||
{
|
||||
stubCodes_ = cx->new_<ICStubCodeMap>(cx);
|
||||
if (!stubCodes_ || !stubCodes_->init())
|
||||
@ -494,7 +494,7 @@ IonCompartment::initialize(JSContext *cx)
|
||||
}
|
||||
|
||||
bool
|
||||
IonCompartment::ensureIonStubsExist(JSContext *cx)
|
||||
JitCompartment::ensureIonStubsExist(JSContext *cx)
|
||||
{
|
||||
if (!stringConcatStub_) {
|
||||
stringConcatStub_ = generateStringConcatStub(cx, SequentialExecution);
|
||||
@ -531,7 +531,7 @@ jit::FinishOffThreadBuilder(IonBuilder *builder)
|
||||
}
|
||||
|
||||
static inline void
|
||||
FinishAllOffThreadCompilations(IonCompartment *ion)
|
||||
FinishAllOffThreadCompilations(JitCompartment *ion)
|
||||
{
|
||||
OffThreadCompilationVector &compilations = ion->finishedOffThreadCompilations();
|
||||
|
||||
@ -543,7 +543,7 @@ FinishAllOffThreadCompilations(IonCompartment *ion)
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
IonRuntime::Mark(JSTracer *trc)
|
||||
JitRuntime::Mark(JSTracer *trc)
|
||||
{
|
||||
JS_ASSERT(!trc->runtime->isHeapMinorCollecting());
|
||||
Zone *zone = trc->runtime->atomsCompartment()->zone();
|
||||
@ -554,7 +554,7 @@ IonRuntime::Mark(JSTracer *trc)
|
||||
}
|
||||
|
||||
void
|
||||
IonCompartment::mark(JSTracer *trc, JSCompartment *compartment)
|
||||
JitCompartment::mark(JSTracer *trc, JSCompartment *compartment)
|
||||
{
|
||||
// Cancel any active or pending off thread compilations. Note that the
|
||||
// MIR graph does not hold any nursery pointers, so there's no need to
|
||||
@ -568,7 +568,7 @@ IonCompartment::mark(JSTracer *trc, JSCompartment *compartment)
|
||||
}
|
||||
|
||||
void
|
||||
IonCompartment::sweep(FreeOp *fop)
|
||||
JitCompartment::sweep(FreeOp *fop)
|
||||
{
|
||||
stubCodes_->sweep(fop);
|
||||
|
||||
@ -589,18 +589,18 @@ IonCompartment::sweep(FreeOp *fop)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::getBailoutTable(const FrameSizeClass &frameClass)
|
||||
JitRuntime::getBailoutTable(const FrameSizeClass &frameClass)
|
||||
{
|
||||
JS_ASSERT(frameClass != FrameSizeClass::None());
|
||||
return bailoutTables_[frameClass.classId()];
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::getVMWrapper(const VMFunction &f)
|
||||
JitRuntime::getVMWrapper(const VMFunction &f)
|
||||
{
|
||||
JS_ASSERT(functionWrappers_);
|
||||
JS_ASSERT(functionWrappers_->initialized());
|
||||
IonRuntime::VMWrapperMap::Ptr p = functionWrappers_->readonlyThreadsafeLookup(&f);
|
||||
JitRuntime::VMWrapperMap::Ptr p = functionWrappers_->readonlyThreadsafeLookup(&f);
|
||||
JS_ASSERT(p);
|
||||
|
||||
return p->value;
|
||||
@ -671,7 +671,7 @@ IonCode::finalize(FreeOp *fop)
|
||||
// Buffer can be freed at any time hereafter. Catch use-after-free bugs.
|
||||
// Don't do this if the Ion code is protected, as the signal handler will
|
||||
// deadlock trying to reaqcuire the operation callback lock.
|
||||
if (fop->runtime()->ionRuntime() && !fop->runtime()->ionRuntime()->ionCodeProtected())
|
||||
if (fop->runtime()->jitRuntime() && !fop->runtime()->jitRuntime()->ionCodeProtected())
|
||||
JS_POISON(code_, JS_FREE_PATTERN, bufferSize_);
|
||||
#endif
|
||||
|
||||
@ -919,7 +919,7 @@ IonScript::copyPatchableBackedges(JSContext *cx, IonCode *code,
|
||||
// interrupt immediately as the operation callback lock is held here.
|
||||
PatchJump(backedge, cx->runtime()->interrupt ? interruptCheck : loopHeader);
|
||||
|
||||
cx->runtime()->ionRuntime()->addPatchableBackedge(patchableBackedge);
|
||||
cx->runtime()->jitRuntime()->addPatchableBackedge(patchableBackedge);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1070,7 +1070,7 @@ IonScript::purgeCaches(Zone *zone)
|
||||
|
||||
JSRuntime *rt = zone->runtimeFromMainThread();
|
||||
IonContext ictx(rt);
|
||||
AutoFlushCache afc("purgeCaches", rt->ionRuntime());
|
||||
AutoFlushCache afc("purgeCaches", rt->jitRuntime());
|
||||
for (size_t i = 0; i < numCaches(); i++)
|
||||
getCacheFromIndex(i).reset();
|
||||
}
|
||||
@ -1110,7 +1110,7 @@ IonScript::destroyBackedges(JSRuntime *rt)
|
||||
{
|
||||
for (size_t i = 0; i < backedgeEntries_; i++) {
|
||||
PatchableBackedge *backedge = &backedgeList()[i];
|
||||
rt->ionRuntime()->removePatchableBackedge(backedge);
|
||||
rt->jitRuntime()->removePatchableBackedge(backedge);
|
||||
}
|
||||
|
||||
// Clear the list of backedges, so that this method is idempotent. It is
|
||||
@ -1123,11 +1123,11 @@ void
|
||||
jit::ToggleBarriers(JS::Zone *zone, bool needs)
|
||||
{
|
||||
JSRuntime *rt = zone->runtimeFromMainThread();
|
||||
if (!rt->hasIonRuntime())
|
||||
if (!rt->hasJitRuntime())
|
||||
return;
|
||||
|
||||
IonContext ictx(rt);
|
||||
AutoFlushCache afc("ToggleBarriers", rt->ionRuntime());
|
||||
AutoFlushCache afc("ToggleBarriers", rt->jitRuntime());
|
||||
for (gc::CellIterUnderGC i(zone, gc::FINALIZE_SCRIPT); !i.done(); i.next()) {
|
||||
JSScript *script = i.get<JSScript>();
|
||||
if (script->hasIonScript())
|
||||
@ -1137,8 +1137,8 @@ jit::ToggleBarriers(JS::Zone *zone, bool needs)
|
||||
}
|
||||
|
||||
for (CompartmentsInZoneIter comp(zone); !comp.done(); comp.next()) {
|
||||
if (comp->ionCompartment())
|
||||
comp->ionCompartment()->toggleBaselineStubBarriers(needs);
|
||||
if (comp->jitCompartment())
|
||||
comp->jitCompartment()->toggleBaselineStubBarriers(needs);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1485,7 +1485,7 @@ void
|
||||
AttachFinishedCompilations(JSContext *cx)
|
||||
{
|
||||
#ifdef JS_THREADSAFE
|
||||
IonCompartment *ion = cx->compartment()->ionCompartment();
|
||||
JitCompartment *ion = cx->compartment()->jitCompartment();
|
||||
if (!ion || !cx->runtime()->workerThreadState)
|
||||
return;
|
||||
|
||||
@ -1513,7 +1513,7 @@ AttachFinishedCompilations(JSContext *cx)
|
||||
// Release the worker thread lock and root the compiler for GC.
|
||||
AutoTempAllocatorRooter root(cx, &builder->temp());
|
||||
AutoUnlockWorkerThreadState unlock(cx->runtime());
|
||||
AutoFlushCache afc("AttachFinishedCompilations", cx->runtime()->ionRuntime());
|
||||
AutoFlushCache afc("AttachFinishedCompilations", cx->runtime()->jitRuntime());
|
||||
success = codegen->link(cx, builder->constraints());
|
||||
}
|
||||
|
||||
@ -1579,10 +1579,10 @@ IonCompile(JSContext *cx, JSScript *script,
|
||||
|
||||
types::AutoEnterAnalysis enter(cx);
|
||||
|
||||
if (!cx->compartment()->ensureIonCompartmentExists(cx))
|
||||
if (!cx->compartment()->ensureJitCompartmentExists(cx))
|
||||
return AbortReason_Alloc;
|
||||
|
||||
if (!cx->compartment()->ionCompartment()->ensureIonStubsExist(cx))
|
||||
if (!cx->compartment()->jitCompartment()->ensureIonStubsExist(cx))
|
||||
return AbortReason_Alloc;
|
||||
|
||||
MIRGraph *graph = alloc->new_<MIRGraph>(temp);
|
||||
@ -1596,7 +1596,7 @@ IonCompile(JSContext *cx, JSScript *script,
|
||||
|
||||
BaselineInspector inspector(script);
|
||||
|
||||
AutoFlushCache afc("IonCompile", cx->runtime()->ionRuntime());
|
||||
AutoFlushCache afc("IonCompile", cx->runtime()->jitRuntime());
|
||||
|
||||
AutoTempAllocatorRooter root(cx, temp);
|
||||
types::CompilerConstraintList *constraints = types::NewCompilerConstraintList();
|
||||
@ -1994,7 +1994,7 @@ jit::CanEnterInParallel(JSContext *cx, HandleScript script)
|
||||
|
||||
// This can GC, so afterward, script->parallelIon is
|
||||
// not guaranteed to be valid.
|
||||
if (!cx->runtime()->ionRuntime()->enterIon())
|
||||
if (!cx->runtime()->jitRuntime()->enterIon())
|
||||
return Method_Error;
|
||||
|
||||
// Subtle: it is possible for GC to occur during
|
||||
@ -2027,11 +2027,11 @@ jit::CanEnterUsingFastInvoke(JSContext *cx, HandleScript script, uint32_t numAct
|
||||
if (numActualArgs < script->function()->nargs)
|
||||
return Method_Skipped;
|
||||
|
||||
if (!cx->compartment()->ensureIonCompartmentExists(cx))
|
||||
if (!cx->compartment()->ensureJitCompartmentExists(cx))
|
||||
return Method_Error;
|
||||
|
||||
// This can GC, so afterward, script->ion is not guaranteed to be valid.
|
||||
if (!cx->runtime()->ionRuntime()->enterIon())
|
||||
if (!cx->runtime()->jitRuntime()->enterIon())
|
||||
return Method_Error;
|
||||
|
||||
if (!script->hasIonScript())
|
||||
@ -2047,7 +2047,7 @@ EnterIon(JSContext *cx, EnterJitData &data)
|
||||
JS_ASSERT(jit::IsIonEnabled(cx));
|
||||
JS_ASSERT(!data.osrFrame);
|
||||
|
||||
EnterIonCode enter = cx->runtime()->ionRuntime()->enterIon();
|
||||
EnterIonCode enter = cx->runtime()->jitRuntime()->enterIon();
|
||||
|
||||
// Caller must construct |this| before invoking the Ion function.
|
||||
JS_ASSERT_IF(data.constructing, data.maxArgv[0].isObject());
|
||||
@ -2058,7 +2058,7 @@ EnterIon(JSContext *cx, EnterJitData &data)
|
||||
IonContext ictx(cx, nullptr);
|
||||
JitActivation activation(cx, data.constructing);
|
||||
JSAutoResolveFlags rf(cx, RESOLVE_INFER);
|
||||
AutoFlushInhibitor afi(cx->runtime()->ionRuntime());
|
||||
AutoFlushInhibitor afi(cx->runtime()->jitRuntime());
|
||||
|
||||
// Single transition point from Interpreter to Baseline.
|
||||
enter(data.jitcode, data.maxArgc, data.maxArgv, /* osrFrame = */nullptr, data.calleeToken,
|
||||
@ -2072,7 +2072,7 @@ EnterIon(JSContext *cx, EnterJitData &data)
|
||||
data.result = data.maxArgv[0];
|
||||
|
||||
// Release temporary buffer used for OSR into Ion.
|
||||
cx->runtime()->getIonRuntime(cx)->freeOsrTempData();
|
||||
cx->runtime()->getJitRuntime(cx)->freeOsrTempData();
|
||||
|
||||
JS_ASSERT_IF(data.result.isMagic(), data.result.isMagic(JS_ION_ERROR));
|
||||
return data.result.isMagic() ? IonExec_Error : IonExec_Ok;
|
||||
@ -2164,7 +2164,7 @@ jit::FastInvoke(JSContext *cx, HandleFunction fun, CallArgs &args)
|
||||
|
||||
JitActivation activation(cx, /* firstFrameIsConstructing = */false);
|
||||
|
||||
EnterIonCode enter = cx->runtime()->ionRuntime()->enterIon();
|
||||
EnterIonCode enter = cx->runtime()->jitRuntime()->enterIon();
|
||||
void *calleeToken = CalleeToToken(fun);
|
||||
|
||||
RootedValue result(cx, Int32Value(args.length()));
|
||||
@ -2317,16 +2317,16 @@ void
|
||||
jit::InvalidateAll(FreeOp *fop, Zone *zone)
|
||||
{
|
||||
for (CompartmentsInZoneIter comp(zone); !comp.done(); comp.next()) {
|
||||
if (!comp->ionCompartment())
|
||||
if (!comp->jitCompartment())
|
||||
continue;
|
||||
CancelOffThreadIonCompile(comp, nullptr);
|
||||
FinishAllOffThreadCompilations(comp->ionCompartment());
|
||||
FinishAllOffThreadCompilations(comp->jitCompartment());
|
||||
}
|
||||
|
||||
for (JitActivationIterator iter(fop->runtime()); !iter.done(); ++iter) {
|
||||
if (iter.activation()->compartment()->zone() == zone) {
|
||||
IonContext ictx(fop->runtime());
|
||||
AutoFlushCache afc("InvalidateAll", fop->runtime()->ionRuntime());
|
||||
AutoFlushCache afc("InvalidateAll", fop->runtime()->jitRuntime());
|
||||
IonSpew(IonSpew_Invalidate, "Invalidating all frames for GC");
|
||||
InvalidateActivation(fop, iter.jitTop(), true);
|
||||
}
|
||||
@ -2339,7 +2339,7 @@ jit::Invalidate(types::TypeCompartment &types, FreeOp *fop,
|
||||
const Vector<types::RecompileInfo> &invalid, bool resetUses)
|
||||
{
|
||||
IonSpew(IonSpew_Invalidate, "Start invalidation.");
|
||||
AutoFlushCache afc ("Invalidate", fop->runtime()->ionRuntime());
|
||||
AutoFlushCache afc ("Invalidate", fop->runtime()->jitRuntime());
|
||||
|
||||
// Add an invalidation reference to all invalidated IonScripts to indicate
|
||||
// to the traversal which frames have been invalidated.
|
||||
@ -2571,14 +2571,14 @@ void
|
||||
AutoFlushCache::updateTop(uintptr_t p, size_t len)
|
||||
{
|
||||
IonContext *ictx = MaybeGetIonContext();
|
||||
IonRuntime *irt = (ictx != nullptr) ? ictx->runtime->ionRuntime() : nullptr;
|
||||
if (!irt || !irt->flusher())
|
||||
JitRuntime *jrt = (ictx != nullptr) ? ictx->runtime->jitRuntime() : nullptr;
|
||||
if (!jrt || !jrt->flusher())
|
||||
JSC::ExecutableAllocator::cacheFlush((void*)p, len);
|
||||
else
|
||||
irt->flusher()->update(p, len);
|
||||
jrt->flusher()->update(p, len);
|
||||
}
|
||||
|
||||
AutoFlushCache::AutoFlushCache(const char *nonce, IonRuntime *rt)
|
||||
AutoFlushCache::AutoFlushCache(const char *nonce, JitRuntime *rt)
|
||||
: start_(0),
|
||||
stop_(0),
|
||||
name_(nonce),
|
||||
@ -2593,7 +2593,7 @@ AutoFlushCache::AutoFlushCache(const char *nonce, IonRuntime *rt)
|
||||
rt->setFlusher(this);
|
||||
}
|
||||
|
||||
AutoFlushInhibitor::AutoFlushInhibitor(IonRuntime *rt)
|
||||
AutoFlushInhibitor::AutoFlushInhibitor(JitRuntime *rt)
|
||||
: runtime_(rt),
|
||||
afc(nullptr)
|
||||
{
|
||||
|
@ -2083,7 +2083,7 @@ jit::AnalyzeNewScriptProperties(JSContext *cx, HandleFunction fun,
|
||||
|
||||
types::AutoEnterAnalysis enter(cx);
|
||||
|
||||
if (!cx->compartment()->ensureIonCompartmentExists(cx))
|
||||
if (!cx->compartment()->ensureJitCompartmentExists(cx))
|
||||
return Method_Error;
|
||||
|
||||
if (!script->hasBaselineScript()) {
|
||||
|
@ -1732,7 +1732,7 @@ GetPropertyIC::update(JSContext *cx, size_t cacheIndex,
|
||||
GetPropertyIC &cache = ion->getCache(cacheIndex).toGetProperty();
|
||||
RootedPropertyName name(cx, cache.name());
|
||||
|
||||
AutoFlushCache afc ("GetPropertyCache", cx->runtime()->ionRuntime());
|
||||
AutoFlushCache afc ("GetPropertyCache", cx->runtime()->jitRuntime());
|
||||
|
||||
// Override the return value if we are invalidated (bug 728188).
|
||||
AutoDetectInvalidation adi(cx, vp.address(), ion);
|
||||
@ -1889,7 +1889,7 @@ bool
|
||||
GetPropertyParIC::update(ForkJoinSlice *slice, size_t cacheIndex,
|
||||
HandleObject obj, MutableHandleValue vp)
|
||||
{
|
||||
AutoFlushCache afc("GetPropertyParCache", slice->runtime()->ionRuntime());
|
||||
AutoFlushCache afc("GetPropertyParCache", slice->runtime()->jitRuntime());
|
||||
|
||||
IonScript *ion = GetTopIonJSScript(slice)->parallelIonScript();
|
||||
GetPropertyParIC &cache = ion->getCache(cacheIndex).toGetPropertyPar();
|
||||
@ -2784,7 +2784,7 @@ bool
|
||||
SetPropertyIC::update(JSContext *cx, size_t cacheIndex, HandleObject obj,
|
||||
HandleValue value)
|
||||
{
|
||||
AutoFlushCache afc ("SetPropertyCache", cx->runtime()->ionRuntime());
|
||||
AutoFlushCache afc ("SetPropertyCache", cx->runtime()->jitRuntime());
|
||||
|
||||
void *returnAddr;
|
||||
RootedScript script(cx, GetTopIonJSScript(cx, &returnAddr));
|
||||
@ -2882,7 +2882,7 @@ SetPropertyParIC::update(ForkJoinSlice *slice, size_t cacheIndex, HandleObject o
|
||||
{
|
||||
JS_ASSERT(slice->isThreadLocal(obj));
|
||||
|
||||
AutoFlushCache afc("SetPropertyParCache", slice->runtime()->ionRuntime());
|
||||
AutoFlushCache afc("SetPropertyParCache", slice->runtime()->jitRuntime());
|
||||
|
||||
IonScript *ion = GetTopIonJSScript(slice)->parallelIonScript();
|
||||
SetPropertyParIC &cache = ion->getCache(cacheIndex).toSetPropertyPar();
|
||||
@ -3429,7 +3429,7 @@ GetElementIC::update(JSContext *cx, size_t cacheIndex, HandleObject obj,
|
||||
}
|
||||
|
||||
// Override the return value if we are invalidated (bug 728188).
|
||||
AutoFlushCache afc ("GetElementCache", cx->runtime()->ionRuntime());
|
||||
AutoFlushCache afc ("GetElementCache", cx->runtime()->jitRuntime());
|
||||
AutoDetectInvalidation adi(cx, res.address(), ion);
|
||||
|
||||
RootedId id(cx);
|
||||
@ -3899,7 +3899,7 @@ bool
|
||||
GetElementParIC::update(ForkJoinSlice *slice, size_t cacheIndex, HandleObject obj,
|
||||
HandleValue idval, MutableHandleValue vp)
|
||||
{
|
||||
AutoFlushCache afc("GetElementParCache", slice->runtime()->ionRuntime());
|
||||
AutoFlushCache afc("GetElementParCache", slice->runtime()->jitRuntime());
|
||||
|
||||
IonScript *ion = GetTopIonJSScript(slice)->parallelIonScript();
|
||||
GetElementParIC &cache = ion->getCache(cacheIndex).toGetElementPar();
|
||||
@ -4097,7 +4097,7 @@ IsCacheableScopeChain(JSObject *scopeChain, JSObject *holder)
|
||||
JSObject *
|
||||
BindNameIC::update(JSContext *cx, size_t cacheIndex, HandleObject scopeChain)
|
||||
{
|
||||
AutoFlushCache afc ("BindNameCache", cx->runtime()->ionRuntime());
|
||||
AutoFlushCache afc ("BindNameCache", cx->runtime()->jitRuntime());
|
||||
|
||||
IonScript *ion = GetTopIonJSScript(cx)->ionScript();
|
||||
BindNameIC &cache = ion->getCache(cacheIndex).toBindName();
|
||||
@ -4230,7 +4230,7 @@ bool
|
||||
NameIC::update(JSContext *cx, size_t cacheIndex, HandleObject scopeChain,
|
||||
MutableHandleValue vp)
|
||||
{
|
||||
AutoFlushCache afc ("GetNameCache", cx->runtime()->ionRuntime());
|
||||
AutoFlushCache afc ("GetNameCache", cx->runtime()->jitRuntime());
|
||||
|
||||
void *returnAddr;
|
||||
IonScript *ion = GetTopIonJSScript(cx, &returnAddr)->ionScript();
|
||||
@ -4293,7 +4293,7 @@ CallsiteCloneIC::attach(JSContext *cx, IonScript *ion, HandleFunction original,
|
||||
JSObject *
|
||||
CallsiteCloneIC::update(JSContext *cx, size_t cacheIndex, HandleObject callee)
|
||||
{
|
||||
AutoFlushCache afc ("CallsiteCloneCache", cx->runtime()->ionRuntime());
|
||||
AutoFlushCache afc ("CallsiteCloneCache", cx->runtime()->jitRuntime());
|
||||
|
||||
// Act as the identity for functions that are not clone-at-callsite, as we
|
||||
// generate this cache as long as some callees are clone-at-callsite.
|
||||
|
@ -696,8 +696,8 @@ struct IonScriptCounts
|
||||
|
||||
struct VMFunction;
|
||||
|
||||
class IonCompartment;
|
||||
class IonRuntime;
|
||||
class JitCompartment;
|
||||
class JitRuntime;
|
||||
|
||||
struct AutoFlushCache
|
||||
{
|
||||
@ -705,14 +705,14 @@ struct AutoFlushCache
|
||||
uintptr_t start_;
|
||||
uintptr_t stop_;
|
||||
const char *name_;
|
||||
IonRuntime *runtime_;
|
||||
JitRuntime *runtime_;
|
||||
bool used_;
|
||||
|
||||
public:
|
||||
void update(uintptr_t p, size_t len);
|
||||
static void updateTop(uintptr_t p, size_t len);
|
||||
~AutoFlushCache();
|
||||
AutoFlushCache(const char *nonce, IonRuntime *rt);
|
||||
AutoFlushCache(const char *nonce, JitRuntime *rt);
|
||||
void flushAnyway();
|
||||
};
|
||||
|
||||
@ -727,10 +727,10 @@ struct AutoFlushCache
|
||||
struct AutoFlushInhibitor
|
||||
{
|
||||
private:
|
||||
IonRuntime *runtime_;
|
||||
JitRuntime *runtime_;
|
||||
AutoFlushCache *afc;
|
||||
public:
|
||||
AutoFlushInhibitor(IonRuntime *rt);
|
||||
AutoFlushInhibitor(JitRuntime *rt);
|
||||
~AutoFlushInhibitor();
|
||||
};
|
||||
} // namespace jit
|
||||
|
@ -15,9 +15,9 @@
|
||||
#include "jit/BaselineIC.h"
|
||||
#include "jit/BaselineJIT.h"
|
||||
#include "jit/Ion.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/IonMacroAssembler.h"
|
||||
#include "jit/IonSpewer.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#include "jit/ParallelFunctions.h"
|
||||
#include "jit/PcScriptCache.h"
|
||||
#include "jit/Safepoints.h"
|
||||
@ -377,7 +377,7 @@ HandleExceptionIon(JSContext *cx, const InlineFrameIterator &frame, ResumeFromEx
|
||||
if (retval == BAILOUT_RETURN_OK) {
|
||||
JS_ASSERT(info);
|
||||
rfe->kind = ResumeFromException::RESUME_BAILOUT;
|
||||
rfe->target = cx->runtime()->ionRuntime()->getBailoutTail()->raw();
|
||||
rfe->target = cx->runtime()->jitRuntime()->getBailoutTail()->raw();
|
||||
rfe->bailoutInfo = info;
|
||||
return;
|
||||
}
|
||||
|
@ -13,8 +13,8 @@
|
||||
|
||||
#include "assembler/jit/ExecutableAllocator.h"
|
||||
#include "jit/IonCode.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/IonMacroAssembler.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
|
||||
namespace js {
|
||||
namespace jit {
|
||||
@ -76,7 +76,7 @@ class Linker
|
||||
}
|
||||
|
||||
IonCode *newCode(JSContext *cx, JSC::CodeKind kind) {
|
||||
return newCode(cx, cx->compartment()->ionCompartment()->execAlloc(), kind);
|
||||
return newCode(cx, cx->compartment()->jitCompartment()->execAlloc(), kind);
|
||||
}
|
||||
|
||||
IonCode *newCodeForIonScript(JSContext *cx) {
|
||||
@ -88,7 +88,7 @@ class Linker
|
||||
// as the triggering thread may use the executable allocator below.
|
||||
JS_ASSERT(cx->runtime()->currentThreadOwnsOperationCallbackLock());
|
||||
|
||||
JSC::ExecutableAllocator *alloc = cx->runtime()->ionRuntime()->getIonAlloc(cx);
|
||||
JSC::ExecutableAllocator *alloc = cx->runtime()->jitRuntime()->getIonAlloc(cx);
|
||||
if (!alloc)
|
||||
return nullptr;
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
#elif defined(JS_CPU_ARM)
|
||||
# include "jit/arm/MacroAssembler-arm.h"
|
||||
#endif
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/IonInstrumentation.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#include "jit/VMFunctions.h"
|
||||
#include "vm/ProxyObject.h"
|
||||
#include "vm/Shape.h"
|
||||
@ -647,10 +647,10 @@ class MacroAssembler : public MacroAssemblerSpecific
|
||||
Push(PreBarrierReg);
|
||||
computeEffectiveAddress(address, PreBarrierReg);
|
||||
|
||||
JSRuntime *runtime = GetIonContext()->runtime;
|
||||
JitRuntime *rt = GetIonContext()->runtime->jitRuntime();
|
||||
IonCode *preBarrier = (type == MIRType_Shape)
|
||||
? runtime->ionRuntime()->shapePreBarrier()
|
||||
: runtime->ionRuntime()->valuePreBarrier();
|
||||
? rt->shapePreBarrier()
|
||||
: rt->valuePreBarrier();
|
||||
|
||||
call(preBarrier);
|
||||
Pop(PreBarrierReg);
|
||||
|
@ -4,8 +4,8 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef jit_IonCompartment_h
|
||||
#define jit_IonCompartment_h
|
||||
#ifndef jit_JitCompartment_h
|
||||
#define jit_JitCompartment_h
|
||||
|
||||
#ifdef JS_ION
|
||||
|
||||
@ -89,7 +89,7 @@ class ICStubSpace
|
||||
}
|
||||
};
|
||||
|
||||
// Space for optimized stubs. Every IonCompartment has a single
|
||||
// Space for optimized stubs. Every JitCompartment has a single
|
||||
// OptimizedICStubSpace.
|
||||
struct OptimizedICStubSpace : public ICStubSpace
|
||||
{
|
||||
@ -126,7 +126,7 @@ struct FallbackICStubSpace : public ICStubSpace
|
||||
// if signal handlers are being used to implement interrupts.
|
||||
class PatchableBackedge : public InlineListNode<PatchableBackedge>
|
||||
{
|
||||
friend class IonRuntime;
|
||||
friend class JitRuntime;
|
||||
|
||||
CodeLocationJump backedge;
|
||||
CodeLocationLabel loopHeader;
|
||||
@ -140,9 +140,9 @@ class PatchableBackedge : public InlineListNode<PatchableBackedge>
|
||||
{}
|
||||
};
|
||||
|
||||
class IonRuntime
|
||||
class JitRuntime
|
||||
{
|
||||
friend class IonCompartment;
|
||||
friend class JitCompartment;
|
||||
|
||||
// Executable allocator for all code except the main code in an IonScript.
|
||||
// Shared with the runtime.
|
||||
@ -196,7 +196,7 @@ class IonRuntime
|
||||
VMWrapperMap *functionWrappers_;
|
||||
|
||||
// Buffer for OSR from baseline to Ion. To avoid holding on to this for
|
||||
// too long, it's also freed in IonCompartment::mark and in EnterBaseline
|
||||
// too long, it's also freed in JitCompartment::mark and in EnterBaseline
|
||||
// (after returning from JIT code).
|
||||
uint8_t *osrTempData_;
|
||||
|
||||
@ -226,8 +226,8 @@ class IonRuntime
|
||||
JSC::ExecutableAllocator *createIonAlloc(JSContext *cx);
|
||||
|
||||
public:
|
||||
IonRuntime();
|
||||
~IonRuntime();
|
||||
JitRuntime();
|
||||
~JitRuntime();
|
||||
bool initialize(JSContext *cx);
|
||||
|
||||
uint8_t *allocateOsrTempData(size_t size);
|
||||
@ -325,12 +325,12 @@ class IonRuntime
|
||||
}
|
||||
};
|
||||
|
||||
class IonCompartment
|
||||
class JitCompartment
|
||||
{
|
||||
friend class JitActivation;
|
||||
|
||||
// Ion state for the compartment's runtime.
|
||||
IonRuntime *rt;
|
||||
JitRuntime *rt;
|
||||
|
||||
// Any scripts for which off thread compilation has successfully finished,
|
||||
// failed, or been cancelled. All off thread compilations which are started
|
||||
@ -352,7 +352,7 @@ class IonCompartment
|
||||
OptimizedICStubSpace optimizedStubSpace_;
|
||||
|
||||
// Stub to concatenate two strings inline. Note that it can't be
|
||||
// stored in IonRuntime because masm.newGCString bakes in zone-specific
|
||||
// stored in JitRuntime because masm.newGCString bakes in zone-specific
|
||||
// pointers. This has to be a weak pointer to avoid keeping the whole
|
||||
// compartment alive.
|
||||
ReadBarriered<IonCode> stringConcatStub_;
|
||||
@ -409,8 +409,8 @@ class IonCompartment
|
||||
JSC::ExecutableAllocator *createIonAlloc();
|
||||
|
||||
public:
|
||||
IonCompartment(IonRuntime *rt);
|
||||
~IonCompartment();
|
||||
JitCompartment(JitRuntime *rt);
|
||||
~JitCompartment();
|
||||
|
||||
bool initialize(JSContext *cx);
|
||||
|
||||
@ -452,4 +452,4 @@ const unsigned WINDOWS_BIG_FRAME_TOUCH_INCREMENT = 4096 - 1;
|
||||
|
||||
#endif // JS_ION
|
||||
|
||||
#endif /* jit_IonCompartment_h */
|
||||
#endif /* jit_JitCompartment_h */
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include "jit/CompileInfo.h"
|
||||
#include "jit/IonAllocPolicy.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#ifdef JS_ION_PERF
|
||||
# include "jit/PerfSpewer.h"
|
||||
#endif
|
||||
@ -44,11 +44,11 @@ class MIRGenerator
|
||||
bool ensureBallast() {
|
||||
return temp().ensureBallast();
|
||||
}
|
||||
IonCompartment *ionCompartment() const {
|
||||
return compartment->ionCompartment();
|
||||
JitCompartment *jitCompartment() const {
|
||||
return compartment->jitCompartment();
|
||||
}
|
||||
IonRuntime *ionRuntime() const {
|
||||
return GetIonContext()->runtime->ionRuntime();
|
||||
JitRuntime *jitRuntime() const {
|
||||
return GetIonContext()->runtime->jitRuntime();
|
||||
}
|
||||
CompileInfo &info() {
|
||||
return *info_;
|
||||
|
@ -10,8 +10,8 @@
|
||||
#include "builtin/TypedObject.h"
|
||||
#include "frontend/BytecodeCompiler.h"
|
||||
#include "jit/BaselineIC.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/IonFrames.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#include "vm/ArrayObject.h"
|
||||
#include "vm/Debugger.h"
|
||||
#include "vm/Interpreter.h"
|
||||
@ -465,8 +465,8 @@ InterruptCheck(JSContext *cx)
|
||||
// is definitely about to be handled; if there are still backedges
|
||||
// afterwards which point to the interrupt handler, the next time they are
|
||||
// taken the backedges will just be reset again.
|
||||
cx->runtime()->ionRuntime()->patchIonBackedges(cx->runtime(),
|
||||
IonRuntime::BackedgeLoopHeader);
|
||||
cx->runtime()->jitRuntime()->patchIonBackedges(cx->runtime(),
|
||||
JitRuntime::BackedgeLoopHeader);
|
||||
|
||||
return !!js_HandleExecutionInterrupt(cx);
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "assembler/jit/ExecutableAllocator.h"
|
||||
#include "gc/Marking.h"
|
||||
#include "jit/arm/MacroAssembler-arm.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
|
||||
using namespace js;
|
||||
using namespace js::jit;
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "jscompartment.h"
|
||||
|
||||
#include "jit/Bailouts.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
|
||||
using namespace js;
|
||||
using namespace js::jit;
|
||||
@ -27,7 +27,7 @@ JS_STATIC_ASSERT(sizeof(ExtendedBailoutStack) ==
|
||||
|
||||
#endif
|
||||
#if 0
|
||||
BailoutEnvironment::BailoutEnvironment(IonCompartment *ion, void **sp)
|
||||
BailoutEnvironment::BailoutEnvironment(JitCompartment *ion, void **sp)
|
||||
: sp_(sp)
|
||||
{
|
||||
bailout_ = reinterpret_cast<ExtendedBailoutStack *>(sp);
|
||||
@ -133,7 +133,7 @@ IonBailoutIterator::IonBailoutIterator(const JitActivationIterator &activations,
|
||||
// Compute the snapshot offset from the bailout ID.
|
||||
JitActivation *activation = activations.activation()->asJit();
|
||||
JSRuntime *rt = activation->compartment()->runtimeFromMainThread();
|
||||
IonCode *code = rt->ionRuntime()->getBailoutTable(bailout->frameClass());
|
||||
IonCode *code = rt->jitRuntime()->getBailoutTable(bailout->frameClass());
|
||||
uintptr_t tableOffset = bailout->tableOffset();
|
||||
uintptr_t tableStart = reinterpret_cast<uintptr_t>(code->raw());
|
||||
|
||||
|
@ -13,8 +13,8 @@
|
||||
#include "jsnum.h"
|
||||
|
||||
#include "jit/CodeGenerator.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/IonFrames.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#include "jit/MIR.h"
|
||||
#include "jit/MIRGraph.h"
|
||||
#include "vm/Shape.h"
|
||||
@ -157,7 +157,7 @@ CodeGeneratorARM::generateOutOfLineCode()
|
||||
// Push the frame size, so the handler can recover the IonScript.
|
||||
masm.ma_mov(Imm32(frameSize()), lr);
|
||||
|
||||
IonCode *handler = gen->ionRuntime()->getGenericBailoutHandler();
|
||||
IonCode *handler = gen->jitRuntime()->getGenericBailoutHandler();
|
||||
masm.branch(handler);
|
||||
}
|
||||
|
||||
@ -1883,7 +1883,7 @@ CodeGeneratorARM::generateInvalidateEpilogue()
|
||||
|
||||
// Push the Ion script onto the stack (when we determine what that pointer is).
|
||||
invalidateEpilogueData_ = masm.pushWithPatch(ImmWord(uintptr_t(-1)));
|
||||
IonCode *thunk = gen->ionRuntime()->getInvalidationThunk();
|
||||
IonCode *thunk = gen->jitRuntime()->getInvalidationThunk();
|
||||
|
||||
masm.branch(thunk);
|
||||
|
||||
|
@ -3679,7 +3679,7 @@ MacroAssemblerARMCompat::handleFailureWithHandler(void *handler)
|
||||
passABIArg(r0);
|
||||
callWithABI(handler);
|
||||
|
||||
IonCode *excTail = GetIonContext()->runtime->ionRuntime()->getExceptionTail();
|
||||
IonCode *excTail = GetIonContext()->runtime->jitRuntime()->getExceptionTail();
|
||||
branch(excTail);
|
||||
}
|
||||
|
||||
|
@ -10,10 +10,10 @@
|
||||
#include "jit/arm/BaselineHelpers-arm.h"
|
||||
#include "jit/Bailouts.h"
|
||||
#include "jit/ExecutionModeInlines.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/IonFrames.h"
|
||||
#include "jit/IonLinker.h"
|
||||
#include "jit/IonSpewer.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#ifdef JS_ION_PERF
|
||||
# include "jit/PerfSpewer.h"
|
||||
#endif
|
||||
@ -104,7 +104,7 @@ struct EnterJITStack
|
||||
* ...using standard EABI calling convention
|
||||
*/
|
||||
IonCode *
|
||||
IonRuntime::generateEnterJIT(JSContext *cx, EnterJitType type)
|
||||
JitRuntime::generateEnterJIT(JSContext *cx, EnterJitType type)
|
||||
{
|
||||
const Address slot_token(sp, offsetof(EnterJITStack, token));
|
||||
const Address slot_vp(sp, offsetof(EnterJITStack, vp));
|
||||
@ -112,7 +112,7 @@ IonRuntime::generateEnterJIT(JSContext *cx, EnterJitType type)
|
||||
JS_ASSERT(OsrFrameReg == r3);
|
||||
|
||||
MacroAssembler masm(cx);
|
||||
AutoFlushCache afc("GenerateEnterJIT", cx->runtime()->ionRuntime());
|
||||
AutoFlushCache afc("GenerateEnterJIT", cx->runtime()->jitRuntime());
|
||||
Assembler *aasm = &masm;
|
||||
|
||||
// Save non-volatile registers. These must be saved by the trampoline,
|
||||
@ -349,9 +349,9 @@ IonRuntime::generateEnterJIT(JSContext *cx, EnterJitType type)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateInvalidator(JSContext *cx)
|
||||
JitRuntime::generateInvalidator(JSContext *cx)
|
||||
{
|
||||
// See large comment in x86's IonRuntime::generateInvalidator.
|
||||
// See large comment in x86's JitRuntime::generateInvalidator.
|
||||
MacroAssembler masm(cx);
|
||||
//masm.as_bkpt();
|
||||
// At this point, one of two things has happened.
|
||||
@ -396,7 +396,7 @@ IonRuntime::generateInvalidator(JSContext *cx)
|
||||
masm.ma_add(sp, r1, sp);
|
||||
|
||||
// Jump to shared bailout tail. The BailoutInfo pointer has to be in r2.
|
||||
IonCode *bailoutTail = cx->runtime()->ionRuntime()->getBailoutTail();
|
||||
IonCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
masm.branch(bailoutTail);
|
||||
|
||||
Linker linker(masm);
|
||||
@ -411,7 +411,7 @@ IonRuntime::generateInvalidator(JSContext *cx)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateArgumentsRectifier(JSContext *cx, ExecutionMode mode, void **returnAddrOut)
|
||||
JitRuntime::generateArgumentsRectifier(JSContext *cx, ExecutionMode mode, void **returnAddrOut)
|
||||
{
|
||||
MacroAssembler masm(cx);
|
||||
// ArgumentsRectifierReg contains the |nargs| pushed onto the current frame.
|
||||
@ -609,12 +609,12 @@ GenerateBailoutThunk(JSContext *cx, MacroAssembler &masm, uint32_t frameClass)
|
||||
}
|
||||
|
||||
// Jump to shared bailout tail. The BailoutInfo pointer has to be in r2.
|
||||
IonCode *bailoutTail = cx->runtime()->ionRuntime()->getBailoutTail();
|
||||
IonCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
masm.branch(bailoutTail);
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateBailoutTable(JSContext *cx, uint32_t frameClass)
|
||||
JitRuntime::generateBailoutTable(JSContext *cx, uint32_t frameClass)
|
||||
{
|
||||
MacroAssembler masm(cx);
|
||||
|
||||
@ -636,7 +636,7 @@ IonRuntime::generateBailoutTable(JSContext *cx, uint32_t frameClass)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateBailoutHandler(JSContext *cx)
|
||||
JitRuntime::generateBailoutHandler(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm(cx);
|
||||
GenerateBailoutThunk(cx, masm, NO_FRAME_SIZE_CLASS_ID);
|
||||
@ -652,7 +652,7 @@ IonRuntime::generateBailoutHandler(JSContext *cx)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
JitRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
{
|
||||
typedef MoveResolver::MoveOperand MoveOperand;
|
||||
|
||||
@ -832,7 +832,7 @@ IonRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generatePreBarrier(JSContext *cx, MIRType type)
|
||||
JitRuntime::generatePreBarrier(JSContext *cx, MIRType type)
|
||||
{
|
||||
MacroAssembler masm(cx);
|
||||
|
||||
@ -876,7 +876,7 @@ typedef bool (*HandleDebugTrapFn)(JSContext *, BaselineFrame *, uint8_t *, bool
|
||||
static const VMFunction HandleDebugTrapInfo = FunctionInfo<HandleDebugTrapFn>(HandleDebugTrap);
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
JitRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
|
||||
@ -893,7 +893,7 @@ IonRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
masm.movePtr(ImmPtr(nullptr), BaselineStubReg);
|
||||
EmitEnterStubFrame(masm, scratch2);
|
||||
|
||||
IonCode *code = cx->runtime()->ionRuntime()->getVMWrapper(HandleDebugTrapInfo);
|
||||
IonCode *code = cx->runtime()->jitRuntime()->getVMWrapper(HandleDebugTrapInfo);
|
||||
if (!code)
|
||||
return nullptr;
|
||||
|
||||
@ -928,7 +928,7 @@ IonRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateExceptionTailStub(JSContext *cx)
|
||||
JitRuntime::generateExceptionTailStub(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
|
||||
@ -945,7 +945,7 @@ IonRuntime::generateExceptionTailStub(JSContext *cx)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateBailoutTailStub(JSContext *cx)
|
||||
JitRuntime::generateBailoutTailStub(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "gc/Marking.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#if defined(JS_CPU_X86)
|
||||
# include "jit/x86/MacroAssembler-x86.h"
|
||||
#elif defined(JS_CPU_X64)
|
||||
|
@ -33,7 +33,7 @@ BaselineCompilerShared::BaselineCompilerShared(JSContext *cx, HandleScript scrip
|
||||
bool
|
||||
BaselineCompilerShared::callVM(const VMFunction &fun, bool preInitialize)
|
||||
{
|
||||
IonCode *code = cx->runtime()->ionRuntime()->getVMWrapper(fun);
|
||||
IonCode *code = cx->runtime()->jitRuntime()->getVMWrapper(fun);
|
||||
if (!code)
|
||||
return false;
|
||||
|
||||
|
@ -639,7 +639,7 @@ CodeGeneratorShared::callVM(const VMFunction &fun, LInstruction *ins, const Regi
|
||||
#endif
|
||||
|
||||
// Get the wrapper of the VM function.
|
||||
IonCode *wrapper = gen->ionRuntime()->getVMWrapper(fun);
|
||||
IonCode *wrapper = gen->jitRuntime()->getVMWrapper(fun);
|
||||
if (!wrapper)
|
||||
return false;
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/IonFrames.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#include "jit/RangeAnalysis.h"
|
||||
|
||||
#include "jit/shared/CodeGenerator-shared-inl.h"
|
||||
@ -298,7 +298,7 @@ CodeGeneratorX86Shared::generateOutOfLineCode()
|
||||
// Push the frame size, so the handler can recover the IonScript.
|
||||
masm.push(Imm32(frameSize()));
|
||||
|
||||
IonCode *handler = gen->ionRuntime()->getGenericBailoutHandler();
|
||||
IonCode *handler = gen->jitRuntime()->getGenericBailoutHandler();
|
||||
masm.jmp(ImmPtr(handler->raw()), Relocation::IONCODE);
|
||||
}
|
||||
|
||||
@ -1601,7 +1601,7 @@ CodeGeneratorX86Shared::generateInvalidateEpilogue()
|
||||
|
||||
// Push the Ion script onto the stack (when we determine what that pointer is).
|
||||
invalidateEpilogueData_ = masm.pushWithPatch(ImmWord(uintptr_t(-1)));
|
||||
IonCode *thunk = gen->ionRuntime()->getInvalidationThunk();
|
||||
IonCode *thunk = gen->jitRuntime()->getInvalidationThunk();
|
||||
|
||||
masm.call(thunk);
|
||||
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
#include "jit/Bailouts.h"
|
||||
#include "jit/BaselineFrame.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/IonFrames.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#include "jit/MoveEmitter.h"
|
||||
|
||||
using namespace js;
|
||||
@ -288,7 +288,7 @@ MacroAssemblerX64::handleFailureWithHandler(void *handler)
|
||||
passABIArg(rax);
|
||||
callWithABI(handler);
|
||||
|
||||
IonCode *excTail = GetIonContext()->runtime->ionRuntime()->getExceptionTail();
|
||||
IonCode *excTail = GetIonContext()->runtime->jitRuntime()->getExceptionTail();
|
||||
jmp(excTail);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,9 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "jit/Bailouts.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/IonFrames.h"
|
||||
#include "jit/IonLinker.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#ifdef JS_ION_PERF
|
||||
# include "jit/PerfSpewer.h"
|
||||
#endif
|
||||
@ -30,7 +30,7 @@ static const RegisterSet AllRegs =
|
||||
* ...using standard x64 fastcall calling convention
|
||||
*/
|
||||
IonCode *
|
||||
IonRuntime::generateEnterJIT(JSContext *cx, EnterJitType type)
|
||||
JitRuntime::generateEnterJIT(JSContext *cx, EnterJitType type)
|
||||
{
|
||||
MacroAssembler masm(cx);
|
||||
|
||||
@ -302,12 +302,12 @@ IonRuntime::generateEnterJIT(JSContext *cx, EnterJitType type)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateInvalidator(JSContext *cx)
|
||||
JitRuntime::generateInvalidator(JSContext *cx)
|
||||
{
|
||||
AutoIonContextAlloc aica(cx);
|
||||
MacroAssembler masm(cx);
|
||||
|
||||
// See explanatory comment in x86's IonRuntime::generateInvalidator.
|
||||
// See explanatory comment in x86's JitRuntime::generateInvalidator.
|
||||
|
||||
masm.addq(Imm32(sizeof(uintptr_t)), rsp);
|
||||
|
||||
@ -337,7 +337,7 @@ IonRuntime::generateInvalidator(JSContext *cx)
|
||||
masm.lea(Operand(rsp, rbx, TimesOne, sizeof(InvalidationBailoutStack)), rsp);
|
||||
|
||||
// Jump to shared bailout tail. The BailoutInfo pointer has to be in r9.
|
||||
IonCode *bailoutTail = cx->runtime()->ionRuntime()->getBailoutTail();
|
||||
IonCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
masm.jmp(bailoutTail);
|
||||
|
||||
Linker linker(masm);
|
||||
@ -351,7 +351,7 @@ IonRuntime::generateInvalidator(JSContext *cx)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateArgumentsRectifier(JSContext *cx, ExecutionMode mode, void **returnAddrOut)
|
||||
JitRuntime::generateArgumentsRectifier(JSContext *cx, ExecutionMode mode, void **returnAddrOut)
|
||||
{
|
||||
// Do not erase the frame pointer in this function.
|
||||
|
||||
@ -473,18 +473,18 @@ GenerateBailoutThunk(JSContext *cx, MacroAssembler &masm, uint32_t frameClass)
|
||||
masm.lea(Operand(rsp, rcx, TimesOne, sizeof(void *)), rsp);
|
||||
|
||||
// Jump to shared bailout tail. The BailoutInfo pointer has to be in r9.
|
||||
IonCode *bailoutTail = cx->runtime()->ionRuntime()->getBailoutTail();
|
||||
IonCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
masm.jmp(bailoutTail);
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateBailoutTable(JSContext *cx, uint32_t frameClass)
|
||||
JitRuntime::generateBailoutTable(JSContext *cx, uint32_t frameClass)
|
||||
{
|
||||
MOZ_ASSUME_UNREACHABLE("x64 does not use bailout tables");
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateBailoutHandler(JSContext *cx)
|
||||
JitRuntime::generateBailoutHandler(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
|
||||
@ -501,7 +501,7 @@ IonRuntime::generateBailoutHandler(JSContext *cx)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
JitRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
{
|
||||
typedef MoveResolver::MoveOperand MoveOperand;
|
||||
|
||||
@ -688,7 +688,7 @@ IonRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generatePreBarrier(JSContext *cx, MIRType type)
|
||||
JitRuntime::generatePreBarrier(JSContext *cx, MIRType type)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
|
||||
@ -726,7 +726,7 @@ typedef bool (*HandleDebugTrapFn)(JSContext *, BaselineFrame *, uint8_t *, bool
|
||||
static const VMFunction HandleDebugTrapInfo = FunctionInfo<HandleDebugTrapFn>(HandleDebugTrap);
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
JitRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
|
||||
@ -747,7 +747,7 @@ IonRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
masm.movePtr(ImmPtr(nullptr), BaselineStubReg);
|
||||
EmitEnterStubFrame(masm, scratch3);
|
||||
|
||||
IonCode *code = cx->runtime()->ionRuntime()->getVMWrapper(HandleDebugTrapInfo);
|
||||
IonCode *code = cx->runtime()->jitRuntime()->getVMWrapper(HandleDebugTrapInfo);
|
||||
if (!code)
|
||||
return nullptr;
|
||||
|
||||
@ -782,7 +782,7 @@ IonRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateExceptionTailStub(JSContext *cx)
|
||||
JitRuntime::generateExceptionTailStub(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
|
||||
@ -799,7 +799,7 @@ IonRuntime::generateExceptionTailStub(JSContext *cx)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateBailoutTailStub(JSContext *cx)
|
||||
JitRuntime::generateBailoutTailStub(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "jscompartment.h"
|
||||
|
||||
#include "jit/Bailouts.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
|
||||
using namespace js;
|
||||
using namespace js::jit;
|
||||
@ -86,7 +86,7 @@ IonBailoutIterator::IonBailoutIterator(const JitActivationIterator &activations,
|
||||
// Compute the snapshot offset from the bailout ID.
|
||||
JitActivation *activation = activations.activation()->asJit();
|
||||
JSRuntime *rt = activation->compartment()->runtimeFromMainThread();
|
||||
IonCode *code = rt->ionRuntime()->getBailoutTable(bailout->frameClass());
|
||||
IonCode *code = rt->jitRuntime()->getBailoutTable(bailout->frameClass());
|
||||
uintptr_t tableOffset = bailout->tableOffset();
|
||||
uintptr_t tableStart = reinterpret_cast<uintptr_t>(code->raw());
|
||||
|
||||
|
@ -285,7 +285,7 @@ MacroAssemblerX86::handleFailureWithHandler(void *handler)
|
||||
passABIArg(eax);
|
||||
callWithABI(handler);
|
||||
|
||||
IonCode *excTail = GetIonContext()->runtime->ionRuntime()->getExceptionTail();
|
||||
IonCode *excTail = GetIonContext()->runtime->jitRuntime()->getExceptionTail();
|
||||
jmp(excTail);
|
||||
}
|
||||
|
||||
|
@ -10,10 +10,10 @@
|
||||
#include "jit/Bailouts.h"
|
||||
#include "jit/BaselineJIT.h"
|
||||
#include "jit/ExecutionModeInlines.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/IonFrames.h"
|
||||
#include "jit/IonLinker.h"
|
||||
#include "jit/IonSpewer.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#ifdef JS_ION_PERF
|
||||
# include "jit/PerfSpewer.h"
|
||||
#endif
|
||||
@ -47,7 +47,7 @@ enum EnterJitEbpArgumentOffset {
|
||||
* using the standard cdecl calling convention.
|
||||
*/
|
||||
IonCode *
|
||||
IonRuntime::generateEnterJIT(JSContext *cx, EnterJitType type)
|
||||
JitRuntime::generateEnterJIT(JSContext *cx, EnterJitType type)
|
||||
{
|
||||
MacroAssembler masm(cx);
|
||||
|
||||
@ -285,7 +285,7 @@ IonRuntime::generateEnterJIT(JSContext *cx, EnterJitType type)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateInvalidator(JSContext *cx)
|
||||
JitRuntime::generateInvalidator(JSContext *cx)
|
||||
{
|
||||
AutoIonContextAlloc aica(cx);
|
||||
MacroAssembler masm(cx);
|
||||
@ -328,7 +328,7 @@ IonRuntime::generateInvalidator(JSContext *cx)
|
||||
masm.lea(Operand(esp, ebx, TimesOne, sizeof(InvalidationBailoutStack)), esp);
|
||||
|
||||
// Jump to shared bailout tail. The BailoutInfo pointer has to be in ecx.
|
||||
IonCode *bailoutTail = cx->runtime()->ionRuntime()->getBailoutTail();
|
||||
IonCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
masm.jmp(bailoutTail);
|
||||
|
||||
Linker linker(masm);
|
||||
@ -343,7 +343,7 @@ IonRuntime::generateInvalidator(JSContext *cx)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateArgumentsRectifier(JSContext *cx, ExecutionMode mode, void **returnAddrOut)
|
||||
JitRuntime::generateArgumentsRectifier(JSContext *cx, ExecutionMode mode, void **returnAddrOut)
|
||||
{
|
||||
MacroAssembler masm(cx);
|
||||
|
||||
@ -492,12 +492,12 @@ GenerateBailoutThunk(JSContext *cx, MacroAssembler &masm, uint32_t frameClass)
|
||||
}
|
||||
|
||||
// Jump to shared bailout tail. The BailoutInfo pointer has to be in ecx.
|
||||
IonCode *bailoutTail = cx->runtime()->ionRuntime()->getBailoutTail();
|
||||
IonCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
masm.jmp(bailoutTail);
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateBailoutTable(JSContext *cx, uint32_t frameClass)
|
||||
JitRuntime::generateBailoutTable(JSContext *cx, uint32_t frameClass)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
|
||||
@ -519,7 +519,7 @@ IonRuntime::generateBailoutTable(JSContext *cx, uint32_t frameClass)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateBailoutHandler(JSContext *cx)
|
||||
JitRuntime::generateBailoutHandler(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
|
||||
@ -536,7 +536,7 @@ IonRuntime::generateBailoutHandler(JSContext *cx)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
JitRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
{
|
||||
typedef MoveResolver::MoveOperand MoveOperand;
|
||||
|
||||
@ -717,7 +717,7 @@ IonRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generatePreBarrier(JSContext *cx, MIRType type)
|
||||
JitRuntime::generatePreBarrier(JSContext *cx, MIRType type)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
|
||||
@ -762,7 +762,7 @@ typedef bool (*HandleDebugTrapFn)(JSContext *, BaselineFrame *, uint8_t *, bool
|
||||
static const VMFunction HandleDebugTrapInfo = FunctionInfo<HandleDebugTrapFn>(HandleDebugTrap);
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
JitRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
|
||||
@ -783,7 +783,7 @@ IonRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
masm.movePtr(ImmPtr(nullptr), BaselineStubReg);
|
||||
EmitEnterStubFrame(masm, scratch3);
|
||||
|
||||
IonCode *code = cx->runtime()->ionRuntime()->getVMWrapper(HandleDebugTrapInfo);
|
||||
IonCode *code = cx->runtime()->jitRuntime()->getVMWrapper(HandleDebugTrapInfo);
|
||||
if (!code)
|
||||
return nullptr;
|
||||
|
||||
@ -818,7 +818,7 @@ IonRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateExceptionTailStub(JSContext *cx)
|
||||
JitRuntime::generateExceptionTailStub(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
|
||||
@ -835,7 +835,7 @@ IonRuntime::generateExceptionTailStub(JSContext *cx)
|
||||
}
|
||||
|
||||
IonCode *
|
||||
IonRuntime::generateBailoutTailStub(JSContext *cx)
|
||||
JitRuntime::generateBailoutTailStub(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include "gc/Marking.h"
|
||||
#ifdef JS_ION
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#endif
|
||||
#include "js/RootingAPI.h"
|
||||
#include "vm/StopIterationObject.h"
|
||||
@ -68,7 +68,7 @@ JSCompartment::JSCompartment(Zone *zone, const JS::CompartmentOptions &options =
|
||||
enumerators(nullptr),
|
||||
compartmentStats(nullptr)
|
||||
#ifdef JS_ION
|
||||
, ionCompartment_(nullptr)
|
||||
, jitCompartment_(nullptr)
|
||||
#endif
|
||||
{
|
||||
runtime_->numCompartments++;
|
||||
@ -77,7 +77,7 @@ JSCompartment::JSCompartment(Zone *zone, const JS::CompartmentOptions &options =
|
||||
JSCompartment::~JSCompartment()
|
||||
{
|
||||
#ifdef JS_ION
|
||||
js_delete(ionCompartment_);
|
||||
js_delete(jitCompartment_);
|
||||
#endif
|
||||
|
||||
js_delete(watchpointMap);
|
||||
@ -120,59 +120,59 @@ JSCompartment::init(JSContext *cx)
|
||||
}
|
||||
|
||||
#ifdef JS_ION
|
||||
jit::IonRuntime *
|
||||
JSRuntime::createIonRuntime(JSContext *cx)
|
||||
jit::JitRuntime *
|
||||
JSRuntime::createJitRuntime(JSContext *cx)
|
||||
{
|
||||
// The runtime will only be created on its owning thread, but reads of a
|
||||
// runtime's ionRuntime() can occur when another thread is triggering an
|
||||
// runtime's jitRuntime() can occur when another thread is triggering an
|
||||
// operation callback.
|
||||
AutoLockForOperationCallback lock(this);
|
||||
|
||||
JS_ASSERT(!ionRuntime_);
|
||||
JS_ASSERT(!jitRuntime_);
|
||||
|
||||
ionRuntime_ = cx->new_<jit::IonRuntime>();
|
||||
jitRuntime_ = cx->new_<jit::JitRuntime>();
|
||||
|
||||
if (!ionRuntime_)
|
||||
if (!jitRuntime_)
|
||||
return nullptr;
|
||||
|
||||
if (!ionRuntime_->initialize(cx)) {
|
||||
js_delete(ionRuntime_);
|
||||
ionRuntime_ = nullptr;
|
||||
if (!jitRuntime_->initialize(cx)) {
|
||||
js_delete(jitRuntime_);
|
||||
jitRuntime_ = nullptr;
|
||||
|
||||
AutoLockForExclusiveAccess atomsLock(cx);
|
||||
|
||||
JSCompartment *comp = cx->runtime()->atomsCompartment();
|
||||
if (comp->ionCompartment_) {
|
||||
js_delete(comp->ionCompartment_);
|
||||
comp->ionCompartment_ = nullptr;
|
||||
if (comp->jitCompartment_) {
|
||||
js_delete(comp->jitCompartment_);
|
||||
comp->jitCompartment_ = nullptr;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return ionRuntime_;
|
||||
return jitRuntime_;
|
||||
}
|
||||
|
||||
bool
|
||||
JSCompartment::ensureIonCompartmentExists(JSContext *cx)
|
||||
JSCompartment::ensureJitCompartmentExists(JSContext *cx)
|
||||
{
|
||||
using namespace js::jit;
|
||||
if (ionCompartment_)
|
||||
if (jitCompartment_)
|
||||
return true;
|
||||
|
||||
IonRuntime *ionRuntime = cx->runtime()->getIonRuntime(cx);
|
||||
if (!ionRuntime)
|
||||
JitRuntime *jitRuntime = cx->runtime()->getJitRuntime(cx);
|
||||
if (!jitRuntime)
|
||||
return false;
|
||||
|
||||
/* Set the compartment early, so linking works. */
|
||||
ionCompartment_ = cx->new_<IonCompartment>(ionRuntime);
|
||||
jitCompartment_ = cx->new_<JitCompartment>(jitRuntime);
|
||||
|
||||
if (!ionCompartment_)
|
||||
if (!jitCompartment_)
|
||||
return false;
|
||||
|
||||
if (!ionCompartment_->initialize(cx)) {
|
||||
js_delete(ionCompartment_);
|
||||
ionCompartment_ = nullptr;
|
||||
if (!jitCompartment_->initialize(cx)) {
|
||||
js_delete(jitCompartment_);
|
||||
jitCompartment_ = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -488,8 +488,8 @@ JSCompartment::mark(JSTracer *trc)
|
||||
JS_ASSERT(!trc->runtime->isHeapMinorCollecting());
|
||||
|
||||
#ifdef JS_ION
|
||||
if (ionCompartment_)
|
||||
ionCompartment_->mark(trc, this);
|
||||
if (jitCompartment_)
|
||||
jitCompartment_->mark(trc, this);
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -525,8 +525,8 @@ JSCompartment::sweep(FreeOp *fop, bool releaseTypes)
|
||||
global_ = nullptr;
|
||||
|
||||
#ifdef JS_ION
|
||||
if (ionCompartment_)
|
||||
ionCompartment_->sweep(fop);
|
||||
if (jitCompartment_)
|
||||
jitCompartment_->sweep(fop);
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -607,7 +607,7 @@ JSCompartment::clearTables()
|
||||
JS_ASSERT(crossCompartmentWrappers.empty());
|
||||
JS_ASSERT_IF(callsiteClones.initialized(), callsiteClones.empty());
|
||||
#ifdef JS_ION
|
||||
JS_ASSERT(!ionCompartment_);
|
||||
JS_ASSERT(!jitCompartment_);
|
||||
#endif
|
||||
JS_ASSERT(!debugScopes);
|
||||
JS_ASSERT(!gcWeakMapList);
|
||||
@ -897,9 +897,9 @@ JSCompartment::addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf,
|
||||
*regexpCompartment += regExps.sizeOfExcludingThis(mallocSizeOf);
|
||||
*debuggeesSet += debuggees.sizeOfExcludingThis(mallocSizeOf);
|
||||
#ifdef JS_ION
|
||||
if (ionCompartment()) {
|
||||
if (jitCompartment()) {
|
||||
*baselineStubsOptimized +=
|
||||
ionCompartment()->optimizedStubSpace()->sizeOfExcludingThis(mallocSizeOf);
|
||||
jitCompartment()->optimizedStubSpace()->sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
namespace js {
|
||||
|
||||
namespace jit {
|
||||
class IonCompartment;
|
||||
class JitCompartment;
|
||||
}
|
||||
|
||||
namespace gc {
|
||||
@ -405,12 +405,12 @@ struct JSCompartment
|
||||
|
||||
#ifdef JS_ION
|
||||
private:
|
||||
js::jit::IonCompartment *ionCompartment_;
|
||||
js::jit::JitCompartment *jitCompartment_;
|
||||
|
||||
public:
|
||||
bool ensureIonCompartmentExists(JSContext *cx);
|
||||
js::jit::IonCompartment *ionCompartment() {
|
||||
return ionCompartment_;
|
||||
bool ensureJitCompartmentExists(JSContext *cx);
|
||||
js::jit::JitCompartment *jitCompartment() {
|
||||
return jitCompartment_;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "jit/BaselineJIT.h"
|
||||
#include "jit/Ion.h"
|
||||
#include "jit/IonAnalysis.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#endif
|
||||
#include "js/MemoryMetrics.h"
|
||||
#include "vm/Shape.h"
|
||||
|
@ -105,7 +105,7 @@ FinishOffThreadIonCompile(jit::IonBuilder *builder)
|
||||
JS_ASSERT(compartment->runtimeFromAnyThread()->workerThreadState);
|
||||
JS_ASSERT(compartment->runtimeFromAnyThread()->workerThreadState->isLocked());
|
||||
|
||||
compartment->ionCompartment()->finishedOffThreadCompilations().append(builder);
|
||||
compartment->jitCompartment()->finishedOffThreadCompilations().append(builder);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
@ -126,8 +126,8 @@ js::CancelOffThreadIonCompile(JSCompartment *compartment, JSScript *script)
|
||||
|
||||
WorkerThreadState &state = *rt->workerThreadState;
|
||||
|
||||
jit::IonCompartment *ion = compartment->ionCompartment();
|
||||
if (!ion)
|
||||
jit::JitCompartment *jitComp = compartment->jitCompartment();
|
||||
if (!jitComp)
|
||||
return;
|
||||
|
||||
AutoLockWorkerThreadState lock(state);
|
||||
@ -153,7 +153,7 @@ js::CancelOffThreadIonCompile(JSCompartment *compartment, JSScript *script)
|
||||
}
|
||||
}
|
||||
|
||||
jit::OffThreadCompilationVector &compilations = ion->finishedOffThreadCompilations();
|
||||
jit::OffThreadCompilationVector &compilations = jitComp->finishedOffThreadCompilations();
|
||||
|
||||
/* Cancel code generation for any completed entries. */
|
||||
for (size_t i = 0; i < compilations.length(); i++) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#if defined(DEBUG) && defined(JS_THREADSAFE) && defined(JS_ION)
|
||||
# include "jit/Ion.h"
|
||||
# include "jit/IonCompartment.h"
|
||||
# include "jit/JitCompartment.h"
|
||||
# include "jit/MIR.h"
|
||||
# include "jit/MIRGraph.h"
|
||||
#endif // DEBUG && THREADSAFE && ION
|
||||
@ -1287,7 +1287,7 @@ class ParallelIonInvoke
|
||||
IonScript *ion = callee->nonLazyScript()->parallelIonScript();
|
||||
IonCode *code = ion->method();
|
||||
jitcode_ = code->raw();
|
||||
enter_ = rt->ionRuntime()->enterIon();
|
||||
enter_ = rt->jitRuntime()->enterIon();
|
||||
calleeToken_ = CalleeToToken(callee);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
# include "assembler/assembler/MacroAssembler.h"
|
||||
#endif
|
||||
#include "jit/AsmJSSignalHandlers.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#include "jit/PcScriptCache.h"
|
||||
#include "js/MemoryMetrics.h"
|
||||
#include "yarr/BumpPointerAllocator.h"
|
||||
@ -141,7 +141,7 @@ JSRuntime::JSRuntime(JSUseHelperThreads useHelperThreads)
|
||||
freeLifoAlloc(TEMP_LIFO_ALLOC_PRIMARY_CHUNK_SIZE),
|
||||
execAlloc_(nullptr),
|
||||
bumpAlloc_(nullptr),
|
||||
ionRuntime_(nullptr),
|
||||
jitRuntime_(nullptr),
|
||||
selfHostingGlobal_(nullptr),
|
||||
nativeStackBase(0),
|
||||
cxCallback(nullptr),
|
||||
@ -508,9 +508,9 @@ JSRuntime::~JSRuntime()
|
||||
js_delete(bumpAlloc_);
|
||||
js_delete(mathCache_);
|
||||
#ifdef JS_ION
|
||||
js_delete(ionRuntime_);
|
||||
js_delete(jitRuntime_);
|
||||
#endif
|
||||
js_delete(execAlloc_); /* Delete after ionRuntime_. */
|
||||
js_delete(execAlloc_); /* Delete after jitRuntime_. */
|
||||
|
||||
js_delete(ionPcScriptCache);
|
||||
|
||||
@ -565,8 +565,8 @@ JSRuntime::addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf, JS::Runtim
|
||||
#ifdef JS_ION
|
||||
{
|
||||
AutoLockForOperationCallback lock(this);
|
||||
if (ionRuntime()) {
|
||||
if (JSC::ExecutableAllocator *ionAlloc = ionRuntime()->ionAlloc(this))
|
||||
if (jitRuntime()) {
|
||||
if (JSC::ExecutableAllocator *ionAlloc = jitRuntime()->ionAlloc(this))
|
||||
ionAlloc->addSizeOfCode(&rtSizes->code);
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ class MathCache;
|
||||
class WorkerThreadState;
|
||||
|
||||
namespace jit {
|
||||
class IonRuntime;
|
||||
class JitRuntime;
|
||||
class JitActivation;
|
||||
struct PcScriptCache;
|
||||
}
|
||||
@ -860,7 +860,7 @@ struct JSRuntime : public JS::shadow::Runtime,
|
||||
*/
|
||||
JSC::ExecutableAllocator *execAlloc_;
|
||||
WTF::BumpPointerAllocator *bumpAlloc_;
|
||||
js::jit::IonRuntime *ionRuntime_;
|
||||
js::jit::JitRuntime *jitRuntime_;
|
||||
|
||||
JSObject *selfHostingGlobal_;
|
||||
|
||||
@ -869,7 +869,7 @@ struct JSRuntime : public JS::shadow::Runtime,
|
||||
|
||||
JSC::ExecutableAllocator *createExecutableAllocator(JSContext *cx);
|
||||
WTF::BumpPointerAllocator *createBumpPointerAllocator(JSContext *cx);
|
||||
js::jit::IonRuntime *createIonRuntime(JSContext *cx);
|
||||
js::jit::JitRuntime *createJitRuntime(JSContext *cx);
|
||||
|
||||
public:
|
||||
JSC::ExecutableAllocator *getExecAlloc(JSContext *cx) {
|
||||
@ -885,14 +885,14 @@ struct JSRuntime : public JS::shadow::Runtime,
|
||||
WTF::BumpPointerAllocator *getBumpPointerAllocator(JSContext *cx) {
|
||||
return bumpAlloc_ ? bumpAlloc_ : createBumpPointerAllocator(cx);
|
||||
}
|
||||
js::jit::IonRuntime *getIonRuntime(JSContext *cx) {
|
||||
return ionRuntime_ ? ionRuntime_ : createIonRuntime(cx);
|
||||
js::jit::JitRuntime *getJitRuntime(JSContext *cx) {
|
||||
return jitRuntime_ ? jitRuntime_ : createJitRuntime(cx);
|
||||
}
|
||||
js::jit::IonRuntime *ionRuntime() {
|
||||
return ionRuntime_;
|
||||
js::jit::JitRuntime *jitRuntime() const {
|
||||
return jitRuntime_;
|
||||
}
|
||||
bool hasIonRuntime() const {
|
||||
return !!ionRuntime_;
|
||||
bool hasJitRuntime() const {
|
||||
return !!jitRuntime_;
|
||||
}
|
||||
js::InterpreterStack &interpreterStack() {
|
||||
return interpreterStack_;
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "gc/Marking.h"
|
||||
#ifdef JS_ION
|
||||
#include "jit/BaselineFrame.h"
|
||||
#include "jit/IonCompartment.h"
|
||||
#include "jit/JitCompartment.h"
|
||||
#endif
|
||||
|
||||
#include "jit/IonFrameIterator-inl.h"
|
||||
|
Loading…
Reference in New Issue
Block a user