Closed Bug 552374 Opened 14 years ago Closed 14 years ago

nanojit: clean up asm_spill() and friends a little

Categories

(Core Graveyard :: Nanojit, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

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

Attachments

(1 file)

Attached patch patchSplinter Review
This patch has some slight clean-ups to asm_spill() and
friends.  I was hoping to clean things up more, but failed.  'pop' really 
bugs me :(

- Rename asm_spilli() as asm_maybe_spill(), because it doesn't always spill.

- Move the post-spill handling of the i386-only 'pop' case into 
  prepareResultReg(), which already has the computation of 'pop'.
  
- Only call asm_spill() if a spill is necessary;  avoids a test in each
  back-end's copy of asm_spill().
  
- Using 'i' for non-integer variable names is a bad idea.  Avoid a few more
  of these.
  
- Remove the no-longer-needed 'pop' arg to deprecated_freeRsrcOf().
Attachment #432496 - Flags: review?(edwsmith)
Attachment #432496 - Flags: review?(edwsmith) → review+
Comment on attachment 432496 [details] [diff] [review]
patch

Assembler.cpp:587:  the comment should read "...no longer used on i386..."

Assembler.cpp:647:  TR does hit this assert.  In AS3 a call to a function that is declared to return Number will emit a non-pure LIR_fcall with the result ignored, e.g.

package {
    function f():Number { return 0 }
    f()
}

In the TR regressions, it happens in these three tests:
  as3/Definitions/FunctionAccessors/GetSuper.abc
  ecma3/GlobalObject/e15_1_2_2_1.abc
  ecma3/String/e15_5_4_5_4.abc 

Tests run fine with the assert removed.  R+ with those minor changes.
TR: http://hg.mozilla.org/tamarin-redux/rev/96e8b653ab9a
Whiteboard: fixed-in-nanojit, fixed-in-tracemonkey → fixed-in-nanojit, fixed-in-tracemonkey, fixed-in-tamarin
http://hg.mozilla.org/mozilla-central/rev/5ff90d0961a7
Status: ASSIGNED → 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: