Index: src/ia32/lithium-ia32.cc |
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
index 8435a3c2a1320b1e90ee0fe726f34cdad9a54f0f..04e9d246a93ed15dde8d2f325359a28eec8be02c 100644 |
--- a/src/ia32/lithium-ia32.cc |
+++ b/src/ia32/lithium-ia32.cc |
@@ -1013,15 +1013,17 @@ 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(zone()) 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; |
@@ -1030,13 +1032,17 @@ LEnvironment* LChunkBuilder::CreateEnvironment( |
if (value->IsArgumentsObject()) { |
op = NULL; |
} else if (value->IsPushArgument()) { |
- op = new(zone()) LArgument((*argument_index_accumulator)++); |
+ op = new(zone()) 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; |
} |
@@ -2380,6 +2386,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()); |
@@ -2390,7 +2397,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; |
} |