Bug 239266
Summary: | [JSC] Don't generate ropes when they will be very short-lived | ||
---|---|---|---|
Product: | WebKit | Reporter: | Robin Morisset <rmorisset> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Robin Morisset
Currently our code for concatenation always generate ropes. This is rather wasteful when we can tell statically that they will flow into a GetByVal or similar opcode that resolves the rope, as it forces us to do some extra allocations, massively increasing GC pressure. Worse, some of our opcodes using strings only have fast paths for non-rope strings.
The simplest solution would be to add an eager_str_cat opcode (name to be bikeshedded) to DFG that does string concatenation without bothering with a rope, and have a pass in the DFG that finds all string concatenations that is dominated by a use of the string that resolves the rope, and replaces these concatenations by eager_str_cat.
This optimization was found by looking at the code that we generate for JS2, so I expect it is likely to be a significant speedup.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/91996051>