merge after backout of 9ecf699d4047

This commit is contained in:
Daniel Holbert 2008-08-28 15:04:54 -07:00
Родитель d950edafa6 cf35f98efc
Коммит cf73f6de49
6 изменённых файлов: 6 добавлений и 21 удалений

Просмотреть файл

@ -1267,9 +1267,7 @@ JS_EvaluateUCInStackFrame(JSContext *cx, JSStackFrame *fp,
flags = fp->flags;
fp->flags |= JSFRAME_DEBUGGER | JSFRAME_EVAL;
script = js_CompileScript(cx, scobj, JS_StackFramePrincipals(cx, fp),
TCF_COMPILE_N_GO |
TCF_PUT_STATIC_DEPTH(fp->script->staticDepth + 1),
chars, length, NULL,
TCF_COMPILE_N_GO, chars, length, NULL,
filename, lineno);
fp->flags = flags;
if (!script)

Просмотреть файл

@ -1878,9 +1878,6 @@ BindNameToSlot(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn)
if (!(tc->flags & TCF_IN_FUNCTION)) {
if ((cx->fp->flags & JSFRAME_SPECIAL) && cx->fp->fun) {
if (cg->staticDepth > JS_DISPLAY_SIZE)
goto out;
localKind = js_LookupLocal(cx, cx->fp->fun, atom, &index);
if (localKind != JSLOCAL_NONE) {
if (PN_OP(pn) == JSOP_NAME) {

Просмотреть файл

@ -209,14 +209,6 @@ struct JSTreeContext { /* tree context for semantic checks */
TCF_FUN_USES_NONLOCALS | \
TCF_FUN_CLOSURE_VS_VAR)
/*
* Flags field, not stored in JSTreeContext.flags, for passing staticDepth
* into js_CompileScript.
*/
#define TCF_STATIC_DEPTH_MASK 0xffff0000
#define TCF_GET_STATIC_DEPTH(f) ((uint32)(f) >> 16)
#define TCF_PUT_STATIC_DEPTH(d) ((uint16)(d) << 16)
#ifdef JS_SCOPE_DEPTH_METER
# define JS_SCOPE_DEPTH_METERING(code) ((void) (code))
#else

Просмотреть файл

@ -1318,15 +1318,14 @@ js_obj_eval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
fp->flags |= JSFRAME_EVAL;
} while ((fp = fp->down) != caller);
script = js_CompileScript(cx, scopeobj, principals,
TCF_COMPILE_N_GO |
TCF_PUT_STATIC_DEPTH(caller->script->staticDepth + 1),
script = js_CompileScript(cx, scopeobj, principals, TCF_COMPILE_N_GO,
JSSTRING_CHARS(str), JSSTRING_LENGTH(str),
NULL, file, line);
if (!script) {
ok = JS_FALSE;
goto out;
}
script->staticDepth = caller->script->staticDepth + 1;
if (argc < 2) {
/* Execute using caller's new scope object (might be a Call object). */

Просмотреть файл

@ -566,7 +566,7 @@ js_CompileScript(JSContext *cx, JSObject *obj, JSPrincipals *principals,
void *sbrk(ptrdiff_t), *before = sbrk(0);
#endif
JS_ASSERT(!(tcflags & ~(TCF_COMPILE_N_GO | TCF_NO_SCRIPT_RVAL | TCF_STATIC_DEPTH_MASK)));
JS_ASSERT(!(tcflags & ~(TCF_COMPILE_N_GO | TCF_NO_SCRIPT_RVAL)));
if (!js_InitParseContext(cx, &pc, principals, chars, length, file,
filename, lineno)) {
@ -591,8 +591,7 @@ js_CompileScript(JSContext *cx, JSObject *obj, JSPrincipals *principals,
pc.tokenStream.lineno);
/* From this point the control must flow via the label out. */
cg.treeContext.flags |= (uint16) tcflags;
cg.staticDepth = TCF_GET_STATIC_DEPTH(tcflags);
cg.treeContext.flags |= tcflags;
/*
* Inline Statements() to emit as we go to save space.

Просмотреть файл

@ -263,7 +263,7 @@ script_compile_sub(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
* and compile-time scope.
*/
fp->flags |= JSFRAME_SCRIPT_OBJECT;
tcflags = caller ? TCF_PUT_STATIC_DEPTH(caller->staticDepth + 1) : 0;
tcflags = 0;
script = js_CompileScript(cx, scopeobj, principals, tcflags,
JSSTRING_CHARS(str), JSSTRING_LENGTH(str),
NULL, file, line);