Index: src/x64/lithium-x64.cc |
diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc |
index fee2f4f2ab98bbfd2351e821a920e3271608c5f2..1236e3870b20e84d2877ffa7a5b0cb9b51192749 100644 |
--- a/src/x64/lithium-x64.cc |
+++ b/src/x64/lithium-x64.cc |
@@ -1000,14 +1000,16 @@ LEnvironment* LChunkBuilder::CreateEnvironment( |
LEnvironment* outer = |
CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator); |
int ast_id = hydrogen_env->ast_id(); |
- ASSERT(ast_id != AstNode::kNoNumber); |
+ ASSERT(ast_id != AstNode::kNoNumber || hydrogen_env->is_arguments_adaptor()); |
int value_count = hydrogen_env->length(); |
LEnvironment* result = new LEnvironment(hydrogen_env->closure(), |
+ hydrogen_env->is_arguments_adaptor(), |
ast_id, |
hydrogen_env->parameter_count(), |
argument_count_, |
value_count, |
outer); |
+ int argument_index = *argument_index_accumulator; |
for (int i = 0; i < value_count; ++i) { |
if (hydrogen_env->is_special_index(i)) continue; |
@@ -1016,13 +1018,17 @@ LEnvironment* LChunkBuilder::CreateEnvironment( |
if (value->IsArgumentsObject()) { |
op = NULL; |
} else if (value->IsPushArgument()) { |
- op = new LArgument((*argument_index_accumulator)++); |
+ op = new LArgument(argument_index++); |
} else { |
op = UseAny(value); |
} |
result->AddValue(op, value->representation()); |
} |
+ if (!hydrogen_env->is_arguments_adaptor()) { |
+ *argument_index_accumulator = argument_index; |
+ } |
+ |
return result; |
} |
@@ -2245,6 +2251,7 @@ LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { |
HEnvironment* outer = current_block_->last_environment(); |
HConstant* undefined = graph()->GetConstantUndefined(); |
HEnvironment* inner = outer->CopyForInlining(instr->closure(), |
+ instr->arguments_count(), |
instr->function(), |
undefined, |
instr->call_kind()); |
@@ -2255,7 +2262,8 @@ LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { |
LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
- HEnvironment* outer = current_block_->last_environment()->outer(); |
+ HEnvironment* outer = current_block_->last_environment()-> |
+ DiscardInlined(false); |
current_block_->UpdateEnvironment(outer); |
return NULL; |
} |