Index: src/arm/lithium-arm.cc |
diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc |
index 30ccd05beecb39c979a4dbe91ee301d381390d7d..ececdcd3511a229c28865bf6e7e7b17dbb503411 100644 |
--- a/src/arm/lithium-arm.cc |
+++ b/src/arm/lithium-arm.cc |
@@ -711,7 +711,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); |
} |