Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: src/compiler/instruction-selector.cc

Issue 2562393002: [wasm] Introduce the TrapIf and TrapUnless operators to generate trap code. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/instruction-selector.cc
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc
index f204bb849e4045acef928a2068130f5572112cd4..00330cd7603d421f83767a33ebaa5ace4164129c 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -127,6 +127,10 @@ void InstructionSelector::AddInstruction(Instruction* instr) {
}
}
+void InstructionSelector::SetSourcePosition(const Instruction* instr,
+ SourcePosition value) {
+ sequence()->SetSourcePosition(instr, value);
+}
Instruction* InstructionSelector::Emit(InstructionCode opcode,
InstructionOperand output,
@@ -838,8 +842,7 @@ void InstructionSelector::VisitBlock(BasicBlock* block) {
if (source_position.IsKnown() &&
(source_position_mode_ == kAllSourcePositions ||
node->opcode() == IrOpcode::kCall)) {
- sequence()->SetSourcePosition(instructions_[current_node_end],
- source_position);
+ SetSourcePosition(instructions_[current_node_end], source_position);
}
}
@@ -1011,6 +1014,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:

Powered by Google App Engine
This is Rietveld 408576698