Ignore:
Timestamp:
Aug 7, 2010, 11:04:59 PM (15 years ago)
Author:
[email protected]
Message:

2010-08-07 Nathan Lawrence <[email protected]>

Reviewed by Geoffrey Garen.

The JIT code contains a number of direct references to GC'd objects.
When we have movable objects, these references will need to be
updated.

  • Android.mk:
  • CMakeLists.txt:
  • GNUmakefile.am:
  • JavaScriptCore.gypi:
  • JavaScriptCore.pro:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::int32AtLocation): (JSC::AbstractMacroAssembler::pointerAtLocation): (JSC::AbstractMacroAssembler::jumpTarget):
  • assembler/MacroAssembler.h: (JSC::MacroAssembler::loadPtrWithPatch):

Normally, loadPtr will optimize when the register is eax. Since
the slightly smaller instruction changes the offsets, it messes up
our ability to repatch the code. We added this new instruction
that garuntees a constant size.

  • assembler/MacroAssemblerX86.h: (JSC::MacroAssemblerX86::load32WithPatch):

Changed load32 in the same way described above.

(JSC::MacroAssemblerX86::load32):

Moved the logic to optimize laod32 from movl_mr to load32

(JSC::MacroAssemblerX86::store32):

Moved the logic to optimize store32 from movl_rm to store32

  • assembler/X86Assembler.h: (JSC::X86Assembler::movl_rm): (JSC::X86Assembler::movl_mr): (JSC::X86Assembler::int32AtLocation): (JSC::X86Assembler::pointerAtLocation): (JSC::X86Assembler::jumpTarget):
  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::markAggregate):
  • bytecode/Instruction.h:

As described in StructureStubInfo.h, we needed to add additional
fields to both StructureStubInfo and
PolymorphicAccessStructureList so that we can determine the
structure of the JITed code at patch time.

(JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
(JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):

  • bytecode/StructureStubInfo.cpp: (JSC::StructureStubInfo::markAggregate):

Added this function to mark the JITed code that correosponds to
this structure stub info.

  • bytecode/StructureStubInfo.h: (JSC::StructureStubInfo::initGetByIdProto): (JSC::StructureStubInfo::initGetByIdChain): (JSC::StructureStubInfo::):
  • jit/JIT.h:
  • jit/JITMarkObjects.cpp: Added. (JSC::JIT::patchPrototypeStructureAddress): (JSC::JIT::patchGetDirectOffset): (JSC::JIT::markGetByIdProto): (JSC::JIT::markGetByIdChain): (JSC::JIT::markGetByIdProtoList): (JSC::JIT::markPutByIdTransition): (JSC::JIT::markGlobalObjectReference):
  • jit/JITPropertyAccess.cpp:

Added asserts for the patch offsets.

(JSC::JIT::compileGetDirectOffset):
(JSC::JIT::testPrototype):
(JSC::JIT::privateCompilePutByIdTransition):
(JSC::JIT::privateCompileGetByIdProto):
(JSC::JIT::privateCompileGetByIdProtoList):
(JSC::JIT::privateCompileGetByIdChainList):
(JSC::JIT::privateCompileGetByIdChain):

  • jit/JITPropertyAccess32_64.cpp: (JSC::JIT::compileGetDirectOffset): (JSC::JIT::testPrototype): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain):
  • jit/JITStubs.cpp: (JSC::setupPolymorphicProtoList):
  • wtf/Platform.h:

Added ENABLE_MOVABLE_GC_OBJECTS flag

File:
1 edited

Legend:

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

    r64608 r64938  
    11551155    void movl_rm(RegisterID src, void* addr)
    11561156    {
    1157         if (src == X86Registers::eax)
    1158             movl_EAXm(addr);
    1159         else
    1160             m_formatter.oneByteOp(OP_MOV_EvGv, src, addr);
     1157        m_formatter.oneByteOp(OP_MOV_EvGv, src, addr);
    11611158    }
    11621159   
    11631160    void movl_mr(void* addr, RegisterID dst)
    11641161    {
    1165         if (dst == X86Registers::eax)
    1166             movl_mEAX(addr);
    1167         else
    1168             m_formatter.oneByteOp(OP_MOV_GvEv, dst, addr);
     1162        m_formatter.oneByteOp(OP_MOV_GvEv, dst, addr);
    11691163    }
    11701164
     
    15581552
    15591553        setPointer(reinterpret_cast<char*>(code) + where.m_offset, value);
     1554    }
     1555
     1556    static int32_t int32AtLocation(void* where)
     1557    {
     1558        return static_cast<int32_t*>(where)[-1];
     1559    }
     1560
     1561    static void* pointerAtLocation(void* where)
     1562    {
     1563        return static_cast<void**>(where)[-1];
     1564    }
     1565
     1566    static void* jumpTarget(void* jump)
     1567    {
     1568        intptr_t src = reinterpret_cast<intptr_t>(jump);
     1569        int32_t offset = static_cast<int32_t*>(jump)[-1];
     1570        return reinterpret_cast<void*>(src + offset);
    15601571    }
    15611572
Note: See TracChangeset for help on using the changeset viewer.