Backed out changeset b92529577644 (bug 895395) on suspicion of causing shutdown hangs on OS X

This commit is contained in:
Ed Morley 2013-11-20 12:29:48 +00:00
parent 73463a4880
commit 06dad708cb
3 changed files with 7 additions and 8 deletions

View File

@ -355,7 +355,9 @@ frontend::CompileScript(ExclusiveContext *cx, LifoAlloc *alloc, HandleObject sco
if (!FoldConstants(cx, &pn, &parser))
return nullptr;
if (!NameFunctions(cx, pn))
// Inferring names for functions in compiled scripts is currently only
// supported while on the main thread. See bug 895395.
if (cx->isJSContext() && !NameFunctions(cx->asJSContext(), pn))
return nullptr;
if (!EmitTree(cx, &bce, pn))

View File

@ -23,7 +23,7 @@ class NameResolver
{
static const size_t MaxParents = 100;
ExclusiveContext *cx;
JSContext *cx;
size_t nparents; /* number of parents in the parents array */
ParseNode *parents[MaxParents]; /* history of ParseNodes we've been looking at */
StringBuffer *buf; /* when resolving, buffer to append to */
@ -262,7 +262,7 @@ class NameResolver
}
public:
explicit NameResolver(ExclusiveContext *cx) : cx(cx), nparents(0), buf(nullptr) {}
explicit NameResolver(JSContext *cx) : cx(cx), nparents(0), buf(nullptr) {}
/*
* Resolve all names for anonymous functions recursively within the
@ -331,7 +331,7 @@ class NameResolver
} /* anonymous namespace */
bool
frontend::NameFunctions(ExclusiveContext *cx, ParseNode *pn)
frontend::NameFunctions(JSContext *cx, ParseNode *pn)
{
NameResolver nr(cx);
nr.resolve(pn);

View File

@ -10,15 +10,12 @@
#include "js/TypeDecls.h"
namespace js {
class ExclusiveContext;
namespace frontend {
class ParseNode;
bool
NameFunctions(ExclusiveContext *cx, ParseNode *pn);
NameFunctions(JSContext *cx, ParseNode *pn);
} /* namespace frontend */
} /* namespace js */