Closed Bug 1141104 Opened 9 years ago Closed 2 years ago

Support INIT_THIN_INLINE in LSubstr

Categories

(Core :: JavaScript Engine: JIT, defect, P5)

defect

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: h4writer, Assigned: jandem)

Details

Attachments

(2 files, 1 obsolete file)

bug 1119081 comment 5

Note: I tried to use CreateDependentString in LSubstr when implementing. The only issue is that LSubstr is very constrained with it registers making it possible to squeeze some more perf. out of it. Using CreateDependentString would mean introducing an push/pop to create an extra register (in x86, since we are out of registers with sps enabled).
Attached patch Patch (obsolete) — Splinter Review
Assignee: nobody → hv1989
Attachment #8574692 - Flags: review?(jdemooij)
Comment on attachment 8574692 [details] [diff] [review]
Patch

Review of attachment 8574692 [details] [diff] [review]:
-----------------------------------------------------------------

I think I made a minor mistake. So clearing review for now.
Attachment #8574692 - Flags: review?(jdemooij)
Attached patch PatchSplinter Review
Test for INIT_FAT_INLINE_FLAGS instead of INIT_THIN_INLINE_FLAGS, since INIT_FAT_INLINE_FLAGS = INIT_THIN_INLINE_FLAGS | JS_BIT(4)
Attachment #8574692 - Attachment is obsolete: true
Attachment #8574724 - Flags: review?(jdemooij)
Comment on attachment 8574724 [details] [diff] [review]
Patch

Review of attachment 8574724 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jit/CodeGenerator.cpp
@@ +5884,5 @@
>      masm.branchTest32(Assembler::Zero, stringFlags, Imm32(JSString::INLINE_CHARS_BIT), &notInline);
> +
> +    Label createThinInline, next;
> +    masm.branchTest32(Assembler::Zero, stringFlags, Imm32(JSString::INIT_FAT_INLINE_FLAGS),
> +                      &createThinInline);

If we have a thin inline string, this will be NonZero as well because some of the flags in INIT_FAT_INLINE_FLAGS will be set. I think it'd be nice to use the length-register, because a substring of a non-inline string will often fit in an inline string and a FatInlineString will often have a ThinInlineString substring. I didn't check but I expect that's what the C++ code does too.
Attachment #8574724 - Flags: review?(jdemooij)
Priority: -- → P5

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: hv1989 → nobody
Flags: needinfo?(jdemooij)

We were allocating fat inline strings iff the base string is an inline string.

The patch changes this to be based on the length instead, so that we use inline
strings in a lot more cases. We now also allocate thin inline strings when possible.
This matches the C++ version of this code better.

Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
Flags: needinfo?(jdemooij)
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dddf6ad9ce42
Use inline strings more in LSubstr codegen to match SubstringKernel better . r=anba
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: