Index: src/mips/lithium-mips.cc |
diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc |
index 2c098fe77c140bbd95d7b26d2b1b5d67d2bdad1f..99e718cc6d7dae1a3f6ce08b1104a0b663e7e661 100644 |
--- a/src/mips/lithium-mips.cc |
+++ b/src/mips/lithium-mips.cc |
@@ -1005,14 +1005,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; |
@@ -1021,13 +1023,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; |
} |
@@ -2247,6 +2253,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()); |
@@ -2257,7 +2264,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; |
} |