зеркало из https://github.com/mozilla/pjs.git
Bug 754179 - Remove some dead front-end code. r=jorendorff.
--HG-- extra : rebase_source : 6483ba3654782181b89fb5ac3c8f352929efbaa7
This commit is contained in:
Родитель
a5e5d27f88
Коммит
37b38678fc
|
@ -127,7 +127,6 @@ BytecodeEmitter::BytecodeEmitter(Parser *parser, SharedContext *sc, unsigned lin
|
|||
bool
|
||||
BytecodeEmitter::init()
|
||||
{
|
||||
roLexdeps.init();
|
||||
return constMap.init() && atomIndices.ensureMap(sc->context);
|
||||
}
|
||||
|
||||
|
@ -5929,9 +5928,7 @@ frontend::EmitTree(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
|||
|
||||
case PNK_UPVARS:
|
||||
JS_ASSERT(pn->pn_names->count() != 0);
|
||||
bce->roLexdeps = pn->pn_names;
|
||||
ok = EmitTree(cx, bce, pn->pn_tree);
|
||||
bce->roLexdeps.clearMap();
|
||||
pn->pn_names.releaseMap(cx);
|
||||
break;
|
||||
|
||||
|
|
|
@ -123,7 +123,6 @@ struct BytecodeEmitter
|
|||
Parser *parser; /* the parser */
|
||||
|
||||
OwnedAtomIndexMapPtr atomIndices; /* literals indexed for mapping */
|
||||
AtomDefnMapPtr roLexdeps;
|
||||
unsigned firstLine; /* first line, for JSScript::NewScriptFromEmitter */
|
||||
|
||||
int stackDepth; /* current stack depth in script frame */
|
||||
|
|
|
@ -117,9 +117,7 @@ Parser::Parser(JSContext *cx, JSPrincipals *prin, JSPrincipals *originPrin,
|
|||
principals(NULL),
|
||||
originPrincipals(NULL),
|
||||
callerFrame(cfp),
|
||||
callerVarObj(cfp ? &cfp->varObj() : NULL),
|
||||
allocator(cx),
|
||||
functionCount(0),
|
||||
traceListHead(NULL),
|
||||
tc(NULL),
|
||||
keepAtoms(cx->runtime),
|
||||
|
@ -127,7 +125,6 @@ Parser::Parser(JSContext *cx, JSPrincipals *prin, JSPrincipals *originPrin,
|
|||
compileAndGo(compileAndGo)
|
||||
{
|
||||
cx->activeCompilations++;
|
||||
PodArrayZero(tempFreeList);
|
||||
setPrincipals(prin, originPrin);
|
||||
JS_ASSERT_IF(cfp, cfp->isScriptFrame());
|
||||
}
|
||||
|
@ -223,7 +220,6 @@ Parser::newFunctionBox(JSObject *obj, ParseNode *fn, TreeContext *tc)
|
|||
funbox->node = fn;
|
||||
funbox->siblings = tc->sc->functionList;
|
||||
tc->sc->functionList = funbox;
|
||||
++functionCount;
|
||||
funbox->kids = NULL;
|
||||
funbox->parent = tc->sc->funbox;
|
||||
new (&funbox->bindings) Bindings(context);
|
||||
|
@ -4910,7 +4906,7 @@ class GenexpGuard {
|
|||
TreeContext *tc = parser->tc;
|
||||
if (tc->parenDepth == 0) {
|
||||
tc->yieldCount = 0;
|
||||
tc->yieldNode = tc->argumentsNode = NULL;
|
||||
tc->yieldNode = NULL;
|
||||
}
|
||||
startYieldCount = tc->yieldCount;
|
||||
tc->parenDepth++;
|
||||
|
|
|
@ -55,8 +55,6 @@
|
|||
#include "frontend/ParseNode.h"
|
||||
#include "frontend/TreeContext.h"
|
||||
|
||||
#define NUM_TEMP_FREELISTS 6U /* 32 to 2048 byte size classes (32 bit) */
|
||||
|
||||
typedef struct BindData BindData;
|
||||
|
||||
namespace js {
|
||||
|
@ -70,15 +68,12 @@ enum VarContext { HoistVars, DontHoistVars };
|
|||
struct Parser : private AutoGCRooter
|
||||
{
|
||||
JSContext *const context; /* FIXME Bug 551291: use AutoGCRooter::context? */
|
||||
void *tempFreeList[NUM_TEMP_FREELISTS];
|
||||
TokenStream tokenStream;
|
||||
void *tempPoolMark; /* initial JSContext.tempLifoAlloc mark */
|
||||
JSPrincipals *principals; /* principals associated with source */
|
||||
JSPrincipals *originPrincipals; /* see jsapi.h 'originPrincipals' comment */
|
||||
StackFrame *const callerFrame; /* scripted caller frame for eval and dbgapi */
|
||||
JSObject *const callerVarObj; /* callerFrame's varObj */
|
||||
ParseNodeAllocator allocator;
|
||||
uint32_t functionCount; /* number of functions in current unit */
|
||||
ObjectBox *traceListHead; /* list of parsed object for GC tracing */
|
||||
|
||||
TreeContext *tc; /* innermost tree context (stack-allocated) */
|
||||
|
|
|
@ -103,7 +103,6 @@ TreeContext::TreeContext(Parser *prs, SharedContext *sc)
|
|||
blockNode(NULL),
|
||||
decls(prs->context),
|
||||
yieldNode(NULL),
|
||||
argumentsNode(NULL),
|
||||
parserTC(&prs->tc),
|
||||
lexdeps(prs->context),
|
||||
parent(prs->tc),
|
||||
|
|
|
@ -272,9 +272,6 @@ struct TreeContext { /* tree context for semantic checks */
|
|||
ParseNode *yieldNode; /* parse node for a yield expression that might
|
||||
be an error if we turn out to be inside a
|
||||
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:
|
||||
TreeContext **parserTC; /* this points to the Parser's active tc
|
||||
|
|
|
@ -484,18 +484,6 @@ js_DumpAtoms(JSContext *cx, FILE *fp)
|
|||
}
|
||||
#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 {
|
||||
|
||||
void
|
||||
|
|
|
@ -1201,30 +1201,6 @@ IsBuiltinFunctionConstructor(JSFunction *fun)
|
|||
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 */
|
||||
|
||||
JSFunction *
|
||||
|
|
Загрузка…
Ссылка в новой задаче