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/AbstractMacroAssembler.h

    r62306 r64938  
    522522    }
    523523
     524    static int32_t int32AtLocation(CodeLocationDataLabel32 dataLabel32)
     525    {
     526        return AssemblerType::int32AtLocation(dataLabel32.dataLocation());
     527    }
     528
     529    static void* pointerAtLocation(CodeLocationDataLabelPtr dataLabelPtr)
     530    {
     531        return AssemblerType::pointerAtLocation(dataLabelPtr.dataLocation());
     532    }
     533
     534    static void* jumpTarget(CodeLocationJump jump)
     535    {
     536        return AssemblerType::jumpTarget(jump.dataLocation());
     537    }
     538
    524539    static void repatchInt32(CodeLocationDataLabel32 dataLabel32, int32_t value)
    525540    {
Note: See TracChangeset for help on using the changeset viewer.