Bug 951979 - Reorder compilation vs. operation callback lock ordering constraints, r=jandem.

This commit is contained in:
Brian Hackett 2013-12-19 14:56:03 -07:00
parent 5514a61695
commit a95605b1f8
3 changed files with 9 additions and 3 deletions

View File

@ -1089,10 +1089,16 @@ class JSScript : public js::gc::BarrieredCell<JSScript>
}
bool hasIonScript() const {
// Note: While a script's baseline script is protected by the
// compilation lock, writes to the ion script are not. This helps lock
// ordering issues in CodeGenerator::link. Tests of script->ion during
// off thread compilation can therefore race, though these are fairly
// benign and the IonScript itself is never accessed.
js::AutoThreadSafeAccess ts(this);
return ion && ion != ION_DISABLED_SCRIPT && ion != ION_COMPILING_SCRIPT;
}
bool canIonCompile() const {
// Note: see above comment.
js::AutoThreadSafeAccess ts(this);
return ion != ION_DISABLED_SCRIPT;
}

View File

@ -981,10 +981,10 @@ JSRuntime::assertCanLock(RuntimeLock which)
JS_ASSERT(exclusiveAccessOwner != PR_GetCurrentThread());
case WorkerThreadStateLock:
JS_ASSERT_IF(workerThreadState, !workerThreadState->isLocked());
case OperationCallbackLock:
JS_ASSERT(!currentThreadOwnsOperationCallbackLock());
case CompilationLock:
JS_ASSERT(compilationLockOwner != PR_GetCurrentThread());
case OperationCallbackLock:
JS_ASSERT(!currentThreadOwnsOperationCallbackLock());
case GCLock:
JS_ASSERT(gcLockOwner != PR_GetCurrentThread());
break;

View File

@ -735,8 +735,8 @@ struct JSRuntime : public JS::shadow::Runtime,
enum RuntimeLock {
ExclusiveAccessLock,
WorkerThreadStateLock,
OperationCallbackLock,
CompilationLock,
OperationCallbackLock,
GCLock
};
#ifdef DEBUG