Source/JavaScriptCore/ChangeLog

 12017-06-27 Saam Barati <sbarati@apple.com>
 2
 3 JITStubRoutine::passesFilter should use isJITPC
 4 https://bugs.webkit.org/show_bug.cgi?id=173906
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 This patch makes JITStubRoutine use the isJITPC abstraction defined
 9 inside ExecutableAllocator.h. Before, JITStubRoutine would was using
 10 the harcoded platform size constant. This means it'd do the wrong thing
 11 if Options::jitMemoryReservationSize() was larger than the defined
 12 constant for that platform. This patch also removes up a bunch of
 13 dead code in that file.
 14
 15 * jit/ExecutableAllocator.cpp:
 16 * jit/ExecutableAllocator.h:
 17 * jit/JITStubRoutine.h:
 18 (JSC::JITStubRoutine::passesFilter):
 19 (JSC::JITStubRoutine::canPerformRangeFilter): Deleted.
 20 (JSC::JITStubRoutine::filteringStartAddress): Deleted.
 21 (JSC::JITStubRoutine::filteringExtentSize): Deleted.
 22
1232017-06-27 Caio Lima <ticaiolima@gmail.com>
224
325 [ESnext] Implement Object Rest - Implementing Object Rest Destructuring
218865

Source/JavaScriptCore/jit/ExecutableAllocator.cpp

@@using namespace WTF;
8282
8383namespace JSC {
8484
 85#if defined(FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB) && FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB > 0
 86static const size_t fixedExecutableMemoryPoolSize = FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB * 1024 * 1024;
 87#elif CPU(ARM)
 88static const size_t fixedExecutableMemoryPoolSize = 16 * 1024 * 1024;
 89#elif CPU(ARM64)
 90static const size_t fixedExecutableMemoryPoolSize = 64 * 1024 * 1024;
 91#elif CPU(X86_64)
 92static const size_t fixedExecutableMemoryPoolSize = 1024 * 1024 * 1024;
 93#else
 94static const size_t fixedExecutableMemoryPoolSize = 32 * 1024 * 1024;
 95#endif
 96
 97#if CPU(ARM)
 98static const double executablePoolReservationFraction = 0.15;
 99#else
 100static const double executablePoolReservationFraction = 0.25;
 101#endif
 102
85103JS_EXPORTDATA uintptr_t startOfFixedExecutableMemoryPool;
86104JS_EXPORTDATA uintptr_t endOfFixedExecutableMemoryPool;
87105JS_EXPORTDATA bool useFastPermisionsJITCopy { false };
218863

Source/JavaScriptCore/jit/ExecutableAllocator.h

@@typedef WTF::MetaAllocatorHandle Executa
6060
6161#if ENABLE(ASSEMBLER)
6262
63 #if defined(FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB) && FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB > 0
64 static const size_t fixedExecutableMemoryPoolSize = FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB * 1024 * 1024;
65 #elif CPU(ARM)
66 static const size_t fixedExecutableMemoryPoolSize = 16 * 1024 * 1024;
67 #elif CPU(ARM64)
68 static const size_t fixedExecutableMemoryPoolSize = 64 * 1024 * 1024;
69 #elif CPU(X86_64)
70 static const size_t fixedExecutableMemoryPoolSize = 1024 * 1024 * 1024;
71 #else
72 static const size_t fixedExecutableMemoryPoolSize = 32 * 1024 * 1024;
73 #endif
74 #if CPU(ARM)
75 static const double executablePoolReservationFraction = 0.15;
76 #else
77 static const double executablePoolReservationFraction = 0.25;
78 #endif
79 
8063extern JS_EXPORTDATA uintptr_t startOfFixedExecutableMemoryPool;
8164extern JS_EXPORTDATA uintptr_t endOfFixedExecutableMemoryPool;
8265
218863

Source/JavaScriptCore/jit/JITStubRoutine.h

@@public:
9696 uintptr_t endAddress() const { return m_code.executableMemory()->endAsInteger(); }
9797 static uintptr_t addressStep() { return jitAllocationGranule; }
9898
99  static bool canPerformRangeFilter()
100  {
101  return true;
102  }
103  static uintptr_t filteringStartAddress()
104  {
105  return startOfFixedExecutableMemoryPool;
106  }
107  static size_t filteringExtentSize()
108  {
109  return fixedExecutableMemoryPoolSize;
110  }
11199 static bool passesFilter(uintptr_t address)
112100 {
113  if (!canPerformRangeFilter()) {
114  // Just check that the address doesn't use any special values that would make
115  // our hashtables upset.
116  return address >= jitAllocationGranule && address != std::numeric_limits<uintptr_t>::max();
117  }
118 
119  if (address - filteringStartAddress() >= filteringExtentSize())
120  return false;
121 
122  return true;
 101 return isJITPC(bitwise_cast<void*>(address));
123102 }
124103
125104 // Return true if you are still valid after. Return false if you are now invalid. If you return
218863