Changeset 236864 in webkit
- Timestamp:
- Oct 4, 2018, 5:35:25 PM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r236839 r236864 1 2018-10-04 Mark Lam <mark.lam@apple.com> 2 3 Move start/EndOfFixedExecutableMemoryPool pointers into the FixedVMPoolExecutableAllocator object. 4 https://bugs.webkit.org/show_bug.cgi?id=190295 5 <rdar://problem/19197193> 6 7 Reviewed by Saam Barati. 8 9 This allows us to use the tagging logic already baked into MacroAssemblerCodePtr 10 instead of needing to use our own custom version here. 11 12 * jit/ExecutableAllocator.cpp: 13 (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator): 14 (JSC::FixedVMPoolExecutableAllocator::memoryStart): 15 (JSC::FixedVMPoolExecutableAllocator::memoryEnd): 16 (JSC::FixedVMPoolExecutableAllocator::isJITPC): 17 (JSC::ExecutableAllocator::allocate): 18 (JSC::startOfFixedExecutableMemoryPoolImpl): 19 (JSC::endOfFixedExecutableMemoryPoolImpl): 20 (JSC::isJITPC): 21 * jit/ExecutableAllocator.h: 22 1 23 2018-10-04 Mark Lam <mark.lam@apple.com> 2 24 -
trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp
r236758 r236864 105 105 #endif 106 106 107 JS_EXPORT_PRIVATE void* taggedStartOfFixedExecutableMemoryPool;108 JS_EXPORT_PRIVATE void* taggedEndOfFixedExecutableMemoryPool;109 110 107 #if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E) 111 108 JS_EXPORT_PRIVATE bool useFastPermisionsJITCopy { false }; … … 169 166 170 167 void* reservationEnd = reinterpret_cast<uint8_t*>(reservationBase) + reservationSize; 171 taggedStartOfFixedExecutableMemoryPool = tagCodePtr<ExecutableMemoryPtrTag>(reservationBase); 172 taggedEndOfFixedExecutableMemoryPool = tagCodePtr<ExecutableMemoryPtrTag>(reservationEnd); 168 169 m_memoryStart = MacroAssemblerCodePtr<ExecutableMemoryPtrTag>(tagCodePtr<ExecutableMemoryPtrTag>(reservationBase)); 170 m_memoryEnd = MacroAssemblerCodePtr<ExecutableMemoryPtrTag>(tagCodePtr<ExecutableMemoryPtrTag>(reservationEnd)); 173 171 } 174 172 } 175 173 176 174 virtual ~FixedVMPoolExecutableAllocator(); 175 176 void* memoryStart() { return m_memoryStart.untaggedExecutableAddress(); } 177 void* memoryEnd() { return m_memoryEnd.untaggedExecutableAddress(); } 178 bool isJITPC(void* pc) { return memoryStart() <= pc && pc < memoryEnd(); } 177 179 178 180 protected: … … 359 361 private: 360 362 PageReservation m_reservation; 363 MacroAssemblerCodePtr<ExecutableMemoryPtrTag> m_memoryStart; 364 MacroAssemblerCodePtr<ExecutableMemoryPtrTag> m_memoryEnd; 361 365 }; 362 366 … … 462 466 463 467 #if USE(POINTER_PROFILING) 464 void* start = startOfFixedExecutableMemoryPool();465 void* end = endOfFixedExecutableMemoryPool();468 void* start = allocator->memoryStart(); 469 void* end = allocator->memoryEnd(); 466 470 void* resultStart = result->start().untaggedPtr(); 467 471 void* resultEnd = result->end().untaggedPtr(); 468 RELEASE_ASSERT(start == removeCodePtrTag(taggedStartOfFixedExecutableMemoryPool));469 RELEASE_ASSERT(end == removeCodePtrTag(taggedEndOfFixedExecutableMemoryPool));470 472 RELEASE_ASSERT(start <= resultStart && resultStart < end); 471 473 RELEASE_ASSERT(start < resultEnd && resultEnd <= end); … … 496 498 #endif 497 499 498 } 500 void* startOfFixedExecutableMemoryPoolImpl() 501 { 502 return allocator->memoryStart(); 503 } 504 505 void* endOfFixedExecutableMemoryPoolImpl() 506 { 507 return allocator->memoryEnd(); 508 } 509 510 bool isJITPC(void* pc) 511 { 512 return allocator->isJITPC(pc); 513 } 514 515 } // namespace JSC 499 516 500 517 #else // !ENABLE(JIT) -
trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h
r236758 r236864 62 62 #if ENABLE(JIT) 63 63 64 extern JS_EXPORT_PRIVATE void* taggedStartOfFixedExecutableMemoryPool;65 extern JS_EXPORT_PRIVATE void* taggedEndOfFixedExecutableMemoryPool;64 JS_EXPORT_PRIVATE void* startOfFixedExecutableMemoryPoolImpl(); 65 JS_EXPORT_PRIVATE void* endOfFixedExecutableMemoryPoolImpl(); 66 66 67 67 template<typename T = void*> 68 68 T startOfFixedExecutableMemoryPool() 69 69 { 70 return untagCodePtr<T, ExecutableMemoryPtrTag>(taggedStartOfFixedExecutableMemoryPool);70 return bitwise_cast<T>(startOfFixedExecutableMemoryPoolImpl()); 71 71 } 72 72 … … 74 74 T endOfFixedExecutableMemoryPool() 75 75 { 76 return untagCodePtr<T, ExecutableMemoryPtrTag>(taggedEndOfFixedExecutableMemoryPool);76 return bitwise_cast<T>(endOfFixedExecutableMemoryPoolImpl()); 77 77 } 78 78 79 inline bool isJITPC(void* pc) 80 { 81 return startOfFixedExecutableMemoryPool() <= pc && pc < endOfFixedExecutableMemoryPool(); 82 } 79 bool isJITPC(void* pc); 83 80 84 81 #if !ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)
Note:
See TracChangeset
for help on using the changeset viewer.