DFG should assert that argument value recoveries can only be
[WebKit-https.git] / Source / JavaScriptCore / bytecode / ValueRecovery.h
index 4d2134e0ab25c1b554259fc2970525d9dc267312..007c6d3b7171d4b7ab0c2541f1040c6e8c90dba1 100644 (file)
@@ -192,6 +192,8 @@ public:
     
     ValueRecoveryTechnique technique() const { return m_technique; }
     
+    bool isConstant() const { return m_technique == Constant; }
+    
     bool isInRegisters() const
     {
         switch (m_technique) {
@@ -208,6 +210,20 @@ public:
         }
     }
     
+    bool isAlreadyInRegisterFile() const
+    {
+        switch (technique()) {
+        case AlreadyInRegisterFile:
+        case AlreadyInRegisterFileAsUnboxedInt32:
+        case AlreadyInRegisterFileAsUnboxedCell:
+        case AlreadyInRegisterFileAsUnboxedBoolean:
+        case AlreadyInRegisterFileAsUnboxedDouble:
+            return true;
+        default:
+            return false;
+        }
+    }
+    
     MacroAssembler::RegisterID gpr() const
     {
         ASSERT(m_technique == InGPR || m_technique == UnboxedInt32InGPR || m_technique == UnboxedBooleanInGPR || m_technique == UInt32InGPR);