Reduce the number of relocations needed for NamesOfInterfacesWithProtos

RESOLVED FIXED in mozilla30

Status

()

Core
DOM
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: bz, Assigned: froydnj)

Tracking

unspecified
mozilla30
x86
Mac OS X
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Might be best (smallest) to just generate a single string with all the names in it, and generate a separate table of offsets into that string.
(Assignee)

Comment 2

4 years ago
Created attachment 8373361 [details] [diff] [review]
reduce relocations required by NamesOfInterfacesWithProtos

Hooray for string tables.

This compiles fine with GCC, but I think at one point GCC used to complain
about \0 in string constants.  May have to take a different tack if B2G builds
complain, or if other compilers are pedantic as well.
Attachment #8373361 - Flags: review?(bzbarsky)
Comment on attachment 8373361 [details] [diff] [review]
reduce relocations required by NamesOfInterfacesWithProtos

>+        return "extern const char *%s(unsigned int aIndex);\n\n" % self.accessorName

I'd prefer we drop the trailing \n here and have the caller insert them as needed.  That lets the caller control its own spacing.  Yes, we're not very consistent about that sort of thing right now.  :(  Simply making the CGList in the caller use "\n\n" instead of "\n" as the list separator might be good here.

>+        return """
>+const char *%s(unsigned int aIndex)

Please drop the leading newline here?

r=me
Attachment #8373361 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/241a7157196c
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.