Changeset 272685 in webkit


Ignore:
Timestamp:
Feb 10, 2021, 2:00:54 PM (4 years ago)
Author:
mark.lam@apple.com
Message:

We should not static_assert on an ENABLE() macro.
https://bugs.webkit.org/show_bug.cgi?id=221714
rdar://74197896

Reviewed by Yusuke Suzuki.

This is because the ENABLE() macro reduces to a macro expression
(defined ENABLE_##WTF_FEATURE && ENABLE_##WTF_FEATURE) which is not a C++
expression that a static_assert can evaluate.

  • llint/LLIntData.cpp:
  • llint/LLIntData.h:

(JSC::LLInt::getCodePtr):
(JSC::LLInt::getWide16CodePtr):
(JSC::LLInt::getWide32CodePtr):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r272663 r272685  
     12021-02-10  Mark Lam  <mark.lam@apple.com>
     2
     3        We should not static_assert on an ENABLE() macro.
     4        https://bugs.webkit.org/show_bug.cgi?id=221714
     5        rdar://74197896
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        This is because the ENABLE() macro reduces to a macro expression
     10        `(defined ENABLE_##WTF_FEATURE && ENABLE_##WTF_FEATURE)` which is not a C++
     11        expression that a static_assert can evaluate.
     12
     13        * llint/LLIntData.cpp:
     14        * llint/LLIntData.h:
     15        (JSC::LLInt::getCodePtr):
     16        (JSC::LLInt::getWide16CodePtr):
     17        (JSC::LLInt::getWide32CodePtr):
     18
    1192021-02-10  Saam Barati  <sbarati@apple.com>
    220
  • trunk/Source/JavaScriptCore/llint/LLIntData.h

    r272330 r272685  
    11/*
    2  * Copyright (C) 2011-2020 Apple Inc. All rights reserved.
     2 * Copyright (C) 2011-2021 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    156156}
    157157
     158#if ENABLE(ARM64E) && !ENABLE(COMPUTED_GOTO_OPCODES)
     159#error ENABLE(ARM64E) requires ENABLE(COMPUTED_GOTO_OPCODES) for getCodePtr (and its variants).
     160#endif
     161
    158162template<PtrTag tag>
    159163ALWAYS_INLINE MacroAssemblerCodePtr<tag> getCodePtr(OpcodeID opcodeID)
     
    163167    return getCodePtrImpl<tag>(*opcode, opcode);
    164168#else
    165     static_assert(!ENABLE(ARM64E));
    166169    return getCodePtrImpl<tag>(getOpcode(opcodeID), nullptr);
    167170#endif
     
    175178    return getCodePtrImpl<tag>(*opcode, opcode);
    176179#else
    177     static_assert(!ENABLE(ARM64E));
    178180    return getCodePtrImpl<tag>(getOpcodeWide16(opcodeID), nullptr);
    179181#endif
     
    187189    return getCodePtrImpl<tag>(*opcode, opcode);
    188190#else
    189     static_assert(!ENABLE(ARM64E));
    190191    return getCodePtrImpl<tag>(getOpcodeWide32(opcodeID), nullptr);
    191192#endif
     
    296297    return getCodePtrImpl<tag>(*opcode, opcode);
    297298#else
    298     static_assert(!ENABLE(ARM64E));
    299299    return getCodePtrImpl<tag>(getOpcode(opcodeID), nullptr);
    300300#endif
     
    308308    return getCodePtrImpl<tag>(*opcode, opcode);
    309309#else
    310     static_assert(!ENABLE(ARM64E));
    311310    return getCodePtrImpl<tag>(getOpcodeWide16(opcodeID), nullptr);
    312311#endif
     
    320319    return getCodePtrImpl<tag>(*opcode, opcode);
    321320#else
    322     static_assert(!ENABLE(ARM64E));
    323321    return getCodePtrImpl<tag>(getOpcodeWide32(opcodeID), nullptr);
    324322#endif
Note: See TracChangeset for help on using the changeset viewer.