⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 280687 in webkit


Ignore:
Timestamp:
Aug 5, 2021, 8:14:42 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Use reinterpret_cast_ptr in KeywordLookupGenerator, PropertyMapHashTable
https://bugs.webkit.org/show_bug.cgi?id=228819

Patch by Zan Dobersek <zdobersek@igalia.com> on 2021-08-05
Reviewed by Adrian Perez de Castro.

Switch to using reinterpret_cast_ptr in KeywordLookupGenerator (which
generates the KeywordLookup.h header) and PropertyMapHashTable, reducing
a bit the GCC warning spewage when compiling for targets benefitting
from the reinterpret_cast_ptr workaround.

  • KeywordLookupGenerator.py:
  • runtime/PropertyMapHashTable.h:

(JSC::PropertyTable::table):
(JSC::PropertyTable::table const):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r280659 r280687  
     12021-08-05  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        Use reinterpret_cast_ptr in KeywordLookupGenerator, PropertyMapHashTable
     4        https://bugs.webkit.org/show_bug.cgi?id=228819
     5
     6        Reviewed by Adrian Perez de Castro.
     7
     8        Switch to using reinterpret_cast_ptr in KeywordLookupGenerator (which
     9        generates the KeywordLookup.h header) and PropertyMapHashTable, reducing
     10        a bit the GCC warning spewage when compiling for targets benefitting
     11        from the reinterpret_cast_ptr workaround.
     12
     13        * KeywordLookupGenerator.py:
     14        * runtime/PropertyMapHashTable.h:
     15        (JSC::PropertyTable::table):
     16        (JSC::PropertyTable::table const):
     17
    1182021-08-04  Yijia Huang  <yijia_huang@apple.com>
    219
  • trunk/Source/JavaScriptCore/KeywordLookupGenerator.py

    r258531 r280687  
    220220print("// This file was generated by KeywordLookupGenerator.py.  Do not edit.")
    221221print("""
     222#include <wtf/StdLibExtras.h>
     223
    222224#if CPU(NEEDS_ALIGNED_ACCESS)
    223225
     
    259261
    260262#define COMPARE_2CHARS(address, char1, char2) \\
    261     ((reinterpret_cast<const uint16_t*>(address))[0] == CHARPAIR_TOUINT16(char1, char2))
     263    ((reinterpret_cast_ptr<const uint16_t*>(address))[0] == CHARPAIR_TOUINT16(char1, char2))
    262264#define COMPARE_2UCHARS(address, char1, char2) \\
    263     ((reinterpret_cast<const uint32_t*>(address))[0] == UCHARPAIR_TOUINT32(char1, char2))
     265    ((reinterpret_cast_ptr<const uint32_t*>(address))[0] == UCHARPAIR_TOUINT32(char1, char2))
    264266
    265267#if CPU(X86_64)
    266268
    267269#define COMPARE_4CHARS(address, char1, char2, char3, char4) \\
    268     ((reinterpret_cast<const uint32_t*>(address))[0] == CHARQUAD_TOUINT32(char1, char2, char3, char4))
     270    ((reinterpret_cast_ptr<const uint32_t*>(address))[0] == CHARQUAD_TOUINT32(char1, char2, char3, char4))
    269271#define COMPARE_4UCHARS(address, char1, char2, char3, char4) \\
    270     ((reinterpret_cast<const uint64_t*>(address))[0] == UCHARQUAD_TOUINT64(char1, char2, char3, char4))
     272    ((reinterpret_cast_ptr<const uint64_t*>(address))[0] == UCHARQUAD_TOUINT64(char1, char2, char3, char4))
    271273
    272274#else // CPU(X86_64)
  • trunk/Source/JavaScriptCore/runtime/PropertyMapHashTable.h

    r273138 r280687  
    2727#include <wtf/HashTable.h>
    2828#include <wtf/MathExtras.h>
     29#include <wtf/StdLibExtras.h>
    2930#include <wtf/Vector.h>
    3031#include <wtf/text/AtomStringImpl.h>
     
    549550{
    550551    // The table of values lies after the hash index.
    551     return reinterpret_cast<ValueType*>(m_index + m_indexSize);
     552    return reinterpret_cast_ptr<ValueType*>(m_index + m_indexSize);
    552553}
    553554
     
    555556{
    556557    // The table of values lies after the hash index.
    557     return reinterpret_cast<const ValueType*>(m_index + m_indexSize);
     558    return reinterpret_cast_ptr<const ValueType*>(m_index + m_indexSize);
    558559}
    559560
Note: See TracChangeset for help on using the changeset viewer.