Deoptimize group assignment to avoid writing extra code for the hard case where the rhs has fewer elements than the lhs (but the rhs might have proto-elements; 355023, r=mrbkap).

This commit is contained in:
brendan%mozilla.org 2006-10-05 21:18:22 +00:00
Родитель 3b5a89f3f8
Коммит defea01fc8
1 изменённых файлов: 2 добавлений и 1 удалений

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

@ -3524,7 +3524,8 @@ MaybeEmitGroupAssignment(JSContext *cx, JSCodeGenerator *cg, JSOp declOp,
JS_ASSERT(*pop == JSOP_POP || *pop == JSOP_POPV);
lhs = pn->pn_left;
rhs = pn->pn_right;
if (lhs->pn_type == TOK_RB && rhs->pn_type == TOK_RB) {
if (lhs->pn_type == TOK_RB && rhs->pn_type == TOK_RB &&
lhs->pn_count <= rhs->pn_count) {
if (!EmitGroupAssignment(cx, cg, declOp, lhs, rhs))
return JS_FALSE;
*pop = JSOP_NOP;