Closed Bug 1580101 Opened 7 years ago Closed 7 years ago

[BinAST] Eliminate string comparison in sorting sum interfaces and enums

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(1 external file)

We can have pre-calculated numeric sort key for them and use it instead

maybe... numeric value of BinASTKind and BinASTVariant can just be used...?

If they are in the same alphanumerical order, sure.

(In reply to Tooru Fujisawa [:arai] from comment #1)

maybe... numeric value of BinASTKind and BinASTVariant can just be used...?

uh, this wasn't the case

BinASTVariant is sorted alphabetically by CPP_NAME (like BinaryOperatorOrUnaryOperatorPlus) and then SPEC_NAME (like +),
but we need to sort them by SPEC_NAME (like +) here.

for BinASTKind, it's in the same order and we can use its numeric value.

I'll check if we can change the order of BinASTVariant.

We could create a second enum BinASTVariantByAlphanumericalOrder and then add a constant-time lookup BinASTVariant => BinASTVariantByAlphanumericalOrder.

Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/c044e1acf814 Use raw BinASTKind and BinASTVariant for sorting alphabetically. r=Yoric
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: