Changeset 249449 in webkit for trunk/Source/JavaScriptCore/assembler/ARMv7Assembler.h
- Timestamp:
- Sep 3, 2019, 6:47:02 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/assembler/ARMv7Assembler.h
r247097 r249449 1 1 /* 2 * Copyright (C) 2009-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2009-2019 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2010 University of Szeged 4 4 * … … 1970 1970 } 1971 1971 1972 template <typename CopyFunction> 1973 static void fillNops(void* base, size_t size, CopyFunction copy) 1972 using CopyFunction = void*(&)(void*, const void*, size_t); 1973 1974 template <CopyFunction copy> 1975 static void fillNops(void* base, size_t size) 1974 1976 { 1975 1977 RELEASE_ASSERT(!(size % sizeof(int16_t))); … … 2124 2126 } 2125 2127 2126 typedef void* (*CopyFunction)(void*, const void*, size_t); 2127 2128 static void ALWAYS_INLINE link(LinkRecord& record, uint8_t* from, const uint8_t* fromInstruction8, uint8_t* to, CopyFunction copy) 2128 template<CopyFunction copy> 2129 static void ALWAYS_INLINE link(LinkRecord& record, uint8_t* from, const uint8_t* fromInstruction8, uint8_t* to) 2129 2130 { 2130 2131 const uint16_t* fromInstruction = reinterpret_cast_ptr<const uint16_t*>(fromInstruction8); 2131 2132 switch (record.linkType()) { 2132 2133 case LinkJumpT1: 2133 linkJumpT1 (record.condition(), reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy);2134 linkJumpT1<copy>(record.condition(), reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to); 2134 2135 break; 2135 2136 case LinkJumpT2: 2136 linkJumpT2 (reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy);2137 linkJumpT2<copy>(reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to); 2137 2138 break; 2138 2139 case LinkJumpT3: 2139 linkJumpT3 (record.condition(), reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy);2140 linkJumpT3<copy>(record.condition(), reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to); 2140 2141 break; 2141 2142 case LinkJumpT4: 2142 linkJumpT4 (reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy);2143 linkJumpT4<copy>(reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to); 2143 2144 break; 2144 2145 case LinkConditionalJumpT4: 2145 linkConditionalJumpT4 (record.condition(), reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy);2146 linkConditionalJumpT4<copy>(record.condition(), reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to); 2146 2147 break; 2147 2148 case LinkConditionalBX: 2148 linkConditionalBX (record.condition(), reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy);2149 linkConditionalBX<copy>(record.condition(), reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to); 2149 2150 break; 2150 2151 case LinkBX: 2151 linkBX (reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy);2152 linkBX<copy>(reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to); 2152 2153 break; 2153 2154 default: … … 2599 2600 return ((relative << 7) >> 7) == relative; 2600 2601 } 2601 2602 static void linkJumpT1(Condition cond, uint16_t* writeTarget, const uint16_t* instruction, void* target, CopyFunction copy = performJITMemcpy) 2602 2603 template<CopyFunction copy = performJITMemcpy> 2604 static void linkJumpT1(Condition cond, uint16_t* writeTarget, const uint16_t* instruction, void* target) 2603 2605 { 2604 2606 // FIMXE: this should be up in the MacroAssembler layer. :-( … … 2618 2620 copy(writeTarget - 1, &newInstruction, sizeof(uint16_t)); 2619 2621 } 2620 2621 static void linkJumpT2(uint16_t* writeTarget, const uint16_t* instruction, void* target, CopyFunction copy = performJITMemcpy) 2622 2623 template<CopyFunction copy = performJITMemcpy> 2624 static void linkJumpT2(uint16_t* writeTarget, const uint16_t* instruction, void* target) 2622 2625 { 2623 2626 // FIMXE: this should be up in the MacroAssembler layer. :-( … … 2638 2641 } 2639 2642 2640 static void linkJumpT3(Condition cond, uint16_t* writeTarget, const uint16_t* instruction, void* target, CopyFunction copy = performJITMemcpy) 2643 template<CopyFunction copy = performJITMemcpy> 2644 static void linkJumpT3(Condition cond, uint16_t* writeTarget, const uint16_t* instruction, void* target) 2641 2645 { 2642 2646 // FIMXE: this should be up in the MacroAssembler layer. :-( … … 2655 2659 } 2656 2660 2657 static void linkJumpT4(uint16_t* writeTarget, const uint16_t* instruction, void* target, CopyFunction copy = performJITMemcpy) 2661 template<CopyFunction copy = performJITMemcpy> 2662 static void linkJumpT4(uint16_t* writeTarget, const uint16_t* instruction, void* target) 2658 2663 { 2659 2664 // FIMXE: this should be up in the MacroAssembler layer. :-( … … 2674 2679 copy(writeTarget - 2, instructions, 2 * sizeof(uint16_t)); 2675 2680 } 2676 2677 static void linkConditionalJumpT4(Condition cond, uint16_t* writeTarget, const uint16_t* instruction, void* target, CopyFunction copy = performJITMemcpy) 2681 2682 template<CopyFunction copy = performJITMemcpy> 2683 static void linkConditionalJumpT4(Condition cond, uint16_t* writeTarget, const uint16_t* instruction, void* target) 2678 2684 { 2679 2685 // FIMXE: this should be up in the MacroAssembler layer. :-( … … 2683 2689 uint16_t newInstruction = ifThenElse(cond) | OP_IT; 2684 2690 copy(writeTarget - 3, &newInstruction, sizeof(uint16_t)); 2685 linkJumpT4(writeTarget, instruction, target, copy); 2686 } 2687 2688 static void linkBX(uint16_t* writeTarget, const uint16_t* instruction, void* target, CopyFunction copy = performJITMemcpy) 2691 linkJumpT4<copy>(writeTarget, instruction, target); 2692 } 2693 2694 template<CopyFunction copy = performJITMemcpy> 2695 static void linkBX(uint16_t* writeTarget, const uint16_t* instruction, void* target) 2689 2696 { 2690 2697 // FIMXE: this should be up in the MacroAssembler layer. :-( … … 2705 2712 copy(writeTarget - 5, instructions, 5 * sizeof(uint16_t)); 2706 2713 } 2707 2708 static void linkConditionalBX(Condition cond, uint16_t* writeTarget, const uint16_t* instruction, void* target, CopyFunction copy = performJITMemcpy) 2714 2715 template<CopyFunction copy = performJITMemcpy> 2716 static void linkConditionalBX(Condition cond, uint16_t* writeTarget, const uint16_t* instruction, void* target) 2709 2717 { 2710 2718 // FIMXE: this should be up in the MacroAssembler layer. :-(
Note:
See TracChangeset
for help on using the changeset viewer.