Open Bug 1313651 Opened 9 years ago Updated 2 years ago

Make JS::NumberValue constexpr.

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

Tracking Status
firefox52 --- wontfix

People

(Reporter: arai, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: triage-deferred)

Attachments

(1 file)

separated from bug 1311088. non-double JS::NumberValue can be made constexpr.
See Also: → 1311088
Attached patch numbervalueSplinter Review
Is this what you had in mind?
Attachment #8837428 - Flags: review?(arai.unmht)
Comment on attachment 8837428 [details] [diff] [review] numbervalue Review of attachment 8837428 [details] [diff] [review]: ----------------------------------------------------------------- Yeah, thank you :) there's another plan for it in bug 1313652, and I hadn't decided which way to go (sorry I should've linked it at first) also, this may affect the binary size, since there are so many JS::NumberValue consumers in bindings. can you check how much this change increases or reduces the binary size ? if there's no critical issue in binary size (and performance, that I don't think it hits tho), this patch should be ready to land, as long as this doesn't hit some compiler issue (I saw PGO bustage caused by constexpr lately)
Attachment #8837428 - Flags: review?(arai.unmht) → feedback+
See Also: → 1313652
> also, this may affect the binary size, since there are so many > JS::NumberValue consumers in bindings. > can you check how much this change increases or reduces the binary size ? > if there's no critical issue in binary size (and performance, that I don't > think it hits tho), this patch should be ready to land, > as long as this doesn't hit some compiler issue > (I saw PGO bustage caused by constexpr lately) I got zero change with MSVC... (<aside> Recently I noticed that MSVC has trouble with NumberValue(uint32_t i) even though it's already marked constexpr. That specific overload is a big contributor to codesize because WebGL2RenderingContext.webidl has a huge table. I think maybe that function is too complex for MSVC to handle at compile-time. Also, we can't make WebGL2RenderingContext use one of the other overloads because they have some unfortunate enum values like 0xFFFFFFFF :( </aside>) Also, that recent PGO bustage was from me, so I'm familiar with it. :-) Constexpr functions are fine; when MSVC blows up it's because of constexpr data.
(In reply to David Major [:dmajor] from comment #3) > I got zero change with MSVC... how about clang and gcc ? > (<aside> Recently I noticed that MSVC has > trouble with NumberValue(uint32_t i) even though it's already marked > constexpr.That specific overload is a big contributor to codesize because > WebGL2RenderingContext.webidl has a huge table. I think maybe that function > is too complex for MSVC to handle at compile-time. Also, we can't make > WebGL2RenderingContext use one of the other overloads because they have some > unfortunate enum values like 0xFFFFFFFF :( </aside>) any chance using Value::fromRawBits with raw bits helps? of course it's not a good idea, but if it helps, there might be some point that doesn't abuse the API and also enables optimization, with maybe minor fix to JSAPI. > Also, that recent PGO bustage was from me, so I'm familiar with it. :-) > Constexpr functions are fine; when MSVC blows up it's because of constexpr > data. oh, good to hear that this won't affect the PGO issue :)
Mass wontfix for bugs affecting firefox 52.
Keywords: triage-deferred
Priority: -- → P3
Severity: normal → S3
Blocks: sm-runtime
Severity: S3 → N/A
Type: defect → enhancement
Blocks: sm-meta
No longer blocks: sm-runtime
No longer blocks: sm-meta
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: