Title: [272685] trunk/Source/_javascript_Core
Revision
272685
Author
mark....@apple.com
Date
2021-02-10 14:00:54 -0800 (Wed, 10 Feb 2021)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (272684 => 272685)


--- trunk/Source/_javascript_Core/ChangeLog	2021-02-10 21:34:27 UTC (rev 272684)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-02-10 22:00:54 UTC (rev 272685)
@@ -1,3 +1,21 @@
+2021-02-10  Mark Lam  <mark....@apple.com>
+
+        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):
+
 2021-02-10  Saam Barati  <sbar...@apple.com>
 
         Don't crash when reparsing an arrow function and the parsing invariant is broken

Modified: trunk/Source/_javascript_Core/llint/LLIntData.h (272684 => 272685)


--- trunk/Source/_javascript_Core/llint/LLIntData.h	2021-02-10 21:34:27 UTC (rev 272684)
+++ trunk/Source/_javascript_Core/llint/LLIntData.h	2021-02-10 22:00:54 UTC (rev 272685)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2021 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -155,6 +155,10 @@
     return MacroAssemblerCodePtr<tag>::createFromExecutableAddress(retaggedOpcode);
 }
 
+#if ENABLE(ARM64E) && !ENABLE(COMPUTED_GOTO_OPCODES)
+#error ENABLE(ARM64E) requires ENABLE(COMPUTED_GOTO_OPCODES) for getCodePtr (and its variants).
+#endif
+
 template<PtrTag tag>
 ALWAYS_INLINE MacroAssemblerCodePtr<tag> getCodePtr(OpcodeID opcodeID)
 {
@@ -162,7 +166,6 @@
     const Opcode* opcode = getOpcodeAddress(opcodeID);
     return getCodePtrImpl<tag>(*opcode, opcode);
 #else
-    static_assert(!ENABLE(ARM64E));
     return getCodePtrImpl<tag>(getOpcode(opcodeID), nullptr);
 #endif
 }
@@ -174,7 +177,6 @@
     const Opcode* opcode = getOpcodeWide16Address(opcodeID);
     return getCodePtrImpl<tag>(*opcode, opcode);
 #else
-    static_assert(!ENABLE(ARM64E));
     return getCodePtrImpl<tag>(getOpcodeWide16(opcodeID), nullptr);
 #endif
 }
@@ -186,7 +188,6 @@
     const Opcode* opcode = getOpcodeWide32Address(opcodeID);
     return getCodePtrImpl<tag>(*opcode, opcode);
 #else
-    static_assert(!ENABLE(ARM64E));
     return getCodePtrImpl<tag>(getOpcodeWide32(opcodeID), nullptr);
 #endif
 }
@@ -295,7 +296,6 @@
     const Opcode* opcode = getOpcodeAddress(opcodeID);
     return getCodePtrImpl<tag>(*opcode, opcode);
 #else
-    static_assert(!ENABLE(ARM64E));
     return getCodePtrImpl<tag>(getOpcode(opcodeID), nullptr);
 #endif
 }
@@ -307,7 +307,6 @@
     const Opcode* opcode = getOpcodeWide16Address(opcodeID);
     return getCodePtrImpl<tag>(*opcode, opcode);
 #else
-    static_assert(!ENABLE(ARM64E));
     return getCodePtrImpl<tag>(getOpcodeWide16(opcodeID), nullptr);
 #endif
 }
@@ -319,7 +318,6 @@
     const Opcode* opcode = getOpcodeWide32Address(opcodeID);
     return getCodePtrImpl<tag>(*opcode, opcode);
 #else
-    static_assert(!ENABLE(ARM64E));
     return getCodePtrImpl<tag>(getOpcodeWide32(opcodeID), nullptr);
 #endif
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to