Browse Source

LibX86: Remove Instruction::m_handler

We can fetch the handler via Instruction::m_descriptor.
Andreas Kling 5 years ago
parent
commit
4f8e86ad67
1 changed files with 2 additions and 4 deletions
  1. 2 4
      Libraries/LibX86/Instruction.h

+ 2 - 4
Libraries/LibX86/Instruction.h

@@ -425,7 +425,7 @@ public:
         return m_modrm;
         return m_modrm;
     }
     }
 
 
-    ALWAYS_INLINE InstructionHandler handler() const { return m_handler; }
+    ALWAYS_INLINE InstructionHandler handler() const { return m_descriptor->handler; }
 
 
     bool has_segment_prefix() const { return m_segment_prefix.has_value(); }
     bool has_segment_prefix() const { return m_segment_prefix.has_value(); }
     Optional<SegmentRegister> segment_prefix() const { return m_segment_prefix; }
     Optional<SegmentRegister> segment_prefix() const { return m_segment_prefix; }
@@ -811,7 +811,7 @@ ALWAYS_INLINE unsigned Instruction::length() const
     return len;
     return len;
 }
 }
 
 
-ALWAYS_INLINE static Optional<SegmentRegister> to_segment_prefix(u8 op)
+ALWAYS_INLINE Optional<SegmentRegister> to_segment_prefix(u8 op)
 {
 {
     switch (op) {
     switch (op) {
     case 0x26:
     case 0x26:
@@ -935,8 +935,6 @@ ALWAYS_INLINE Instruction::Instruction(InstructionStreamType& stream, bool o32,
         break;
         break;
     }
     }
 
 
-    m_handler = m_descriptor->handler;
-
 #ifdef DISALLOW_INVALID_LOCK_PREFIX
 #ifdef DISALLOW_INVALID_LOCK_PREFIX
     if (m_has_lock_prefix && !m_descriptor->lock_prefix_allowed) {
     if (m_has_lock_prefix && !m_descriptor->lock_prefix_allowed) {
         fprintf(stderr, "Instruction not allowed with LOCK prefix, this will raise #UD\n");
         fprintf(stderr, "Instruction not allowed with LOCK prefix, this will raise #UD\n");