]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - yarr/YarrJIT.h
JavaScriptCore-7600.1.4.9.tar.gz
[apple/javascriptcore.git] / yarr / YarrJIT.h
index 71928e73ce7dd4156c2e83551d63d3fea0a7738e..8ce1bf1b63c3ef031d84595444d74e2cc8936286 100644 (file)
 
 #if ENABLE(YARR_JIT)
 
-#include "JSGlobalData.h"
+#include "VM.h"
 #include "MacroAssemblerCodeRef.h"
 #include "MatchResult.h"
-#include "UString.h"
 #include "Yarr.h"
 #include "YarrPattern.h"
 
 
 namespace JSC {
 
-class JSGlobalData;
+class VM;
 class ExecutablePool;
 
 namespace Yarr {
 
 class YarrCodeBlock {
-#if CPU(X86_64)
+#if CPU(X86_64) || CPU(ARM64)
     typedef MatchResult (*YarrJITCode8)(const LChar* input, unsigned start, unsigned length, int* output) YARR_CALL;
     typedef MatchResult (*YarrJITCode16)(const UChar* input, unsigned start, unsigned length, int* output) YARR_CALL;
     typedef MatchResult (*YarrJITCodeMatchOnly8)(const LChar* input, unsigned start, unsigned length) YARR_CALL;
@@ -109,7 +108,37 @@ public:
     }
 
 #if ENABLE(REGEXP_TRACING)
-    void *getAddr() { return m_ref.code().executableAddress(); }
+    void *get8BitMatchOnlyAddr()
+    {
+        if (!has8BitCodeMatchOnly())
+            return 0;
+
+        return m_matchOnly8.code().executableAddress();
+    }
+
+    void *get16BitMatchOnlyAddr()
+    {
+        if (!has16BitCodeMatchOnly())
+            return 0;
+
+        return m_matchOnly16.code().executableAddress();
+    }
+
+    void *get8BitMatchAddr()
+    {
+        if (!has8BitCode())
+            return 0;
+
+        return m_ref8.code().executableAddress();
+    }
+
+    void *get16BitMatchAddr()
+    {
+        if (!has16BitCode())
+            return 0;
+
+        return m_ref16.code().executableAddress();
+    }
 #endif
 
     void clear()
@@ -133,7 +162,7 @@ enum YarrJITCompileMode {
     MatchOnly,
     IncludeSubpatterns
 };
-void jitCompile(YarrPattern&, YarrCharSize, JSGlobalData*, YarrCodeBlock& jitObject, YarrJITCompileMode = IncludeSubpatterns);
+void jitCompile(YarrPattern&, YarrCharSize, VM*, YarrCodeBlock& jitObject, YarrJITCompileMode = IncludeSubpatterns);
 
 } } // namespace JSC::Yarr