| Index: src/compiler/instruction-selector-impl.h
 | 
| diff --git a/src/compiler/instruction-selector-impl.h b/src/compiler/instruction-selector-impl.h
 | 
| index 6cb87ea0c06cd2ecff9da771ba60c997cb2c728b..3b0b7c038fb9089380b63bd14777704d87b0fcfd 100644
 | 
| --- a/src/compiler/instruction-selector-impl.h
 | 
| +++ b/src/compiler/instruction-selector-impl.h
 | 
| @@ -5,14 +5,17 @@
 | 
|  #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
 | 
|  #define V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
 | 
|  
 | 
| -#include "src/compiler/instruction.h"
 | 
|  #include "src/compiler/instruction-selector.h"
 | 
| +#include "src/compiler/instruction.h"
 | 
|  #include "src/compiler/linkage.h"
 | 
|  #include "src/compiler/schedule.h"
 | 
|  #include "src/macro-assembler.h"
 | 
|  
 | 
|  namespace v8 {
 | 
|  namespace internal {
 | 
| +
 | 
| +class SourcePosition;
 | 
| +
 | 
|  namespace compiler {
 | 
|  
 | 
|  // Helper struct containing data about a table or lookup switch.
 | 
| @@ -345,10 +348,19 @@ class FlagsContinuation final {
 | 
|      return FlagsContinuation(condition, result);
 | 
|    }
 | 
|  
 | 
| +  // Creates a new flags continuation for a wasm trap.
 | 
| +  static FlagsContinuation ForTrap(FlagsCondition condition,
 | 
| +                                   Runtime::FunctionId trap_id,
 | 
| +                                   SourcePosition* source_position,
 | 
| +                                   Node* result) {
 | 
| +    return FlagsContinuation(condition, trap_id, source_position, result);
 | 
| +  }
 | 
| +
 | 
|    bool IsNone() const { return mode_ == kFlags_none; }
 | 
|    bool IsBranch() const { return mode_ == kFlags_branch; }
 | 
|    bool IsDeoptimize() const { return mode_ == kFlags_deoptimize; }
 | 
|    bool IsSet() const { return mode_ == kFlags_set; }
 | 
| +  bool IsTrap() const { return mode_ == kFlags_trap; }
 | 
|    FlagsCondition condition() const {
 | 
|      DCHECK(!IsNone());
 | 
|      return condition_;
 | 
| @@ -365,6 +377,14 @@ class FlagsContinuation final {
 | 
|      DCHECK(IsSet());
 | 
|      return frame_state_or_result_;
 | 
|    }
 | 
| +  int trap_id() const {
 | 
| +    DCHECK(IsTrap());
 | 
| +    return trap_id_;
 | 
| +  }
 | 
| +  SourcePosition* source_position() const {
 | 
| +    DCHECK(IsTrap());
 | 
| +    return source_position_;
 | 
| +  }
 | 
|    BasicBlock* true_block() const {
 | 
|      DCHECK(IsBranch());
 | 
|      return true_block_;
 | 
| @@ -437,6 +457,16 @@ class FlagsContinuation final {
 | 
|      DCHECK_NOT_NULL(result);
 | 
|    }
 | 
|  
 | 
| +  FlagsContinuation(FlagsCondition condition, int32_t trap_id,
 | 
| +                    SourcePosition* source_position, Node* result)
 | 
| +      : mode_(kFlags_trap),
 | 
| +        condition_(condition),
 | 
| +        frame_state_or_result_(result),
 | 
| +        trap_id_(trap_id),
 | 
| +        source_position_(source_position) {
 | 
| +    DCHECK_NOT_NULL(result);
 | 
| +  }
 | 
| +
 | 
|    FlagsMode const mode_;
 | 
|    FlagsCondition condition_;
 | 
|    DeoptimizeReason reason_;      // Only value if mode_ == kFlags_deoptimize
 | 
| @@ -444,6 +474,8 @@ class FlagsContinuation final {
 | 
|                                   // or mode_ == kFlags_set.
 | 
|    BasicBlock* true_block_;       // Only valid if mode_ == kFlags_branch.
 | 
|    BasicBlock* false_block_;      // Only valid if mode_ == kFlags_branch.
 | 
| +  int32_t trap_id_;              // Only valid if mode_ == kFlags_trap.
 | 
| +  SourcePosition* source_position_;  // Only valid if mode_ == kFlags_trap.
 | 
|  };
 | 
|  
 | 
|  }  // namespace compiler
 | 
| 
 |