Ignore:
Timestamp:
Jul 24, 2013, 9:01:38 PM (12 years ago)
Author:
[email protected]
Message:

fourthTier: Misc JIT probe enhacements.
https://bugs.webkit.org/show_bug.cgi?id=116586.

Reviewed by Michael Saboff.

  1. Added JIT probe support for ARMv7 and traditional ARM. Built and tested on ARMv7. ARM version not tested nor built.
  2. Fix the following bugs in the X86 and X86_64 probes:
    1. Cannot assume that the stack pointer is already aligned when we push args for the probe. Instead, we ensure the stack alignment at runtime when we set up the probe call. This is now done in the ctiMasmProbeTrampoline.
    2. On return, the user probe function may have altered the stack pointer value to be restored. Previously, if the sp restore value points to some of the other register restore values in the ProbeContext record, we will fail to return from the probe having those user specified value as we're expected to do. This is now fixed.
  3. Rearranged the X86/X86_64 registers order to organize them like gdb expects on X86_64.
  4. We also now preserve the condition code registers.
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • assembler/ARMAssembler.h:
  • assembler/ARMv7Assembler.h:

(ARMRegisters):

  • assembler/MacroAssemblerARM.cpp:

(JSC::isVFPPresent):
(JSC::MacroAssemblerARM::ProbeContext::dumpCPURegisters):
(JSC::MacroAssemblerARM::ProbeContext::dump):
(JSC::MacroAssemblerARM::probe):

  • assembler/MacroAssemblerARM.h:

(MacroAssemblerARM):
(CPUState):
(ProbeContext):
(JSC::MacroAssemblerARM::trustedImm32FromPtr):

  • assembler/MacroAssemblerARMv7.h:

(MacroAssemblerARMv7):
(CPUState):
(ProbeContext):
(JSC::MacroAssemblerARMv7::trustedImm32FromPtr):

  • assembler/MacroAssemblerX86.h:

(MacroAssemblerX86):
(JSC::MacroAssemblerX86::probe):

  • assembler/MacroAssemblerX86Common.cpp:

(JSC::MacroAssemblerX86Common::ProbeContext::dumpCPURegisters):

  • assembler/MacroAssemblerX86_64.h:

(JSC::MacroAssemblerX86_64::probe):

  • assembler/X86Assembler.h:
  • config.h:
  • jit/JITStubsARM.h:
  • jit/JITStubsARMv7.h:
  • jit/JITStubsX86.h:
  • jit/JITStubsX86Common.h:
  • jit/JITStubsX86_64.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM.h

    r150748 r153197  
    11/*
    2  * Copyright (C) 2008 Apple Inc.
     2 * Copyright (C) 2008, 2013 Apple Inc.
    33 * Copyright (C) 2009, 2010 University of Szeged
    44 * All rights reserved.
     
    3636namespace JSC {
    3737
     38struct JITStackFrame;
     39
    3840class MacroAssemblerARM : public AbstractMacroAssembler<ARMAssembler> {
    3941    static const int DoubleConditionMask = 0x0f;
     
    13291331    }
    13301332
     1333#if USE(MASM_PROBE)
     1334    struct CPUState {
     1335        #define DECLARE_REGISTER(_type, _regName) \
     1336            _type _regName;
     1337        FOR_EACH_CPU_REGISTER(DECLARE_REGISTER)
     1338        #undef DECLARE_REGISTER
     1339    };
     1340
     1341    struct ProbeContext;
     1342    typedef void (*ProbeFunction)(struct ProbeContext*);
     1343
     1344    struct ProbeContext {
     1345        ProbeFunction probeFunction;
     1346        void* arg1;
     1347        void* arg2;
     1348        JITStackFrame* jitStackFrame;
     1349        CPUState cpu;
     1350
     1351        void dump(const char* indentation = 0);
     1352    private:
     1353        void dumpCPURegisters(const char* indentation);
     1354    };
     1355
     1356    // For details about probe(), see comment in MacroAssemblerX86_64.h.
     1357    void probe(ProbeFunction, void* arg1 = 0, void* arg2 = 0);
     1358#endif // USE(MASM_PROBE)
     1359
    13311360protected:
    13321361    ARMAssembler::Condition ARMCondition(RelationalCondition cond)
     
    13841413    }
    13851414
     1415#if USE(MASM_PROBE)
     1416    inline TrustedImm32 trustedImm32FromPtr(void* ptr)
     1417    {
     1418        return TrustedImm32(TrustedImmPtr(ptr));
     1419    }
     1420
     1421    inline TrustedImm32 trustedImm32FromPtr(ProbeFunction function)
     1422    {
     1423        return TrustedImm32(TrustedImmPtr(reinterpret_cast<void*>(function)));
     1424    }
     1425
     1426    inline TrustedImm32 trustedImm32FromPtr(void (*function)())
     1427    {
     1428        return TrustedImm32(TrustedImmPtr(reinterpret_cast<void*>(function)));
     1429    }
     1430#endif
     1431
    13861432    static const bool s_isVFPPresent;
    13871433};
Note: See TracChangeset for help on using the changeset viewer.