Title: [260876] trunk/Source/_javascript_Core
- Revision
- 260876
- Author
- [email protected]
- Date
- 2020-04-28 23:09:32 -0700 (Tue, 28 Apr 2020)
Log Message
Unreviewed, build fix on watchOS
https://bugs.webkit.org/show_bug.cgi?id=210978
* runtime/JSBigInt.cpp:
(JSC::JSBigInt::createFrom):
(JSC::Int32BigIntImpl::digit):
* runtime/JSBigInt.h:
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (260875 => 260876)
--- trunk/Source/_javascript_Core/ChangeLog 2020-04-29 06:04:31 UTC (rev 260875)
+++ trunk/Source/_javascript_Core/ChangeLog 2020-04-29 06:09:32 UTC (rev 260876)
@@ -1,5 +1,15 @@
2020-04-28 Yusuke Suzuki <[email protected]>
+ Unreviewed, build fix on watchOS
+ https://bugs.webkit.org/show_bug.cgi?id=210978
+
+ * runtime/JSBigInt.cpp:
+ (JSC::JSBigInt::createFrom):
+ (JSC::Int32BigIntImpl::digit):
+ * runtime/JSBigInt.h:
+
+2020-04-28 Yusuke Suzuki <[email protected]>
+
[JSC] BigInt constructor should accept larger integers than safe-integers
https://bugs.webkit.org/show_bug.cgi?id=210755
Modified: trunk/Source/_javascript_Core/runtime/JSBigInt.cpp (260875 => 260876)
--- trunk/Source/_javascript_Core/runtime/JSBigInt.cpp 2020-04-29 06:04:31 UTC (rev 260875)
+++ trunk/Source/_javascript_Core/runtime/JSBigInt.cpp 2020-04-29 06:09:32 UTC (rev 260876)
@@ -228,11 +228,11 @@
// First, build the MSD by shifting the mantissa appropriately.
if (msdTopBit < mantissaTopBit) {
remainingMantissaBits = mantissaTopBit - msdTopBit;
- digit = mantissa >> remainingMantissaBits;
+ digit = static_cast<Digit>(mantissa >> remainingMantissaBits);
mantissa = mantissa << (64 - remainingMantissaBits);
} else {
ASSERT(msdTopBit >= mantissaTopBit);
- digit = mantissa << (msdTopBit - mantissaTopBit);
+ digit = static_cast<Digit>(mantissa << (msdTopBit - mantissaTopBit));
mantissa = 0;
}
result->setDigit(digits - 1, digit);
@@ -318,6 +318,7 @@
JSBigInt* m_bigInt;
};
+#if USE(BIGINT32)
class Int32BigIntImpl {
public:
explicit Int32BigIntImpl(int32_t value)
@@ -331,6 +332,7 @@
{
ASSERT(length());
ASSERT_UNUSED(i, i == 0);
+ static_assert(sizeof(Digit) == sizeof(uint64_t), "INT32_MAX can be represented with length() == 1 only when Digit is 64bit");
if (sign())
return -static_cast<int64_t>(m_value);
return m_value;
@@ -342,6 +344,7 @@
friend struct JSBigInt::ImplResult;
int32_t m_value;
};
+#endif
ALWAYS_INLINE JSBigInt::ImplResult::ImplResult(HeapBigIntImpl& heapImpl)
: payload(heapImpl.m_bigInt)
@@ -1358,6 +1361,7 @@
{
return compareImpl(HeapBigIntImpl { x }, HeapBigIntImpl { y });
}
+#if USE(BIGINT32)
JSBigInt::ComparisonResult JSBigInt::compare(int32_t x, JSBigInt* y)
{
return compareImpl(Int32BigIntImpl { x }, HeapBigIntImpl { y });
@@ -1367,6 +1371,7 @@
return compareImpl(HeapBigIntImpl { x }, Int32BigIntImpl { y });
}
+
template <typename BigIntImpl1, typename BigIntImpl2>
JSBigInt::ImplResult JSBigInt::absoluteAdd(JSGlobalObject* globalObject, BigIntImpl1 x, BigIntImpl2 y, bool resultSign)
{
Modified: trunk/Source/_javascript_Core/runtime/JSBigInt.h (260875 => 260876)
--- trunk/Source/_javascript_Core/runtime/JSBigInt.h 2020-04-29 06:04:31 UTC (rev 260875)
+++ trunk/Source/_javascript_Core/runtime/JSBigInt.h 2020-04-29 06:09:32 UTC (rev 260876)
@@ -138,6 +138,7 @@
bool equalsToNumber(JSValue);
JS_EXPORT_PRIVATE bool equalsToInt32(int32_t);
static ComparisonResult compare(JSBigInt* x, JSBigInt* y);
+#if USE(BIGINT32)
static ComparisonResult compare(int32_t x, JSBigInt* y);
static ComparisonResult compare(JSBigInt* x, int32_t y);
static ComparisonResult compare(int32_t x, int32_t y)
@@ -148,6 +149,7 @@
return JSBigInt::ComparisonResult::LessThan;
return JSBigInt::ComparisonResult::GreaterThan;
}
+#endif
bool getPrimitiveNumber(JSGlobalObject*, double& number, JSValue& result) const;
double toNumber(JSGlobalObject*) const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes