Changeset 37804 in webkit for trunk/JavaScriptCore
- Timestamp:
- Oct 22, 2008, 8:36:04 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r37799 r37804 1 2008-10-22 Oliver Hunt <[email protected]> 2 3 Reviewed by Maciej Stachowiak. 4 5 Really "fix" CTI mode on windows 2k3. 6 7 This adds new methods fastMallocExecutable and fastFreeExecutable 8 to wrap allocation for cti code. This still just makes fastMalloc 9 return executable memory all the time, which will be fixed in a 10 later patch. 11 12 However in windows debug builds all executable allocations will be 13 allocated on separate executable pages, which should resolve any 14 remaining 2k3 issues. Conveniently the 2k3 bot will now also fail 15 if there are any fastFree vs. fastFreeExecutable errors. 16 17 * ChangeLog: 18 * VM/CodeBlock.cpp: 19 (JSC::CodeBlock::~CodeBlock): 20 * kjs/regexp.cpp: 21 (JSC::RegExp::~RegExp): 22 * masm/X86Assembler.h: 23 (JSC::JITCodeBuffer::copy): 24 * wtf/FastMalloc.cpp: 25 (WTF::fastMallocExecutable): 26 (WTF::fastFreeExecutable): 27 (WTF::TCMallocStats::fastMallocExecutable): 28 (WTF::TCMallocStats::fastFreeExecutable): 29 * wtf/FastMalloc.h: 30 1 31 2008-10-22 Darin Adler <[email protected]> 2 32 -
trunk/JavaScriptCore/VM/CodeBlock.cpp
r37789 r37804 946 946 derefStructureIDs(&instructions[structureIDInstructions[i].opcodeIndex]); 947 947 if (structureIDInstructions[i].stubRoutine) 948 fastFree(structureIDInstructions[i].stubRoutine);948 WTF::fastFreeExecutable(structureIDInstructions[i].stubRoutine); 949 949 if (CallLinkInfo* callLinkInfo = structureIDInstructions[i].linkInfoPtr) { 950 950 callLinkInfo->callee->removeCaller(callLinkInfo); … … 957 957 958 958 if (ctiCode) 959 fastFree(ctiCode);959 WTF::fastFreeExecutable(ctiCode); 960 960 #endif 961 961 } -
trunk/JavaScriptCore/kjs/regexp.cpp
r37457 r37804 106 106 #if ENABLE(WREC) 107 107 if (m_wrecFunction) 108 fastFree(m_wrecFunction);108 WTF::fastFreeExecutable(m_wrecFunction); 109 109 #endif 110 110 } -
trunk/JavaScriptCore/masm/X86Assembler.h
r37670 r37804 31 31 #include <wtf/Assertions.h> 32 32 #include <wtf/AlwaysInline.h> 33 #include <wtf/FastMalloc.h> 34 33 35 #if HAVE(MMAN) 34 36 #include <sys/mman.h> … … 124 126 return 0; 125 127 126 void* result = fastMalloc(m_index);128 void* result = WTF::fastMallocExecutable(m_index); 127 129 128 130 if (!result) -
trunk/JavaScriptCore/wtf/FastMalloc.cpp
r36406 r37804 175 175 #if !PLATFORM(WIN_OS) 176 176 #include <pthread.h> 177 #else 178 #include "windows.h" 177 179 #endif 178 180 179 181 namespace WTF { 180 182 181 183 void* tryFastMalloc(size_t n) 182 184 { … … 231 233 232 234 void releaseFastMallocFreeMemory() { } 235 236 #if HAVE(VIRTUALALLOC) 237 void* fastMallocExecutable(size_t n) 238 { 239 return VirtualAlloc(0, n, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); 240 } 241 242 void fastFreeExecutable(void* p) 243 { 244 VirtualFree(p, 0, MEM_RELEASE); 245 } 246 #else 247 void* fastMallocExecutable(size_t n) 248 { 249 return fastMalloc(n); 250 } 251 252 void fastFreeExecutable(void* p) 253 { 254 fastFree(p); 255 } 256 #endif 233 257 234 258 } // namespace WTF … … 3360 3384 return old_ptr; 3361 3385 } 3386 } 3387 3388 void* fastMallocExecutable(size_t n) 3389 { 3390 return malloc<false>(n); 3391 } 3392 3393 void fastFreeExecutable(void* p) 3394 { 3395 free(p); 3362 3396 } 3363 3397 -
trunk/JavaScriptCore/wtf/FastMalloc.h
r35691 r37804 41 41 42 42 void fastFree(void* p); 43 44 void* fastMallocExecutable(size_t n); 45 void fastFreeExecutable(void* p); 43 46 44 47 #ifndef NDEBUG
Note:
See TracChangeset
for help on using the changeset viewer.