Title: [115697] trunk/Source/_javascript_Core
Revision
115697
Author
[email protected]
Date
2012-04-30 18:20:54 -0700 (Mon, 30 Apr 2012)

Log Message

Should be able to use YARR JIT without the JS language JIT
https://bugs.webkit.org/show_bug.cgi?id=85252

Reviewed by Geoff Garen.

Need to split canUseRegExpJIT out of canUseJIT.

* runtime/JSGlobalData.cpp:
(JSC):
(JSC::useJIT):
(JSC::JSGlobalData::JSGlobalData):
    - replace m_canUseJIT with m_canUseAssembler
* runtime/JSGlobalData.h:
(JSGlobalData):
(JSC::JSGlobalData::canUseRegExpJIT):
    - Added canUseRegExpJIT, distinct from canUseJIT.
* runtime/RegExp.cpp:
(JSC::RegExp::compile):
(JSC::RegExp::compileMatchOnly):
    - Call canUseRegExpJIT instead of canUseJIT.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (115696 => 115697)


--- trunk/Source/_javascript_Core/ChangeLog	2012-05-01 01:10:35 UTC (rev 115696)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-05-01 01:20:54 UTC (rev 115697)
@@ -1,5 +1,28 @@
 2012-04-30  Gavin Barraclough  <[email protected]>
 
+        Should be able to use YARR JIT without the JS language JIT
+        https://bugs.webkit.org/show_bug.cgi?id=85252
+
+        Reviewed by Geoff Garen.
+
+        Need to split canUseRegExpJIT out of canUseJIT.
+
+        * runtime/JSGlobalData.cpp:
+        (JSC):
+        (JSC::useJIT):
+        (JSC::JSGlobalData::JSGlobalData):
+            - replace m_canUseJIT with m_canUseAssembler
+        * runtime/JSGlobalData.h:
+        (JSGlobalData):
+        (JSC::JSGlobalData::canUseRegExpJIT):
+            - Added canUseRegExpJIT, distinct from canUseJIT.
+        * runtime/RegExp.cpp:
+        (JSC::RegExp::compile):
+        (JSC::RegExp::compileMatchOnly):
+            - Call canUseRegExpJIT instead of canUseJIT.
+
+2012-04-30  Gavin Barraclough  <[email protected]>
+
         Should be able to build YARR JIT without the JS language JIT
         https://bugs.webkit.org/show_bug.cgi?id=85242
 

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp (115696 => 115697)


--- trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp	2012-05-01 01:10:35 UTC (rev 115696)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp	2012-05-01 01:20:54 UTC (rev 115697)
@@ -88,6 +88,31 @@
 extern const HashTable stringTable;
 extern const HashTable stringConstructorTable;
 
+#if ENABLE(ASSEMBLER) && (ENABLE(CLASSIC_INTERPRETER) || ENABLE(LLINT))
+static bool enableAssembler(ExecutableAllocator& executableAllocator)
+{
+    if (!executableAllocator.isValid() || !Options::useJIT)
+        return false;
+
+#if USE(CF)
+    CFStringRef canUseJITKey = CFStringCreateWithCString(0 , "_javascript_CoreUseJIT", kCFStringEncodingMacRoman);
+    CFBooleanRef canUseJIT = (CFBooleanRef)CFPreferencesCopyAppValue(canUseJITKey, kCFPreferencesCurrentApplication);
+    if (canUseJIT) {
+        return kCFBooleanTrue == canUseJIT;
+        CFRelease(canUseJIT);
+    }
+    CFRelease(canUseJITKey);
+#endif
+
+#if USE(CF) || OS(UNIX)
+    char* canUseJITString = getenv("_javascript_CoreUseJIT");
+    return !canUseJITString || atoi(canUseJITString);
+#else
+    return true;
+#endif
+}
+#endif
+
 JSGlobalData::JSGlobalData(GlobalDataType globalDataType, ThreadStackType threadStackType, HeapSize heapSize)
     : heap(this, heapSize)
     , globalDataType(globalDataType)
@@ -138,6 +163,9 @@
 #if CPU(X86) && ENABLE(JIT)
     , m_timeoutCount(512)
 #endif
+#if ENABLE(ASSEMBLER) && (ENABLE(CLASSIC_INTERPRETER) || ENABLE(LLINT))
+    , m_canUseAssembler(enableAssembler(executableAllocator))
+#endif
 #if ENABLE(GC_VALIDATION)
     , m_initializingObjectClass(0)
 #endif
@@ -171,33 +199,7 @@
 
     wtfThreadData().setCurrentIdentifierTable(existingEntryIdentifierTable);
 
-#if ENABLE(JIT) && (ENABLE(CLASSIC_INTERPRETER) || ENABLE(LLINT))
-#if USE(CF)
-    CFStringRef canUseJITKey = CFStringCreateWithCString(0 , "_javascript_CoreUseJIT", kCFStringEncodingMacRoman);
-    CFBooleanRef canUseJIT = (CFBooleanRef)CFPreferencesCopyAppValue(canUseJITKey, kCFPreferencesCurrentApplication);
-    if (canUseJIT) {
-        m_canUseJIT = kCFBooleanTrue == canUseJIT;
-        CFRelease(canUseJIT);
-    } else {
-      char* canUseJITString = getenv("_javascript_CoreUseJIT");
-      m_canUseJIT = !canUseJITString || atoi(canUseJITString);
-    }
-    CFRelease(canUseJITKey);
-#elif OS(UNIX)
-    char* canUseJITString = getenv("_javascript_CoreUseJIT");
-    m_canUseJIT = !canUseJITString || atoi(canUseJITString);
-#else
-    m_canUseJIT = true;
-#endif
-#endif
 #if ENABLE(JIT)
-#if ENABLE(CLASSIC_INTERPRETER) || ENABLE(LLINT)
-    if (m_canUseJIT)
-        m_canUseJIT = executableAllocator.isValid();
-    
-    if (!Options::useJIT)
-        m_canUseJIT = false;
-#endif
     jitStubs = adoptPtr(new JITThunks(this));
 #endif
     

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.h (115696 => 115697)


--- trunk/Source/_javascript_Core/runtime/JSGlobalData.h	2012-05-01 01:10:35 UTC (rev 115696)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.h	2012-05-01 01:20:54 UTC (rev 115697)
@@ -236,9 +236,17 @@
 #elif !ENABLE(CLASSIC_INTERPRETER) && !ENABLE(LLINT)
         bool canUseJIT() { return true; } // jit only
 #else
-        bool canUseJIT() { return m_canUseJIT; }
+        bool canUseJIT() { return m_canUseAssembler; }
 #endif
 
+#if !ENABLE(YARR_JIT)
+        bool canUseRegExpJIT() { return false; } // interpreter only
+#elif !ENABLE(CLASSIC_INTERPRETER) && !ENABLE(LLINT)
+        bool canUseRegExpJIT() { return true; } // jit only
+#else
+        bool canUseRegExpJIT() { return m_canUseAssembler; }
+#endif
+
         OwnPtr<ParserArena> parserArena;
         OwnPtr<Keywords> keywords;
         Interpreter* interpreter;
@@ -368,8 +376,8 @@
         JSGlobalData(GlobalDataType, ThreadStackType, HeapSize);
         static JSGlobalData*& sharedInstanceInternal();
         void createNativeThunk();
-#if ENABLE(JIT) && (ENABLE(CLASSIC_INTERPRETER) || ENABLE(LLINT))
-        bool m_canUseJIT;
+#if ENABLE(ASSEMBLER) && (ENABLE(CLASSIC_INTERPRETER) || ENABLE(LLINT))
+        bool m_canUseAssembler;
 #endif
 #if ENABLE(GC_VALIDATION)
         const ClassInfo* m_initializingObjectClass;

Modified: trunk/Source/_javascript_Core/runtime/RegExp.cpp (115696 => 115697)


--- trunk/Source/_javascript_Core/runtime/RegExp.cpp	2012-05-01 01:10:35 UTC (rev 115696)
+++ trunk/Source/_javascript_Core/runtime/RegExp.cpp	2012-05-01 01:20:54 UTC (rev 115697)
@@ -279,7 +279,7 @@
     }
 
 #if ENABLE(YARR_JIT)
-    if (!pattern.m_containsBackreferences && globalData->canUseJIT()) {
+    if (!pattern.m_containsBackreferences && globalData->canUseRegExpJIT()) {
         Yarr::jitCompile(pattern, charSize, globalData, m_regExpJITCode);
 #if ENABLE(YARR_JIT_DEBUG)
         if (!m_regExpJITCode.isFallBack())
@@ -401,7 +401,7 @@
     }
 
 #if ENABLE(YARR_JIT)
-    if (!pattern.m_containsBackreferences && globalData->canUseJIT()) {
+    if (!pattern.m_containsBackreferences && globalData->canUseRegExpJIT()) {
         Yarr::jitCompile(pattern, charSize, globalData, m_regExpJITCode, Yarr::MatchOnly);
 #if ENABLE(YARR_JIT_DEBUG)
         if (!m_regExpJITCode.isFallBack())
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to