Rename NodeMayOverflowInXXX to NodeMayOverflowInt32InXXX.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 27 Dec 2015 06:27:03 +0000 (06:27 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 27 Dec 2015 06:27:03 +0000 (06:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152555

Reviewed by Alex Christensen.

That's because the NodeMayOverflowInBaseline and NodeMayOverflowInDFG flags only
indicates potential overflowing of Int32 values.  We'll be adding overflow
profiling for Int52 values later, and we should disambiguate between the 2 types.

This is purely a renaming patch.  There are no semantic changes.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::makeSafe):
(JSC::DFG::ByteCodeParser::makeDivSafe):
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGNodeFlags.cpp:
(JSC::DFG::dumpNodeFlags):
* dfg/DFGNodeFlags.h:
(JSC::DFG::nodeMayOverflowInt32):
(JSC::DFG::nodeCanSpeculateInt32):
(JSC::DFG::nodeMayOverflow): Deleted.

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Source/JavaScriptCore/dfg/DFGNodeFlags.cpp
Source/JavaScriptCore/dfg/DFGNodeFlags.h

index df006db..4811bf1 100644 (file)
@@ -1,3 +1,27 @@
+2015-12-26  Mark Lam  <mark.lam@apple.com>
+
+        Rename NodeMayOverflowInXXX to NodeMayOverflowInt32InXXX.
+        https://bugs.webkit.org/show_bug.cgi?id=152555
+
+        Reviewed by Alex Christensen.
+
+        That's because the NodeMayOverflowInBaseline and NodeMayOverflowInDFG flags only
+        indicates potential overflowing of Int32 values.  We'll be adding overflow
+        profiling for Int52 values later, and we should disambiguate between the 2 types.
+
+        This is purely a renaming patch.  There are no semantic changes.
+
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::makeSafe):
+        (JSC::DFG::ByteCodeParser::makeDivSafe):
+        (JSC::DFG::ByteCodeParser::handleIntrinsicCall):
+        * dfg/DFGNodeFlags.cpp:
+        (JSC::DFG::dumpNodeFlags):
+        * dfg/DFGNodeFlags.h:
+        (JSC::DFG::nodeMayOverflowInt32):
+        (JSC::DFG::nodeCanSpeculateInt32):
+        (JSC::DFG::nodeMayOverflow): Deleted.
+
 2015-12-23  Andreas Kling  <akling@apple.com>
 
         jsc CLI tool crashes on EOF.
index 5198e91..9edd2d9 100644 (file)
@@ -882,7 +882,7 @@ private:
     Node* makeSafe(Node* node)
     {
         if (m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow))
-            node->mergeFlags(NodeMayOverflowInDFG);
+            node->mergeFlags(NodeMayOverflowInt32InDFG);
         if (m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, NegativeZero))
             node->mergeFlags(NodeMayNegZeroInDFG);
         
@@ -898,14 +898,14 @@ private:
         case ArithSub:
         case ValueAdd:
         case ArithMod: // for ArithMod "MayOverflow" means we tried to divide by zero, or we saw double.
-            node->mergeFlags(NodeMayOverflowInBaseline);
+            node->mergeFlags(NodeMayOverflowInt32InBaseline);
             break;
             
         case ArithNegate:
             // Currently we can't tell the difference between a negation overflowing
             // (i.e. -(1 << 31)) or generating negative zero (i.e. -0). If it took slow
             // path then we assume that it did both of those things.
-            node->mergeFlags(NodeMayOverflowInBaseline);
+            node->mergeFlags(NodeMayOverflowInt32InBaseline);
             node->mergeFlags(NodeMayNegZeroInBaseline);
             break;
 
@@ -915,7 +915,7 @@ private:
             // https://bugs.webkit.org/show_bug.cgi?id=132470
             if (m_inlineStackTop->m_profiledBlock->likelyToTakeDeepestSlowCase(m_currentIndex)
                 || m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow))
-                node->mergeFlags(NodeMayOverflowInBaseline | NodeMayNegZeroInBaseline);
+                node->mergeFlags(NodeMayOverflowInt32InBaseline | NodeMayNegZeroInBaseline);
             else if (m_inlineStackTop->m_profiledBlock->likelyToTakeSlowCase(m_currentIndex)
                 || m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, NegativeZero))
                 node->mergeFlags(NodeMayNegZeroInBaseline);
