зеркало из https://github.com/mozilla/gecko-dev.git
merge after backout of 9ecf699d4047
This commit is contained in:
Коммит
cf73f6de49
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче