Changeset 37457 in webkit
- Timestamp:
- Oct 9, 2008 5:50:25 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r37403 r37457 1 2008-10-09 Alp Toker <alp@nuanti.com> 2 3 Reviewed by Mark Rowe. 4 5 https://bugs.webkit.org/show_bug.cgi?id=20760 6 Implement support for x86 Linux in CTI 7 8 Prepare to enable CTI/WREC on supported architectures. Will be 9 switched on when the crasher introduced in r37386 is resolved. 10 11 * configure.ac: 12 1 13 2008-10-07 Alp Toker <alp@nuanti.com> 2 14 -
trunk/JavaScriptCore/ChangeLog
r37453 r37457 1 2008-10-09 Alp Toker <alp@nuanti.com> 2 3 Reviewed by Mark Rowe. 4 5 https://bugs.webkit.org/show_bug.cgi?id=20760 6 Implement support for x86 Linux in CTI 7 8 Prepare to enable CTI/WREC on supported architectures. 9 10 Make it possible to use the CTI_ARGUMENT workaround with GCC as well 11 as MSVC by fixing some preprocessor conditionals. 12 13 Note that CTI/WREC no longer requires CTI_ARGUMENT on Linux so we 14 don't actually enable it except when building with MSVC. GCC on Win32 15 remains untested. 16 17 Adapt inline ASM code to use the global symbol underscore prefix only 18 on Darwin and to call the properly mangled Machine::cti_vm_throw 19 symbol name depending on CTI_ARGUMENT. 20 21 Also avoid global inclusion of the JIT infrastructure headers 22 throughout WebCore and WebKit causing recompilation of about ~1500 23 source files after modification to X86Assembler.h, CTI.h, WREC.h, 24 which are only used deep inside JavaScriptCore. 25 26 * GNUmakefile.am: 27 * VM/CTI.cpp: 28 * VM/CTI.h: 29 * VM/Machine.cpp: 30 * VM/Machine.h: 31 * kjs/regexp.cpp: 32 (JSC::RegExp::RegExp): 33 (JSC::RegExp::~RegExp): 34 (JSC::RegExp::match): 35 * kjs/regexp.h: 36 * masm/X86Assembler.h: 37 (JSC::X86Assembler::emitConvertToFastCall): 38 (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline): 39 (JSC::X86Assembler::emitRestoreArgumentReference): 40 1 41 2008-10-09 Gavin Barraclough <barraclough@apple.com> 2 42 -
trunk/JavaScriptCore/GNUmakefile.am
r36989 r37457 3 3 -I$(srcdir)/JavaScriptCore/ForwardingHeaders \ 4 4 -I$(srcdir)/JavaScriptCore/VM \ 5 -I$(srcdir)/JavaScriptCore/pcre \ 5 6 -I$(srcdir)/JavaScriptCore/profiler \ 6 7 -I$(srcdir)/JavaScriptCore/wtf/unicode \ … … 63 64 JavaScriptCore/ForwardingHeaders/JavaScriptCore/WebKitAvailability.h \ 64 65 JavaScriptCore/JavaScriptCorePrefix.h \ 66 JavaScriptCore/VM/CTI.cpp \ 67 JavaScriptCore/VM/CTI.h \ 65 68 JavaScriptCore/VM/CodeBlock.cpp \ 66 69 JavaScriptCore/VM/CodeBlock.h \ … … 200 203 JavaScriptCore/kjs/regexp.h \ 201 204 JavaScriptCore/kjs/ustring.h \ 205 JavaScriptCore/masm/X86Assembler.h \ 202 206 JavaScriptCore/os-win32/stdbool.h \ 203 207 JavaScriptCore/os-win32/stdint.h \ … … 223 227 JavaScriptCore/profiler/TreeProfile.cpp \ 224 228 JavaScriptCore/profiler/TreeProfile.h \ 229 JavaScriptCore/wrec/CharacterClassConstructor.cpp \ 230 JavaScriptCore/wrec/CharacterClassConstructor.h \ 231 JavaScriptCore/wrec/WREC.cpp \ 232 JavaScriptCore/wrec/WREC.h \ 225 233 JavaScriptCore/wtf/ASCIICType.h \ 226 234 JavaScriptCore/wtf/AVLTree.h \ -
trunk/JavaScriptCore/VM/CTI.cpp
r37453 r37457 85 85 #if COMPILER(GCC) && PLATFORM(X86) 86 86 87 #if PLATFORM(DARWIN) 88 #define SYMBOL_STRING(name) "_" #name 89 #else 90 #define SYMBOL_STRING(name) #name 91 #endif 92 87 93 asm( 88 ".globl _ctiTrampoline""\n"89 "_ctiTrampoline:" "\n"94 ".globl " SYMBOL_STRING(ctiTrampoline) "\n" 95 SYMBOL_STRING(ctiTrampoline) ":" "\n" 90 96 "pushl %esi" "\n" 91 97 "pushl %edi" "\n" … … 101 107 102 108 asm( 103 ".globl _ctiVMThrowTrampoline" "\n" 104 "_ctiVMThrowTrampoline:" "\n" 105 "call __ZN3JSC7Machine12cti_vm_throwEPv" "\n" 109 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" 110 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" 111 #if USE(CTI_ARGUMENT) 112 "call " SYMBOL_STRING(_ZN3JSC7Machine12cti_vm_throwEPPv) "\n" 113 #else 114 "call " SYMBOL_STRING(_ZN3JSC7Machine12cti_vm_throwEPv) "\n" 115 #endif 106 116 "addl $0x24, %esp" "\n" 107 117 "popl %edi" "\n" -
trunk/JavaScriptCore/VM/CTI.h
r37453 r37457 31 31 #define WTF_USE_CTI_REPATCH_PIC 1 32 32 33 #include "Machine.h" 33 34 #include "Opcode.h" 34 35 #include "RegisterFile.h" … … 37 38 #include <wtf/AlwaysInline.h> 38 39 #include <wtf/Vector.h> 39 40 #if COMPILER(MSVC)41 #define CTI_ARGS void** args42 #define ARGS (args)43 #else44 #define CTI_ARGS void* args45 #define ARGS (&args)46 #endif47 40 48 41 #define CTI_ARGS_code 0x0C … … 103 96 struct OperandTypes; 104 97 105 struct VoidPtrPair { void* first; void* second; };106 107 #if COMPILER(MSVC)108 109 #if USE(FAST_CALL_CTI_ARGUMENT)110 #define SFX_CALL __fastcall111 #else112 #define SFX_CALL __cdecl113 #endif114 115 #else116 #define SFX_CALL117 #endif118 119 98 typedef JSValue* (SFX_CALL *CTIHelper_j)(CTI_ARGS); 120 99 typedef JSPropertyNameIterator* (SFX_CALL *CTIHelper_p)(CTI_ARGS); -
trunk/JavaScriptCore/VM/Machine.cpp
r37441 r37457 56 56 #include "SamplingTool.h" 57 57 #include <stdio.h> 58 59 #if ENABLE(CTI) 60 #include "CTI.h" 61 #endif 58 62 59 63 #if PLATFORM(DARWIN) -
trunk/JavaScriptCore/VM/Machine.h
r37433 r37457 37 37 #include <wtf/HashMap.h> 38 38 39 #if ENABLE(CTI)40 #include "CTI.h"41 #endif42 43 39 namespace JSC { 44 40 … … 48 44 class Instruction; 49 45 class InternalFunction; 46 class JITCodeBuffer; 50 47 class JSFunction; 51 48 class JSGlobalObject; … … 54 51 class ScopeChainNode; 55 52 class SamplingTool; 53 54 #if ENABLE(CTI) 55 56 #if USE(CTI_ARGUMENT) 57 #define CTI_ARGS void** args 58 #define ARGS (args) 59 #else 60 #define CTI_ARGS void* args 61 #define ARGS (&args) 62 #endif 63 64 #if COMPILER(MSVC) 65 #if USE(FAST_CALL_CTI_ARGUMENT) 66 #define SFX_CALL __fastcall 67 #else 68 #define SFX_CALL __cdecl 69 #endif 70 #else 71 #define SFX_CALL 72 73 #endif 74 75 struct VoidPtrPair { void* first; void* second; }; 76 #endif 56 77 57 78 enum DebugHookID { -
trunk/JavaScriptCore/kjs/regexp.cpp
r37433 r37457 28 28 #include <stdlib.h> 29 29 #include <string.h> 30 #include <wrec/WREC.h> 30 31 #include <wtf/Assertions.h> 31 32 #include <wtf/OwnArrayPtr.h> … … 41 42 { 42 43 #if ENABLE(WREC) 43 m_wrecFunction = reinterpret_cast<WRECFunction>(CTI::compileRegExp(globalData->machine, pattern, &m_numSubpatterns, &m_constructionError));44 m_wrecFunction = CTI::compileRegExp(globalData->machine, pattern, &m_numSubpatterns, &m_constructionError); 44 45 if (m_wrecFunction) 45 46 return; … … 84 85 85 86 #if ENABLE(WREC) 86 m_wrecFunction = reinterpret_cast<WRECFunction>(CTI::compileRegExp(globalData->machine, pattern, &m_numSubpatterns, &m_constructionError, (m_flagBits & IgnoreCase), (m_flagBits & Multiline)));87 m_wrecFunction = CTI::compileRegExp(globalData->machine, pattern, &m_numSubpatterns, &m_constructionError, (m_flagBits & IgnoreCase), (m_flagBits & Multiline)); 87 88 if (m_wrecFunction) 88 89 return; … … 105 106 #if ENABLE(WREC) 106 107 if (m_wrecFunction) 107 fastFree( reinterpret_cast<void*>(m_wrecFunction));108 fastFree(m_wrecFunction); 108 109 #endif 109 110 } … … 132 133 ovector->set(offsetVector); 133 134 134 int result = m_wrecFunction(s.data(), i, s.size(), offsetVector);135 int result = reinterpret_cast<WRECFunction>(m_wrecFunction)(s.data(), i, s.size(), offsetVector); 135 136 136 137 if (result < 0) { -
trunk/JavaScriptCore/kjs/regexp.h
r37433 r37457 25 25 #include <wtf/Forward.h> 26 26 #include <wtf/RefCounted.h> 27 #include <wrec/WREC.h>28 27 29 28 struct JSRegExp; … … 68 67 69 68 #if ENABLE(WREC) 70 WRECFunction m_wrecFunction; 69 // Called as a WRECFunction 70 void* m_wrecFunction; 71 71 #endif 72 72 }; -
trunk/JavaScriptCore/masm/X86Assembler.h
r37453 r37457 1055 1055 } 1056 1056 1057 #if USE(CTI_ARGUMENT)1057 #if COMPILER(MSVC) 1058 1058 void emitConvertToFastCall() 1059 1059 { … … 1062 1062 movl_mr(12, X86::esp, X86::ecx); 1063 1063 } 1064 1064 #else 1065 void emitConvertToFastCall() {} 1066 #endif 1067 1068 #if USE(CTI_ARGUMENT) 1065 1069 void emitRestoreArgumentReference() 1066 1070 { … … 1077 1081 movl_rr(X86::esp, X86::ecx); 1078 1082 addl_i32r(4, X86::ecx); 1083 #endif 1084 } 1079 1085 #else 1080 #endif 1081 } 1082 #else 1083 void emitConvertToFastCall() {}; 1084 void emitRestoreArgumentReference() {}; 1085 void emitRestoreArgumentReferenceForTrampoline() {}; 1086 void emitRestoreArgumentReference() {} 1087 void emitRestoreArgumentReferenceForTrampoline() {} 1086 1088 #endif 1087 1089 -
trunk/configure.ac
r37022 r37457 8 8 9 9 AC_CONFIG_HEADERS([autotoolsconfig.h]) 10 AC_CANONICAL_SYSTEM 10 11 11 12 WEBKIT_MAJOR_VERSION=webkit_major_version … … 24 25 25 26 AM_INIT_AUTOMAKE([foreign subdir-objects]) 26 27 AC_CANONICAL_HOST28 27 29 28 # host checking - inspired by the GTK+ configure.in … … 502 501 AC_MSG_RESULT([$enable_fast_malloc]) 503 502 503 AC_MSG_CHECKING([whether to enable JIT compilation]) 504 AC_ARG_ENABLE([jit], 505 AC_HELP_STRING([--enable-jit], 506 [Enable JIT compilation default=no]), 507 [],[enable_jit="no"]) 508 if test "$enable_jit" = "yes"; then 509 case "$target_cpu" in 510 i*86) 511 AC_DEFINE([ENABLE_CTI], [1], [Define to enable CTI]) 512 AC_DEFINE([ENABLE_WREC], [1], [Define to enable WREC]) 513 ;; 514 *) 515 enable_jit="no (CPU '$target_cpu' not supported)" 516 ;; 517 esac 518 fi 519 AC_MSG_RESULT([$enable_jit]) 520 504 521 # determine the font backend 505 522 AC_MSG_CHECKING([the font backend to use]) … … 659 676 Optimized memory allocator : $enable_fast_malloc 660 677 Features: 678 JIT compilation : $enable_jit 661 679 Dashboard support : $enable_dashboard_support 662 680 HTML5 offline web applications support : $enable_offline_web_applications
Note: See TracChangeset
for help on using the changeset viewer.