Bug 79104 - Unaligned userspace access for SH4 platforms
Summary: Unaligned userspace access for SH4 platforms
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Other
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-21 07:03 PST by thouraya
Modified: 2012-03-26 19:04 PDT (History)
3 users (show)

See Also:


Attachments
fix unaligend access memory issue in YARR JIT (5.51 KB, patch)
2012-02-21 07:09 PST, thouraya
fpizlo: review-
Details | Formatted Diff | Diff
patch (18.20 KB, patch)
2012-03-16 07:58 PDT, thouraya
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description thouraya 2012-02-21 07:03:37 PST
Unaligned access memory when running sunspider
Comment 1 thouraya 2012-02-21 07:09:10 PST
Created attachment 127968 [details]
fix unaligend access memory issue in YARR JIT
Comment 2 thouraya 2012-03-06 23:11:51 PST
Hi,

Any update on the patch?

Regards,
Thouraya.
Comment 3 Filip Pizlo 2012-03-06 23:22:03 PST
Comment on attachment 127968 [details]
fix unaligend access memory issue in YARR JIT

View in context: https://bugs.webkit.org/attachment.cgi?id=127968&action=review

> Source/JavaScriptCore/assembler/MacroAssemblerSH4.h:978
> +        m_assembler.ensureSpace(m_assembler.maxInstructionSize + 68, sizeof(uint32_t));
> +        move(scr, SH4Registers::r0);
> +        m_assembler.andlImm8r(0x3, SH4Registers::r0);
> +        m_assembler.cmpEqImmR0(0x0, SH4Registers::r0);
> +        m_assembler.branch(BF_OPCODE, 2 + extraInst);
> +
> +        if (dest != SH4Registers::r0)
> +            move(scr1, SH4Registers::r0);
> +
> +        load32(scr, dest);
> +        m_assembler.branch(BRA_OPCODE, 25 + extraInst);
> +        m_assembler.nop();
> +
> +        m_assembler.andlImm8r(0x1, SH4Registers::r0);
> +        m_assembler.cmpEqImmR0(0x0, SH4Registers::r0);
> +
> +        if (dest != SH4Registers::r0)
> +            move(scr1, SH4Registers::r0);
> +
> +        m_assembler.branch(BF_OPCODE, 8);

Why aren't you just using the macro assembler API instead of having to manually compute branch offsets?
Comment 4 thouraya 2012-03-16 07:58:47 PDT
Created attachment 132284 [details]
patch

Hi,

attached the patch to fix the unaligned user space access and some changes to use the macro assembler API instead of  computing manually branch offsets.


Regards,
Thouraya.
Comment 5 thouraya 2012-03-20 09:24:53 PDT
Hi,

Please,
Could you have a look on the patch ?

Thanks a lot.
thouraya.

(In reply to comment #3)
> (From update of attachment 127968 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=127968&action=review
> 
> > Source/JavaScriptCore/assembler/MacroAssemblerSH4.h:978
> > +        m_assembler.ensureSpace(m_assembler.maxInstructionSize + 68, sizeof(uint32_t));
> > +        move(scr, SH4Registers::r0);
> > +        m_assembler.andlImm8r(0x3, SH4Registers::r0);
> > +        m_assembler.cmpEqImmR0(0x0, SH4Registers::r0);
> > +        m_assembler.branch(BF_OPCODE, 2 + extraInst);
> > +
> > +        if (dest != SH4Registers::r0)
> > +            move(scr1, SH4Registers::r0);
> > +
> > +        load32(scr, dest);
> > +        m_assembler.branch(BRA_OPCODE, 25 + extraInst);
> > +        m_assembler.nop();
> > +
> > +        m_assembler.andlImm8r(0x1, SH4Registers::r0);
> > +        m_assembler.cmpEqImmR0(0x0, SH4Registers::r0);
> > +
> > +        if (dest != SH4Registers::r0)
> > +            move(scr1, SH4Registers::r0);
> > +
> > +        m_assembler.branch(BF_OPCODE, 8);
> 
> Why aren't you just using the macro assembler API instead of having to manually compute branch offsets?
Comment 6 thouraya 2012-03-26 00:58:43 PDT
Hi,

Any updates?

Regards.
Comment 7 WebKit Review Bot 2012-03-26 19:04:01 PDT
Comment on attachment 132284 [details]
patch

Clearing flags on attachment: 132284

Committed r112192: <http://trac.webkit.org/changeset/112192>
Comment 8 WebKit Review Bot 2012-03-26 19:04:06 PDT
All reviewed patches have been landed.  Closing bug.