Changeset 195319 in webkit


Ignore:
Timestamp:
Jan 19, 2016 3:15:53 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

[JSC] fixSpillSlotZDef() crashes on ARM64
https://bugs.webkit.org/show_bug.cgi?id=153246

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-01-19
Reviewed by Geoffrey Garen.

Moving an immediate to memory is not a valid instruction on ARM64.
This patch adds a small workaround for this specific case: an instruction
to zero a chunk of memory.

  • assembler/MacroAssemblerARM64.h:

(JSC::MacroAssemblerARM64::storeZero32):

  • assembler/MacroAssemblerX86Common.h:

(JSC::MacroAssemblerX86Common::storeZero32):

  • b3/air/AirFixSpillSlotZDef.h:

(JSC::B3::Air::fixSpillSlotZDef):

  • b3/air/AirOpcode.opcodes:
Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r195317 r195319  
     12016-01-19  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        [JSC] fixSpillSlotZDef() crashes on ARM64
     4        https://bugs.webkit.org/show_bug.cgi?id=153246
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Moving an immediate to memory is not a valid instruction on ARM64.
     9        This patch adds a small workaround for this specific case: an instruction
     10        to zero a chunk of memory.
     11
     12        * assembler/MacroAssemblerARM64.h:
     13        (JSC::MacroAssemblerARM64::storeZero32):
     14        * assembler/MacroAssemblerX86Common.h:
     15        (JSC::MacroAssemblerX86Common::storeZero32):
     16        * b3/air/AirFixSpillSlotZDef.h:
     17        (JSC::B3::Air::fixSpillSlotZDef):
     18        * b3/air/AirOpcode.opcodes:
     19
    1202016-01-19  Enrica Casucci  <enrica@apple.com>
    221
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h

    r194873 r195319  
    12321232    }
    12331233
     1234    void storeZero32(ImplicitAddress address)
     1235    {
     1236        store32(ARM64Registers::zr, address);
     1237    }
     1238
     1239    void storeZero32(BaseIndex address)
     1240    {
     1241        store32(ARM64Registers::zr, address);
     1242    }
     1243
    12341244    DataLabel32 store32WithAddressOffsetPatch(RegisterID src, Address address)
    12351245    {
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h

    r195296 r195319  
    730730    {
    731731        m_assembler.movl_i32m(imm.m_value, address.offset, address.base, address.index, address.scale);
     732    }
     733
     734    void storeZero32(ImplicitAddress address)
     735    {
     736        store32(TrustedImm32(0), address);
     737    }
     738
     739    void storeZero32(BaseIndex address)
     740    {
     741        store32(TrustedImm32(0), address);
    732742    }
    733743
  • trunk/Source/JavaScriptCore/b3/air/AirAllocateStack.cpp

    r195298 r195319  
    297297                            RELEASE_ASSERT(width == Arg::Width32);
    298298
    299                             // We rely on the fact that there must be some way to move zero to a
    300                             // memory location without first burning a register. On ARM, we would do
    301                             // this using zr.
    302                             RELEASE_ASSERT(isValidForm(Move32, Arg::Imm, Arg::Addr));
     299                            RELEASE_ASSERT(isValidForm(StoreZero32, Arg::Stack));
    303300                            insertionSet.insert(
    304                                 instIndex + 1, Move32, inst.origin, Arg::imm(0),
     301                                instIndex + 1, StoreZero32, inst.origin,
    305302                                stackAddr(arg.offset() + 4 + slot->offsetFromFP()));
    306303                        }
  • trunk/Source/JavaScriptCore/b3/air/AirOpcode.opcodes

    r195139 r195319  
    435435    x86: Imm, Index as store32
    436436
     437StoreZero32 U:G:32
     438    Addr
     439    Index
     440
    437441SignExtend32ToPtr U:G:32, D:G:Ptr
    438442    Tmp, Tmp
Note: See TracChangeset for help on using the changeset viewer.