| Index: src/x64/lithium-x64.cc
|
| ===================================================================
|
| --- src/x64/lithium-x64.cc (revision 7030)
|
| +++ src/x64/lithium-x64.cc (working copy)
|
| @@ -653,16 +653,16 @@
|
|
|
| LInstruction* LChunkBuilder::SetInstructionPendingDeoptimizationEnvironment(
|
| LInstruction* instr, int ast_id) {
|
| - ASSERT(instructions_pending_deoptimization_environment_ == NULL);
|
| + ASSERT(instruction_pending_deoptimization_environment_ == NULL);
|
| ASSERT(pending_deoptimization_ast_id_ == AstNode::kNoNumber);
|
| - instructions_pending_deoptimization_environment_ = instr;
|
| + instruction_pending_deoptimization_environment_ = instr;
|
| pending_deoptimization_ast_id_ = ast_id;
|
| return instr;
|
| }
|
|
|
|
|
| void LChunkBuilder::ClearInstructionPendingDeoptimizationEnvironment() {
|
| - instructions_pending_deoptimization_environment_ = NULL;
|
| + instruction_pending_deoptimization_environment_ = NULL;
|
| pending_deoptimization_ast_id_ = AstNode::kNoNumber;
|
| }
|
|
|
| @@ -1043,8 +1043,9 @@
|
|
|
|
|
| LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) {
|
| - Abort("Unimplemented: %s", "DoPushArgument");
|
| - return NULL;
|
| + ++argument_count_;
|
| + LOperand* argument = UseOrConstant(instr->argument());
|
| + return new LPushArgument(argument);
|
| }
|
|
|
|
|
| @@ -1054,8 +1055,7 @@
|
|
|
|
|
| LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) {
|
| - Abort("Unimplemented: %s", "DoGlobalReceiver");
|
| - return NULL;
|
| + return DefineAsRegister(new LGlobalReceiver);
|
| }
|
|
|
|
|
| @@ -1097,8 +1097,10 @@
|
|
|
|
|
| LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) {
|
| - Abort("Unimplemented: %s", "DoCallNew");
|
| - return NULL;
|
| + LOperand* constructor = UseFixed(instr->constructor(), rdi);
|
| + argument_count_ -= instr->argument_count();
|
| + LCallNew* result = new LCallNew(constructor);
|
| + return MarkAsCall(DefineFixed(result, rax), instr);
|
| }
|
|
|
|
|
| @@ -1326,6 +1328,13 @@
|
| }
|
|
|
|
|
| +LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
|
| + // The control instruction marking the end of a block that completed
|
| + // abruptly (e.g., threw an exception). There is nothing specific to do.
|
| + return NULL;
|
| +}
|
| +
|
| +
|
| LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
|
| Abort("Unimplemented: %s", "DoThrow");
|
| return NULL;
|
| @@ -1395,8 +1404,8 @@
|
|
|
|
|
| LInstruction* LChunkBuilder::DoCheckNonSmi(HCheckNonSmi* instr) {
|
| - Abort("Unimplemented: %s", "DoCheckNonSmi");
|
| - return NULL;
|
| + LOperand* value = UseRegisterAtStart(instr->value());
|
| + return AssignEnvironment(new LCheckSmi(value, zero));
|
| }
|
|
|
|
|
| @@ -1407,26 +1416,28 @@
|
|
|
|
|
| LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) {
|
| - Abort("Unimplemented: %s", "DoCheckPrototypeMaps");
|
| - return NULL;
|
| + LOperand* temp = TempRegister();
|
| + LCheckPrototypeMaps* result = new LCheckPrototypeMaps(temp);
|
| + return AssignEnvironment(result);
|
| }
|
|
|
|
|
| LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) {
|
| - Abort("Unimplemented: %s", "DoCheckSmi");
|
| - return NULL;
|
| + LOperand* value = UseRegisterAtStart(instr->value());
|
| + return AssignEnvironment(new LCheckSmi(value, not_zero));
|
| }
|
|
|
|
|
| LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) {
|
| - Abort("Unimplemented: %s", "DoCheckFunction");
|
| - return NULL;
|
| + LOperand* value = UseRegisterAtStart(instr->value());
|
| + return AssignEnvironment(new LCheckFunction(value));
|
| }
|
|
|
|
|
| LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) {
|
| - Abort("Unimplemented: %s", "DoCheckMap");
|
| - return NULL;
|
| + LOperand* value = UseRegisterAtStart(instr->value());
|
| + LCheckMap* result = new LCheckMap(value);
|
| + return AssignEnvironment(result);
|
| }
|
|
|
|
|
| @@ -1454,15 +1465,15 @@
|
|
|
|
|
| LInstruction* LChunkBuilder::DoLoadGlobal(HLoadGlobal* instr) {
|
| - Abort("Unimplemented: %s", "DoLoadGlobal");
|
| - return NULL;
|
| + LLoadGlobal* result = new LLoadGlobal;
|
| + return instr->check_hole_value()
|
| + ? AssignEnvironment(DefineAsRegister(result))
|
| + : DefineAsRegister(result);
|
| }
|
|
|
|
|
| LInstruction* LChunkBuilder::DoStoreGlobal(HStoreGlobal* instr) {
|
| - Abort("Unimplemented: %s", "DoStoreGlobal");
|
| - return NULL;
|
| -}
|
| + return new LStoreGlobal(UseRegisterAtStart(instr->value()));}
|
|
|
|
|
| LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) {
|
| @@ -1472,8 +1483,9 @@
|
|
|
|
|
| LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
|
| - Abort("Unimplemented: %s", "DoLoadNamedField");
|
| - return NULL;
|
| + ASSERT(instr->representation().IsTagged());
|
| + LOperand* obj = UseRegisterAtStart(instr->object());
|
| + return DefineAsRegister(new LLoadNamedField(obj));
|
| }
|
|
|
|
|
| @@ -1523,8 +1535,22 @@
|
|
|
|
|
| LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
|
| - Abort("Unimplemented: %s", "DoStoreNamedField");
|
| - return NULL;
|
| + bool needs_write_barrier = instr->NeedsWriteBarrier();
|
| +
|
| + LOperand* obj = needs_write_barrier
|
| + ? UseTempRegister(instr->object())
|
| + : UseRegisterAtStart(instr->object());
|
| +
|
| + LOperand* val = needs_write_barrier
|
| + ? UseTempRegister(instr->value())
|
| + : UseRegister(instr->value());
|
| +
|
| + // We only need a scratch register if we have a write barrier or we
|
| + // have a store into the properties array (not in-object-property).
|
| + LOperand* temp = (!instr->is_in_object() || needs_write_barrier)
|
| + ? TempRegister() : NULL;
|
| +
|
| + return new LStoreNamedField(obj, val, temp);
|
| }
|
|
|
|
|
| @@ -1645,7 +1671,7 @@
|
| if (pending_deoptimization_ast_id_ == instr->ast_id()) {
|
| LLazyBailout* lazy_bailout = new LLazyBailout;
|
| LInstruction* result = AssignEnvironment(lazy_bailout);
|
| - instructions_pending_deoptimization_environment_->
|
| + instruction_pending_deoptimization_environment_->
|
| set_deoptimization_environment(result->environment());
|
| ClearInstructionPendingDeoptimizationEnvironment();
|
| return result;
|
| @@ -1661,7 +1687,14 @@
|
|
|
|
|
| LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
|
| - Abort("Unimplemented: %s", "DoEnterInlined");
|
| + HEnvironment* outer = current_block_->last_environment();
|
| + HConstant* undefined = graph()->GetConstantUndefined();
|
| + HEnvironment* inner = outer->CopyForInlining(instr->closure(),
|
| + instr->function(),
|
| + false,
|
| + undefined);
|
| + current_block_->UpdateEnvironment(inner);
|
| + chunk_->AddInlinedClosure(instr->closure());
|
| return NULL;
|
| }
|
|
|
|
|