Title: [188870] branches/jsc-tailcall/Source/_javascript_Core
Revision
188870
Author
[email protected]
Date
2015-08-24 11:07:48 -0700 (Mon, 24 Aug 2015)

Log Message

jsc-tailcall: Add a bunch of operators
https://bugs.webkit.org/show_bug.cgi?id=148337

Reviewed by Saam Barati.

* jit/GPRInfo.h:
(JSC::JSValueRegs::operator bool):
(JSC::JSValueRegs::operator==):
(JSC::JSValueRegs::operator!=):
(JSC::JSValueSource::operator bool):
(JSC::JSValueRegs::operator!):
(JSC::JSValueSource::operator!):
* jit/Reg.h:
(JSC::Reg::operator bool):

Modified Paths

Diff

Modified: branches/jsc-tailcall/Source/_javascript_Core/ChangeLog (188869 => 188870)


--- branches/jsc-tailcall/Source/_javascript_Core/ChangeLog	2015-08-24 17:38:23 UTC (rev 188869)
+++ branches/jsc-tailcall/Source/_javascript_Core/ChangeLog	2015-08-24 18:07:48 UTC (rev 188870)
@@ -1,5 +1,22 @@
 2015-08-24  Basile Clement  <[email protected]>
 
+        jsc-tailcall: Add a bunch of operators
+        https://bugs.webkit.org/show_bug.cgi?id=148337
+
+        Reviewed by Saam Barati.
+
+        * jit/GPRInfo.h:
+        (JSC::JSValueRegs::operator bool):
+        (JSC::JSValueRegs::operator==):
+        (JSC::JSValueRegs::operator!=):
+        (JSC::JSValueSource::operator bool):
+        (JSC::JSValueRegs::operator!):
+        (JSC::JSValueSource::operator!):
+        * jit/Reg.h:
+        (JSC::Reg::operator bool):
+
+2015-08-24  Basile Clement  <[email protected]>
+
         jsc-tailcall: ValueRecovery should distinguish between doubles in an FPR and JSValues in an FPR
         https://bugs.webkit.org/show_bug.cgi?id=148336
 

Modified: branches/jsc-tailcall/Source/_javascript_Core/jit/GPRInfo.h (188869 => 188870)


--- branches/jsc-tailcall/Source/_javascript_Core/jit/GPRInfo.h	2015-08-24 17:38:23 UTC (rev 188869)
+++ branches/jsc-tailcall/Source/_javascript_Core/jit/GPRInfo.h	2015-08-24 18:07:48 UTC (rev 188870)
@@ -65,6 +65,10 @@
     }
     
     bool operator!() const { return m_gpr == InvalidGPRReg; }
+    explicit operator bool() const { return m_gpr != InvalidGPRReg; }
+
+    bool operator==(JSValueRegs other) { return m_gpr == other.m_gpr; }
+    bool operator!=(JSValueRegs other) { return !(*this == other); }
     
     GPRReg gpr() const { return m_gpr; }
     GPRReg tagGPR() const { return InvalidGPRReg; }
@@ -110,6 +114,7 @@
     }
     
     bool operator!() const { return m_base == InvalidGPRReg; }
+    explicit operator bool() const { return m_base != InvalidGPRReg; }
     
     bool isAddress() const { return m_offset != notAddress(); }
     
@@ -166,11 +171,19 @@
         return JSValueRegs(InvalidGPRReg, gpr);
     }
     
-    bool operator!() const
+    bool operator!() const { return !static_cast<bool>(*this); }
+    explicit operator bool() const
     {
-        return static_cast<GPRReg>(m_tagGPR) == InvalidGPRReg
-            && static_cast<GPRReg>(m_payloadGPR) == InvalidGPRReg;
+        return static_cast<GPRReg>(m_tagGPR) != InvalidGPRReg
+            || static_cast<GPRReg>(m_payloadGPR) != InvalidGPRReg;
     }
+
+    bool operator==(JSValueRegs other) const
+    {
+        return m_tagGPR == other.m_tagGPR
+            && m_payloadGPR == other.m_payloadGPR;
+    }
+    bool operator!=(JSValueRegs other) const { return !(*this == other); }
     
     GPRReg tagGPR() const { return static_cast<GPRReg>(m_tagGPR); }
     GPRReg payloadGPR() const { return static_cast<GPRReg>(m_payloadGPR); }
@@ -238,11 +251,12 @@
         result.m_tagType = static_cast<int8_t>(JSValue::CellTag);
         return result;
     }
-    
-    bool operator!() const
+
+    bool operator!() const { return !static_cast<bool>(*this); }
+    explicit operator bool() const
     {
-        return static_cast<GPRReg>(m_baseOrTag) == InvalidGPRReg
-            && static_cast<GPRReg>(m_payload) == InvalidGPRReg;
+        return static_cast<GPRReg>(m_baseOrTag) != InvalidGPRReg
+            || static_cast<GPRReg>(m_payload) != InvalidGPRReg;
     }
     
     bool isAddress() const

Modified: branches/jsc-tailcall/Source/_javascript_Core/jit/Reg.h (188869 => 188870)


--- branches/jsc-tailcall/Source/_javascript_Core/jit/Reg.h	2015-08-24 17:38:23 UTC (rev 188869)
+++ branches/jsc-tailcall/Source/_javascript_Core/jit/Reg.h	2015-08-24 18:07:48 UTC (rev 188870)
@@ -101,6 +101,7 @@
     
     bool isSet() const { return m_index != invalid(); }
     bool operator!() const { return !isSet(); }
+    explicit operator bool() const { return isSet(); }
     
     bool isGPR() const
     {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to