Index: src/x64/lithium-x64.cc |
diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc |
index 5fc56462bb02dbdc6944c6c981f666d88484aa01..3f0cb0cd228812a0611af22caf143e4852ec5901 100644 |
--- a/src/x64/lithium-x64.cc |
+++ b/src/x64/lithium-x64.cc |
@@ -706,7 +706,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; |
} |
@@ -989,10 +991,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(); |
@@ -1002,7 +1007,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; |
@@ -1011,7 +1015,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); |
} |