LCOV - app.info - js/src/assembler/assembler/AbstractMacroAssembler.h

LCOV - code coverage report
| Current view: | directory - js/src/assembler/assembler - AbstractMacroAssembler.h (source / functions) |  | Found | Hit | Coverage |
| Test: | app.info | Lines: | 164 | 164 | 100.0 %
| Date: | 2012-04-07 | Functions: | 63 | 63 | 100.0 %

           1                 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
           2                 :  * vim: set ts=8 sw=4 et tw=79:
           3                 :  *
           4                 :  * ***** BEGIN LICENSE BLOCK *****
           5                 :  * Copyright (C) 2008 Apple Inc. All rights reserved.
           6                 :  *
           7                 :  * Redistribution and use in source and binary forms, with or without
           8                 :  * modification, are permitted provided that the following conditions
           9                 :  * are met:
          10                 :  * 1. Redistributions of source code must retain the above copyright
          11                 :  *    notice, this list of conditions and the following disclaimer.
          12                 :  * 2. Redistributions in binary form must reproduce the above copyright
          13                 :  *    notice, this list of conditions and the following disclaimer in the
          14                 :  *    documentation and/or other materials provided with the distribution.
          15                 :  *
          16                 :  * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
          17                 :  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
          18                 :  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
          19                 :  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
          20                 :  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
          21                 :  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
          22                 :  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
          23                 :  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
          24                 :  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
          25                 :  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
          26                 :  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
          27                 :  *
          28                 :  * ***** END LICENSE BLOCK ***** */
          29                 :
          30                 : #ifndef AbstractMacroAssembler_h
          31                 : #define AbstractMacroAssembler_h
          32                 :
          33                 : #include "assembler/wtf/Platform.h"
          34                 : #include "assembler/assembler/MacroAssemblerCodeRef.h"
          35                 : #include "assembler/assembler/CodeLocation.h"
          36                 :
          37                 : #if ENABLE_ASSEMBLER
          38                 :
          39                 : namespace JSC {
          40                 :
          41                 : class LinkBuffer;
          42                 : class RepatchBuffer;
          43                 :
          44                 : template <class AssemblerType>
          45          768214 : class AbstractMacroAssembler {
          46                 : public:
          47                 :     typedef AssemblerType AssemblerType_T;
          48                 :
          49                 :     typedef MacroAssemblerCodePtr CodePtr;
          50                 :     typedef MacroAssemblerCodeRef CodeRef;
          51                 :
          52                 :     class Jump;
          53                 :
          54                 :     typedef typename AssemblerType::RegisterID RegisterID;
          55                 :     typedef typename AssemblerType::FPRegisterID FPRegisterID;
          56                 :     typedef typename AssemblerType::JmpSrc JmpSrc;
          57                 :     typedef typename AssemblerType::JmpDst JmpDst;
          58                 :
          59                 : #ifdef DEBUG
          60           95862 :     void setSpewPath(bool isOOLPath)
          61                 :     {
          62           95862 :         m_assembler.isOOLPath = isOOLPath;
          63           95862 :     }
          64                 : #endif
          65                 :
          66                 :     // Section 1: MacroAssembler operand types
          67                 :     //
          68                 :     // The following types are used as operands to MacroAssembler operations,
          69                 :     // describing immediate  and memory operands to the instructions to be planted.
          70                 :
          71                 :
          72                 :     enum Scale {
          73                 :         TimesOne,
          74                 :         TimesTwo,
          75                 :         TimesFour,
          76                 :         TimesEight
          77                 :     };
          78                 :
          79                 :     // Address:
          80                 :     //
          81                 :     // Describes a simple base-offset address.
          82                 :     struct Address {
          83          124392 :         explicit Address() {}
          84                 :
          85        48445248 :         explicit Address(RegisterID base, int32_t offset = 0)
          86                 :             : base(base)
          87        48445248 :             , offset(offset)
          88                 :         {
          89        48445248 :         }
          90                 :
          91                 :         RegisterID base;
          92                 :         int32_t offset;
          93                 :     };
          94                 :
          95                 :     struct ExtendedAddress {
          96            2700 :         explicit ExtendedAddress(RegisterID base, intptr_t offset = 0)
          97                 :             : base(base)
          98            2700 :             , offset(offset)
          99                 :         {
         100            2700 :         }
         101                 :
         102                 :         RegisterID base;
         103                 :         intptr_t offset;
         104                 :     };
         105                 :
         106                 :     // ImplicitAddress:
         107                 :     //
         108                 :     // This class is used for explicit 'load' and 'store' operations
         109                 :     // (as opposed to situations in which a memory operand is provided
         110                 :     // to a generic operation, such as an integer arithmetic instruction).
         111                 :     //
         112                 :     // In the case of a load (or store) operation we want to permit
         113                 :     // addresses to be implicitly constructed, e.g. the two calls:
         114                 :     //
         115                 :     //     load32(Address(addrReg), destReg);
         116                 :     //     load32(addrReg, destReg);
         117                 :     //
         118                 :     // Are equivalent, and the explicit wrapping of the Address in the former
         119                 :     // is unnecessary.
         120                 :     struct ImplicitAddress {
         121            9329 :         ImplicitAddress(RegisterID base)
         122                 :             : base(base)
         123            9329 :             , offset(0)
         124                 :         {
         125            9329 :         }
         126                 :
         127        32966559 :         ImplicitAddress(Address address)
         128                 :             : base(address.base)
         129        32966559 :             , offset(address.offset)
         130                 :         {
         131        32966559 :         }
         132                 :
         133                 :         RegisterID base;
         134                 :         int32_t offset;
         135                 :     };
         136                 :
         137                 :     // BaseIndex:
         138                 :     //
         139                 :     // Describes a complex addressing mode.
         140                 :     struct BaseIndex {
         141          182643 :         BaseIndex(RegisterID base, RegisterID index, Scale scale, int32_t offset = 0)
         142                 :             : base(base)
         143                 :             , index(index)
         144                 :             , scale(scale)
         145          182643 :             , offset(offset)
         146                 :         {
         147          182643 :         }
         148                 :
         149                 :         RegisterID base;
         150                 :         RegisterID index;
         151                 :         Scale scale;
         152                 :         int32_t offset;
         153                 :     };
         154                 :
         155                 :     // AbsoluteAddress:
         156                 :     //
         157                 :     // Describes an memory operand given by a pointer.  For regular load & store
         158                 :     // operations an unwrapped void* will be used, rather than using this.
         159                 :     struct AbsoluteAddress {
         160          250185 :         explicit AbsoluteAddress(void* ptr)
         161          250185 :             : m_ptr(ptr)
         162                 :         {
         163          250185 :         }
         164                 :
         165                 :         void* m_ptr;
         166                 :     };
         167                 :
         168                 :     // TrustedImmPtr:
         169                 :     //
         170                 :     // A pointer sized immediate operand to an instruction - this is wrapped
         171                 :     // in a class requiring explicit construction in order to differentiate
         172                 :     // from pointers used as absolute addresses to memory operations
         173                 :     struct TrustedImmPtr {
         174         7853621 :         explicit TrustedImmPtr(const void* value)
         175         7853621 :             : m_value(value)
         176                 :         {
         177         7853621 :         }
         178                 :
         179         7853621 :         intptr_t asIntptr()
         180                 :         {
         181         7853621 :             return reinterpret_cast<intptr_t>(m_value);
         182                 :         }
         183                 :
         184                 :         const void* m_value;
         185                 :     };
         186                 :
         187                 :     struct ImmPtr : public TrustedImmPtr {
         188         7848185 :         explicit ImmPtr(const void* value)
         189         7848185 :             : TrustedImmPtr(value)
         190                 :         {
         191         7848185 :         }
         192                 :     };
         193                 :
         194                 :     // TrustedImm32:
         195                 :     //
         196                 :     // A 32bit immediate operand to an instruction - this is wrapped in a
         197                 :     // class requiring explicit construction in order to prevent RegisterIDs
         198                 :     // (which are implemented as an enum) from accidentally being passed as
         199                 :     // immediate values.
         200                 :     struct TrustedImm32 {
         201        14219095 :         explicit TrustedImm32(int32_t value)
         202        14219095 :             : m_value(value)
         203                 : #if WTF_CPU_ARM || WTF_CPU_MIPS
         204                 :             , m_isPointer(false)
         205                 : #endif
         206                 :         {
         207        14219095 :         }
         208                 :
         209                 : #if !WTF_CPU_X86_64
         210         3464620 :         explicit TrustedImm32(TrustedImmPtr ptr)
         211         3464620 :             : m_value(ptr.asIntptr())
         212                 : #if WTF_CPU_ARM || WTF_CPU_MIPS
         213                 :             , m_isPointer(true)
         214                 : #endif
         215                 :         {
         216         3464620 :         }
         217                 : #endif
         218                 :
         219                 :         int32_t m_value;
         220                 : #if WTF_CPU_ARM || WTF_CPU_MIPS
         221                 :         // We rely on being able to regenerate code to recover exception handling
         222                 :         // information.  Since ARMv7 supports 16-bit immediates there is a danger
         223                 :         // that if pointer values change the layout of the generated code will change.
         224                 :         // To avoid this problem, always generate pointers (and thus Imm32s constructed
         225                 :         // from ImmPtrs) with a code sequence that is able  to represent  any pointer
         226                 :         // value - don't use a more compact form in these cases.
         227                 :         // Same for MIPS.
         228                 :         bool m_isPointer;
         229                 : #endif
         230                 :     };
         231                 :
         232                 :
         233                 :     struct Imm32 : public TrustedImm32 {
         234        14158946 :         explicit Imm32(int32_t value)
         235        14158946 :             : TrustedImm32(value)
         236                 :         {
         237        14158946 :         }
         238                 : #if !WTF_CPU_X86_64
         239         3464620 :         explicit Imm32(TrustedImmPtr ptr)
         240         3464620 :             : TrustedImm32(ptr)
         241                 :         {
         242         3464620 :         }
         243                 : #endif
         244                 :     };
         245                 :
         246                 :     struct ImmDouble {
         247                 :         union {
         248                 :             struct {
         249                 : #if WTF_CPU_BIG_ENDIAN || WTF_CPU_MIDDLE_ENDIAN
         250                 :                 uint32_t msb, lsb;
         251                 : #else
         252                 :                 uint32_t lsb, msb;
         253                 : #endif
         254                 :             } s;
         255                 :             uint64_t u64;
         256                 :             double d;
         257                 :         } u;
         258                 :
         259             116 :         explicit ImmDouble(double d) {
         260             116 :             u.d = d;
         261             116 :         }
         262                 :     };
         263                 :
         264                 :     // Section 2: MacroAssembler code buffer handles
         265                 :     //
         266                 :     // The following types are used to reference items in the code buffer
         267                 :     // during JIT code generation.  For example, the type Jump is used to
         268                 :     // track the location of a jump instruction so that it may later be
         269                 :     // linked to a label marking its destination.
         270                 :
         271                 :
         272                 :     // Label:
         273                 :     //
         274                 :     // A Label records a point in the generated instruction stream, typically such that
         275                 :     // it may be used as a destination for a jump.
         276                 :     class Label {
         277                 :         template<class TemplateAssemblerType>
         278                 :         friend class AbstractMacroAssembler;
         279                 :         friend class Jump;
         280                 :         friend class MacroAssemblerCodeRef;
         281                 :         friend class LinkBuffer;
         282                 :
         283                 :     public:
         284        29579396 :         Label()
         285        29579396 :         {
         286        29579396 :         }
         287                 :
         288        23785233 :         Label(AbstractMacroAssembler<AssemblerType>* masm)
         289        23785233 :             : m_label(masm->m_assembler.label())
         290                 :         {
         291        23785233 :         }
         292                 :
         293                 :         bool isUsed() const { return m_label.isUsed(); }
         294                 :         void used() { m_label.used(); }
         295          387168 :         bool isSet() const { return m_label.isValid(); }
         296                 :     private:
         297                 :         JmpDst m_label;
         298                 :     };
         299                 :
         300                 :     // DataLabelPtr:
         301                 :     //
         302                 :     // A DataLabelPtr is used to refer to a location in the code containing a pointer to be
         303                 :     // patched after the code has been generated.
         304            5436 :     class DataLabelPtr {
         305                 :         template<class TemplateAssemblerType>
         306                 :         friend class AbstractMacroAssembler;
         307                 :         friend class LinkBuffer;
         308                 :     public:
         309        10436874 :         DataLabelPtr()
         310        10436874 :         {
         311        10436874 :         }
         312                 :
         313         3159070 :         DataLabelPtr(AbstractMacroAssembler<AssemblerType>* masm)
         314         3159070 :             : m_label(masm->m_assembler.label())
         315                 :         {
         316         3159070 :         }
         317                 :
         318                 :         bool isSet() const { return m_label.isValid(); }
         319                 :
         320                 :     private:
         321                 :         JmpDst m_label;
         322                 :     };
         323                 :
         324                 :     // DataLabel32:
         325                 :     //
         326                 :     // A DataLabel32 is used to refer to a location in the code containing a
         327                 :     // 32-bit constant to be patched after the code has been generated.
         328                 :     class DataLabel32 {
         329                 :         template<class TemplateAssemblerType>
         330                 :         friend class AbstractMacroAssembler;
         331                 :         friend class LinkBuffer;
         332                 :     public:
         333           39500 :         DataLabel32()
         334           39500 :         {
         335           39500 :         }
         336                 :
         337           55350 :         DataLabel32(AbstractMacroAssembler<AssemblerType>* masm)
         338           55350 :             : m_label(masm->m_assembler.label())
         339                 :         {
         340           55350 :         }
         341                 :
         342                 :     private:
         343                 :         JmpDst m_label;
         344                 :     };
         345                 :
         346                 :     // Call:
         347                 :     //
         348                 :     // A Call object is a reference to a call instruction that has been planted
         349                 :     // into the code buffer - it is typically used to link the call, setting the
         350                 :     // relative offset such that when executed it will call to the desired
         351                 :     // destination.
         352                 :     class Call {
         353                 :         template<class TemplateAssemblerType>
         354                 :         friend class AbstractMacroAssembler;
         355                 :
         356                 :     public:
         357                 :         enum Flags {
         358                 :             None = 0x0,
         359                 :             Linkable = 0x1,
         360                 :             Near = 0x2,
         361                 :             LinkableNear = 0x3
         362                 :         };
         363                 :
         364          672968 :         Call()
         365          672968 :             : m_flags(None)
         366                 :         {
         367          672968 :         }
         368                 :
         369         2683842 :         Call(JmpSrc jmp, Flags flags)
         370                 :             : m_jmp(jmp)
         371         2683842 :             , m_flags(flags)
         372                 :         {
         373         2683842 :         }
         374                 :
         375         4028540 :         bool isFlagSet(Flags flag)
         376                 :         {
         377         4028540 :             return !!(m_flags & flag);
         378                 :         }
         379                 :
         380                 :         static Call fromTailJump(Jump jump)
         381                 :         {
         382                 :             return Call(jump.m_jmp, Linkable);
         383                 :         }
         384                 :
         385                 :         JmpSrc m_jmp;
         386                 :     private:
         387                 :         Flags m_flags;
         388                 :     };
         389                 :
         390                 :     // Jump:
         391                 :     //
         392                 :     // A jump object is a reference to a jump instruction that has been planted
         393                 :     // into the code buffer - it is typically used to link the jump, setting the
         394                 :     // relative offset such that when executed it will jump to the desired
         395                 :     // destination.
         396         1672049 :     class Jump {
         397                 :         template<class TemplateAssemblerType>
         398                 :         friend class AbstractMacroAssembler;
         399                 :         friend class Call;
         400                 :         friend class LinkBuffer;
         401                 :     public:
         402         6657743 :         Jump()
         403         6657743 :         {
         404         6657743 :         }
         405                 :
         406        10129393 :         Jump(JmpSrc jmp)
         407        10129393 :             : m_jmp(jmp)
         408                 :         {
         409        10129393 :         }
         410                 :
         411          153253 :         void link(AbstractMacroAssembler<AssemblerType>* masm)
         412                 :         {
         413          153253 :             masm->m_assembler.linkJump(m_jmp, masm->m_assembler.label());
         414          153253 :         }
         415                 :
         416         4611511 :         void linkTo(Label label, AbstractMacroAssembler<AssemblerType>* masm)
         417                 :         {
         418         4611511 :             masm->m_assembler.linkJump(m_jmp, label.m_label);
         419         4611511 :         }
         420                 :
         421                 :     private:
         422                 :         JmpSrc m_jmp;
         423                 :     };
         424                 :
         425                 :     // JumpList:
         426                 :     //
         427                 :     // A JumpList is a set of Jump objects.
         428                 :     // All jumps in the set will be linked to the same destination.
         429          972247 :     class JumpList {
         430                 :         friend class LinkBuffer;
         431                 :
         432                 :     public:
         433                 :         typedef js::Vector<Jump, 16 ,js::SystemAllocPolicy > JumpVector;
         434                 :
         435          267690 :         JumpList() {}
         436                 :
         437          704557 :         JumpList(const JumpList &other)
         438          704557 :         {
         439          704557 :             m_jumps.append(other.m_jumps);
         440          704557 :         }
         441                 :
         442                 :         JumpList &operator=(const JumpList &other)
         443                 :         {
         444                 :             m_jumps.clear();
         445                 :             m_jumps.append(other.m_jumps);
         446                 :             return *this;
         447                 :         }
         448                 :
         449          101133 :         void link(AbstractMacroAssembler<AssemblerType>* masm)
         450                 :         {
         451          101133 :             size_t size = m_jumps.length();
         452          220331 :             for (size_t i = 0; i < size; ++i)
         453          119198 :                 m_jumps[i].link(masm);
         454          101133 :             m_jumps.clear();
         455          101133 :         }
         456                 :
         457            5891 :         void linkTo(Label label, AbstractMacroAssembler<AssemblerType>* masm)
         458                 :         {
         459            5891 :             size_t size = m_jumps.length();
         460           14774 :             for (size_t i = 0; i < size; ++i)
         461            8883 :                 m_jumps[i].linkTo(label, masm);
         462            5891 :             m_jumps.clear();
         463            5891 :         }
         464                 :
         465          128081 :         void append(Jump jump)
         466                 :         {
         467          128081 :             m_jumps.append(jump);
         468          128081 :         }
         469                 :
         470          163519 :         void append(const JumpList& other)
         471                 :         {
         472          163519 :             m_jumps.append(other.m_jumps.begin(), other.m_jumps.length());
         473          163519 :         }
         474                 :
         475           75498 :         void clear()
         476                 :         {
         477           75498 :             m_jumps.clear();
         478           75498 :         }
         479                 :
         480           47966 :         bool empty()
         481                 :         {
         482           47966 :             return !m_jumps.length();
         483                 :         }
         484                 :
         485                 :         const JumpVector& jumps() const { return m_jumps; }
         486                 :
         487                 :     private:
         488                 :         JumpVector m_jumps;
         489                 :     };
         490                 :
         491                 :
         492                 :     // Section 3: Misc admin methods
         493                 :
         494                 :     static CodePtr trampolineAt(CodeRef ref, Label label)
         495                 :     {
         496                 :         return CodePtr(AssemblerType::getRelocatedAddress(ref.m_code.dataLocation(), label.m_label));
         497                 :     }
         498                 :
         499         4605584 :     size_t size()
         500                 :     {
         501         4605584 :         return m_assembler.size();
         502                 :     }
         503                 :
         504                 :     unsigned char *buffer()
         505                 :     {
         506                 :         return m_assembler.buffer();
         507                 :     }
         508                 :
         509          669360 :     bool oom()
         510                 :     {
         511          669360 :         return m_assembler.oom();
         512                 :     }
         513                 :
         514          187304 :     void executableCopy(void* buffer)
         515                 :     {
         516          187304 :         ASSERT(!oom());
         517          187304 :         m_assembler.executableCopy(buffer);
         518          187304 :     }
         519                 :
         520        23662257 :     Label label()
         521                 :     {
         522        23662257 :         return Label(this);
         523                 :     }
         524                 :
         525           55350 :     DataLabel32 dataLabel32()
         526                 :     {
         527           55350 :         return DataLabel32(this);
         528                 :     }
         529                 :
         530                 :     Label align()
         531                 :     {
         532                 :         m_assembler.align(16);
         533                 :         return Label(this);
         534                 :     }
         535                 :
         536           58182 :     ptrdiff_t differenceBetween(Label from, Jump to)
         537                 :     {
         538           58182 :         return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_jmp);
         539                 :     }
         540                 :
         541                 :     ptrdiff_t differenceBetween(Label from, Call to)
         542                 :     {
         543                 :         return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_jmp);
         544                 :     }
         545                 :
         546         2239969 :     ptrdiff_t differenceBetween(Label from, Label to)
         547                 :     {
         548         2239969 :         return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label);
         549                 :     }
         550                 :
         551           93776 :     ptrdiff_t differenceBetween(Label from, DataLabelPtr to)
         552                 :     {
         553           93776 :         return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label);
         554                 :     }
         555                 :
         556           15850 :     ptrdiff_t differenceBetween(Label from, DataLabel32 to)
         557                 :     {
         558           15850 :         return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label);
         559                 :     }
         560                 :
         561           55350 :     ptrdiff_t differenceBetween(DataLabel32 from, Label to)
         562                 :     {
         563           55350 :         return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label);
         564                 :     }
         565                 :
         566                 :     ptrdiff_t differenceBetween(DataLabelPtr from, Label to)
         567                 :     {
         568                 :         return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label);
         569                 :     }
         570                 :
         571                 :     ptrdiff_t differenceBetween(DataLabelPtr from, Jump to)
         572                 :     {
         573                 :         return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_jmp);
         574                 :     }
         575                 :
         576                 :     ptrdiff_t differenceBetween(DataLabelPtr from, DataLabelPtr to)
         577                 :     {
         578                 :         return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label);
         579                 :     }
         580                 :
         581                 :     ptrdiff_t differenceBetween(DataLabelPtr from, Call to)
         582                 :     {
         583                 :         return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_jmp);
         584                 :     }
         585                 :
         586                 : protected:
         587                 :     AssemblerType m_assembler;
         588                 :
         589                 :     friend class LinkBuffer;
         590                 :     friend class RepatchBuffer;
         591                 :
         592         5271181 :     static void linkJump(void* code, Jump jump, CodeLocationLabel target)
         593                 :     {
         594         5271181 :         AssemblerType::linkJump(code, jump.m_jmp, target.dataLocation());
         595         5271181 :     }
         596                 :
         597         1118118 :     static void linkPointer(void* code, typename AssemblerType::JmpDst label, void* value)
         598                 :     {
         599         1118118 :         AssemblerType::linkPointer(code, label, value);
         600         1118118 :     }
         601                 :
         602         1102830 :     static void* getLinkerAddress(void* code, typename AssemblerType::JmpSrc label)
         603                 :     {
         604         1102830 :         return AssemblerType::getRelocatedAddress(code, label);
         605                 :     }
         606                 :
         607         8600777 :     static void* getLinkerAddress(void* code, typename AssemblerType::JmpDst label)
         608                 :     {
         609         8600777 :         return AssemblerType::getRelocatedAddress(code, label);
         610                 :     }
         611                 :
         612         2606267 :     static unsigned getLinkerCallReturnOffset(Call call)
         613                 :     {
         614         2606267 :         return AssemblerType::getCallReturnOffset(call.m_jmp);
         615                 :     }
         616                 :
         617           91555 :     static void repatchJump(CodeLocationJump jump, CodeLocationLabel destination)
         618                 :     {
         619           91555 :         AssemblerType::relinkJump(jump.dataLocation(), destination.dataLocation());
         620           91555 :     }
         621                 :
         622            7386 :     static bool canRepatchJump(CodeLocationJump jump, CodeLocationLabel destination)
         623                 :     {
         624            7386 :         return AssemblerType::canRelinkJump(jump.dataLocation(), destination.dataLocation());
         625                 :     }
         626                 :
         627                 :     static void repatchNearCall(CodeLocationNearCall nearCall, CodeLocationLabel destination)
         628                 :     {
         629                 :         AssemblerType::relinkCall(nearCall.dataLocation(), destination.executableAddress());
         630                 :     }
         631                 :
         632          418422 :     static void repatchInt32(CodeLocationDataLabel32 dataLabel32, int32_t value)
         633                 :     {
         634          418422 :         AssemblerType::repatchInt32(dataLabel32.dataLocation(), value);
         635          418422 :     }
         636                 :
         637          220479 :     static void repatchPointer(CodeLocationDataLabelPtr dataLabelPtr, void* value)
         638                 :     {
         639          220479 :         AssemblerType::repatchPointer(dataLabelPtr.dataLocation(), value);
         640          220479 :     }
         641                 :
         642            9977 :     static void repatchLoadPtrToLEA(CodeLocationInstruction instruction)
         643                 :     {
         644            9977 :         AssemblerType::repatchLoadPtrToLEA(instruction.dataLocation());
         645            9977 :     }
         646                 :
         647                 :     static void repatchLEAToLoadPtr(CodeLocationInstruction instruction)
         648                 :     {
         649                 :         AssemblerType::repatchLEAToLoadPtr(instruction.dataLocation());
         650                 :     }
         651                 : };
         652                 :
         653                 : } // namespace JSC
         654                 :
         655                 : #endif // ENABLE(ASSEMBLER)
         656                 :
         657                 : #endif // AbstractMacroAssembler_h

Generated by: LCOV version 1.7