WebKit Bugzilla
Attachment 341763 Details for
Bug 186196
: [JSC] Correct values and members of JSBigInt appropriately
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186196-20180602005618.patch (text/plain), 4.91 KB, created by
Yusuke Suzuki
on 2018-06-01 08:56:19 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-06-01 08:56:19 PDT
Size:
4.91 KB
patch
obsolete
>Subversion Revision: 232393 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 526c31e0643e24ea94ca005e3c77e9d62f17acef..47498a8e8ee1a6552bd49478ffd6b4f8721b9b88 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,25 @@ >+2018-06-01 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ [JSC] Correct values and members of JSBigInt appropriately >+ https://bugs.webkit.org/show_bug.cgi?id=186196 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch cleans up a bit to select more appropriate values and members of JSBigInt. >+ >+ 1. JSBigInt's structure should be StructureIsImmortal. >+ 2. JSBigInt::allocationSize should be annotated with `inline`. >+ 3. Remove JSBigInt::visitChildren since it is completely the same to JSCell::visitChildren. >+ 4. Remove JSBigInt::finishCreation since it is completely the same to JSCell::finishCreation. >+ >+ * runtime/JSBigInt.cpp: >+ (JSC::JSBigInt::allocationSize): >+ (JSC::JSBigInt::allocateFor): >+ (JSC::JSBigInt::compareToDouble): >+ (JSC::JSBigInt::visitChildren): Deleted. >+ (JSC::JSBigInt::finishCreation): Deleted. >+ * runtime/JSBigInt.h: >+ > 2018-05-31 Yusuke Suzuki <utatane.tea@gmail.com> > > [Baseline] Store constant directly in emit_op_mov >diff --git a/Source/JavaScriptCore/runtime/JSBigInt.cpp b/Source/JavaScriptCore/runtime/JSBigInt.cpp >index 854523335eeb5bc21aefc5db1502fcd2e17fa2c7..6742d9bc13a255b46b7fdc36b94d0efc35ffb660 100644 >--- a/Source/JavaScriptCore/runtime/JSBigInt.cpp >+++ b/Source/JavaScriptCore/runtime/JSBigInt.cpp >@@ -61,13 +61,6 @@ namespace JSC { > const ClassInfo JSBigInt::s_info = > { "JSBigInt", nullptr, nullptr, nullptr, CREATE_METHOD_TABLE(JSBigInt) }; > >-void JSBigInt::visitChildren(JSCell* cell, SlotVisitor& visitor) >-{ >- JSBigInt* thisObject = jsCast<JSBigInt*>(cell); >- ASSERT_GC_OBJECT_INHERITS(thisObject, info()); >- Base::visitChildren(thisObject, visitor); >-} >- > JSBigInt::JSBigInt(VM& vm, Structure* structure, unsigned length) > : Base(vm, structure) > , m_length(length) >@@ -92,7 +85,7 @@ JSBigInt* JSBigInt::createZero(VM& vm) > return zeroBigInt; > } > >-size_t JSBigInt::allocationSize(unsigned length) >+inline size_t JSBigInt::allocationSize(unsigned length) > { > size_t sizeWithPadding = WTF::roundUpToMultipleOf<sizeof(size_t)>(sizeof(JSBigInt)); > return sizeWithPadding + length * sizeof(Digit); >@@ -105,12 +98,6 @@ JSBigInt* JSBigInt::createWithLength(VM& vm, unsigned length) > return bigInt; > } > >-void JSBigInt::finishCreation(VM& vm) >-{ >- Base::finishCreation(vm); >-} >- >- > JSBigInt* JSBigInt::createFrom(VM& vm, int32_t value) > { > if (!value) >@@ -1058,7 +1045,6 @@ JSBigInt* JSBigInt::rightTrim(VM& vm) > JSBigInt* JSBigInt::allocateFor(ExecState* state, VM& vm, unsigned radix, unsigned charcount) > { > ASSERT(2 <= radix && radix <= 36); >- ASSERT(charcount >= 0); > > size_t bitsPerChar = maxBitsPerCharTable[radix]; > size_t chars = charcount; >@@ -1320,7 +1306,7 @@ JSBigInt::ComparisonResult JSBigInt::compareToDouble(JSBigInt* x, double y) > > // 0-indexed position of {x}'s most significant bit within the {msd}. > int msdTopBit = digitBits - 1 - msdLeadingZeros; >- ASSERT(msdTopBit == (xBitLength - 1) % digitBits); >+ ASSERT(msdTopBit == static_cast<int>((xBitLength - 1) % digitBits)); > > // Shifted chunk of {mantissa} for comparing with {digit}. > Digit compareMantissa; >diff --git a/Source/JavaScriptCore/runtime/JSBigInt.h b/Source/JavaScriptCore/runtime/JSBigInt.h >index 28e4da6cccd712694a3d9b1b03f57c2ff30518c1..fba5a6d2d6f386ca98897a8ec464c84439c84424 100644 >--- a/Source/JavaScriptCore/runtime/JSBigInt.h >+++ b/Source/JavaScriptCore/runtime/JSBigInt.h >@@ -37,7 +37,7 @@ namespace JSC { > > class JSBigInt final : public JSCell { > using Base = JSCell; >- static const unsigned StructureFlags = Base::StructureFlags | OverridesToThis; >+ static const unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal | OverridesToThis; > > public: > >@@ -46,10 +46,7 @@ class JSBigInt final : public JSCell { > enum class InitializationType { None, WithZero }; > void initialize(InitializationType); > >- static void visitChildren(JSCell*, SlotVisitor&); >- > static size_t estimatedSize(JSCell*); >- static size_t allocationSize(unsigned length); > > static Structure* createStructure(VM&, JSGlobalObject*, JSValue prototype); > static JSBigInt* createZero(VM&); >@@ -62,8 +59,6 @@ class JSBigInt final : public JSCell { > > DECLARE_EXPORT_INFO; > >- void finishCreation(VM&); >- > JSValue toPrimitive(ExecState*, PreferredPrimitiveType) const; > > void setSign(bool sign) { m_sign = sign; } >@@ -175,6 +170,7 @@ class JSBigInt final : public JSCell { > > void inplaceMultiplyAdd(Digit multiplier, Digit part); > >+ static size_t allocationSize(unsigned length); > static size_t offsetOfData(); > Digit* dataStorage(); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
darin
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186196
: 341763