| Index: src/x64/lithium-x64.cc
|
| ===================================================================
|
| --- src/x64/lithium-x64.cc (revision 9531)
|
| +++ src/x64/lithium-x64.cc (working copy)
|
| @@ -214,10 +214,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());
|
| }
|
|
|
| @@ -706,7 +707,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;
|
| }
|
|
|
| @@ -989,10 +992,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();
|
| @@ -1002,7 +1008,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;
|
|
|
| @@ -1011,7 +1016,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);
|
| }
|
| @@ -1436,10 +1441,10 @@
|
| }
|
|
|
|
|
| -LInstruction* LChunkBuilder::DoIsNullAndBranch(HIsNullAndBranch* instr) {
|
| +LInstruction* LChunkBuilder::DoIsNilAndBranch(HIsNilAndBranch* instr) {
|
| ASSERT(instr->value()->representation().IsTagged());
|
| - LOperand* temp = instr->is_strict() ? NULL : TempRegister();
|
| - return new LIsNullAndBranch(UseRegisterAtStart(instr->value()), temp);
|
| + LOperand* temp = instr->kind() == kStrictEquality ? NULL : TempRegister();
|
| + return new LIsNilAndBranch(UseRegisterAtStart(instr->value()), temp);
|
| }
|
|
|
|
|
| @@ -1489,6 +1494,7 @@
|
| LInstruction* LChunkBuilder::DoClassOfTestAndBranch(
|
| HClassOfTestAndBranch* instr) {
|
| return new LClassOfTestAndBranch(UseTempRegister(instr->value()),
|
| + TempRegister(),
|
| TempRegister());
|
| }
|
|
|
| @@ -1716,7 +1722,7 @@
|
|
|
| LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) {
|
| LLoadGlobalCell* result = new LLoadGlobalCell;
|
| - return instr->check_hole_value()
|
| + return instr->RequiresHoleCheck()
|
| ? AssignEnvironment(DefineAsRegister(result))
|
| : DefineAsRegister(result);
|
| }
|
| @@ -1731,8 +1737,10 @@
|
|
|
| LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) {
|
| LStoreGlobalCell* result =
|
| - new LStoreGlobalCell(UseRegister(instr->value()), TempRegister());
|
| - return instr->check_hole_value() ? AssignEnvironment(result) : result;
|
| + new LStoreGlobalCell(UseTempRegister(instr->value()),
|
| + TempRegister(),
|
| + TempRegister());
|
| + return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result;
|
| }
|
|
|
|
|
|
|