From 744ba05dd6cc342b75d315f6b568ab6e24a0519f Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 2 Nov 2011 20:45:48 -0700 Subject: [PATCH] Bug 696284 - Add a comment explaining why we allocate BytecodeEmitter on the heap. r=jorendorff. DONTBUILD --- js/src/frontend/BytecodeEmitter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index ca19fcef3ca..73302d80260 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -5820,7 +5820,11 @@ frontend::EmitTree(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn) JS_ASSERT_IF(pn->pn_funbox->tcflags & TCF_FUN_HEAVYWEIGHT, fun->kind() == JSFUN_INTERPRETED); - /* Generate code for the function's body. */ + /* + * Generate code for the function's body. bce2 is not allocated on the + * stack because doing so significantly reduces the maximum depth of + * nested functions we can handle. See bug 696284. + */ BytecodeEmitter *bce2 = cx->new_(bce->parser, pn->pn_pos.begin.lineno); if (!bce2) { js_ReportOutOfMemory(cx);