Changeset 166732 in webkit


Ignore:
Timestamp:
Apr 3, 2014 11:25:26 AM (10 years ago)
Author:
mark.lam@apple.com
Message:

Fix bit rot in ARMv7 JIT probe mechanism.
<https://webkit.org/b/131167>

Reviewed by Geoffrey Garen.

  1. The macro assembler does not support pushing the SP register. Worked around this by pushing the LR register as a placeholder, and then writing the original SP value to that slot.
  2. The CPUState field in the ProbeContext needs to be aligned on a 4 byte boundary, not an 8 byte boundary.
  • assembler/MacroAssemblerARMv7.cpp:

(JSC::MacroAssemblerARMv7::probe):

  • jit/JITStubsARMv7.h:
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r166716 r166732  
     12014-04-03  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix bit rot in ARMv7 JIT probe mechanism.
     4        <https://webkit.org/b/131167>
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        1. The macro assembler does not support pushing the SP register.  Worked
     9           around this by pushing the LR register as a placeholder, and then
     10           writing the original SP value to that slot.
     11        2. The CPUState field in the ProbeContext needs to be aligned on a 4
     12           byte boundary, not an 8 byte boundary.
     13
     14        * assembler/MacroAssemblerARMv7.cpp:
     15        (JSC::MacroAssemblerARMv7::probe):
     16        * jit/JITStubsARMv7.h:
     17
    1182014-04-02  Mark Lam  <mark.lam@apple.com>
    219
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.cpp

    r157571 r166732  
    8383void MacroAssemblerARMv7::probe(MacroAssemblerARMv7::ProbeFunction function, void* arg1, void* arg2)
    8484{
    85     push(RegisterID::sp);
    8685    push(RegisterID::lr);
     86    push(RegisterID::lr);
     87    add32(TrustedImm32(8), RegisterID::sp, RegisterID::lr);
     88    store32(RegisterID::lr, ArmAddress(RegisterID::sp, 4));
    8789    push(RegisterID::ip);
    8890    push(RegisterID::r0);
  • trunk/Source/JavaScriptCore/jit/JITStubsARMv7.h

    r165676 r166732  
    5353#define PROBE_ARG2_OFFSET (2 * PTR_SIZE)
    5454
    55 #define PROBE_FIRST_GPREG_OFFSET (4 * PTR_SIZE)
     55#define PROBE_FIRST_GPREG_OFFSET (3 * PTR_SIZE)
    5656
    5757#define GPREG_SIZE 4
Note: See TracChangeset for help on using the changeset viewer.