Title: [292535] trunk/Source/_javascript_Core
- Revision
- 292535
- Author
- [email protected]
- Date
- 2022-04-07 07:43:36 -0700 (Thu, 07 Apr 2022)
Log Message
[JSC][32bit] Use constexpr tags instead of enums
https://bugs.webkit.org/show_bug.cgi?id=238926
Patch by Geza Lore <[email protected]> on 2022-04-07
Reviewed by Yusuke Suzuki.
The *Tag values are just 32-bit constants, so define them as
constexpr. This reduces compiler nuisance warnings about enum
comparisons.
* dfg/DFGSpeculativeJIT.cpp:
* runtime/JSCJSValue.h:
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (292534 => 292535)
--- trunk/Source/_javascript_Core/ChangeLog 2022-04-07 14:40:11 UTC (rev 292534)
+++ trunk/Source/_javascript_Core/ChangeLog 2022-04-07 14:43:36 UTC (rev 292535)
@@ -1,3 +1,17 @@
+2022-04-07 Geza Lore <[email protected]>
+
+ [JSC][32bit] Use constexpr tags instead of enums
+ https://bugs.webkit.org/show_bug.cgi?id=238926
+
+ Reviewed by Yusuke Suzuki.
+
+ The *Tag values are just 32-bit constants, so define them as
+ constexpr. This reduces compiler nuisance warnings about enum
+ comparisons.
+
+ * dfg/DFGSpeculativeJIT.cpp:
+ * runtime/JSCJSValue.h:
+
2022-04-07 Carlos Garcia Campos <[email protected]>
[GTK][WPE] RemoteInspector add support for IPv6
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (292534 => 292535)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2022-04-07 14:40:11 UTC (rev 292534)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2022-04-07 14:43:36 UTC (rev 292535)
@@ -11674,9 +11674,7 @@
JSValueRegs(gpr), edge, SpecBytecodeNumber,
m_jit.branchIfNotNumber(gpr));
#else
- IGNORE_WARNINGS_BEGIN("enum-compare")
static_assert(JSValue::Int32Tag >= JSValue::LowestTag, "Int32Tag is included in >= JSValue::LowestTag range.");
- IGNORE_WARNINGS_END
GPRReg tagGPR = value.tagGPR();
DFG_TYPE_CHECK(
value.jsValueRegs(), edge, ~SpecInt32Only,
@@ -12321,9 +12319,7 @@
regs, edge, SpecMisc,
m_jit.branch64(MacroAssembler::Above, regs.gpr(), MacroAssembler::TrustedImm64(JSValue::MiscTag)));
#else
- IGNORE_WARNINGS_BEGIN("enum-compare")
static_assert(JSValue::Int32Tag >= JSValue::UndefinedTag, "Int32Tag is included in >= JSValue::UndefinedTag range.");
- IGNORE_WARNINGS_END
DFG_TYPE_CHECK(
regs, edge, ~SpecInt32Only,
m_jit.branchIfInt32(regs.tagGPR()));
Modified: trunk/Source/_javascript_Core/runtime/JSCJSValue.h (292534 => 292535)
--- trunk/Source/_javascript_Core/runtime/JSCJSValue.h 2022-04-07 14:40:11 UTC (rev 292534)
+++ trunk/Source/_javascript_Core/runtime/JSCJSValue.h 2022-04-07 14:43:36 UTC (rev 292535)
@@ -157,16 +157,15 @@
public:
#if USE(JSVALUE32_64)
- enum { Int32Tag = 0xffffffff };
- enum { BooleanTag = 0xfffffffe };
- enum { NullTag = 0xfffffffd };
- enum { UndefinedTag = 0xfffffffc };
- enum { CellTag = 0xfffffffb };
- enum { EmptyValueTag = 0xfffffffa };
- enum { DeletedValueTag = 0xfffffff9 };
+ static constexpr uint32_t Int32Tag = 0xffffffff;
+ static constexpr uint32_t BooleanTag = 0xfffffffe;
+ static constexpr uint32_t NullTag = 0xfffffffd;
+ static constexpr uint32_t UndefinedTag = 0xfffffffc;
+ static constexpr uint32_t CellTag = 0xfffffffb;
+ static constexpr uint32_t EmptyValueTag = 0xfffffffa;
+ static constexpr uint32_t DeletedValueTag = 0xfffffff9;
- enum { LowestTag = DeletedValueTag };
-
+ static constexpr uint32_t LowestTag = DeletedValueTag;
#endif
static EncodedJSValue encode(JSValue);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes