Backout changeset 0589b96414e6 which landed without a bug and broke the builds

This commit is contained in:
Ehsan Akhgari 2012-07-26 22:56:23 -04:00
parent 4d23b4d892
commit e7c1a3020f
10 changed files with 33 additions and 33 deletions

View File

@ -2422,7 +2422,7 @@ void
JSScript::recompileForStepMode(FreeOp *fop)
{
#ifdef JS_METHODJIT
if (hasMJITInfo()) {
if (hasJITInfo()) {
mjit::Recompiler::clearStackReferences(fop, this);
mjit::ReleaseScriptCode(fop, this);
}
@ -2685,7 +2685,7 @@ JSScript::argumentsOptimizationFailed(JSContext *cx, JSScript *script_)
}
#ifdef JS_METHODJIT
if (script->hasMJITInfo()) {
if (script->hasJITInfo()) {
mjit::ExpandInlineFrames(cx->compartment);
mjit::Recompiler::clearStackReferences(cx->runtime->defaultFreeOp(), script);
mjit::ReleaseScriptCode(cx->runtime->defaultFreeOp(), script);

View File

@ -441,7 +441,7 @@ struct JSScript : public js::gc::Cell
private:
#ifdef JS_METHODJIT
JITScriptSet *mJITInfo;
JITScriptSet *jitInfo;
#endif
js::HeapPtrFunction function_;
js::HeapPtrObject enclosingScope_;
@ -680,24 +680,24 @@ struct JSScript : public js::gc::Cell
friend class js::mjit::CallCompiler;
public:
bool hasMJITInfo() {
return mJITInfo != NULL;
bool hasJITInfo() {
return jitInfo != NULL;
}
static size_t offsetOfMJITInfo() { return offsetof(JSScript, mJITInfo); }
static size_t offsetOfJITInfo() { return offsetof(JSScript, jitInfo); }
inline bool ensureHasMJITInfo(JSContext *cx);
inline void destroyMJITInfo(js::FreeOp *fop);
inline bool ensureHasJITInfo(JSContext *cx);
inline void destroyJITInfo(js::FreeOp *fop);
JITScriptHandle *jitHandle(bool constructing, bool barriers) {
JS_ASSERT(mJITInfo);
JS_ASSERT(jitInfo);
return constructing
? (barriers ? &mJITInfo->jitHandleCtorBarriered : &mJITInfo->jitHandleCtor)
: (barriers ? &mJITInfo->jitHandleNormalBarriered : &mJITInfo->jitHandleNormal);
? (barriers ? &jitInfo->jitHandleCtorBarriered : &jitInfo->jitHandleCtor)
: (barriers ? &jitInfo->jitHandleNormalBarriered : &jitInfo->jitHandleNormal);
}
js::mjit::JITScript *getJIT(bool constructing, bool barriers) {
if (!mJITInfo)
if (!jitInfo)
return NULL;
JITScriptHandle *jith = jitHandle(constructing, barriers);
return jith->isValid() ? jith->getValid() : NULL;

View File

@ -194,19 +194,19 @@ JSScript::hasClearedGlobal() const
#ifdef JS_METHODJIT
inline bool
JSScript::ensureHasMJITInfo(JSContext *cx)
JSScript::ensureHasJITInfo(JSContext *cx)
{
if (mJITInfo)
if (jitInfo)
return true;
mJITInfo = cx->new_<JITScriptSet>();
return mJITInfo != NULL;
jitInfo = cx->new_<JITScriptSet>();
return jitInfo != NULL;
}
inline void
JSScript::destroyMJITInfo(js::FreeOp *fop)
JSScript::destroyJITInfo(js::FreeOp *fop)
{
fop->delete_(mJITInfo);
mJITInfo = NULL;
fop->delete_(jitInfo);
jitInfo = NULL;
}
#endif /* JS_METHODJIT */

View File

@ -111,7 +111,7 @@ mjit::Compiler::compile()
CompileStatus status = performCompilation();
if (status != Compile_Okay && status != Compile_Retry) {
if (!outerScript->ensureHasMJITInfo(cx))
if (!outerScript->ensureHasJITInfo(cx))
return Compile_Error;
JSScript::JITScriptHandle *jith = outerScript->jitHandle(isConstructing, cx->compartment->needsBarrier());
JSScript::ReleaseCode(cx->runtime->defaultFreeOp(), jith);
@ -930,7 +930,7 @@ mjit::CanMethodJIT(JSContext *cx, JSScript *script, jsbytecode *pc,
if (frame->hasPushedSPSFrame() && !cx->runtime->spsProfiler.enabled())
return Compile_Skipped;
if (script->hasMJITInfo()) {
if (script->hasJITInfo()) {
JSScript::JITScriptHandle *jith = script->jitHandle(construct, cx->compartment->needsBarrier());
if (jith->isUnjittable())
return Compile_Abort;
@ -953,7 +953,7 @@ mjit::CanMethodJIT(JSContext *cx, JSScript *script, jsbytecode *pc,
uint64_t gcNumber = cx->runtime->gcNumber;
if (!script->ensureHasMJITInfo(cx))
if (!script->ensureHasJITInfo(cx))
return Compile_Error;
JSScript::JITScriptHandle *jith = script->jitHandle(construct, cx->compartment->needsBarrier());

View File

@ -1362,10 +1362,10 @@ JSScript::JITScriptHandle::staticAsserts()
size_t
JSScript::sizeOfJitScripts(JSMallocSizeOfFun mallocSizeOf)
{
if (!hasMJITInfo())
if (!hasJITInfo())
return 0;
size_t n = mallocSizeOf(mJITInfo);
size_t n = mallocSizeOf(jitInfo);
for (int constructing = 0; constructing <= 1; constructing++) {
for (int barriers = 0; barriers <= 1; barriers++) {
JITScript *jit = getJIT((bool) constructing, (bool) barriers);

View File

@ -870,7 +870,7 @@ CanMethodJIT(JSContext *cx, JSScript *script, jsbytecode *pc,
inline void
ReleaseScriptCode(FreeOp *fop, JSScript *script)
{
if (!script->hasMJITInfo())
if (!script->hasJITInfo())
return;
for (int constructing = 0; constructing <= 1; constructing++) {
@ -881,7 +881,7 @@ ReleaseScriptCode(FreeOp *fop, JSScript *script)
}
}
script->destroyMJITInfo(fop);
script->destroyJITInfo(fop);
}
// Expand all stack frames inlined by the JIT within a compartment.

View File

@ -573,10 +573,10 @@ class CallCompiler : public BaseCompiler
masm.loadPtr(scriptAddr, t0);
// Test that:
// - script->mJITInfo is not NULL
// - script->mJITInfo->jitHandle{Ctor,Normal}->value is neither NULL nor UNJITTABLE, and
// - script->mJITInfo->jitHandle{Ctor,Normal}->value->arityCheckEntry is not NULL.
masm.loadPtr(Address(t0, JSScript::offsetOfMJITInfo()), t0);
// - script->jitInfo is not NULL
// - script->jitInfo->jitHandle{Ctor,Normal}->value is neither NULL nor UNJITTABLE, and
// - script->jitInfo->jitHandle{Ctor,Normal}->value->arityCheckEntry is not NULL.
masm.loadPtr(Address(t0, JSScript::offsetOfJITInfo()), t0);
Jump hasNoJitInfo = masm.branchPtr(Assembler::Equal, t0, ImmPtr(NULL));
size_t offset = JSScript::JITScriptSet::jitHandleOffset(callingNew,
f.cx->compartment->needsBarrier());

View File

@ -394,7 +394,7 @@ ClearAllFrames(JSCompartment *compartment)
void
Recompiler::clearStackReferences(FreeOp *fop, JSScript *script)
{
JS_ASSERT(script->hasMJITInfo());
JS_ASSERT(script->hasJITInfo());
JaegerSpew(JSpew_Recompile, "recompiling script (file \"%s\") (line \"%d\") (length \"%d\")\n",
script->filename, script->lineno, script->length);

View File

@ -233,7 +233,7 @@ void
BreakpointSite::recompile(FreeOp *fop)
{
#ifdef JS_METHODJIT
if (script->hasMJITInfo()) {
if (script->hasJITInfo()) {
mjit::Recompiler::clearStackReferences(fop, script);
mjit::ReleaseScriptCode(fop, script);
}

View File

@ -504,7 +504,7 @@ GlobalObject::clear(JSContext *cx)
*/
for (gc::CellIter i(cx->compartment, gc::FINALIZE_SCRIPT); !i.done(); i.next()) {
JSScript *script = i.get<JSScript>();
if (script->compileAndGo && script->hasMJITInfo() && script->hasClearedGlobal()) {
if (script->compileAndGo && script->hasJITInfo() && script->hasClearedGlobal()) {
mjit::Recompiler::clearStackReferences(cx->runtime->defaultFreeOp(), script);
mjit::ReleaseScriptCode(cx->runtime->defaultFreeOp(), script);
}