Changeset 230040 in webkit


Ignore:
Timestamp:
Mar 28, 2018 1:05:43 PM (6 years ago)
Author:
mark.lam@apple.com
Message:

Enhance ARM64 probe to support pointer profiling.
https://bugs.webkit.org/show_bug.cgi?id=184069
<rdar://problem/38939879>

Reviewed by JF Bastien.

  • assembler/MacroAssemblerARM64.cpp:

(JSC::MacroAssembler::probe):

  • assembler/MacroAssemblerX86Common.h:

(JSC::MacroAssemblerX86Common::popPair):
(JSC::MacroAssemblerX86Common::pushPair):

  • assembler/testmasm.cpp:

(JSC::testProbeReadsArgumentRegisters):
(JSC::testProbeWritesArgumentRegisters):

  • runtime/PtrTag.h:

(JSC::tagForPtr):

Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r230026 r230040  
     12018-03-28  Mark Lam  <mark.lam@apple.com>
     2
     3        Enhance ARM64 probe to support pointer profiling.
     4        https://bugs.webkit.org/show_bug.cgi?id=184069
     5        <rdar://problem/38939879>
     6
     7        Reviewed by JF Bastien.
     8
     9        * assembler/MacroAssemblerARM64.cpp:
     10        (JSC::MacroAssembler::probe):
     11        * assembler/MacroAssemblerX86Common.h:
     12        (JSC::MacroAssemblerX86Common::popPair):
     13        (JSC::MacroAssemblerX86Common::pushPair):
     14        * assembler/testmasm.cpp:
     15        (JSC::testProbeReadsArgumentRegisters):
     16        (JSC::testProbeWritesArgumentRegisters):
     17        * runtime/PtrTag.h:
     18        (JSC::tagForPtr):
     19
    1202018-03-28  Robin Morisset  <rmorisset@apple.com>
    221
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.cpp

    r221002 r230040  
    11/*
    2  * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2013-2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    372372    // the caller of the probe (which is what we want in order to play nice with debuggers e.g. lldb).
    373373    "mov       x0, sp" "\n" // Set the Probe::State* arg.
    374     "blr       x28" "\n" // Call the probe handler.
     374    CALL_WITH_PTRTAG("blr", "x28", CFunctionPtrTag) // Call the probe handler.
    375375
    376376    // Make sure the Probe::State is entirely below the result stack pointer so
     
    408408
    409409    "mov       x0, x27" "\n" // Set the Probe::State* arg.
    410     "blr       x2" "\n" // Call the initializeStackFunction (loaded into x2 above).
     410    CALL_WITH_PTRTAG("blr", "x2", CFunctionPtrTag) // Call the initializeStackFunction (loaded into x2 above).
    411411
    412412    LOCAL_LABEL_STRING(ctiMasmProbeTrampolineRestoreRegisters) ":" "\n"
     
    518518    move(TrustedImmPtr(reinterpret_cast<void*>(function)), x24);
    519519    move(TrustedImmPtr(arg), x25);
    520     m_assembler.blr(x26);
     520    call(x26, CFunctionPtrTag);
    521521
    522522    // ctiMasmProbeTrampoline should have restored every register except for lr and the sp.
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h

    r229988 r230040  
    21342134    }
    21352135
     2136    void popPair(RegisterID dest1, RegisterID dest2)
     2137    {
     2138        pop(dest2);
     2139        pop(dest1);
     2140    }
     2141
     2142    void pushPair(RegisterID src1, RegisterID src2)
     2143    {
     2144        push(src1);
     2145        push(src2);
     2146    }
    21362147
    21372148    // Register move operations:
  • trunk/Source/JavaScriptCore/assembler/testmasm.cpp

    r229609 r230040  
    235235        jit.emitFunctionPrologue();
    236236
    237         jit.push(GPRInfo::argumentGPR0);
    238         jit.push(GPRInfo::argumentGPR1);
    239         jit.push(GPRInfo::argumentGPR2);
    240         jit.push(GPRInfo::argumentGPR3);
     237        jit.pushPair(GPRInfo::argumentGPR0, GPRInfo::argumentGPR1);
     238        jit.pushPair(GPRInfo::argumentGPR2, GPRInfo::argumentGPR3);
    241239
    242240        jit.move(CCallHelpers::TrustedImm32(testWord32(0)), GPRInfo::argumentGPR0);
     
    268266        });
    269267
    270         jit.pop(GPRInfo::argumentGPR3);
    271         jit.pop(GPRInfo::argumentGPR2);
    272         jit.pop(GPRInfo::argumentGPR1);
    273         jit.pop(GPRInfo::argumentGPR0);
     268        jit.popPair(GPRInfo::argumentGPR2, GPRInfo::argumentGPR3);
     269        jit.popPair(GPRInfo::argumentGPR0, GPRInfo::argumentGPR1);
    274270
    275271        jit.emitFunctionEpilogue();
     
    288284        jit.emitFunctionPrologue();
    289285
    290         jit.push(GPRInfo::argumentGPR0);
    291         jit.push(GPRInfo::argumentGPR1);
    292         jit.push(GPRInfo::argumentGPR2);
    293         jit.push(GPRInfo::argumentGPR3);
     286        jit.pushPair(GPRInfo::argumentGPR0, GPRInfo::argumentGPR1);
     287        jit.pushPair(GPRInfo::argumentGPR2, GPRInfo::argumentGPR3);
    294288
    295289        // Pre-initialize with non-expected values.
     
    334328        });
    335329
    336         jit.pop(GPRInfo::argumentGPR3);
    337         jit.pop(GPRInfo::argumentGPR2);
    338         jit.pop(GPRInfo::argumentGPR1);
    339         jit.pop(GPRInfo::argumentGPR0);
     330        jit.popPair(GPRInfo::argumentGPR2, GPRInfo::argumentGPR3);
     331        jit.popPair(GPRInfo::argumentGPR0, GPRInfo::argumentGPR1);
    340332
    341333        jit.emitFunctionEpilogue();
  • trunk/Source/JavaScriptCore/runtime/PtrTag.h

    r229817 r230040  
    7171inline uintptr_t nextPtrTagID() { return 0; }
    7272
     73inline const char* tagForPtr(const void*) { return "<no tag>"; }
     74
    7375template<typename... Arguments>
    7476inline constexpr PtrTag ptrTag(Arguments&&...) { return NoPtrTag; }
     
    120122template<typename PtrType> void assertIsNullOrTaggedWith(PtrType, PtrTag) { }
    121123
     124#define CALL_WITH_PTRTAG(callInstructionString, targetRegisterString, tag) \
     125    callInstructionString " " targetRegisterString "\n"
     126
    122127#endif // !USE(POINTER_PROFILING)
    123128
Note: See TracChangeset for help on using the changeset viewer.