Unreviewed, windows build fix.
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Oct 2017 21:37:59 +0000 (21:37 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Oct 2017 21:37:59 +0000 (21:37 +0000)
* assembler/X86Assembler.h:
(JSC::X86Assembler::numberOfRegisters):
(JSC::X86Assembler::numberOfSPRegisters):
(JSC::X86Assembler::numberOfFPRegisters):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224248 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/X86Assembler.h

index 289660a..97862da 100644 (file)
@@ -1,5 +1,14 @@
 2017-10-31  Keith Miller  <keith_miller@apple.com>
 
+        Unreviewed, windows build fix.
+
+        * assembler/X86Assembler.h:
+        (JSC::X86Assembler::numberOfRegisters):
+        (JSC::X86Assembler::numberOfSPRegisters):
+        (JSC::X86Assembler::numberOfFPRegisters):
+
+2017-10-31  Keith Miller  <keith_miller@apple.com>
+
         Make all register enums be backed by uint8_t.
         https://bugs.webkit.org/show_bug.cgi?id=179074
 
index d4d7cb8..b936a19 100644 (file)
@@ -103,13 +103,13 @@ public:
         return X86Registers::edi;
 #endif
     }
-    static constexpr unsigned numberOfRegisters() { return lastRegister() - firstRegister() + 1; }
+    static constexpr unsigned numberOfRegisters() { return static_cast<uint8_t>(lastRegister()) - static_cast<uint8_t>(firstRegister()) + 1; }
     
     typedef X86Registers::SPRegisterID SPRegisterID;
 
     static constexpr SPRegisterID firstSPRegister() { return X86Registers::eip; }
     static constexpr SPRegisterID lastSPRegister() { return X86Registers::eflags; }
-    static constexpr unsigned numberOfSPRegisters() { return lastSPRegister() - firstSPRegister() + 1; }
+    static constexpr unsigned numberOfSPRegisters() { return static_cast<uint8_t>(lastSPRegister()) - static_cast<uint8_t>(firstSPRegister()) + 1; }
     
     typedef X86Registers::XMMRegisterID XMMRegisterID;
     typedef XMMRegisterID FPRegisterID;
@@ -123,7 +123,7 @@ public:
         return X86Registers::xmm7;
 #endif
     }
-    static constexpr unsigned numberOfFPRegisters() { return lastFPRegister() - firstFPRegister() + 1; }
+    static constexpr unsigned numberOfFPRegisters() { return static_cast<uint8_t>(lastFPRegister()) - static_cast<uint8_t>(firstFPRegister()) + 1; }
     
     static const char* gprName(RegisterID id)
     {