Changeset 241267 in webkit


Ignore:
Timestamp:
Feb 11, 2019 10:10:25 AM (5 years ago)
Author:
mark.lam@apple.com
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):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r241256 r241267  
     12019-02-10  Mark Lam  <mark.lam@apple.com>
     2
     3        Remove the RELEASE_ASSERT check for duplicate cases in the BinarySwitch constructor.
     4        https://bugs.webkit.org/show_bug.cgi?id=194493
     5        <rdar://problem/36380852>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        Having duplicate cases in the BinarySwitch is not a correctness issue.  It is
     10        however not good for performance and memory usage.  As such, a debug ASSERT will
     11        do.  We'll also do an audit of the clients of BinarySwitch to see if it's
     12        possible to be instantiated with duplicate cases in
     13        https://bugs.webkit.org/show_bug.cgi?id=194492 later.
     14
     15        Also added some value dumps to the RELEASE_ASSERT to help debug the issue when we
     16        see duplicate cases.
     17
     18        * jit/BinarySwitch.cpp:
     19        (JSC::BinarySwitch::BinarySwitch):
     20
    1212019-02-10  Darin Adler  <darin@apple.com>
    222
  • trunk/Source/JavaScriptCore/jit/BinarySwitch.cpp

    r231347 r241267  
    11/*
    2  * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2013-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    6060    if (BinarySwitchInternal::verbose)
    6161        dataLog("Sorted cases: ", listDump(m_cases), "\n");
    62    
     62
     63#if !ASSERT_DISABLED
    6364    for (unsigned i = 1; i < m_cases.size(); ++i)
    64         RELEASE_ASSERT(m_cases[i - 1] < m_cases[i]);
    65    
     65        ASSERT(m_cases[i - 1] < m_cases[i], i, m_cases.size(), m_cases[i].value, m_cases[i].index);
     66#endif
     67
    6668    build(0, false, m_cases.size());
    6769}
Note: See TracChangeset for help on using the changeset viewer.