@@ -934,7 +934,7 @@ private:
         ASSERT(node->op() == ArithDiv);
         
         if (m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow))
-            node->mergeFlags(NodeMayOverflowInDFG);
+            node->mergeFlags(NodeMayOverflowInt32InDFG);
         if (m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, NegativeZero))
             node->mergeFlags(NodeMayNegZeroInDFG);
         
@@ -948,7 +948,7 @@ private:
             return node;
         
         // FIXME: It might be possible to make this more granular.
-        node->mergeFlags(NodeMayOverflowInBaseline | NodeMayNegZeroInBaseline);
+        node->mergeFlags(NodeMayOverflowInt32InBaseline | NodeMayNegZeroInBaseline);
         
         return node;
     }
@@ -2010,7 +2010,7 @@ bool ByteCodeParser::handleIntrinsicCall(int resultOperand, Intrinsic intrinsic,
         insertChecks();
         Node* node = addToGraph(ArithAbs, get(virtualRegisterForArgument(1, registerOffset)));
         if (m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow))
-            node->mergeFlags(NodeMayOverflowInDFG);
+            node->mergeFlags(NodeMayOverflowInt32InDFG);
         set(VirtualRegister(resultOperand), node);
         return true;
     }
index 366fbec..47d5519 100644 (file)
@@ -84,13 +84,13 @@ void dumpNodeFlags(PrintStream& actualOut, NodeFlags flags)
         if (flags & NodeBytecodeUsesAsOther)
             out.print(comma, "UseAsOther");
     }
-    
-    if (flags & NodeMayOverflowInBaseline)
-        out.print(comma, "MayOverflowInBaseline");
-    
-    if (flags & NodeMayOverflowInDFG)
-        out.print(comma, "MayOverflowInDFG");
-    
+
+    if (flags & NodeMayOverflowInt32InBaseline)
+        out.print(comma, "MayOverflowInt32InBaseline");
+
+    if (flags & NodeMayOverflowInt32InDFG)
+        out.print(comma, "MayOverflowInt32InDFG");
+
     if (flags & NodeMayNegZeroInBaseline)
         out.print(comma, "MayNegZeroInBaseline");
     
index 4db2a43..a319c9c 100644 (file)
@@ -49,8 +49,8 @@ namespace JSC { namespace DFG {
 // 0x0020 and 0x0040 are free.
                                 
 #define NodeBehaviorMask                 0x0780
-#define NodeMayOverflowInBaseline        0x0080
-#define NodeMayOverflowInDFG             0x0100
+#define NodeMayOverflowInt32InBaseline   0x0080
+#define NodeMayOverflowInt32InDFG        0x0100
 #define NodeMayNegZeroInBaseline         0x0200
 #define NodeMayNegZeroInDFG              0x0400
                                 
@@ -94,18 +94,18 @@ enum RareCaseProfilingSource {
     AllRareCases
 };
 
-static inline bool nodeMayOverflow(NodeFlags flags, RareCaseProfilingSource source)
+static inline bool nodeMayOverflowInt32(NodeFlags flags, RareCaseProfilingSource source)
 {
     NodeFlags mask = 0;
     switch (source) {
     case BaselineRareCase:
-        mask = NodeMayOverflowInBaseline;
+        mask = NodeMayOverflowInt32InBaseline;
         break;
     case DFGRareCase:
-        mask = NodeMayOverflowInDFG;
+        mask = NodeMayOverflowInt32InDFG;
         break;
     case AllRareCases:
-        mask = NodeMayOverflowInBaseline | NodeMayOverflowInDFG;
+        mask = NodeMayOverflowInt32InBaseline | NodeMayOverflowInt32InDFG;
         break;
     }
     return !!(flags & mask);
@@ -130,7 +130,7 @@ static inline bool nodeMayNegZero(NodeFlags flags, RareCaseProfilingSource sourc
 
 static inline bool nodeCanSpeculateInt32(NodeFlags flags, RareCaseProfilingSource source)
 {
-    if (nodeMayOverflow(flags, source))
+    if (nodeMayOverflowInt32(flags, source))
         return !bytecodeUsesAsNumber(flags);
     
     if (nodeMayNegZero(flags, source))