Closed Bug 1591359 Opened 5 years ago Closed 5 years ago

[BinAST] Optimize HuffmanDictionary.{fields_,listLengths_} initialization code

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(2 files)

Currently (even after bug 1590683 patch), HuffmanDictionary::HuffmanDictionary ctor code is like the following:

    pushq  %rbp
    movq   %rsp, %rbp
    movb   $0x0, 0x58(%rdi)
    movb   $0x0, 0xb8(%rdi)
    movb   $0x0, 0x118(%rdi)
    movb   $0x0, 0x178(%rdi)
    movb   $0x0, 0x1d8(%rdi)
    movb   $0x0, 0x238(%rdi)
    movb   $0x0, 0x298(%rdi)
    movb   $0x0, 0x2f8(%rdi)
    movb   $0x0, 0x358(%rdi)
    movb   $0x0, 0x3b8(%rdi)
    movb   $0x0, 0x418(%rdi)
... (skip 284 lines of movb)
    movb   $0x0, 0x6ef8(%rdi)
    movb   $0x0, 0x6f58(%rdi)
    popq   %rbp
    retq

This is initialization of arrays of Variants, HuffmanDictionary.{fields_,listLengths_}, and each operation sets the tag to HuffmanTableUnreachable.

Given we don't need HuffmanTableValue to be Variant after bug 1590683, but just want unused GenericHuffmanTable uninitialized,
if we store the tag (flag) and the uninitialized array of GenericHuffmanTable separately,
the operation can be done with smaller code and also maybe quickly.
(we need some special code to manage array of uninitialized/initialized instances tho)

also, if we use something else than Array, we can remove BINAST_PARAM_NUMBER_OF_* macros.

when parsing 200 small files, HuffmanDictionary ctor takes 1.1% of the total time.

Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED
Blocks: 1593922
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/50a9344008a3 Part 1: Separate HuffmanTableValue& array into TableStatus array and uninitialized GenericHuffmanTable array. r=Yoric https://hg.mozilla.org/integration/autoland/rev/d9cf158e085b Part 2: Rename HuffmanTableUnreachable to TableImplementationUninitialized. r=Yoric
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: