Changeset 44476 in webkit for trunk/JavaScriptCore/assembler


Ignore:
Timestamp:
Jun 5, 2009, 5:08:00 PM (16 years ago)
Author:
[email protected]
Message:

2009-06-05 Gavin Barraclough <[email protected]>

Reviewed by Sam Weinig.

Remove patchLength..tByIdExternalLoadPrefix magic numbers from JIT.h.

These aren't really suitable values to be tracking within common code
of the JIT, since they are not (and realistically cannot) be checked
by ASSERTs, as the other repatch offsets are. Move this functionality
(skipping the REX prefix when patching load instructions to LEAs on
x86-64) into the X86Assembler.

  • assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::CodeLocationInstruction::repatchLoadPtrToLEA):
  • assembler/X86Assembler.h: (JSC::X86Assembler::repatchLoadPtrToLEA):
  • jit/JIT.h:
  • jit/JITPropertyAccess.cpp: (JSC::JIT::patchGetByIdSelf): (JSC::JIT::patchPutByIdReplace):
Location:
trunk/JavaScriptCore/assembler
Files:
2 edited

Legend:

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

    r44455 r44476  
    460460        }
    461461
    462         void repatchLoadToLEA()
    463         {
    464             AssemblerType::repatchLoadToLEA(this->dataLocation());
     462        void repatchLoadPtrToLEA()
     463        {
     464            AssemblerType::repatchLoadPtrToLEA(this->dataLocation());
    465465        }
    466466
  • trunk/JavaScriptCore/assembler/X86Assembler.h

    r44457 r44476  
    14221422    }
    14231423
    1424     static void repatchLoadToLEA(void* where)
    1425     {
     1424    static void repatchLoadPtrToLEA(void* where)
     1425    {
     1426#if PLATFORM(X86_64)
     1427        // On x86-64 pointer memory accesses require a 64-bit operand, and as such a REX prefix.
     1428        // Skip over the prefix byte.
     1429        where = reinterpret_cast<char*>(where) + 1;
     1430#endif
    14261431        ExecutableAllocator::MakeWritable unprotect(where, 1);
    14271432        *reinterpret_cast<unsigned char*>(where) = static_cast<unsigned char>(OP_LEA);
Note: See TracChangeset for help on using the changeset viewer.