Title: [241267] trunk/Source/_javascript_Core
Revision
241267
Author
[email protected]
Date
2019-02-11 10:10:25 -0800 (Mon, 11 Feb 2019)

Log Message

Remove the RELEASE_ASSERT check for duplicate cases in the BinarySwitch constructor.
https://bugs.webkit.org/show_bug.cgi?id=194493
<rdar://problem/36380852>

Reviewed by Yusuke Suzuki.

Having duplicate cases in the BinarySwitch is not a correctness issue.  It is
however not good for performance and memory usage.  As such, a debug ASSERT will
do.  We'll also do an audit of the clients of BinarySwitch to see if it's
possible to be instantiated with duplicate cases in
https://bugs.webkit.org/show_bug.cgi?id=194492 later.

Also added some value dumps to the RELEASE_ASSERT to help debug the issue when we
see duplicate cases.

* jit/BinarySwitch.cpp:
(JSC::BinarySwitch::BinarySwitch):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (241266 => 241267)


--- trunk/Source/_javascript_Core/ChangeLog	2019-02-11 17:29:39 UTC (rev 241266)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-02-11 18:10:25 UTC (rev 241267)
@@ -1,3 +1,23 @@
+2019-02-10  Mark Lam  <[email protected]>
+
+        Remove the RELEASE_ASSERT check for duplicate cases in the BinarySwitch constructor.
+        https://bugs.webkit.org/show_bug.cgi?id=194493
+        <rdar://problem/36380852>
+
+        Reviewed by Yusuke Suzuki.
+
+        Having duplicate cases in the BinarySwitch is not a correctness issue.  It is
+        however not good for performance and memory usage.  As such, a debug ASSERT will
+        do.  We'll also do an audit of the clients of BinarySwitch to see if it's
+        possible to be instantiated with duplicate cases in
+        https://bugs.webkit.org/show_bug.cgi?id=194492 later.
+
+        Also added some value dumps to the RELEASE_ASSERT to help debug the issue when we
+        see duplicate cases.
+
+        * jit/BinarySwitch.cpp:
+        (JSC::BinarySwitch::BinarySwitch):
+
 2019-02-10  Darin Adler  <[email protected]>
 
         Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead

Modified: trunk/Source/_javascript_Core/jit/BinarySwitch.cpp (241266 => 241267)


--- trunk/Source/_javascript_Core/jit/BinarySwitch.cpp	2019-02-11 17:29:39 UTC (rev 241266)
+++ trunk/Source/_javascript_Core/jit/BinarySwitch.cpp	2019-02-11 18:10:25 UTC (rev 241267)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -59,10 +59,12 @@
 
     if (BinarySwitchInternal::verbose)
         dataLog("Sorted cases: ", listDump(m_cases), "\n");
-    
+
+#if !ASSERT_DISABLED
     for (unsigned i = 1; i < m_cases.size(); ++i)
-        RELEASE_ASSERT(m_cases[i - 1] < m_cases[i]);
-    
+        ASSERT(m_cases[i - 1] < m_cases[i], i, m_cases.size(), m_cases[i].value, m_cases[i].index);
+#endif
+
     build(0, false, m_cases.size());
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to