Closed Bug 586262 Opened 14 years ago Closed 14 years ago

Get rid of blx_lr_bug

Categories

(Core Graveyard :: Nanojit, defect)

ARM
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: glandium, Assigned: glandium)

Details

(Whiteboard: fixed-in-nanojit, fixed-in-tamarin)

Attachments

(2 files, 2 obsolete files)

the WinCE device emulator has a bug with 'blx lr', and a blx_lr_bug bool was introduced to avoid that bug and use some other construct when it occurs.

I seems more sensible to just avoid using 'blx lr' at all, avoiding additional runtime tests.
Attached patch Proposed patch (against m-c) (obsolete) — Splinter Review
Assignee: nobody → mh+mozilla
Attachment #464795 - Flags: review?(Jacob.Bramley)
Blocks: 552624
+1

blx_lr_bug is a gross hack (i'm to blame)

The only hazard I can think of in this patch is that IP is not a managed register, and is used implicitly as scratch in various instructions.  I reviewed underrunProtect(), and it's not used there, I'm pretty sure.

The code path in asm_regarg that calls findSpecificRegFor(p, r), will be a problem if r == IP, since IP is not a managed register.
OS: Windows CE → All
(In reply to comment #2)
> The code path in asm_regarg that calls findSpecificRegFor(p, r), will be a
> problem if r == IP, since IP is not a managed register.

Actually, that could be a problem as that code path looks like it'll be hit in some cases.

There are two obvious solutions that I can see:
  • Change the p->isExtant() check to "(p->isExtant()) || (r == IP)". This is perhaps a little fragile, but it looks sane at a glance.
  • Use the register allocation API to get a register for the value, then BLX to that register. This is more complicated perhaps, but safer.
Attached patch Updated patch (obsolete) — Splinter Review
Edwin was right in comment 2. It crashed in the findSpecificRegFor path. Using Jacob's first suggestion, it seems to work properly.
Attachment #464795 - Attachment is obsolete: true
Attachment #465237 - Flags: review?(Jacob.Bramley)
Attachment #464795 - Flags: review?(Jacob.Bramley)
Attachment #465237 - Flags: review?(edwsmith)
Attachment #465237 - Flags: review?(Jacob.Bramley) → review+
In then end, I haven't managed to get a better solution to work, and I don't care enough about this codepath (unused in tracemonkey) to spend more time on it, however interesting it can be.

I'm therefore going this road:
<edwsmith> hey, guys, here's another proposition for you
 why dont we rip out blr_lr_broken() and blr_lr_bug, and just put #ifdef WINCE around the "bug" case in asm_call()
<jbramley> Works for me.

I used UNDER_CE instead of WINCE, though.
Attachment #465237 - Attachment is obsolete: true
Attachment #465290 - Flags: review?(Jacob.Bramley)
Attachment #465237 - Flags: review?(edwsmith)
The armv4t patch I'm working on doesn't depend on that anymore.
No longer blocks: 552624
Summary: Avoid using blx lr at all → Get rid of blx_lr_bug
Attachment #465290 - Flags: review?(edwsmith)
Attachment #465290 - Flags: review?(Jacob.Bramley) → review+
Attachment #465290 - Flags: review?(edwsmith) → review+
With this patch we no longer have to detect the broken emulator, so don't need this weird armasm file that didn't belong under MMgc anyway.
Attachment #465806 - Flags: review?(brbaker)
Attachment #465806 - Flags: review?(brbaker) → review?(treilly)
Landed the nanojit part.
http://hg.mozilla.org/projects/nanojit-central/rev/9e1146b15442
Whiteboard: fixed-in-nanojit
Attachment #465806 - Flags: review?(rwinchel)
Attachment #465806 - Flags: review?(treilly) → review+
Attachment #465806 - Flags: review?(rwinchel) → review+
nanojit part in TR: http://hg.mozilla.org/tamarin-redux/rev/211232d5bd76

TR part in TR: http://hg.mozilla.org/tamarin-redux/rev/9804879bc296
Whiteboard: fixed-in-nanojit → fixed-in-nanojit, fixed-in-tamarin
http://hg.mozilla.org/mozilla-central/rev/6a7c7a36e49e
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: