Closed Bug 1013906 Opened 10 years ago Closed 10 years ago

Spidermonkey MIPS: Port irregexp to MIPS

Categories

(Core :: JavaScript Engine, defect)

Other
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: rankov, Assigned: rankov)

References

Details

Attachments

(2 files, 1 obsolete file)

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: nobody → branislav.rankov
Depends on: 976446
Large part of this problem has been fixed in the bug 1014898.
Attached patch irregexp-mips.patch (obsolete) — Splinter Review
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)
Attachment #8433391 - Attachment is obsolete: true
Attachment #8433983 - Flags: review?(bhackett1024)
Attachment #8434049 - Flags: review?(bhackett1024)
Attachment #8433983 - Flags: review?(bhackett1024) → review+
Attachment #8434049 - Flags: review?(bhackett1024) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: