Bug 754179 - Remove some dead front-end code. r=jorendorff.

--HG--
extra : rebase_source : 6483ba3654782181b89fb5ac3c8f352929efbaa7
This commit is contained in:
Nicholas Nethercote 2012-05-16 18:12:47 -07:00
parent 625bb6db2f
commit c9d3eb41ca
8 changed files with 1 additions and 54 deletions

View File

@ -127,7 +127,6 @@ BytecodeEmitter::BytecodeEmitter(Parser *parser, SharedContext *sc, unsigned lin
bool bool
BytecodeEmitter::init() BytecodeEmitter::init()
{ {
roLexdeps.init();
return constMap.init() && atomIndices.ensureMap(sc->context); return constMap.init() && atomIndices.ensureMap(sc->context);
} }
@ -5929,9 +5928,7 @@ frontend::EmitTree(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
case PNK_UPVARS: case PNK_UPVARS:
JS_ASSERT(pn->pn_names->count() != 0); JS_ASSERT(pn->pn_names->count() != 0);
bce->roLexdeps = pn->pn_names;
ok = EmitTree(cx, bce, pn->pn_tree); ok = EmitTree(cx, bce, pn->pn_tree);
bce->roLexdeps.clearMap();
pn->pn_names.releaseMap(cx); pn->pn_names.releaseMap(cx);
break; break;

View File

@ -123,7 +123,6 @@ struct BytecodeEmitter
Parser *parser; /* the parser */ Parser *parser; /* the parser */
OwnedAtomIndexMapPtr atomIndices; /* literals indexed for mapping */ OwnedAtomIndexMapPtr atomIndices; /* literals indexed for mapping */
AtomDefnMapPtr roLexdeps;
unsigned firstLine; /* first line, for JSScript::NewScriptFromEmitter */ unsigned firstLine; /* first line, for JSScript::NewScriptFromEmitter */
int stackDepth; /* current stack depth in script frame */ int stackDepth; /* current stack depth in script frame */

View File

@ -117,9 +117,7 @@ Parser::Parser(JSContext *cx, JSPrincipals *prin, JSPrincipals *originPrin,
principals(NULL), principals(NULL),
originPrincipals(NULL), originPrincipals(NULL),
callerFrame(cfp), callerFrame(cfp),
callerVarObj(cfp ? &cfp->varObj() : NULL),
allocator(cx), allocator(cx),
functionCount(0),
traceListHead(NULL), traceListHead(NULL),
tc(NULL), tc(NULL),
keepAtoms(cx->runtime), keepAtoms(cx->runtime),
@ -127,7 +125,6 @@ Parser::Parser(JSContext *cx, JSPrincipals *prin, JSPrincipals *originPrin,
compileAndGo(compileAndGo) compileAndGo(compileAndGo)
{ {
cx->activeCompilations++; cx->activeCompilations++;
PodArrayZero(tempFreeList);
setPrincipals(prin, originPrin); setPrincipals(prin, originPrin);
JS_ASSERT_IF(cfp, cfp->isScriptFrame()); JS_ASSERT_IF(cfp, cfp->isScriptFrame());
} }
@ -223,7 +220,6 @@ Parser::newFunctionBox(JSObject *obj, ParseNode *fn, TreeContext *tc)
funbox->node = fn; funbox->node = fn;
funbox->siblings = tc->sc->functionList; funbox->siblings = tc->sc->functionList;
tc->sc->functionList = funbox; tc->sc->functionList = funbox;
++functionCount;
funbox->kids = NULL; funbox->kids = NULL;
funbox->parent = tc->sc->funbox; funbox->parent = tc->sc->funbox;
new (&funbox->bindings) Bindings(context); new (&funbox->bindings) Bindings(context);
@ -4910,7 +4906,7 @@ class GenexpGuard {
TreeContext *tc = parser->tc; TreeContext *tc = parser->tc;
if (tc->parenDepth == 0) { if (tc->parenDepth == 0) {
tc->yieldCount = 0; tc->yieldCount = 0;
tc->yieldNode = tc->argumentsNode = NULL; tc->yieldNode = NULL;
} }
startYieldCount = tc->yieldCount; startYieldCount = tc->yieldCount;
tc->parenDepth++; tc->parenDepth++;

View File

@ -55,8 +55,6 @@
#include "frontend/ParseNode.h" #include "frontend/ParseNode.h"
#include "frontend/TreeContext.h" #include "frontend/TreeContext.h"
#define NUM_TEMP_FREELISTS 6U /* 32 to 2048 byte size classes (32 bit) */
typedef struct BindData BindData; typedef struct BindData BindData;
namespace js { namespace js {
@ -70,15 +68,12 @@ enum VarContext { HoistVars, DontHoistVars };
struct Parser : private AutoGCRooter struct Parser : private AutoGCRooter
{ {
JSContext *const context; /* FIXME Bug 551291: use AutoGCRooter::context? */ JSContext *const context; /* FIXME Bug 551291: use AutoGCRooter::context? */
void *tempFreeList[NUM_TEMP_FREELISTS];
TokenStream tokenStream; TokenStream tokenStream;
void *tempPoolMark; /* initial JSContext.tempLifoAlloc mark */ void *tempPoolMark; /* initial JSContext.tempLifoAlloc mark */
JSPrincipals *principals; /* principals associated with source */ JSPrincipals *principals; /* principals associated with source */
JSPrincipals *originPrincipals; /* see jsapi.h 'originPrincipals' comment */ JSPrincipals *originPrincipals; /* see jsapi.h 'originPrincipals' comment */
StackFrame *const callerFrame; /* scripted caller frame for eval and dbgapi */ StackFrame *const callerFrame; /* scripted caller frame for eval and dbgapi */
JSObject *const callerVarObj; /* callerFrame's varObj */
ParseNodeAllocator allocator; ParseNodeAllocator allocator;
uint32_t functionCount; /* number of functions in current unit */
ObjectBox *traceListHead; /* list of parsed object for GC tracing */ ObjectBox *traceListHead; /* list of parsed object for GC tracing */
TreeContext *tc; /* innermost tree context (stack-allocated) */ TreeContext *tc; /* innermost tree context (stack-allocated) */

View File

@ -103,7 +103,6 @@ TreeContext::TreeContext(Parser *prs, SharedContext *sc)
blockNode(NULL), blockNode(NULL),
decls(prs->context), decls(prs->context),
yieldNode(NULL), yieldNode(NULL),
argumentsNode(NULL),
parserTC(&prs->tc), parserTC(&prs->tc),
lexdeps(prs->context), lexdeps(prs->context),
parent(prs->tc), parent(prs->tc),

View File

@ -272,9 +272,6 @@ struct TreeContext { /* tree context for semantic checks */
ParseNode *yieldNode; /* parse node for a yield expression that might ParseNode *yieldNode; /* parse node for a yield expression that might
be an error if we turn out to be inside a be an error if we turn out to be inside a
generator expression */ generator expression */
ParseNode *argumentsNode; /* parse node for an arguments variable that
might be an error if we turn out to be
inside a generator expression */
private: private:
TreeContext **parserTC; /* this points to the Parser's active tc TreeContext **parserTC; /* this points to the Parser's active tc

View File

@ -484,18 +484,6 @@ js_DumpAtoms(JSContext *cx, FILE *fp)
} }
#endif #endif
#if JS_BITS_PER_WORD == 32
# define TEMP_SIZE_START_LOG2 5
#else
# define TEMP_SIZE_START_LOG2 6
#endif
#define TEMP_SIZE_LIMIT_LOG2 (TEMP_SIZE_START_LOG2 + NUM_TEMP_FREELISTS)
#define TEMP_SIZE_START JS_BIT(TEMP_SIZE_START_LOG2)
#define TEMP_SIZE_LIMIT JS_BIT(TEMP_SIZE_LIMIT_LOG2)
JS_STATIC_ASSERT(TEMP_SIZE_START >= sizeof(JSHashTable));
namespace js { namespace js {
void void

View File

@ -1201,30 +1201,6 @@ IsBuiltinFunctionConstructor(JSFunction *fun)
return fun->maybeNative() == Function; return fun->maybeNative() == Function;
} }
const Shape *
LookupInterpretedFunctionPrototype(JSContext *cx, RootedVarObject funobj)
{
#ifdef DEBUG
JSFunction *fun = funobj->toFunction();
JS_ASSERT(fun->isInterpreted());
JS_ASSERT(!fun->isFunctionPrototype());
JS_ASSERT(!funobj->isBoundFunction());
#endif
jsid id = NameToId(cx->runtime->atomState.classPrototypeAtom);
RootedVar<const Shape*> shape(cx, funobj->nativeLookup(cx, id));
if (!shape) {
if (!ResolveInterpretedFunctionPrototype(cx, funobj))
return NULL;
id = NameToId(cx->runtime->atomState.classPrototypeAtom);
shape = funobj->nativeLookup(cx, id);
}
JS_ASSERT(!shape->configurable());
JS_ASSERT(shape->isDataDescriptor());
JS_ASSERT(shape->hasSlot());
return shape;
}
} /* namespace js */ } /* namespace js */
JSFunction * JSFunction *