Bug 1003918 - Rename ionTop to jitTop, move ionReturnOverride from JSRuntime to JitRuntime. r=shu

This commit is contained in:
Jan de Mooij 2014-05-01 11:35:08 +02:00
parent 26d2f85bd9
commit a232f60649
23 changed files with 101 additions and 100 deletions

View File

@ -6605,21 +6605,21 @@ GenerateFFIIonExit(ModuleCompiler &m, const ModuleCompiler::ExitDescriptor &exit
// JSContext *cx = activation->cx();
// Activation *act = cx->mainThread().activation();
// act.active_ = true;
// act.prevIonTop_ = cx->mainThread().ionTop;
// act.prevJitTop_ = cx->mainThread().jitTop;
// act.prevJitJSContext_ = cx->mainThread().jitJSContext;
// cx->mainThread().jitJSContext = cx;
// On the ARM store8() uses the secondScratchReg (lr) as a temp.
size_t offsetOfActivation = offsetof(JSRuntime, mainThread) +
PerThreadData::offsetOfActivation();
size_t offsetOfIonTop = offsetof(JSRuntime, mainThread) + offsetof(PerThreadData, ionTop);
size_t offsetOfJitTop = offsetof(JSRuntime, mainThread) + offsetof(PerThreadData, jitTop);
size_t offsetOfJitJSContext = offsetof(JSRuntime, mainThread) +
offsetof(PerThreadData, jitJSContext);
masm.loadPtr(Address(reg0, AsmJSActivation::offsetOfContext()), reg3);
masm.loadPtr(Address(reg3, JSContext::offsetOfRuntime()), reg0);
masm.loadPtr(Address(reg0, offsetOfActivation), reg1);
masm.store8(Imm32(1), Address(reg1, JitActivation::offsetOfActiveUint8()));
masm.loadPtr(Address(reg0, offsetOfIonTop), reg2);
masm.storePtr(reg2, Address(reg1, JitActivation::offsetOfPrevIonTop()));
masm.loadPtr(Address(reg0, offsetOfJitTop), reg2);
masm.storePtr(reg2, Address(reg1, JitActivation::offsetOfPrevJitTop()));
masm.loadPtr(Address(reg0, offsetOfJitJSContext), reg2);
masm.storePtr(reg2, Address(reg1, JitActivation::offsetOfPrevJitJSContext()));
masm.storePtr(reg3, Address(reg0, offsetOfJitJSContext));
@ -6647,20 +6647,20 @@ GenerateFFIIonExit(ModuleCompiler &m, const ModuleCompiler::ExitDescriptor &exit
// JSContext *cx = activation->cx();
// Activation *act = cx->mainThread().activation();
// act.active_ = false;
// cx->mainThread().ionTop = prevIonTop_;
// cx->mainThread().jitTop = prevJitTop_;
// cx->mainThread().jitJSContext = prevJitJSContext_;
// On the ARM store8() uses the secondScratchReg (lr) as a temp.
size_t offsetOfActivation = offsetof(JSRuntime, mainThread) +
PerThreadData::offsetOfActivation();
size_t offsetOfIonTop = offsetof(JSRuntime, mainThread) + offsetof(PerThreadData, ionTop);
size_t offsetOfJitTop = offsetof(JSRuntime, mainThread) + offsetof(PerThreadData, jitTop);
size_t offsetOfJitJSContext = offsetof(JSRuntime, mainThread) +
offsetof(PerThreadData, jitJSContext);
masm.loadPtr(Address(reg0, AsmJSActivation::offsetOfContext()), reg0);
masm.loadPtr(Address(reg0, JSContext::offsetOfRuntime()), reg0);
masm.loadPtr(Address(reg0, offsetOfActivation), reg1);
masm.store8(Imm32(0), Address(reg1, JitActivation::offsetOfActiveUint8()));
masm.loadPtr(Address(reg1, JitActivation::offsetOfPrevIonTop()), reg2);
masm.storePtr(reg2, Address(reg0, offsetOfIonTop));
masm.loadPtr(Address(reg1, JitActivation::offsetOfPrevJitTop()), reg2);
masm.storePtr(reg2, Address(reg0, offsetOfJitTop));
masm.loadPtr(Address(reg1, JitActivation::offsetOfPrevJitJSContext()), reg2);
masm.storePtr(reg2, Address(reg0, offsetOfJitJSContext));
}

View File

@ -75,7 +75,7 @@ jit::Bailout(BailoutStack *sp, BaselineBailoutInfo **bailoutInfo)
JS_ASSERT(bailoutInfo);
// We don't have an exit frame.
cx->mainThread().ionTop = nullptr;
cx->mainThread().jitTop = nullptr;
JitActivationIterator jitActivations(cx->runtime());
IonBailoutIterator iter(jitActivations, sp);
JitActivation *activation = jitActivations->asJit();
@ -109,7 +109,7 @@ jit::InvalidationBailout(InvalidationBailoutStack *sp, size_t *frameSizeOut,
JSContext *cx = GetJSContextFromJitCode();
// We don't have an exit frame.
cx->mainThread().ionTop = nullptr;
cx->mainThread().jitTop = nullptr;
JitActivationIterator jitActivations(cx->runtime());
IonBailoutIterator iter(jitActivations, sp);
JitActivation *activation = jitActivations->asJit();
@ -177,7 +177,7 @@ jit::ExceptionHandlerBailout(JSContext *cx, const InlineFrameIterator &frame,
// operation callback like a timeout handler.
MOZ_ASSERT_IF(!excInfo.propagatingIonExceptionForDebugMode(), cx->isExceptionPending());
cx->mainThread().ionTop = nullptr;
cx->mainThread().jitTop = nullptr;
JitActivationIterator jitActivations(cx->runtime());
IonBailoutIterator iter(jitActivations, frame.frame());
JitActivation *activation = jitActivations->asJit();

View File

@ -779,7 +779,7 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
Value v;
if (!iter.moreFrames() && i == exprStackSlots - 1 &&
cx->runtime()->hasIonReturnOverride())
cx->runtime()->jitRuntime()->hasIonReturnOverride())
{
// If coming from an invalidation bailout, and this is the topmost
// value, and a value override has been specified, don't read from the
@ -787,7 +787,7 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
JS_ASSERT(invalidate);
iter.skip();
IonSpew(IonSpew_BaselineBailouts, " [Return Override]");
v = cx->runtime()->takeIonReturnOverride();
v = cx->runtime()->jitRuntime()->takeIonReturnOverride();
} else if (excInfo && excInfo->propagatingIonExceptionForDebugMode()) {
// If we are in the middle of propagating an exception from Ion by
// bailing to baseline due to debug mode, we might not have all

View File

@ -128,7 +128,7 @@ EnterBaseline(JSContext *cx, EnterJitData &data)
data.osrFrame->clearRunningInJit();
}
JS_ASSERT(!cx->runtime()->hasIonReturnOverride());
JS_ASSERT(!cx->runtime()->jitRuntime()->hasIonReturnOverride());
// Jit callers wrap primitive constructor return.
if (!data.result.isMagic() && data.constructing && data.result.isPrimitive())

View File

@ -35,9 +35,9 @@ CompileRuntime::mainThread()
}
const void *
CompileRuntime::addressOfIonTop()
CompileRuntime::addressOfJitTop()
{
return &runtime()->mainThread.ionTop;
return &runtime()->mainThread.jitTop;
}
const void *

View File

@ -33,8 +33,8 @@ class CompileRuntime
js::PerThreadData *mainThread();
// &mainThread.ionTop
const void *addressOfIonTop();
// &mainThread.jitTop
const void *addressOfJitTop();
// rt->mainThread.jitStackLimit;
const void *addressOfJitStackLimit();

View File

@ -163,7 +163,8 @@ JitRuntime::JitRuntime()
functionWrappers_(nullptr),
osrTempData_(nullptr),
flusher_(nullptr),
ionCodeProtected_(false)
ionCodeProtected_(false),
ionReturnOverride_(MagicValue(JS_ARG_POISON))
{
}
@ -2406,7 +2407,7 @@ EnterIon(JSContext *cx, EnterJitData &data)
/* scopeChain = */ nullptr, 0, data.result.address());
}
JS_ASSERT(!cx->runtime()->hasIonReturnOverride());
JS_ASSERT(!cx->runtime()->jitRuntime()->hasIonReturnOverride());
// Jit callers wrap primitive constructor return.
if (!data.result.isMagic() && data.constructing && data.result.isPrimitive())
@ -2514,7 +2515,7 @@ jit::FastInvoke(JSContext *cx, HandleFunction fun, CallArgs &args)
CALL_GENERATED_CODE(enter, jitcode, args.length() + 1, args.array() - 1, /* osrFrame = */nullptr,
calleeToken, /* scopeChain = */ nullptr, 0, result.address());
JS_ASSERT(!cx->runtime()->hasIonReturnOverride());
JS_ASSERT(!cx->runtime()->jitRuntime()->hasIonReturnOverride());
args.rval().set(result);
@ -2523,13 +2524,13 @@ jit::FastInvoke(JSContext *cx, HandleFunction fun, CallArgs &args)
}
static void
InvalidateActivation(FreeOp *fop, uint8_t *ionTop, bool invalidateAll)
InvalidateActivation(FreeOp *fop, uint8_t *jitTop, bool invalidateAll)
{
IonSpew(IonSpew_Invalidate, "BEGIN invalidating activation");
size_t frameno = 1;
for (JitFrameIterator it(ionTop, SequentialExecution); !it.done(); ++it, ++frameno) {
for (JitFrameIterator it(jitTop, SequentialExecution); !it.done(); ++it, ++frameno) {
JS_ASSERT_IF(frameno == 1, it.type() == JitFrame_Exit);
#ifdef DEBUG

View File

@ -84,13 +84,13 @@ GetTopBaselineFrame(JSContext *cx)
inline JSScript *
GetTopIonJSScript(JSContext *cx, void **returnAddrOut = nullptr)
{
return GetTopIonJSScript(cx->mainThread().ionTop, returnAddrOut, SequentialExecution);
return GetTopIonJSScript(cx->mainThread().jitTop, returnAddrOut, SequentialExecution);
}
inline JSScript *
GetTopIonJSScript(ForkJoinContext *cx, void **returnAddrOut = nullptr)
{
return GetTopIonJSScript(cx->perThreadData->ionTop, returnAddrOut, ParallelExecution);
return GetTopIonJSScript(cx->perThreadData->jitTop, returnAddrOut, ParallelExecution);
}
} // namespace jit

View File

@ -76,7 +76,7 @@ ReadFrameBooleanSlot(IonJSFrameLayout *fp, int32_t slot)
}
JitFrameIterator::JitFrameIterator(ThreadSafeContext *cx)
: current_(cx->perThreadData->ionTop),
: current_(cx->perThreadData->jitTop),
type_(JitFrame_Exit),
returnAddressToFp_(nullptr),
frameSize_(0),
@ -615,8 +615,8 @@ HandleException(ResumeFromException *rfe)
// This may happen if a callVM function causes an invalidation (setting the
// override), and then fails, bypassing the bailout handlers that would
// otherwise clear the return override.
if (cx->runtime()->hasIonReturnOverride())
cx->runtime()->takeIonReturnOverride();
if (cx->runtime()->jitRuntime()->hasIonReturnOverride())
cx->runtime()->jitRuntime()->takeIonReturnOverride();
JitFrameIterator iter(cx);
while (!iter.isEntry()) {
@ -715,13 +715,13 @@ HandleException(ResumeFromException *rfe)
++iter;
if (current) {
// Unwind the frame by updating ionTop. This is necessary so that
// Unwind the frame by updating jitTop. This is necessary so that
// (1) debugger exception unwind and leave frame hooks don't see this
// frame when they use ScriptFrameIter, and (2) ScriptFrameIter does
// not crash when accessing an IonScript that's destroyed by the
// ionScript->decref call.
EnsureExitFrame(current);
cx->mainThread().ionTop = (uint8_t *)current;
cx->mainThread().jitTop = (uint8_t *)current;
}
if (overrecursed) {
@ -737,7 +737,7 @@ void
HandleParallelFailure(ResumeFromException *rfe)
{
ForkJoinContext *cx = ForkJoinContext::current();
JitFrameIterator iter(cx->perThreadData->ionTop, ParallelExecution);
JitFrameIterator iter(cx->perThreadData->jitTop, ParallelExecution);
parallel::Spew(parallel::SpewBailouts, "Bailing from VM reentry");
@ -1275,7 +1275,7 @@ GetPcScript(JSContext *cx, JSScript **scriptRes, jsbytecode **pcRes)
JSRuntime *rt = cx->runtime();
// Recover the return address.
JitFrameIterator it(rt->mainThread.ionTop, SequentialExecution);
JitFrameIterator it(rt->mainThread.jitTop, SequentialExecution);
// If the previous frame is a rectifier frame (maybe unwound),
// skip past it.

View File

@ -283,9 +283,9 @@ MakeFrameDescriptor(uint32_t frameSize, FrameType type)
// Returns the JSScript associated with the topmost Ion frame.
inline JSScript *
GetTopIonJSScript(uint8_t *ionTop, void **returnAddrOut, ExecutionMode mode)
GetTopIonJSScript(uint8_t *jitTop, void **returnAddrOut, ExecutionMode mode)
{
JitFrameIterator iter(ionTop, mode);
JitFrameIterator iter(jitTop, mode);
JS_ASSERT(iter.type() == JitFrame_Exit);
++iter;

View File

@ -216,6 +216,20 @@ class JitRuntime
// IonScripts in the runtime.
InlineList<PatchableBackedge> backedgeList_;
// In certain cases, we want to optimize certain opcodes to typed instructions,
// to avoid carrying an extra register to feed into an unbox. Unfortunately,
// that's not always possible. For example, a GetPropertyCacheT could return a
// typed double, but if it takes its out-of-line path, it could return an
// object, and trigger invalidation. The invalidation bailout will consider the
// return value to be a double, and create a garbage Value.
//
// To allow the GetPropertyCacheT optimization, we allow the ability for
// GetPropertyCache to override the return value at the top of the stack - the
// value that will be temporarily corrupt. This special override value is set
// only in callVM() targets that are about to return *and* have invalidated
// their callee.
js::Value ionReturnOverride_;
private:
JitCode *generateExceptionTailStub(JSContext *cx);
JitCode *generateBailoutTailStub(JSContext *cx);
@ -341,6 +355,20 @@ class JitRuntime
JitCode *forkJoinGetSliceStub() const {
return forkJoinGetSliceStub_;
}
bool hasIonReturnOverride() const {
return !ionReturnOverride_.isMagic(JS_ARG_POISON);
}
js::Value takeIonReturnOverride() {
js::Value v = ionReturnOverride_;
ionReturnOverride_ = js::MagicValue(JS_ARG_POISON);
return v;
}
void setIonReturnOverride(const js::Value &v) {
JS_ASSERT(!hasIonReturnOverride());
JS_ASSERT(!v.isMagic());
ionReturnOverride_ = v;
}
};
class JitZone

View File

@ -804,12 +804,12 @@ DebugEpilogue(JSContext *cx, BaselineFrame *frame, jsbytecode *pc, bool ok)
}
if (!ok) {
// Pop this frame by updating ionTop, so that the exception handling
// Pop this frame by updating jitTop, so that the exception handling
// code will start at the previous frame.
IonJSFrameLayout *prefix = frame->framePrefix();
EnsureExitFrame(prefix);
cx->mainThread().ionTop = (uint8_t *)prefix;
cx->mainThread().jitTop = (uint8_t *)prefix;
}
return ok;

View File

@ -566,7 +566,7 @@ class AutoDetectInvalidation
~AutoDetectInvalidation() {
if (!disabled_ && ionScript_->invalidated())
cx_->runtime()->setIonReturnOverride(*rval_);
cx_->runtime()->jitRuntime()->setIonReturnOverride(*rval_);
}
};

View File

@ -3503,8 +3503,9 @@ MacroAssemblerARMCompat::storeTypeTag(ImmTag tag, Register base, Register index,
}
void
MacroAssemblerARMCompat::linkExitFrame() {
uint8_t *dest = (uint8_t*)GetIonContext()->runtime->addressOfIonTop();
MacroAssemblerARMCompat::linkExitFrame()
{
uint8_t *dest = (uint8_t*)GetIonContext()->runtime->addressOfJitTop();
movePtr(ImmPtr(dest), ScratchRegister);
ma_str(StackPointer, Operand(ScratchRegister, 0));
}
@ -3512,7 +3513,7 @@ MacroAssemblerARMCompat::linkExitFrame() {
void
MacroAssemblerARMCompat::linkParallelExitFrame(const Register &pt)
{
ma_str(StackPointer, Operand(pt, offsetof(PerThreadData, ionTop)));
ma_str(StackPointer, Operand(pt, offsetof(PerThreadData, jitTop)));
}
// ARM says that all reads of pc will return 8 higher than the

View File

@ -2834,7 +2834,7 @@ MacroAssemblerMIPSCompat::storeTypeTag(ImmTag tag, Register base, Register index
void
MacroAssemblerMIPSCompat::linkExitFrame()
{
uint8_t *dest = (uint8_t*)GetIonContext()->runtime->addressOfIonTop();
uint8_t *dest = (uint8_t*)GetIonContext()->runtime->addressOfJitTop();
movePtr(ImmPtr(dest), ScratchRegister);
ma_sw(StackPointer, Address(ScratchRegister, 0));
}
@ -2842,7 +2842,7 @@ MacroAssemblerMIPSCompat::linkExitFrame()
void
MacroAssemblerMIPSCompat::linkParallelExitFrame(const Register &pt)
{
ma_sw(StackPointer, Address(pt, offsetof(PerThreadData, ionTop)));
ma_sw(StackPointer, Address(pt, offsetof(PerThreadData, jitTop)));
}
// This macrosintruction calls the ion code and pushes the return address to

View File

@ -1301,10 +1301,9 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
}
// Save an exit frame (which must be aligned to the stack pointer) to
// ThreadData::ionTop of the main thread.
// PerThreadData::jitTop of the main thread.
void linkExitFrame() {
storePtr(StackPointer,
AbsoluteAddress(GetIonContext()->runtime->addressOfIonTop()));
storePtr(StackPointer, AbsoluteAddress(GetIonContext()->runtime->addressOfJitTop()));
}
void callWithExitFrame(JitCode *target, Register dynStack) {
@ -1317,7 +1316,7 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
// Save an exit frame to the thread data of the current thread, given a
// register that holds a PerThreadData *.
void linkParallelExitFrame(const Register &pt) {
storePtr(StackPointer, Address(pt, offsetof(PerThreadData, ionTop)));
storePtr(StackPointer, Address(pt, offsetof(PerThreadData, jitTop)));
}
// See CodeGeneratorX64 calls to noteAsmJSGlobalAccess.

View File

@ -1098,9 +1098,9 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared
}
// Save an exit frame (which must be aligned to the stack pointer) to
// ThreadData::ionTop of the main thread.
// PerThreadData::jitTop of the main thread.
void linkExitFrame() {
movl(StackPointer, Operand(AbsoluteAddress(GetIonContext()->runtime->addressOfIonTop())));
movl(StackPointer, Operand(AbsoluteAddress(GetIonContext()->runtime->addressOfJitTop())));
}
void callWithExitFrame(JitCode *target, Register dynStack) {
@ -1120,7 +1120,7 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared
// Save an exit frame to the thread data of the current thread, given a
// register that holds a PerThreadData *.
void linkParallelExitFrame(const Register &pt) {
movl(StackPointer, Operand(pt, offsetof(PerThreadData, ionTop)));
movl(StackPointer, Operand(pt, offsetof(PerThreadData, jitTop)));
}
#ifdef JSGC_GENERATIONAL

View File

@ -462,7 +462,7 @@ class AutoSetForkJoinContext
ForkJoinActivation::ForkJoinActivation(JSContext *cx)
: Activation(cx, ForkJoin),
prevIonTop_(cx->mainThread().ionTop),
prevJitTop_(cx->mainThread().jitTop),
av_(cx->runtime(), false)
{
// Note: we do not allow GC during parallel sections.
@ -487,7 +487,7 @@ ForkJoinActivation::ForkJoinActivation(JSContext *cx)
ForkJoinActivation::~ForkJoinActivation()
{
cx_->perThreadData->ionTop = prevIonTop_;
cx_->perThreadData->jitTop = prevJitTop_;
}
///////////////////////////////////////////////////////////////////////////

View File

@ -216,7 +216,7 @@ namespace js {
class ForkJoinActivation : public Activation
{
uint8_t *prevIonTop_;
uint8_t *prevJitTop_;
// We ensure that incremental GC be finished before we enter into a fork
// join section, but the runtime/zone might still be marked as needing

View File

@ -69,7 +69,7 @@ const JSSecurityCallbacks js::NullSecurityCallbacks = { };
PerThreadData::PerThreadData(JSRuntime *runtime)
: PerThreadDataFriendFields(),
runtime_(runtime),
ionTop(nullptr),
jitTop(nullptr),
jitJSContext(nullptr),
jitStackLimit(0),
#ifdef JS_TRACE_LOGGING
@ -212,7 +212,6 @@ JSRuntime::JSRuntime(JSRuntime *parentRuntime, JSUseHelperThreads useHelperThrea
defaultJSContextCallback(nullptr),
ctypesActivityCallback(nullptr),
forkJoinWarmup(0),
ionReturnOverride_(MagicValue(JS_ARG_POISON)),
useHelperThreads_(useHelperThreads),
parallelIonCompilationEnabled_(true),
parallelParsingEnabled_(true),

View File

@ -473,10 +473,10 @@ class PerThreadData : public PerThreadDataFriendFields
#endif
/*
* If Ion code is on the stack, and has called into C++, this will be
* aligned to an Ion exit frame.
* If Baseline or Ion code is on the stack, and has called into C++, this
* will be aligned to an exit frame.
*/
uint8_t *ionTop;
uint8_t *jitTop;
/*
* The current JSContext when entering JIT code. This field may only be used
@ -1245,20 +1245,6 @@ struct JSRuntime : public JS::shadow::Runtime,
uint32_t forkJoinWarmup;
private:
// In certain cases, we want to optimize certain opcodes to typed instructions,
// to avoid carrying an extra register to feed into an unbox. Unfortunately,
// that's not always possible. For example, a GetPropertyCacheT could return a
// typed double, but if it takes its out-of-line path, it could return an
// object, and trigger invalidation. The invalidation bailout will consider the
// return value to be a double, and create a garbage Value.
//
// To allow the GetPropertyCacheT optimization, we allow the ability for
// GetPropertyCache to override the return value at the top of the stack - the
// value that will be temporarily corrupt. This special override value is set
// only in callVM() targets that are about to return *and* have invalidated
// their callee.
js::Value ionReturnOverride_;
#ifdef JS_THREADSAFE
static mozilla::Atomic<size_t> liveRuntimesCount;
#else
@ -1270,19 +1256,6 @@ struct JSRuntime : public JS::shadow::Runtime,
return liveRuntimesCount > 0;
}
bool hasIonReturnOverride() const {
return !ionReturnOverride_.isMagic();
}
js::Value takeIonReturnOverride() {
js::Value v = ionReturnOverride_;
ionReturnOverride_ = js::MagicValue(JS_ARG_POISON);
return v;
}
void setIonReturnOverride(const js::Value &v) {
JS_ASSERT(!hasIonReturnOverride());
ionReturnOverride_ = v;
}
JSRuntime(JSRuntime *parentRuntime, JSUseHelperThreads useHelperThreads);
~JSRuntime();

View File

@ -1167,7 +1167,7 @@ FrameIter::updatePcQuadratic()
jit::BaselineFrame *frame = data_.jitFrames_.baselineFrame();
jit::JitActivation *activation = data_.activations_->asJit();
// ActivationIterator::ionTop_ may be invalid, so create a new
// ActivationIterator::jitTop_ may be invalid, so create a new
// activation iterator.
data_.activations_ = ActivationIterator(data_.cx_->perThreadData);
while (data_.activations_.activation() != activation)
@ -1529,11 +1529,11 @@ jit::JitActivation::JitActivation(JSContext *cx, bool firstFrameIsConstructing,
#endif
{
if (active) {
prevIonTop_ = cx->mainThread().ionTop;
prevJitTop_ = cx->mainThread().jitTop;
prevJitJSContext_ = cx->mainThread().jitJSContext;
cx->mainThread().jitJSContext = cx;
} else {
prevIonTop_ = nullptr;
prevJitTop_ = nullptr;
prevJitJSContext_ = nullptr;
}
}
@ -1546,7 +1546,7 @@ jit::JitActivation::JitActivation(ForkJoinContext *cx)
, rematerializedFrames_(nullptr)
#endif
{
prevIonTop_ = cx->perThreadData->ionTop;
prevJitTop_ = cx->perThreadData->jitTop;
prevJitJSContext_ = cx->perThreadData->jitJSContext;
cx->perThreadData->jitJSContext = nullptr;
}
@ -1554,7 +1554,7 @@ jit::JitActivation::JitActivation(ForkJoinContext *cx)
jit::JitActivation::~JitActivation()
{
if (active_) {
cx_->perThreadData->ionTop = prevIonTop_;
cx_->perThreadData->jitTop = prevJitTop_;
cx_->perThreadData->jitJSContext = prevJitJSContext_;
}
@ -1577,11 +1577,11 @@ jit::JitActivation::setActive(JSContext *cx, bool active)
active_ = active;
if (active) {
prevIonTop_ = cx->mainThread().ionTop;
prevJitTop_ = cx->mainThread().jitTop;
prevJitJSContext_ = cx->mainThread().jitJSContext;
cx->mainThread().jitJSContext = cx;
} else {
cx->mainThread().ionTop = prevIonTop_;
cx->mainThread().jitTop = prevJitTop_;
cx->mainThread().jitJSContext = prevJitJSContext_;
}
}
@ -1750,14 +1750,14 @@ InterpreterFrameIterator::operator++()
}
ActivationIterator::ActivationIterator(JSRuntime *rt)
: jitTop_(rt->mainThread.ionTop),
: jitTop_(rt->mainThread.jitTop),
activation_(rt->mainThread.activation_)
{
settle();
}
ActivationIterator::ActivationIterator(PerThreadData *perThreadData)
: jitTop_(perThreadData->ionTop),
: jitTop_(perThreadData->jitTop),
activation_(perThreadData->activation_)
{
settle();
@ -1768,7 +1768,7 @@ ActivationIterator::operator++()
{
JS_ASSERT(activation_);
if (activation_->isJit() && activation_->asJit()->isActive())
jitTop_ = activation_->asJit()->prevIonTop();
jitTop_ = activation_->asJit()->prevJitTop();
activation_ = activation_->prev();
settle();
return *this;

View File

@ -1327,14 +1327,14 @@ namespace jit {
// A JitActivation is used for frames running in Baseline or Ion.
class JitActivation : public Activation
{
uint8_t *prevIonTop_;
uint8_t *prevJitTop_;
JSContext *prevJitJSContext_;
bool firstFrameIsConstructing_;
bool active_;
#ifdef JS_ION
// Rematerialized Ion frames which has info copied out of snapshots. Maps
// frame pointers (i.e. ionTop) to a vector of rematerializations of all
// frame pointers (i.e. jitTop) to a vector of rematerializations of all
// inline frames associated with that frame.
//
// This table is lazily initialized by calling getRematerializedFrame.
@ -1364,14 +1364,14 @@ class JitActivation : public Activation
}
void setActive(JSContext *cx, bool active = true);
uint8_t *prevIonTop() const {
return prevIonTop_;
uint8_t *prevJitTop() const {
return prevJitTop_;
}
bool firstFrameIsConstructing() const {
return firstFrameIsConstructing_;
}
static size_t offsetOfPrevIonTop() {
return offsetof(JitActivation, prevIonTop_);
static size_t offsetOfPrevJitTop() {
return offsetof(JitActivation, prevJitTop_);
}
static size_t offsetOfPrevJitJSContext() {
return offsetof(JitActivation, prevJitJSContext_);