Bug 977181 - Rename some ion* things to jit* (r=jandem)

--HG--
extra : rebase_source : b407530eb658563f32a5c569d1a0095fc2231d42
This commit is contained in:
Luke Wagner 2014-02-26 17:38:46 -06:00
Родитель 6fa2286415
Коммит dd3bfceeff
13 изменённых файлов: 52 добавлений и 41 удалений

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

@ -455,7 +455,7 @@ bool
BaselineCompiler::emitStackCheck(bool earlyCheck)
{
Label skipCall;
uintptr_t *limitAddr = &cx->runtime()->mainThread.ionStackLimit;
uintptr_t *limitAddr = &cx->runtime()->mainThread.jitStackLimit;
uint32_t slotsSize = script->nslots() * sizeof(Value);
uint32_t tolerance = earlyCheck ? slotsSize : 0;

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

@ -2741,7 +2741,7 @@ CodeGenerator::visitCheckOverRecursed(LCheckOverRecursed *lir)
// Since Ion frames exist on the C stack, the stack limit may be
// dynamically set by JS_SetThreadStackLimit() and JS_SetNativeStackQuota().
const void *limitAddr = GetIonContext()->runtime->addressOfIonStackLimit();
const void *limitAddr = GetIonContext()->runtime->addressOfJitStackLimit();
CheckOverRecursedFailure *ool = new(alloc()) CheckOverRecursedFailure(lir);
if (!addOutOfLineCode(ool))
@ -2834,7 +2834,7 @@ bool
CodeGenerator::visitCheckOverRecursedPar(LCheckOverRecursedPar *lir)
{
// See above: unlike visitCheckOverRecursed(), this code runs in
// parallel mode and hence uses the ionStackLimit from the current
// parallel mode and hence uses the jitStackLimit from the current
// thread state. Also, we must check the interrupt flags because
// on interrupt or abort, only the stack limit for the main thread
// is reset, not the worker threads. See comment in vm/ForkJoin.h
@ -2844,7 +2844,7 @@ CodeGenerator::visitCheckOverRecursedPar(LCheckOverRecursedPar *lir)
Register tempReg = ToRegister(lir->getTempReg());
masm.loadPtr(Address(cxReg, offsetof(ForkJoinContext, perThreadData)), tempReg);
masm.loadPtr(Address(tempReg, offsetof(PerThreadData, ionStackLimit)), tempReg);
masm.loadPtr(Address(tempReg, offsetof(PerThreadData, jitStackLimit)), tempReg);
// Conditional forward (unlikely) branch to failure.
CheckOverRecursedFailurePar *ool = new(alloc()) CheckOverRecursedFailurePar(lir);

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

@ -34,15 +34,15 @@ CompileRuntime::addressOfIonTop()
}
const void *
CompileRuntime::addressOfIonStackLimit()
CompileRuntime::addressOfJitStackLimit()
{
return &runtime()->mainThread.ionStackLimit;
return &runtime()->mainThread.jitStackLimit;
}
const void *
CompileRuntime::addressOfJSContext()
{
return &runtime()->mainThread.ionJSContext;
return &runtime()->mainThread.jitJSContext;
}
const void *

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

@ -34,8 +34,8 @@ class CompileRuntime
// &mainThread.ionTop
const void *addressOfIonTop();
// rt->mainThread.ionStackLimit;
const void *addressOfIonStackLimit();
// rt->mainThread.jitStackLimit;
const void *addressOfJitStackLimit();
// &mainThread.ionJSContext
const void *addressOfJSContext();

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

@ -201,7 +201,7 @@ jit::CheckOverRecursedPar(ForkJoinContext *cx)
if (cx->isMainThread())
realStackLimit = GetNativeStackLimit(cx);
else
realStackLimit = cx->perThreadData->ionStackLimit;
realStackLimit = cx->perThreadData->jitStackLimit;
if (!JS_CHECK_STACK_SIZE(realStackLimit, &stackDummy_)) {
cx->bailoutRecord->setCause(ParallelBailoutOverRecursed);

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

@ -109,14 +109,14 @@ bool
CheckOverRecursed(JSContext *cx)
{
// IonMonkey's stackLimit is equal to nativeStackLimit by default. When we
// want to trigger an operation callback, we set the ionStackLimit to nullptr,
// want to trigger an operation callback, we set the jitStackLimit to nullptr,
// which causes the stack limit check to fail.
//
// There are two states we're concerned about here:
// (1) The interrupt bit is set, and we need to fire the interrupt callback.
// (2) The stack limit has been exceeded, and we need to throw an error.
//
// Note that we can reach here if ionStackLimit is MAXADDR, but interrupt
// Note that we can reach here if jitStackLimit is MAXADDR, but interrupt
// has not yet been set to 1. That's okay; it will be set to 1 very shortly,
// and in the interim we might just fire a few useless calls to
// CheckOverRecursed.

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

@ -2143,7 +2143,7 @@ js::RecomputeStackLimit(JSRuntime *rt, StackKind kind)
#endif
// If there's no pending interrupt request set on the runtime's main thread's
// ionStackLimit, then update it so that it reflects the new nativeStacklimit.
// jitStackLimit, then update it so that it reflects the new nativeStacklimit.
//
// Note that, for now, we use the untrusted limit for ion. This is fine,
// because it's the most conservative limit, and if we hit it, we'll bail
@ -2151,10 +2151,10 @@ js::RecomputeStackLimit(JSRuntime *rt, StackKind kind)
#ifdef JS_ION
if (kind == StackForUntrustedScript) {
JSRuntime::AutoLockForOperationCallback lock(rt);
if (rt->mainThread.ionStackLimit != uintptr_t(-1)) {
rt->mainThread.ionStackLimit = rt->mainThread.nativeStackLimit[kind];
if (rt->mainThread.jitStackLimit != uintptr_t(-1)) {
rt->mainThread.jitStackLimit = rt->mainThread.nativeStackLimit[kind];
#ifdef JS_ARM_SIMULATOR
rt->mainThread.ionStackLimit = jit::Simulator::StackLimit();
rt->mainThread.jitStackLimit = jit::Simulator::StackLimit();
#endif
}
}

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

@ -1015,7 +1015,7 @@ js_InvokeOperationCallback(JSContext *cx)
// IonMonkey sets its stack limit to UINTPTR_MAX to trigger operation
// callbacks.
rt->resetIonStackLimit();
rt->resetJitStackLimit();
js::gc::GCIfNeeded(cx);

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

@ -1468,7 +1468,7 @@ ForkJoinShared::executeFromWorker(uint32_t workerId, uintptr_t stackLimit)
// Don't use setIonStackLimit() because that acquires the ionStackLimitLock, and the
// lock has not been initialized in these cases.
thisThread.ionStackLimit = stackLimit;
thisThread.jitStackLimit = stackLimit;
executePortion(&thisThread, workerId);
TlsPerThreadData.set(nullptr);

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

@ -70,8 +70,8 @@ PerThreadData::PerThreadData(JSRuntime *runtime)
: PerThreadDataFriendFields(),
runtime_(runtime),
ionTop(nullptr),
ionJSContext(nullptr),
ionStackLimit(0),
jitJSContext(nullptr),
jitStackLimit(0),
activation_(nullptr),
asmJSActivationStack_(nullptr),
#ifdef JS_ARM_SIMULATOR
@ -566,13 +566,13 @@ NewObjectCache::clearNurseryObjects(JSRuntime *rt)
}
void
JSRuntime::resetIonStackLimit()
JSRuntime::resetJitStackLimit()
{
AutoLockForOperationCallback lock(this);
mainThread.setIonStackLimit(mainThread.nativeStackLimit[js::StackForUntrustedScript]);
mainThread.setJitStackLimit(mainThread.nativeStackLimit[js::StackForUntrustedScript]);
#ifdef JS_ARM_SIMULATOR
mainThread.setIonStackLimit(js::jit::Simulator::StackLimit());
mainThread.setJitStackLimit(js::jit::Simulator::StackLimit());
#endif
}
@ -646,10 +646,10 @@ JSRuntime::triggerOperationCallback(OperationCallbackTrigger trigger)
/*
* Invalidate ionTop to trigger its over-recursion check. Note this must be
* set before interrupt, to avoid racing with js_InvokeOperationCallback,
* into a weird state where interrupt is stuck at 0 but ionStackLimit is
* into a weird state where interrupt is stuck at 0 but jitStackLimit is
* MAXADDR.
*/
mainThread.setIonStackLimit(-1);
mainThread.setJitStackLimit(-1);
interrupt = true;

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

@ -534,10 +534,21 @@ class PerThreadData : public PerThreadDataFriendFields
* aligned to an Ion exit frame.
*/
uint8_t *ionTop;
JSContext *ionJSContext;
uintptr_t ionStackLimit;
inline void setIonStackLimit(uintptr_t limit);
/*
* The current JSContext when entering JIT code. This field may only be used
* from JIT code and C++ directly called by JIT code (otherwise it may refer
* to the wrong JSContext).
*/
JSContext *jitJSContext;
/*
* The stack limit checked by JIT code. This stack limit may be temporarily
* set to null to force JIT code to exit (e.g., for the operation callback).
*/
uintptr_t jitStackLimit;
inline void setJitStackLimit(uintptr_t limit);
/*
* asm.js maintains a stack of AsmJSModule activations (see AsmJS.h). This
@ -1566,9 +1577,9 @@ struct JSRuntime : public JS::shadow::Runtime,
bool jitSupportsFloatingPoint;
// Used to reset stack limit after a signaled interrupt (i.e. ionStackLimit_ = -1)
// Used to reset stack limit after a signaled interrupt (i.e. jitStackLimit_ = -1)
// has been noticed by Ion/Baseline.
void resetIonStackLimit();
void resetJitStackLimit();
// Cache for jit::GetPcScript().
js::jit::PcScriptCache *ionPcScriptCache;
@ -1778,7 +1789,7 @@ namespace js {
static inline JSContext *
GetJSContextFromJitCode()
{
JSContext *cx = TlsPerThreadData.get()->ionJSContext;
JSContext *cx = TlsPerThreadData.get()->jitJSContext;
JS_ASSERT(cx);
return cx;
}
@ -1915,10 +1926,10 @@ class MOZ_STACK_CLASS AutoKeepAtoms
};
inline void
PerThreadData::setIonStackLimit(uintptr_t limit)
PerThreadData::setJitStackLimit(uintptr_t limit)
{
JS_ASSERT(runtime_->currentThreadOwnsOperationCallbackLock());
ionStackLimit = limit;
jitStackLimit = limit;
}
inline JSRuntime *

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

@ -1329,11 +1329,11 @@ jit::JitActivation::JitActivation(JSContext *cx, bool firstFrameIsConstructing,
{
if (active) {
prevIonTop_ = cx->mainThread().ionTop;
prevIonJSContext_ = cx->mainThread().ionJSContext;
cx->mainThread().ionJSContext = cx;
prevJitJSContext_ = cx->mainThread().jitJSContext;
cx->mainThread().jitJSContext = cx;
} else {
prevIonTop_ = nullptr;
prevIonJSContext_ = nullptr;
prevJitJSContext_ = nullptr;
}
}
@ -1341,7 +1341,7 @@ jit::JitActivation::~JitActivation()
{
if (active_) {
cx_->mainThread().ionTop = prevIonTop_;
cx_->mainThread().ionJSContext = prevIonJSContext_;
cx_->mainThread().jitJSContext = prevJitJSContext_;
}
}
@ -1356,11 +1356,11 @@ jit::JitActivation::setActive(JSContext *cx, bool active)
if (active) {
prevIonTop_ = cx->mainThread().ionTop;
prevIonJSContext_ = cx->mainThread().ionJSContext;
cx->mainThread().ionJSContext = cx;
prevJitJSContext_ = cx->mainThread().jitJSContext;
cx->mainThread().jitJSContext = cx;
} else {
cx->mainThread().ionTop = prevIonTop_;
cx->mainThread().ionJSContext = prevIonJSContext_;
cx->mainThread().jitJSContext = prevJitJSContext_;
}
}

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

@ -1305,7 +1305,7 @@ namespace jit {
class JitActivation : public Activation
{
uint8_t *prevIonTop_;
JSContext *prevIonJSContext_;
JSContext *prevJitJSContext_;
bool firstFrameIsConstructing_;
bool active_;