Index: src/compiler/instruction-selector.cc |
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc |
index 5e5b919e536febbfe668b7822d14f0ae8ab4f097..99e2afe99484b35614d8119a26e1ac0cef601fc1 100644 |
--- a/src/compiler/instruction-selector.cc |
+++ b/src/compiler/instruction-selector.cc |
@@ -127,7 +127,6 @@ void InstructionSelector::AddInstruction(Instruction* instr) { |
} |
} |
- |
Instruction* InstructionSelector::Emit(InstructionCode opcode, |
InstructionOperand output, |
size_t temp_count, |
@@ -799,6 +798,13 @@ void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer, |
} |
} |
+bool InstructionSelector::IsSourcePositionUsed(Node* node) { |
+ return (source_position_mode_ == kAllSourcePositions || |
+ node->opcode() == IrOpcode::kCall || |
+ node->opcode() == IrOpcode::kTrapIf || |
+ node->opcode() == IrOpcode::kTrapUnless); |
+} |
+ |
void InstructionSelector::VisitBlock(BasicBlock* block) { |
DCHECK(!current_block_); |
current_block_ = block; |
@@ -840,9 +846,7 @@ void InstructionSelector::VisitBlock(BasicBlock* block) { |
if (instructions_.size() == current_node_end) continue; |
// Mark source position on first instruction emitted. |
SourcePosition source_position = source_positions_->GetSourcePosition(node); |
- if (source_position.IsKnown() && |
- (source_position_mode_ == kAllSourcePositions || |
- node->opcode() == IrOpcode::kCall)) { |
+ if (source_position.IsKnown() && IsSourcePositionUsed(node)) { |
sequence()->SetSourcePosition(instructions_[current_node_end], |
source_position); |
} |
@@ -1016,6 +1020,10 @@ void InstructionSelector::VisitNode(Node* node) { |
return VisitDeoptimizeIf(node); |
case IrOpcode::kDeoptimizeUnless: |
return VisitDeoptimizeUnless(node); |
+ case IrOpcode::kTrapIf: |
+ return VisitTrapIf(node); |
+ case IrOpcode::kTrapUnless: |
+ return VisitTrapUnless(node); |
case IrOpcode::kFrameState: |
case IrOpcode::kStateValues: |
case IrOpcode::kObjectState: |