mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1028867 - Add a --latin1-strings shell flag. r=luke
This commit is contained in:
parent
78bfa0aa1c
commit
ac7f235c0f
@ -2958,7 +2958,7 @@ EvalInWorker(JSContext *cx, unsigned argc, jsval *vp)
|
||||
jschar *chars = (jschar *) js_malloc(str->length() * sizeof(jschar));
|
||||
if (!chars)
|
||||
return false;
|
||||
PodCopy(chars, str->chars(), str->length());
|
||||
CopyChars(chars, *str);
|
||||
|
||||
WorkerInput *input = js_new<WorkerInput>(cx->runtime(), chars, str->length());
|
||||
if (!input)
|
||||
@ -4528,6 +4528,11 @@ ToLatin1(JSContext *cx, unsigned argc, Value *vp)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].toString()->hasLatin1Chars()) {
|
||||
args.rval().set(args[0]);
|
||||
return true;
|
||||
}
|
||||
|
||||
JSLinearString *s = &args[0].toString()->asLinear();
|
||||
s->debugUnsafeConvertToLatin1();
|
||||
args.rval().setString(s);
|
||||
@ -6313,6 +6318,7 @@ main(int argc, char **argv, char **envp)
|
||||
"to test JIT codegen (no-op on platforms other than x86 and x64).")
|
||||
|| !op.addBoolOption('\0', "fuzzing-safe", "Don't expose functions that aren't safe for "
|
||||
"fuzzers to call")
|
||||
|| !op.addBoolOption('\0', "latin1-strings", "Enable Latin1 strings (default: off)")
|
||||
#ifdef DEBUG
|
||||
|| !op.addBoolOption('\0', "dump-entrained-variables", "Print variables which are "
|
||||
"unnecessarily entrained by inner functions")
|
||||
@ -6385,6 +6391,11 @@ main(int argc, char **argv, char **envp)
|
||||
|
||||
#endif // DEBUG
|
||||
|
||||
// Set this option before initializing the JSRuntime, so that Latin1 strings
|
||||
// are used for strings allocated during initialization.
|
||||
if (op.getBoolOption("latin1-strings"))
|
||||
js::EnableLatin1Strings = true;
|
||||
|
||||
#ifdef JS_THREADSAFE
|
||||
// The fake thread count must be set before initializing the Runtime,
|
||||
// which spins up the thread pool.
|
||||
|
@ -14,7 +14,7 @@ TBPL_FLAGS = [
|
||||
[], # no flags, normal baseline and ion
|
||||
['--ion-eager', '--ion-offthread-compile=off'], # implies --baseline-eager
|
||||
['--ion-eager', '--ion-offthread-compile=off', '--ion-check-range-analysis', '--no-sse3'],
|
||||
['--baseline-eager'],
|
||||
['--baseline-eager', '--latin1-strings'],
|
||||
['--baseline-eager', '--no-fpu'],
|
||||
['--no-baseline', '--no-ion'],
|
||||
]
|
||||
|
@ -868,6 +868,8 @@ AutoStableStringChars::initTwoByte(JSContext *cx, JSString *s)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool js::EnableLatin1Strings = false;
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
JSAtom::dump()
|
||||
|
@ -519,9 +519,6 @@ class JSString : public js::gc::BarrieredCell<JSString>
|
||||
void operator=(const JSString &other) MOZ_DELETE;
|
||||
};
|
||||
|
||||
/* Temporary flag to enable Latin1 strings (bug 998392). */
|
||||
static const bool EnableLatin1Strings = false;
|
||||
|
||||
class JSRope : public JSString
|
||||
{
|
||||
template <typename CharT>
|
||||
@ -1002,6 +999,9 @@ JS_STATIC_ASSERT(sizeof(JSAtom) == sizeof(JSString));
|
||||
|
||||
namespace js {
|
||||
|
||||
/* Temporary flag to enable Latin1 strings (bug 998392). */
|
||||
extern bool EnableLatin1Strings;
|
||||
|
||||
/*
|
||||
* Thread safe RAII wrapper for inspecting the contents of JSStrings. The
|
||||
* thread safe operations such as |getCharsNonDestructive| require allocation
|
||||
|
Loading…
Reference in New Issue
Block a user