Bug 902720 - Clean up GetTopIonJSScript to use ThreadSafeContext. (r=jandem)

This commit is contained in:
Shu-yu Guo 2013-08-09 17:07:50 -07:00
parent b78f82127c
commit 3097bf0869
2 changed files with 5 additions and 19 deletions

View File

@ -1660,13 +1660,8 @@ GetPropertyParIC::update(ForkJoinSlice *slice, size_t cacheIndex,
HandleObject obj, MutableHandleValue vp)
{
AutoFlushCache afc("GetPropertyParCache");
PerThreadData *pt = slice->perThreadData;
const SafepointIndex *safepointIndex;
void *returnAddr;
RootedScript topScript(pt, GetTopIonJSScript(pt, &safepointIndex, &returnAddr));
IonScript *ion = topScript->parallelIonScript();
IonScript *ion = GetTopIonJSScript(slice)->parallelIonScript();
GetPropertyParIC &cache = ion->getCache(cacheIndex).toGetPropertyPar();
// Grab the property early, as the pure path is fast anyways and doesn't
@ -2798,13 +2793,8 @@ GetElementParIC::update(ForkJoinSlice *slice, size_t cacheIndex, HandleObject ob
HandleValue idval, MutableHandleValue vp)
{
AutoFlushCache afc("GetElementParCache");
PerThreadData *pt = slice->perThreadData;
const SafepointIndex *safepointIndex;
void *returnAddr;
RootedScript topScript(pt, GetTopIonJSScript(pt, &safepointIndex, &returnAddr));
IonScript *ion = topScript->parallelIonScript();
IonScript *ion = GetTopIonJSScript(slice)->parallelIonScript();
GetElementParIC &cache = ion->getCache(cacheIndex).toGetElementPar();
// Try to get the element early, as the pure path doesn't need a lock. If

View File

@ -317,9 +317,10 @@ GetTopIonJSScript(PerThreadData *pt, const SafepointIndex **safepointIndexOut, v
}
inline JSScript *
GetTopIonJSScript(JSContext *cx, const SafepointIndex **safepointIndexOut, void **returnAddrOut)
GetTopIonJSScript(ThreadSafeContext *cx, const SafepointIndex **safepointIndexOut = NULL,
void **returnAddrOut = NULL)
{
return GetTopIonJSScript(&cx->mainThread(), safepointIndexOut, returnAddrOut);
return GetTopIonJSScript(cx->perThreadData, safepointIndexOut, returnAddrOut);
}
} // namespace ion
@ -336,11 +337,6 @@ GetTopIonJSScript(JSContext *cx, const SafepointIndex **safepointIndexOut, void
namespace js {
namespace ion {
JSScript *
GetTopIonJSScript(JSContext *cx,
const SafepointIndex **safepointIndexOut = NULL,
void **returnAddrOut = NULL);
void
GetPcScript(JSContext *cx, JSScript **scriptRes, jsbytecode **pcRes);