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

View file

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

View file

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

View file

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