Spidermonkey MIPS: Port irregexp to MIPS

RESOLVED FIXED in mozilla32

Status

()

Core
JavaScript Engine
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: rankov, Assigned: rankov)

Tracking

Trunk
mozilla32
Other
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

3 years ago
Bug 976446 has added irregexp to SpiderMonkey. This doesn't build for MIPS currently. 

Some modifications are required to make it work for MIPS. 

Mostly the problem is that cmp* and j are used as separate instructions. We need to use branch* macro instructions instead. There are other similar issues.
(Assignee)

Updated

3 years ago
Assignee: nobody → branislav.rankov
Depends on: 976446
(Assignee)

Comment 1

3 years ago
Large part of this problem has been fixed in the bug 1014898.
(Assignee)

Comment 2

3 years ago
Created attachment 8433391 [details] [diff] [review]
irregexp-mips.patch
Attachment #8433391 - Flags: review?(bhackett1024)
Comment on attachment 8433391 [details] [diff] [review]
irregexp-mips.patch

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

::: js/src/irregexp/NativeRegExpMacroAssembler.cpp
@@ +399,2 @@
>          volatileRegs.add(Register::FromCode(Registers::lr));
> +#elif defined(JS_CODEGEN_ARM)

JS_CODEGEN_MIPS

::: js/src/jit/mips/MacroAssembler-mips.h
@@ +725,5 @@
>      void branchTest32(Condition cond, Register lhs, Register rhs, Label *label) {
> +        if (cond == Equal)
> +            cond = Zero;
> +        else if (cond == NotEqual)
> +            cond = NonZero;

This shouldn't be necessary, callers using Equal/NotEqual should be fixed to use Zero/NonZero instead (and it would be nice if we had the below assert on other platforms too).

::: js/src/jit/shared/MacroAssembler-x86-shared.h
@@ +383,5 @@
>          movl(src, dest);
>      }
> +    void load32Unaligned(const BaseIndex &address, Register dest) {
> +        load32(address, dest);
> +    }

I think it would be better if you updated NativeRegExpMacroAssembler::CanReadUnaligned to return false on MIPS, rather than emulating unaligned reads using this function.  Going forward, we'll eventually want to handle 16 bit unaligned reads when we start matching on latin1 strings but that will also be gated on NativeRegExpMacroAssembler::CanReadUnaligned.
Attachment #8433391 - Flags: review?(bhackett1024)
(Assignee)

Comment 4

3 years ago
Created attachment 8433983 [details] [diff] [review]
irregexp-mips.patch
Attachment #8433391 - Attachment is obsolete: true
Attachment #8433983 - Flags: review?(bhackett1024)
(Assignee)

Comment 5

3 years ago
Created attachment 8434049 [details] [diff] [review]
assert-testbranch32.patch
Attachment #8434049 - Flags: review?(bhackett1024)
Attachment #8433983 - Flags: review?(bhackett1024) → review+
Attachment #8434049 - Flags: review?(bhackett1024) → review+
(Assignee)

Comment 6

3 years ago
https://tbpl.mozilla.org/?tree=Try&rev=3b5c7f08402b
(Assignee)

Comment 7

3 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/d09bea16045c
https://hg.mozilla.org/integration/mozilla-inbound/rev/5eea6f492ed5
https://hg.mozilla.org/mozilla-central/rev/d09bea16045c
https://hg.mozilla.org/mozilla-central/rev/5eea6f492ed5
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in before you can comment on or make changes to this bug.