diff -r b760e8cb29a8 -r 91071a2255bf src/BytecodeCompiler.cpp --- a/src/BytecodeCompiler.cpp Sun Aug 05 01:10:49 2012 -0700 +++ b/src/BytecodeCompiler.cpp Sun Aug 05 01:15:35 2012 -0700 @@ -249,23 +249,14 @@ IndexExpression *index = node->lvalue()->toIndexExpression(); __ note_position(index->pos()); - // Note: Eventually, watch out for a hole here. An expression like: - // - // (a[4] = (5, a = [])) - // - // Could shrink array, so we need to either bind a[i] to a Reference, - // or keep the bounds check near the set. This is just a semantic - // decision. index->left()->accept(this); index->right()->accept(this); if (node->token() != TOK_ASSIGN) __ dup2(); - if (node->token() != TOK_ASSIGN || (type->isStruct() || type->isArray())) { - __ bounds(); + if (node->token() != TOK_ASSIGN || (type->isStruct() || type->isArray())) __ getelem(index->type()); - } } if (node->token() == TOK_ASSIGN) { @@ -302,9 +293,6 @@ __ setfield(expr->fieldIndex(), expr->type()); } else { IndexExpression *index = node->lvalue()->toIndexExpression(); - // :TODO: get rid of the BOUNDS instruction, embed it in g/setelem*? - // We can't emit it here because the stack is slightly out of position. - // __ bounds(); __ setelem(index->type()); } } @@ -382,7 +370,6 @@ index->right()->accept(this); assert(!node->type()->isArray()); - __ bounds(); __ dup2(); __ getelem(node->type()); @@ -538,7 +525,6 @@ node->left()->accept(this); node->right()->accept(this); __ note_position(node->pos()); - __ bounds(); __ getelem(node->type()); } @@ -887,7 +873,6 @@ expr->left()->accept(this); expr->right()->accept(this); __ note_position(expr->pos()); - __ bounds(); __ arrayref_lifo(); } else { // We don't know how to, or can't, build a direct reference to