Closed
Bug 1488775
Opened 7 years ago
Closed 7 years ago
Add JIT support for string + number
Categories
(Core :: JavaScript Engine: JIT, enhancement, P2)
Core
JavaScript Engine: JIT
Tracking
()
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: tcampbell, Assigned: mgaudet)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
We should have an IC to construct int+string ropes. This seems to come up when generating CSS property values.
> {
> "name":"BinaryArith",
> "file":"https://docs.google.com/static/document/client/js/2349105360-kix_main_i18n_integrated_kix_core.js",
> "mode":0,
> "line":1215,
> "column":200,
> "pc":"158db8d5245",
> "op":"add",
> "rhs":{
> "type":"int32",
> "value":1502212
> },
> "lhs":{
> "type":"string",
> "value":""
> }
> },
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → mgaudet
Assignee | ||
Updated•7 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•7 years ago
|
||
Assignee | ||
Comment 2•7 years ago
|
||
A microbenchmark puts this at about 1/3 faster than the fallback path.
Assignee | ||
Comment 3•7 years ago
|
||
Assignee | ||
Comment 4•7 years ago
|
||
Wrote an oomTest, but similar to Bug 1487760, wasn't able to actually demonstrate failure:
if (!('oomTest' in this))
quit();
// Add: String Number Concat OOM test
var addOom = (a, b) => { return a + b; }
function generate_digits(prefix, start) {
digits = []
number = ""+start+".25";
for (var i = 1; i < 7; i++) {
number = i + number;
digits.push([prefix, Number(number), prefix + number]);
}
return digits;
}
// Trying to defeat dtoacache: Warm the IC with one set of digits, then actually oomTest
// using another set.
var warmup_digits = generate_digits("x", 1);
var test_digits = generate_digits("x", 2);
function ot(digits) {
warmup(addOom, digits);
}
// Ensure ICs are warmed
ot(warmup_digits);
oomTest(() => { ot(test_digits); });
I am able to confirm we hit NumberToStringHelper (and therefore are being called from the IC), but never hit the OOM path.
See Also: → 1487760
Comment 5•7 years ago
|
||
I found out it sometimes helps to add a loop into the oom-test function. So instead of just |ot(test_digits);|, maybe try |for (var i = 0; i < 20 /* or 50 or 100 */; ++i) { ot(test_digits); }| and see if it helps?
Reporter | ||
Comment 6•7 years ago
|
||
It turns out the case I was worried about only affects non-base-10 floating point. I believe the footgun remains for future consumers, but it is now unrelated to this patch.
Assignee | ||
Updated•7 years ago
|
Whiteboard: [qf:p1:f64]
Updated•7 years ago
|
Attachment #9006706 -
Attachment description: Bug 1488775 - Add String x Number concatenation IC r=tcampbell → Bug 1488775 - Add String x Number concatenation IC r?tcampbell
Reporter | ||
Comment 7•7 years ago
|
||
Comment on attachment 9006706 [details]
Bug 1488775 - Add String x Number concatenation IC r?tcampbell
Ted Campbell [:tcampbell] has approved the revision.
Attachment #9006706 -
Flags: review+
Pushed by mgaudet@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9661ee2667d6
Add String x Number concatenation IC r=tcampbell
Assignee | ||
Comment 9•7 years ago
|
||
(Re-summaried to cover what actually landed)
Summary: Add JIT support for string + integer → Add JIT support for string + number
Comment 10•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Updated•3 years ago
|
Performance Impact: --- → P1
Whiteboard: [qf:p1:f64]
You need to log in
before you can comment on or make changes to this bug.
Description
•