Issue #3049 - Disable native regexp JIT on loongarch64

This commit is contained in:
Basilisk-Dev 2026-04-24 11:47:52 -04:00 • committed by wuggy
commit 9d44c48014
4 changed files with 12 additions and 2 deletions

View file

@ -301,6 +301,11 @@ LoadContextOptions(const char* aPrefName, void* /* aClosure */)
useIon = false; useIon = false;
#endif #endif
bool useNativeRegExp = GetWorkerPref<bool>(NS_LITERAL_CSTRING("native_regexp"));
#if defined(JS_CODEGEN_LOONGARCH64)
useNativeRegExp = false;
#endif
JS::ContextOptions contextOptions; JS::ContextOptions contextOptions;
contextOptions.setAsmJS(useAsmJS) contextOptions.setAsmJS(useAsmJS)
.setWasm(useWasm) .setWasm(useWasm)
@ -308,7 +313,7 @@ LoadContextOptions(const char* aPrefName, void* /* aClosure */)
NS_LITERAL_CSTRING("throw_on_asmjs_validation_failure"))) NS_LITERAL_CSTRING("throw_on_asmjs_validation_failure")))
.setBaseline(GetWorkerPref<bool>(NS_LITERAL_CSTRING("baselinejit"))) .setBaseline(GetWorkerPref<bool>(NS_LITERAL_CSTRING("baselinejit")))
.setIon(useIon) .setIon(useIon)
.setNativeRegExp(GetWorkerPref<bool>(NS_LITERAL_CSTRING("native_regexp"))) .setNativeRegExp(useNativeRegExp)
.setAsyncStack(GetWorkerPref<bool>(NS_LITERAL_CSTRING("asyncstack"))) .setAsyncStack(GetWorkerPref<bool>(NS_LITERAL_CSTRING("asyncstack")))
.setWerror(GetWorkerPref<bool>(NS_LITERAL_CSTRING("werror"))) .setWerror(GetWorkerPref<bool>(NS_LITERAL_CSTRING("werror")))
.setStreams(GetWorkerPref<bool>(NS_LITERAL_CSTRING("streams"))) .setStreams(GetWorkerPref<bool>(NS_LITERAL_CSTRING("streams")))

View file

@ -1251,7 +1251,7 @@ SampleChars(FrequencyCollator* collator, const CharT* chars, size_t length)
static bool static bool
IsNativeRegExpEnabled(JSContext* cx) IsNativeRegExpEnabled(JSContext* cx)
{ {
#ifdef JS_CODEGEN_NONE #if defined(JS_CODEGEN_NONE) || defined(JS_CODEGEN_LOONGARCH64)
return false; return false;
#else #else
return cx->options().nativeRegExp(); return cx->options().nativeRegExp();

View file

@ -1426,6 +1426,7 @@ ReloadPrefsCallback(const char* pref, void* data)
useAsmJS = false; useAsmJS = false;
useWasm = false; useWasm = false;
useWasmBaseline = false; useWasmBaseline = false;
useNativeRegExp = false;
#endif #endif
bool parallelParsing = Preferences::GetBool(JS_OPTIONS_DOT_STR "parallel_parsing"); bool parallelParsing = Preferences::GetBool(JS_OPTIONS_DOT_STR "parallel_parsing");

View file

@ -1289,7 +1289,11 @@ pref("javascript.options.wasm_baselinejit", true);
#else #else
pref("javascript.options.wasm_baselinejit", false); pref("javascript.options.wasm_baselinejit", false);
#endif #endif
#ifdef JS_CODEGEN_LOONGARCH64
pref("javascript.options.native_regexp", false);
#else
pref("javascript.options.native_regexp", true); pref("javascript.options.native_regexp", true);
#endif
pref("javascript.options.parallel_parsing", true); pref("javascript.options.parallel_parsing", true);
// asyncstack is used for debugging promises in devtools. // asyncstack is used for debugging promises in devtools.
pref("javascript.options.asyncstack", false); pref("javascript.options.asyncstack", false);