Bug 822831 - Do not use Unrooted in a signal handler. r=billm

Landing attempt #2. Some excessively picky people seem to insist that it should successfully compile.

--HG--
extra : rebase_source : 4669fa2322638b06a1c75bee0bbdc2f4479c1cff
This commit is contained in:
Steve Fink 2012-12-18 17:33:25 -08:00
parent 423430cd73
commit 66ac062f5d
5 changed files with 11 additions and 6 deletions

View File

@ -326,7 +326,7 @@ JS_ClearAllWatchPoints(JSContext *cx)
/************************************************************************/
JS_PUBLIC_API(unsigned)
JS_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc)
JS_PCToLineNumber(JSContext *cx, RawScript script, jsbytecode *pc)
{
return js::PCToLineNumber(script, pc);
}

View File

@ -141,8 +141,9 @@ JS_ClearAllWatchPoints(JSContext *cx);
/************************************************************************/
// RawScript because this needs to be callable from a signal handler
extern JS_PUBLIC_API(unsigned)
JS_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc);
JS_PCToLineNumber(JSContext *cx, js::RawScript script, jsbytecode *pc);
extern JS_PUBLIC_API(jsbytecode *)
JS_LineNumberToPC(JSContext *cx, JSScript *script, unsigned lineno);

View File

@ -684,8 +684,10 @@ SetRuntimeProfilingStack(JSRuntime *rt, ProfileEntry *stack, uint32_t *size,
JS_FRIEND_API(void)
EnableRuntimeProfilingStack(JSRuntime *rt, bool enabled);
// Use RawScript rather than UnrootedScript because it may be called from a
// signal handler
JS_FRIEND_API(jsbytecode*)
ProfilingGetPC(JSRuntime *rt, JSScript *script, void *ip);
ProfilingGetPC(JSRuntime *rt, RawScript script, void *ip);
#ifdef JS_THREADSAFE
JS_FRIEND_API(void *)

View File

@ -223,8 +223,10 @@ JMChunkInfo::JMChunkInfo(mjit::JSActiveFrame *frame,
chunk(chunk)
{}
// Use RawScript instead of UnrootedScript because this may be called from a
// signal handler
jsbytecode*
SPSProfiler::ipToPC(UnrootedScript script, size_t ip)
SPSProfiler::ipToPC(RawScript script, size_t ip)
{
if (!jminfo.initialized())
return NULL;

View File

@ -234,7 +234,7 @@ class SPSProfiler
mjit::JITChunk *chunk, void* address);
bool registerICCode(mjit::JITChunk *chunk, UnrootedScript script, jsbytecode* pc,
void *start, size_t size);
jsbytecode *ipToPC(UnrootedScript script, size_t ip);
jsbytecode *ipToPC(RawScript script, size_t ip);
private:
JMChunkInfo *registerScript(mjit::JSActiveFrame *frame,
@ -243,7 +243,7 @@ class SPSProfiler
void unregisterScript(UnrootedScript script, mjit::JITChunk *chunk);
public:
#else
jsbytecode *ipToPC(UnrootedScript script, size_t ip) { return NULL; }
jsbytecode *ipToPC(RawScript script, size_t ip) { return NULL; }
#endif
void setProfilingStack(ProfileEntry *stack, uint32_t *size, uint32_t max);