Closed Bug 1716247 Opened 4 years ago Closed 4 years ago

Visual Studio 2017 fails to compile SM headers

Categories

(Core :: JavaScript: GC, defect, P3)

78 Branch
defect

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 2 obsolete files)

We apparently didn't actually fix the issue in Bug 1679736. At the root of the problem is are some reinterpret_casts which I do not like so I have a few patches to remove the RootListEntry type in favour of an appropriate untemplated base type. This has the side effect of preventing MSVC from freaking out too.

Add a common base type for all PersistentRooted instead of relying on undefined
reinterpret_casts. This avoids PersistentRooted<RootListEntry*> which causes
potential issues when SpiderMonkey is used in a project compiled under MSVC. The
static_cast is still unchecked so the same care needs to be taken as before.

Depends on D117603

Add a common base type with the template parameter erased. This lets us remove
the RootListEntry type and the undefined reinterpret_casts it is using.

Depends on D117604

Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c52f0e7918ec Remove dead code from GC rooting API. r=sfink https://hg.mozilla.org/integration/autoland/rev/0ea7f627a717 Add js::PersistentRootedBase type. r=sfink https://hg.mozilla.org/integration/autoland/rev/58137e59d8fc Add js::RootedUntypedBase type. r=sfink
Flags: needinfo?(tcampbell)
Attachment #9226726 - Attachment is obsolete: true
Attachment #9226727 - Attachment is obsolete: true

When compiling spidermonkey public APIs under MSVC, the dummy type RootListEntry
needs a GCPolicy even though it is not instantiated.

In order to get something into ESR-91, I'll just use the minimal hack. The refactoring patches ran into issues with RootedTraceable and more design work is ndeeded there.

Flags: needinfo?(tcampbell)
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/416ef98b0533 Remove dead code from GC rooting API. r=sfink
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: