Index: src/ia32/lithium-ia32.cc |
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
index 3dc220d3d9ba259c3a3fce7c87911ccc967dd650..c9d008566bdaf5529781cbf59e808b4c4ede5f04 100644 |
--- a/src/ia32/lithium-ia32.cc |
+++ b/src/ia32/lithium-ia32.cc |
@@ -707,7 +707,9 @@ LInstruction* LChunkBuilder::DefineFixedDouble( |
LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) { |
HEnvironment* hydrogen_env = current_block_->last_environment(); |
- instr->set_environment(CreateEnvironment(hydrogen_env)); |
+ int argument_index_accumulator = 0; |
+ instr->set_environment(CreateEnvironment(hydrogen_env, |
+ &argument_index_accumulator)); |
return instr; |
} |
@@ -994,10 +996,13 @@ void LChunkBuilder::VisitInstruction(HInstruction* current) { |
} |
-LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) { |
+LEnvironment* LChunkBuilder::CreateEnvironment( |
+ HEnvironment* hydrogen_env, |
+ int* argument_index_accumulator) { |
if (hydrogen_env == NULL) return NULL; |
- LEnvironment* outer = CreateEnvironment(hydrogen_env->outer()); |
+ LEnvironment* outer = |
+ CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator); |
int ast_id = hydrogen_env->ast_id(); |
ASSERT(ast_id != AstNode::kNoNumber); |
int value_count = hydrogen_env->length(); |
@@ -1007,7 +1012,6 @@ LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) { |
argument_count_, |
value_count, |
outer); |
- int argument_index = 0; |
for (int i = 0; i < value_count; ++i) { |
if (hydrogen_env->is_special_index(i)) continue; |
@@ -1016,7 +1020,7 @@ LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) { |
if (value->IsArgumentsObject()) { |
op = NULL; |
} else if (value->IsPushArgument()) { |
- op = new LArgument(argument_index++); |
+ op = new LArgument((*argument_index_accumulator)++); |
} else { |
op = UseAny(value); |
} |