| Index: src/compiler/instruction-selector.cc
|
| diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc
|
| index 6c7cfe6e4344137f6bf1a41f24da81684fdd8d15..b6d8c7b636b194cd5d971ee1f5e6f9a6e6a56836 100644
|
| --- a/src/compiler/instruction-selector.cc
|
| +++ b/src/compiler/instruction-selector.cc
|
| @@ -12,6 +12,7 @@
|
| #include "src/compiler/pipeline.h"
|
| #include "src/compiler/schedule.h"
|
| #include "src/compiler/state-values-utils.h"
|
| +#include "src/deoptimizer.h"
|
|
|
| namespace v8 {
|
| namespace internal {
|
| @@ -633,12 +634,9 @@ void InstructionSelector::VisitControl(BasicBlock* block) {
|
| return VisitReturn(input);
|
| }
|
| case BasicBlock::kDeoptimize: {
|
| - // If the result itself is a return, return its input.
|
| - Node* value =
|
| - (input != nullptr && input->opcode() == IrOpcode::kDeoptimize)
|
| - ? input->InputAt(0)
|
| - : input;
|
| - return VisitDeoptimize(value);
|
| + DeoptimizeKind kind = DeoptimizeKindOf(input->op());
|
| + Node* value = input->InputAt(0);
|
| + return VisitDeoptimize(kind, value);
|
| }
|
| case BasicBlock::kThrow:
|
| DCHECK_EQ(IrOpcode::kThrow, input->opcode());
|
| @@ -1406,7 +1404,7 @@ void InstructionSelector::VisitReturn(Node* ret) {
|
| }
|
|
|
|
|
| -void InstructionSelector::VisitDeoptimize(Node* value) {
|
| +void InstructionSelector::VisitDeoptimize(DeoptimizeKind kind, Node* value) {
|
| OperandGenerator g(this);
|
|
|
| FrameStateDescriptor* desc = GetFrameStateDescriptor(value);
|
| @@ -1424,7 +1422,16 @@ void InstructionSelector::VisitDeoptimize(Node* value) {
|
|
|
| DCHECK_EQ(args.size(), arg_count);
|
|
|
| - Emit(kArchDeoptimize, 0, nullptr, arg_count, &args.front(), 0, nullptr);
|
| + InstructionCode opcode = kArchDeoptimize;
|
| + switch (kind) {
|
| + case DeoptimizeKind::kEager:
|
| + opcode |= MiscField::encode(Deoptimizer::EAGER);
|
| + break;
|
| + case DeoptimizeKind::kSoft:
|
| + opcode |= MiscField::encode(Deoptimizer::SOFT);
|
| + break;
|
| + }
|
| + Emit(opcode, 0, nullptr, arg_count, &args.front(), 0, nullptr);
|
| }
|
|
|
|
|
|
|