Closed
Bug 1249235
Opened 8 years ago
Closed 8 years ago
Store RegExp flags into single slot.
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(7 files, 1 obsolete file)
Currently RegExp flags are stored into multiple slots, but they are stored with BooleanValue, and no other types would be used, as they're readonly (am I correct?). so we could use single slot with Int32Value, with raw RegExpFlags value. it reduces the RegExpObject's size and possibly improves performance.
Assignee | ||
Comment 1•8 years ago
|
||
so, there was no need to use separated slots after bug 1120169. AllocKind of RegExpObject is reduced from OBJECT8 to OBJECT4. octane/regexp score improves about 2%: before: 4089 after: 4176
Assignee: nobody → arai.unmht
Attachment #8720770 -
Flags: review?(hv1989)
Assignee | ||
Comment 2•8 years ago
|
||
Changing RegExp.prototype.flags to call all getters before other operations reduces the loadfixedslot instruction. without this patch, it needs 2 loadfixedslot, before global and unicode.
Attachment #8720776 -
Flags: review?(hv1989)
Comment 3•8 years ago
|
||
Comment on attachment 8720770 [details] [diff] [review] Part 1: Store RegExp flags into single slot. Review of attachment 8720770 [details] [diff] [review]: ----------------------------------------------------------------- Nice!
Attachment #8720770 -
Flags: review?(hv1989) → review+
Comment 4•8 years ago
|
||
Comment on attachment 8720776 [details] [diff] [review] Part 2: Optimize RegExp.prototype.flags to load flags at once. Review of attachment 8720776 [details] [diff] [review]: ----------------------------------------------------------------- I find this odd. In my knowledge the compiler should be able to transform this into one Load. Looks good. Needinfo'ing me to investigate that.
Attachment #8720776 -
Flags: review?(hv1989) → review+
Updated•8 years ago
|
Flags: needinfo?(hv1989)
Assignee | ||
Comment 5•8 years ago
|
||
To be clear, I used m-i 410ef34da2e7 revision and applied Part 1, and executed following code with `IONFLAGS=logs js --ion-offthread-compile=off test.js` with 64bit build on osx. configure flags: --enable-debug --disable-optimize --enable-warnings-as-errors --enable-nspr-build code: let n = 0; let re = /a/; function f(R) { return R.flags; } for (let i = 0; i < 10000; i ++) { n += f(re).length; } I get func00, func01, and func02. func00 and func01 are graph for RegExp.prototype.flags, and func02 is the graph that includes for loop and RegExp.prototype.flags. in func00 and func01, loadfixedslot is executed twice, and in func02 it's executed only once, per single RegExp.prototype.flags call. maybe func00 and func01 are the graph for not yet fully optimizated cases?
Assignee | ||
Comment 6•8 years ago
|
||
Assignee | ||
Comment 7•8 years ago
|
||
Assignee | ||
Comment 8•8 years ago
|
||
Assignee | ||
Comment 9•8 years ago
|
||
oh, I was wrong, in func02 loadfixedslot is executed twice *before* the loop.
Assignee | ||
Comment 10•8 years ago
|
||
maybe, I've read the graph in totally wrong way. even with Part 2, there are also 2 loadfixedslot's in func00, func01, and func02, with the code in comment #5. so what the Part 2 does wasn't what I intended, sorry.
Assignee | ||
Comment 11•8 years ago
|
||
Assignee | ||
Comment 12•8 years ago
|
||
Assignee | ||
Comment 13•8 years ago
|
||
Assignee | ||
Comment 14•8 years ago
|
||
Comment on attachment 8720776 [details] [diff] [review] Part 2: Optimize RegExp.prototype.flags to load flags at once. as discussed in IRC, marking Part 2 obsolete, as it does not reduce the loadfixedslot. will land Part 1 only after some more investigation.
Attachment #8720776 -
Attachment is obsolete: true
Assignee | ||
Comment 15•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/d1a4b82b556a5491cd824e70f781a55f7025269d Bug 1249235 - Store RegExp flags into single slot. r=h4writer
Comment 16•8 years ago
|
||
Apparently this patch and the others you landed with it, were a win on dromaeo-sunspider-string-validate-input (13% improvement) and made dromaeo-v8-richards stable.
Comment 17•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d1a4b82b556a
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Comment 18•8 years ago
|
||
My needinfo is not needed anymore. Arai++ already fixed it.
Flags: needinfo?(hv1989)
You need to log in
before you can comment on or make changes to this bug.
Description
•