Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Do not put O (jl.Object) in the ancestors dictionaries. #4932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ private[emitter] final class ClassEmitter(sjsGen: SJSGen) {
}

val ancestorsRecord = js.ObjectConstr(
ancestors.map(ancestor => (js.Ident(genName(ancestor)), js.IntLiteral(1))))
ancestors.withFilter(_ != ObjectClass).map(ancestor => (js.Ident(genName(ancestor)), js.IntLiteral(1))))

val isInstanceFunWithGlobals: WithGlobals[js.Tree] = {
if (globalKnowledge.isAncestorOfHijackedClass(className)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,6 @@ private[emitter] object CoreJSLib {
else
Skip(),
privateFieldSet("ancestors", ObjectConstr(List(
Ident(genName(ObjectClass)) -> 1,
Ident(genName(CloneableClass)) -> 1,
Ident(genName(SerializableClass)) -> 1
))),
Expand Down Expand Up @@ -2066,7 +2065,7 @@ private[emitter] object CoreJSLib {
extractWithGlobals(
globalVarDef(VarField.d, ObjectClass, New(globalVar(VarField.TypeData, CoreVar), Nil))) :::
List(
privateFieldSet("ancestors", ObjectConstr(List((Ident(genName(ObjectClass)) -> 1)))),
privateFieldSet("ancestors", ObjectConstr(Nil)),
privateFieldSet("arrayEncodedName", str("L" + fullName + ";")),
privateFieldSet("isAssignableFromFun", {
genArrowFunction(paramList(that), {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ class LibrarySizeTest {
)

testLinkedSizes(
expectedFastLinkSize = 150339,
expectedFullLinkSizeWithoutClosure = 130884,
expectedFullLinkSizeWithClosure = 21394,
expectedFastLinkSize = 150063,
expectedFullLinkSizeWithoutClosure = 130664,
expectedFullLinkSizeWithClosure = 21325,
classDefs,
moduleInitializers = MainTestModuleInitializers
)
Expand Down
8 changes: 4 additions & 4 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1967,16 +1967,16 @@ object Build {
scalaVersion.value match {
case `default212Version` =>
Some(ExpectedSizes(
fastLink = 770000 to 771000,
fullLink = 145000 to 146000,
fastLink = 768000 to 769000,
fullLink = 144000 to 145000,
fastLinkGz = 90000 to 91000,
fullLinkGz = 35000 to 36000,
))

case `default213Version` =>
Some(ExpectedSizes(
fastLink = 479000 to 480000,
fullLink = 102000 to 103000,
fastLink = 478000 to 479000,
fullLink = 101000 to 102000,
fastLinkGz = 62000 to 63000,
fullLinkGz = 27000 to 28000,
))
Expand Down