Index: src/arm/lithium-arm.cc |
=================================================================== |
--- src/arm/lithium-arm.cc (revision 9531) |
+++ src/arm/lithium-arm.cc (working copy) |
@@ -212,10 +212,11 @@ |
} |
-void LIsNullAndBranch::PrintDataTo(StringStream* stream) { |
+void LIsNilAndBranch::PrintDataTo(StringStream* stream) { |
stream->Add("if "); |
InputAt(0)->PrintTo(stream); |
- stream->Add(is_strict() ? " === null" : " == null"); |
+ stream->Add(kind() == kStrictEquality ? " === " : " == "); |
+ stream->Add(nil() == kNullValue ? "null" : "undefined"); |
stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); |
} |
@@ -711,7 +712,9 @@ |
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 +997,13 @@ |
} |
-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 +1013,6 @@ |
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 +1021,7 @@ |
if (value->IsArgumentsObject()) { |
op = NULL; |
} else if (value->IsPushArgument()) { |
- op = new LArgument(argument_index++); |
+ op = new LArgument((*argument_index_accumulator)++); |
} else { |
op = UseAny(value); |
} |
@@ -1444,9 +1449,9 @@ |
} |
-LInstruction* LChunkBuilder::DoIsNullAndBranch(HIsNullAndBranch* instr) { |
+LInstruction* LChunkBuilder::DoIsNilAndBranch(HIsNilAndBranch* instr) { |
ASSERT(instr->value()->representation().IsTagged()); |
- return new LIsNullAndBranch(UseRegisterAtStart(instr->value())); |
+ return new LIsNilAndBranch(UseRegisterAtStart(instr->value())); |
} |
@@ -1734,7 +1739,7 @@ |
LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { |
LLoadGlobalCell* result = new LLoadGlobalCell; |
- return instr->check_hole_value() |
+ return instr->RequiresHoleCheck() |
? AssignEnvironment(DefineAsRegister(result)) |
: DefineAsRegister(result); |
} |
@@ -1748,14 +1753,11 @@ |
LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { |
- if (instr->check_hole_value()) { |
- LOperand* temp = TempRegister(); |
- LOperand* value = UseRegister(instr->value()); |
- return AssignEnvironment(new LStoreGlobalCell(value, temp)); |
- } else { |
- LOperand* value = UseRegisterAtStart(instr->value()); |
- return new LStoreGlobalCell(value, NULL); |
- } |
+ LOperand* temp = TempRegister(); |
+ LOperand* value = UseTempRegister(instr->value()); |
+ LInstruction* result = new LStoreGlobalCell(value, temp); |
+ if (instr->RequiresHoleCheck()) result = AssignEnvironment(result); |
+ return result; |
} |