[Follow up] Web Process crash when starting the web inspector after r174025.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Oct 2014 19:13:32 +0000 (19:13 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Oct 2014 19:13:32 +0000 (19:13 +0000)
<https://webkit.org/b/137340>

Reviewed by Geoffrey Garen.

Applied Geoff's feedback to clean up some code for better clarity after
r174856.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::insertCheck):
* dfg/DFGInsertionSet.h:
(JSC::DFG::InsertionSet::insertOutOfOrder):

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
Source/JavaScriptCore/dfg/DFGInsertionSet.h

index cc82a42..31cca6e 100644 (file)
@@ -1,5 +1,20 @@
 2014-10-20  Mark Lam  <mark.lam@apple.com>
 
+        [Follow up] Web Process crash when starting the web inspector after r174025.
+        <https://webkit.org/b/137340>
+
+        Reviewed by Geoffrey Garen.
+
+        Applied Geoff's feedback to clean up some code for better clarity after
+        r174856.
+
+        * dfg/DFGFixupPhase.cpp:
+        (JSC::DFG::FixupPhase::insertCheck):
+        * dfg/DFGInsertionSet.h:
+        (JSC::DFG::InsertionSet::insertOutOfOrder):
+
+2014-10-20  Mark Lam  <mark.lam@apple.com>
+
         Factor out JITCode::typeName() for debugging use.
         <https://webkit.org/b/137888>
 
index 3953746..79bf908 100644 (file)
@@ -1742,8 +1742,7 @@ private:
         if (currentNodeOrigin == checkedNodeOrigin) {
             // The checked node is within the same bytecode. Hence, the earliest
             // position we can insert the check is right after the checked node.
-            indexInBlock = indexOfNode(node, indexInBlock);
-            indexInBlock++;
+            indexInBlock = indexOfNode(node, indexInBlock) + 1;
         } else {
             // The checked node is from a preceding bytecode. Hence, the earliest
             // position we can insert the check is at the start of the current
index e454425..b97ea60 100644 (file)
@@ -120,14 +120,12 @@ public:
     {
         size_t targetIndex = insertion.index();
         size_t entry = m_insertions.size();
-        if (entry) {
-            do {
-                entry--;
-                if (m_insertions[entry].index() <= targetIndex) {
-                    entry++;
-                    break;
-                }
-            } while (entry);
+        while (entry) {
+            entry--;
+            if (m_insertions[entry].index() <= targetIndex) {
+                entry++;
+                break;
+            }
         }
         m_insertions.insert(entry, insertion);
         return insertion.element();