Ignore:
Timestamp:
Nov 6, 2009, 1:35:03 AM (16 years ago)
Author:
[email protected]
Message:

Tidy up the shift methods on the macro-assembler interface.

Patch by Gavin Barraclough <[email protected]> on 2009-11-06
Reviewed by Oliver Hunt.

Currently behaviour of shifts of a magnitude > 0x1f is undefined.
Instead defined that all shifts are masked to this range. This makes a lot of
practical sense, both since having undefined behaviour is not particularly
desirable, and because this behaviour is commonly required (particularly since
it is required bt ECMA-262 for shifts).

Update the ARM assemblers to provide this behaviour. Remove (now) redundant
masks from JITArithmetic, and remove rshiftPtr (this was used in case that
could be rewritten in a simpler form using rshift32, only optimized JSVALUE32
on x86-64, which uses JSVALUE64!)

  • assembler/MacroAssembler.h:
  • assembler/MacroAssemblerARM.h:

(JSC::MacroAssemblerARM::lshift32):
(JSC::MacroAssemblerARM::rshift32):

  • assembler/MacroAssemblerARMv7.h:

(JSC::MacroAssemblerARMv7::lshift32):
(JSC::MacroAssemblerARMv7::rshift32):

  • assembler/MacroAssemblerX86_64.h:
  • jit/JITArithmetic.cpp:

(JSC::JIT::emit_op_lshift):
(JSC::JIT::emit_op_rshift):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/assembler/MacroAssembler.h

    r48525 r50595  
    180180    }
    181181
    182     void rshiftPtr(RegisterID shift_amount, RegisterID dest)
    183     {
    184         rshift32(shift_amount, dest);
    185     }
    186 
    187     void rshiftPtr(Imm32 imm, RegisterID dest)
    188     {
    189         rshift32(imm, dest);
    190     }
    191 
    192182    void subPtr(RegisterID src, RegisterID dest)
    193183    {
Note: See TracChangeset for help on using the changeset viewer.