mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 16:58:38 +09:00
Issue #2692 - Part 7: De-globalize {*}CompileOptions.
Make all users of the various *CompileOptions classes #include "js/CompileOptions.h" so that nothing but that file has to know about these classes having a JS_PUBLIC_API on them, that would have to be present in forward-declarations.
This commit is contained in:
parent
2e4620b5af
commit
5fd304507d
27 changed files with 89 additions and 52 deletions
|
|
@ -162,6 +162,8 @@ class JS_FRIEND_API(TransitiveCompileOptions)
|
|||
void operator=(const TransitiveCompileOptions&) = delete;
|
||||
};
|
||||
|
||||
class JS_PUBLIC_API(CompileOptions);
|
||||
|
||||
/**
|
||||
* The class representing a full set of compile options.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -108,12 +108,8 @@ using JS::GCHashSet;
|
|||
|
||||
using JS::CallArgs;
|
||||
using JS::CallNonGenericMethod;
|
||||
using JS::CompileOptions;
|
||||
using JS::IsAcceptableThis;
|
||||
using JS::NativeImpl;
|
||||
using JS::OwningCompileOptions;
|
||||
using JS::ReadOnlyCompileOptions;
|
||||
using JS::TransitiveCompileOptions;
|
||||
|
||||
using JS::Rooted;
|
||||
using JS::RootedFunction;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ using mozilla::HashString;
|
|||
using mozilla::RangedPtr;
|
||||
|
||||
using JS::AutoCheckCannotGC;
|
||||
using JS::CompileOptions;
|
||||
using JS::SourceBufferHolder;
|
||||
|
||||
// We should be able to assert this for *any* fp->environmentChain().
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ using namespace js;
|
|||
using namespace js::frontend;
|
||||
|
||||
using JS::AutoValueArray;
|
||||
using JS::CompileOptions;
|
||||
using mozilla::ArrayLength;
|
||||
using mozilla::DebugOnly;
|
||||
using mozilla::Forward;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ using mozilla::Maybe;
|
|||
|
||||
using CapturesVector = GCVector<Value, 4>;
|
||||
|
||||
using JS::CompileOptions;
|
||||
|
||||
// Allocate an object for the |.groups| or |.indices.groups| property
|
||||
// of a regexp match result.
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ using namespace js::frontend;
|
|||
using mozilla::Maybe;
|
||||
using mozilla::Nothing;
|
||||
|
||||
using JS::CompileOptions;
|
||||
using JS::ReadOnlyCompileOptions;
|
||||
using JS::SourceBufferHolder;
|
||||
|
||||
class MOZ_STACK_CLASS AutoCompilationTraceLogger
|
||||
|
|
@ -597,7 +599,7 @@ frontend::CompileEvalScript(ExclusiveContext* cx, LifoAlloc& alloc,
|
|||
}
|
||||
|
||||
ModuleObject*
|
||||
frontend::CompileModule(ExclusiveContext* cx, const ReadOnlyCompileOptions& optionsInput,
|
||||
frontend::CompileModule(ExclusiveContext* cx, const JS::ReadOnlyCompileOptions& optionsInput,
|
||||
SourceBufferHolder& srcBuf, LifoAlloc& alloc,
|
||||
ScriptSourceObject** sourceObjectOut /* = nullptr */)
|
||||
{
|
||||
|
|
@ -640,7 +642,7 @@ frontend::CompileLazyFunction(JSContext* cx, Handle<LazyScript*> lazy, const cha
|
|||
{
|
||||
MOZ_ASSERT(cx->compartment() == lazy->functionNonDelazifying()->compartment());
|
||||
|
||||
CompileOptions options(cx, lazy->version());
|
||||
JS::CompileOptions options(cx, lazy->version());
|
||||
options.setMutedErrors(lazy->mutedErrors())
|
||||
.setFileAndLine(lazy->filename(), lazy->lineno())
|
||||
.setColumn(lazy->column())
|
||||
|
|
@ -706,7 +708,7 @@ frontend::CompileLazyFunction(JSContext* cx, Handle<LazyScript*> lazy, const cha
|
|||
|
||||
bool
|
||||
frontend::CompileStandaloneFunction(JSContext* cx, MutableHandleFunction fun,
|
||||
const ReadOnlyCompileOptions& options,
|
||||
const JS::ReadOnlyCompileOptions& options,
|
||||
JS::SourceBufferHolder& srcBuf,
|
||||
Maybe<uint32_t> parameterListEnd,
|
||||
HandleScope enclosingScope /* = nullptr */)
|
||||
|
|
@ -722,7 +724,7 @@ frontend::CompileStandaloneFunction(JSContext* cx, MutableHandleFunction fun,
|
|||
|
||||
bool
|
||||
frontend::CompileStandaloneGenerator(JSContext* cx, MutableHandleFunction fun,
|
||||
const ReadOnlyCompileOptions& options,
|
||||
const JS::ReadOnlyCompileOptions& options,
|
||||
JS::SourceBufferHolder& srcBuf,
|
||||
Maybe<uint32_t> parameterListEnd)
|
||||
{
|
||||
|
|
@ -735,7 +737,7 @@ frontend::CompileStandaloneGenerator(JSContext* cx, MutableHandleFunction fun,
|
|||
|
||||
bool
|
||||
frontend::CompileStandaloneAsyncFunction(JSContext* cx, MutableHandleFunction fun,
|
||||
const ReadOnlyCompileOptions& options,
|
||||
const JS::ReadOnlyCompileOptions& options,
|
||||
JS::SourceBufferHolder& srcBuf,
|
||||
Maybe<uint32_t> parameterListEnd)
|
||||
{
|
||||
|
|
@ -748,7 +750,7 @@ frontend::CompileStandaloneAsyncFunction(JSContext* cx, MutableHandleFunction fu
|
|||
|
||||
bool
|
||||
frontend::CompileStandaloneAsyncGenerator(JSContext* cx, MutableHandleFunction fun,
|
||||
const ReadOnlyCompileOptions& options,
|
||||
const JS::ReadOnlyCompileOptions& options,
|
||||
JS::SourceBufferHolder& srcBuf,
|
||||
Maybe<uint32_t> parameterListEnd)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include "NamespaceImports.h"
|
||||
|
||||
#include "js/CompileOptions.h"
|
||||
#include "vm/Scope.h"
|
||||
#include "vm/String.h"
|
||||
|
||||
|
|
@ -27,7 +28,7 @@ namespace frontend {
|
|||
|
||||
JSScript*
|
||||
CompileGlobalScript(ExclusiveContext* cx, LifoAlloc& alloc, ScopeKind scopeKind,
|
||||
const ReadOnlyCompileOptions& options,
|
||||
const JS::ReadOnlyCompileOptions& options,
|
||||
JS::SourceBufferHolder& srcBuf,
|
||||
SourceCompressionTask* extraSct = nullptr,
|
||||
ScriptSourceObject** sourceObjectOut = nullptr);
|
||||
|
|
@ -35,17 +36,17 @@ CompileGlobalScript(ExclusiveContext* cx, LifoAlloc& alloc, ScopeKind scopeKind,
|
|||
JSScript*
|
||||
CompileEvalScript(ExclusiveContext* cx, LifoAlloc& alloc,
|
||||
HandleObject scopeChain, HandleScope enclosingScope,
|
||||
const ReadOnlyCompileOptions& options,
|
||||
const JS::ReadOnlyCompileOptions& options,
|
||||
JS::SourceBufferHolder& srcBuf,
|
||||
SourceCompressionTask* extraSct = nullptr,
|
||||
ScriptSourceObject** sourceObjectOut = nullptr);
|
||||
|
||||
ModuleObject*
|
||||
CompileModule(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
CompileModule(JSContext* cx, const JS::ReadOnlyCompileOptions& options,
|
||||
JS::SourceBufferHolder& srcBuf);
|
||||
|
||||
ModuleObject*
|
||||
CompileModule(ExclusiveContext* cx, const ReadOnlyCompileOptions& options,
|
||||
CompileModule(ExclusiveContext* cx, const JS::ReadOnlyCompileOptions& options,
|
||||
JS::SourceBufferHolder& srcBuf, LifoAlloc& alloc,
|
||||
ScriptSourceObject** sourceObjectOut = nullptr);
|
||||
|
||||
|
|
@ -66,36 +67,36 @@ CompileLazyFunction(JSContext* cx, Handle<LazyScript*> lazy, const char16_t* cha
|
|||
//
|
||||
MOZ_MUST_USE bool
|
||||
CompileStandaloneFunction(JSContext* cx, MutableHandleFunction fun,
|
||||
const ReadOnlyCompileOptions& options,
|
||||
const JS::ReadOnlyCompileOptions& options,
|
||||
JS::SourceBufferHolder& srcBuf,
|
||||
mozilla::Maybe<uint32_t> parameterListEnd,
|
||||
HandleScope enclosingScope = nullptr);
|
||||
|
||||
MOZ_MUST_USE bool
|
||||
CompileStandaloneGenerator(JSContext* cx, MutableHandleFunction fun,
|
||||
const ReadOnlyCompileOptions& options,
|
||||
const JS::ReadOnlyCompileOptions& options,
|
||||
JS::SourceBufferHolder& srcBuf,
|
||||
mozilla::Maybe<uint32_t> parameterListEnd);
|
||||
|
||||
MOZ_MUST_USE bool
|
||||
CompileStandaloneAsyncFunction(JSContext* cx, MutableHandleFunction fun,
|
||||
const ReadOnlyCompileOptions& options,
|
||||
const JS::ReadOnlyCompileOptions& options,
|
||||
JS::SourceBufferHolder& srcBuf,
|
||||
mozilla::Maybe<uint32_t> parameterListEnd);
|
||||
|
||||
MOZ_MUST_USE bool
|
||||
CompileStandaloneAsyncGenerator(JSContext* cx, MutableHandleFunction fun,
|
||||
const ReadOnlyCompileOptions& options,
|
||||
const JS::ReadOnlyCompileOptions& options,
|
||||
JS::SourceBufferHolder& srcBuf,
|
||||
mozilla::Maybe<uint32_t> parameterListEnd);
|
||||
|
||||
MOZ_MUST_USE bool
|
||||
CompileAsyncFunctionBody(JSContext* cx, MutableHandleFunction fun,
|
||||
const ReadOnlyCompileOptions& options,
|
||||
const JS::ReadOnlyCompileOptions& options,
|
||||
Handle<PropertyNameVector> formals, JS::SourceBufferHolder& srcBuf);
|
||||
|
||||
ScriptSourceObject*
|
||||
CreateScriptSourceObject(ExclusiveContext* cx, const ReadOnlyCompileOptions& options,
|
||||
CreateScriptSourceObject(ExclusiveContext* cx, const JS::ReadOnlyCompileOptions& options,
|
||||
mozilla::Maybe<uint32_t> parameterListEnd = mozilla::Nothing());
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
#include "frontend/TDZCheckCache.h"
|
||||
#include "frontend/TokenStream.h"
|
||||
#include "frontend/TryEmitter.h"
|
||||
#include "js/CompileOptions.h"
|
||||
#include "vm/Debugger.h"
|
||||
#include "vm/GeneratorObject.h"
|
||||
#include "vm/Stack.h"
|
||||
|
|
@ -5975,8 +5976,8 @@ BytecodeEmitter::emitFunction(FunctionNode* funNode, bool needsProto /* = false
|
|||
Rooted<JSScript*> parent(cx, script);
|
||||
MOZ_ASSERT(parent->getVersion() == parser->options().version);
|
||||
MOZ_ASSERT(parent->mutedErrors() == parser->options().mutedErrors());
|
||||
const TransitiveCompileOptions& transitiveOptions = parser->options();
|
||||
CompileOptions options(cx, transitiveOptions);
|
||||
const JS::TransitiveCompileOptions& transitiveOptions = parser->options();
|
||||
JS::CompileOptions options(cx, transitiveOptions);
|
||||
|
||||
Rooted<JSObject*> sourceObject(cx, script->sourceObject());
|
||||
Rooted<JSScript*> script(cx, JSScript::Create(cx, options, sourceObject,
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ using mozilla::PodZero;
|
|||
using mozilla::Some;
|
||||
|
||||
using JS::AutoGCRooter;
|
||||
using JS::ReadOnlyCompileOptions;
|
||||
|
||||
namespace js {
|
||||
namespace frontend {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include "frontend/SharedContext.h"
|
||||
#include "frontend/SyntaxParseHandler.h"
|
||||
#include "frontend/TokenStream.h"
|
||||
#include "js/CompileOptions.h"
|
||||
|
||||
namespace js {
|
||||
|
||||
|
|
@ -835,7 +836,7 @@ class ParserBase : public StrictModeGetter
|
|||
return pc->sc()->hasModuleGoal() ? ParseGoal::Module : ParseGoal::Script;
|
||||
}
|
||||
|
||||
ParserBase(ExclusiveContext* cx, LifoAlloc& alloc, const ReadOnlyCompileOptions& options,
|
||||
ParserBase(ExclusiveContext* cx, LifoAlloc& alloc, const JS::ReadOnlyCompileOptions& options,
|
||||
const char16_t* chars, size_t length, bool foldConstants,
|
||||
UsedNameTracker& usedNames, Parser<SyntaxParseHandler>* syntaxParser,
|
||||
LazyScript* lazyOuterFunction);
|
||||
|
|
@ -860,7 +861,7 @@ class ParserBase : public StrictModeGetter
|
|||
return pc->sc()->setLocalStrictMode(strict);
|
||||
}
|
||||
|
||||
const ReadOnlyCompileOptions& options() const {
|
||||
const JS::ReadOnlyCompileOptions& options() const {
|
||||
return tokenStream.options();
|
||||
}
|
||||
|
||||
|
|
@ -1081,7 +1082,7 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_TYPE)
|
|||
void freeTree(Node node) { handler.freeTree(node); }
|
||||
|
||||
public:
|
||||
Parser(ExclusiveContext* cx, LifoAlloc& alloc, const ReadOnlyCompileOptions& options,
|
||||
Parser(ExclusiveContext* cx, LifoAlloc& alloc, const JS::ReadOnlyCompileOptions& options,
|
||||
const char16_t* chars, size_t length, bool foldConstants, UsedNameTracker& usedNames,
|
||||
Parser<SyntaxParseHandler>* syntaxParser, LazyScript* lazyOuterFunction);
|
||||
~Parser();
|
||||
|
|
|
|||
|
|
@ -469,7 +469,7 @@ TokenStream::SourceCoords::lineNumAndColumnIndex(uint32_t offset, uint32_t* line
|
|||
#pragma warning(disable:4351)
|
||||
#endif
|
||||
|
||||
TokenStream::TokenStream(ExclusiveContext* cx, const ReadOnlyCompileOptions& options,
|
||||
TokenStream::TokenStream(ExclusiveContext* cx, const JS::ReadOnlyCompileOptions& options,
|
||||
const char16_t* base, size_t length, StrictModeGetter* smg)
|
||||
: srcCoords(cx, options.lineno),
|
||||
options_(options),
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include "jspubtd.h"
|
||||
|
||||
#include "frontend/TokenKind.h"
|
||||
#include "js/CompileOptions.h"
|
||||
#include "js/UniquePtr.h"
|
||||
#include "js/Vector.h"
|
||||
#include "vm/RegExpObject.h"
|
||||
|
|
@ -323,7 +324,7 @@ class MOZ_STACK_CLASS TokenStream
|
|||
public:
|
||||
typedef Vector<char16_t, 32> CharBuffer;
|
||||
|
||||
TokenStream(ExclusiveContext* cx, const ReadOnlyCompileOptions& options,
|
||||
TokenStream(ExclusiveContext* cx, const JS::ReadOnlyCompileOptions& options,
|
||||
const char16_t* base, size_t length, StrictModeGetter* smg);
|
||||
|
||||
~TokenStream();
|
||||
|
|
@ -864,7 +865,7 @@ class MOZ_STACK_CLASS TokenStream
|
|||
return cx;
|
||||
}
|
||||
|
||||
const ReadOnlyCompileOptions& options() const {
|
||||
const JS::ReadOnlyCompileOptions& options() const {
|
||||
return options_;
|
||||
}
|
||||
|
||||
|
|
@ -1041,7 +1042,7 @@ class MOZ_STACK_CLASS TokenStream
|
|||
bool hasLookahead() const { return lookahead > 0; }
|
||||
|
||||
// Options used for parsing/tokenizing.
|
||||
const ReadOnlyCompileOptions& options_;
|
||||
const JS::ReadOnlyCompileOptions& options_;
|
||||
|
||||
Token tokens[ntokens]; // circular token buffer
|
||||
unsigned cursor; // index of last parsed token
|
||||
|
|
|
|||
|
|
@ -1,13 +1,19 @@
|
|||
#include "gdb-tests.h"
|
||||
#include "jsapi.h"
|
||||
#include "jit/JitOptions.h"
|
||||
#include "jsapi.h" // sundry symbols not moved to more-specific headers yet
|
||||
|
||||
#include <string.h>
|
||||
#include "jit/JitOptions.h" // js::jit::JitOptions
|
||||
#include "js/CallArgs.h" // JS::CallArgs, JS::CallArgsFromVp
|
||||
#include "js/CompileOptions.h" // JS::CompileOptions
|
||||
#include "js/RootingAPI.h" // JS::Rooted
|
||||
#include "js/Value.h" // JS::Value
|
||||
|
||||
#include <stdint.h> // uint32_t
|
||||
#include <string.h> // strlen
|
||||
|
||||
static bool
|
||||
Something(JSContext* cx, unsigned argc, JS::Value* vp)
|
||||
{
|
||||
JS::CallArgs args = CallArgsFromVp(argc, vp);
|
||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||
args.rval().setInt32(23);
|
||||
breakpoint();
|
||||
return true;
|
||||
|
|
@ -43,10 +49,10 @@ FRAGMENT(unwind, simple) {
|
|||
"\n"
|
||||
"unwindFunctionOuter();\n";
|
||||
|
||||
CompileOptions opts(cx);
|
||||
JS::CompileOptions opts(cx);
|
||||
opts.setFileAndLine(__FILE__, line0 + 1);
|
||||
RootedValue rval(cx);
|
||||
Evaluate(cx, opts, bytes, strlen(bytes), &rval);
|
||||
JS::RootedValue rval(cx);
|
||||
JS::Evaluate(cx, opts, bytes, strlen(bytes), &rval);
|
||||
|
||||
js::jit::JitOptions.baselineWarmUpThreshold = saveThreshold;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,15 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include <string.h> // strlen
|
||||
|
||||
#include "jsapi.h" // sundry symbols not moved to more-specific headers yet
|
||||
#include "jsfriendapi.h"
|
||||
#include "jspubtd.h" // JS::AutoObjectVector
|
||||
|
||||
#include "js/CompileOptions.h" // JS::CompileOptions
|
||||
#include "js/RootingAPI.h" // JS::Rooted
|
||||
#include "js/TypeDecls.h" // JSFunction, JSObject
|
||||
#include "jsapi-tests/tests.h"
|
||||
|
||||
BEGIN_TEST(test_cloneScript)
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@
|
|||
#include "gc/Policy.h"
|
||||
#include "jit/JitCommon.h"
|
||||
#include "js/CharacterEncoding.h"
|
||||
#include "js/CompileOptions.h"
|
||||
#include "js/Conversions.h"
|
||||
#include "js/Date.h"
|
||||
#include "js/Initialization.h"
|
||||
|
|
@ -107,6 +108,8 @@ using mozilla::PodZero;
|
|||
using mozilla::Some;
|
||||
|
||||
using JS::AutoGCRooter;
|
||||
using JS::CompileOptions;
|
||||
using JS::ReadOnlyCompileOptions;
|
||||
using JS::SourceBufferHolder;
|
||||
using JS::ToInt32;
|
||||
using JS::ToInteger;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include "jit/Ion.h"
|
||||
#include "jit/JitFrameIterator.h"
|
||||
#include "js/CallNonGenericMethod.h"
|
||||
#include "js/CompileOptions.h"
|
||||
#include "js/Proxy.h"
|
||||
#include "js/SourceBufferHolder.h"
|
||||
#include "vm/AsyncFunction.h"
|
||||
|
|
@ -68,7 +69,9 @@ using mozilla::PodCopy;
|
|||
using mozilla::RangedPtr;
|
||||
using mozilla::Some;
|
||||
|
||||
using JS::CompileOptions;
|
||||
using JS::SourceBufferHolder;
|
||||
|
||||
static bool
|
||||
fun_enumerate(JSContext* cx, HandleObject obj)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,10 +34,6 @@ class CallArgs;
|
|||
template <typename T>
|
||||
class Rooted;
|
||||
|
||||
class JS_PUBLIC_API(CompileOptions);
|
||||
class JS_PUBLIC_API(ReadOnlyCompileOptions);
|
||||
class JS_PUBLIC_API(OwningCompileOptions);
|
||||
class JS_PUBLIC_API(TransitiveCompileOptions);
|
||||
class JS_PUBLIC_API(CompartmentOptions);
|
||||
|
||||
struct RootingContext;
|
||||
|
|
|
|||
|
|
@ -69,6 +69,8 @@ using mozilla::PodCopy;
|
|||
using mozilla::PodZero;
|
||||
using mozilla::RotateLeft;
|
||||
|
||||
using JS::CompileOptions;
|
||||
using JS::ReadOnlyCompileOptions;
|
||||
using JS::SourceBufferHolder;
|
||||
|
||||
template<XDRMode mode>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include "gc/Barrier.h"
|
||||
#include "gc/Rooting.h"
|
||||
#include "jit/IonCode.h"
|
||||
#include "js/CompileOptions.h"
|
||||
#include "js/UbiNode.h"
|
||||
#include "js/UniquePtr.h"
|
||||
#include "vm/NativeObject.h"
|
||||
|
|
@ -473,7 +474,7 @@ class ScriptSource
|
|||
if (--refs == 0)
|
||||
js_delete(this);
|
||||
}
|
||||
bool initFromOptions(ExclusiveContext* cx, const ReadOnlyCompileOptions& options,
|
||||
bool initFromOptions(ExclusiveContext* cx, const JS::ReadOnlyCompileOptions& options,
|
||||
mozilla::Maybe<uint32_t> parameterListEnd = mozilla::Nothing());
|
||||
bool setSourceCopy(ExclusiveContext* cx,
|
||||
JS::SourceBufferHolder& srcBuf,
|
||||
|
|
@ -655,7 +656,7 @@ class ScriptSourceObject : public NativeObject
|
|||
// Initialize those properties of this ScriptSourceObject whose values
|
||||
// are provided by |options|, re-wrapping as necessary.
|
||||
static bool initFromOptions(JSContext* cx, HandleScriptSource source,
|
||||
const ReadOnlyCompileOptions& options);
|
||||
const JS::ReadOnlyCompileOptions& options);
|
||||
|
||||
ScriptSource* source() const {
|
||||
return static_cast<ScriptSource*>(getReservedSlot(SOURCE_SLOT).toPrivate());
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@
|
|||
#include "jit/Ion.h"
|
||||
#include "jit/JitcodeMap.h"
|
||||
#include "jit/OptimizationTracking.h"
|
||||
#include "js/CompileOptions.h"
|
||||
#include "js/Debug.h"
|
||||
#include "js/Equality.h" // JS::SameValue
|
||||
#include "js/GCAPI.h"
|
||||
|
|
@ -111,6 +112,8 @@ using namespace js;
|
|||
using namespace js::cli;
|
||||
using namespace js::shell;
|
||||
|
||||
using JS::CompileOptions;
|
||||
|
||||
using mozilla::ArrayLength;
|
||||
using mozilla::Atomic;
|
||||
using mozilla::MakeScopeExit;
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
|
||||
using namespace js;
|
||||
|
||||
using JS::CompileOptions;
|
||||
using JS::dbg::AutoEntryMonitor;
|
||||
using JS::dbg::Builder;
|
||||
using js::frontend::IsIdentifier;
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ using mozilla::DebugOnly;
|
|||
using mozilla::Unused;
|
||||
using mozilla::TimeDuration;
|
||||
|
||||
using JS::CompileOptions;
|
||||
using JS::ReadOnlyCompileOptions;
|
||||
using JS::SourceBufferHolder;
|
||||
|
||||
namespace js {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "frontend/TokenStream.h"
|
||||
#include "jit/Ion.h"
|
||||
#include "js/CompileOptions.h"
|
||||
#include "js/SourceBufferHolder.h"
|
||||
#include "threading/ConditionVariable.h"
|
||||
#include "vm/MutexIDs.h"
|
||||
|
|
@ -476,17 +477,17 @@ CancelOffThreadParses(JSRuntime* runtime);
|
|||
* alive until the compilation finishes.
|
||||
*/
|
||||
bool
|
||||
StartOffThreadParseScript(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
StartOffThreadParseScript(JSContext* cx, const JS::ReadOnlyCompileOptions& options,
|
||||
const char16_t* chars, size_t length,
|
||||
JS::OffThreadCompileCallback callback, void* callbackData);
|
||||
|
||||
bool
|
||||
StartOffThreadParseModule(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
StartOffThreadParseModule(JSContext* cx, const JS::ReadOnlyCompileOptions& options,
|
||||
const char16_t* chars, size_t length,
|
||||
JS::OffThreadCompileCallback callback, void* callbackData);
|
||||
|
||||
bool
|
||||
StartOffThreadDecodeScript(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
StartOffThreadDecodeScript(JSContext* cx, const JS::ReadOnlyCompileOptions& options,
|
||||
JS::TranscodeBuffer& buffer, size_t cursor,
|
||||
JS::OffThreadCompileCallback callback, void* callbackData);
|
||||
|
||||
|
|
@ -541,7 +542,7 @@ struct ParseTask
|
|||
{
|
||||
ParseTaskKind kind;
|
||||
ExclusiveContext* cx;
|
||||
OwningCompileOptions options;
|
||||
JS::OwningCompileOptions options;
|
||||
// Anonymous union, the only correct interpretation is provided by the
|
||||
// ParseTaskKind value, or from the virtual parse function.
|
||||
union {
|
||||
|
|
@ -586,7 +587,7 @@ struct ParseTask
|
|||
ParseTask(ParseTaskKind kind, ExclusiveContext* cx, JSObject* exclusiveContextGlobal,
|
||||
JSContext* initCx, JS::TranscodeBuffer& buffer, size_t cursor,
|
||||
JS::OffThreadCompileCallback callback, void* callbackData);
|
||||
bool init(JSContext* cx, const ReadOnlyCompileOptions& options);
|
||||
bool init(JSContext* cx, const JS::ReadOnlyCompileOptions& options);
|
||||
|
||||
void activate(JSRuntime* rt);
|
||||
virtual void parse() = 0;
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ using mozilla::DebugOnly;
|
|||
using mozilla::Maybe;
|
||||
using mozilla::PodCopy;
|
||||
using js::frontend::TokenStream;
|
||||
using JS::CompileOptions;
|
||||
|
||||
using JS::AutoCheckCannotGC;
|
||||
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ using namespace js;
|
|||
using namespace js::selfhosted;
|
||||
|
||||
using JS::AutoCheckCannotGC;
|
||||
using JS::CompileOptions;
|
||||
using mozilla::IsInRange;
|
||||
using mozilla::Maybe;
|
||||
using mozilla::PodMove;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include "mozilla/EndianUtils.h"
|
||||
#include "mozilla/TypeTraits.h"
|
||||
|
||||
#include "js/CompileOptions.h"
|
||||
#include "js/Transcoding.h"
|
||||
#include "jsatom.h"
|
||||
#include "jsfriendapi.h"
|
||||
|
|
@ -143,7 +144,7 @@ class XDRState : public XDRCoderBase
|
|||
virtual LifoAlloc& lifoAlloc() const;
|
||||
|
||||
virtual bool hasOptions() const { return false; }
|
||||
virtual const ReadOnlyCompileOptions& options() {
|
||||
virtual const JS::ReadOnlyCompileOptions& options() {
|
||||
MOZ_CRASH("does not have options");
|
||||
}
|
||||
virtual bool hasScriptSourceObjectOut() const { return false; }
|
||||
|
|
@ -307,7 +308,7 @@ using XDRDecoder = XDRState<XDR_DECODE>;
|
|||
|
||||
class XDROffThreadDecoder : public XDRDecoder
|
||||
{
|
||||
const ReadOnlyCompileOptions* options_;
|
||||
const JS::ReadOnlyCompileOptions* options_;
|
||||
ScriptSourceObject** sourceObjectOut_;
|
||||
LifoAlloc& alloc_;
|
||||
|
||||
|
|
@ -321,7 +322,7 @@ class XDROffThreadDecoder : public XDRDecoder
|
|||
// When providing a sourceObjectOut pointer, you have to ensure that it is
|
||||
// marked by the GC to avoid dangling pointers.
|
||||
XDROffThreadDecoder(ExclusiveContext* cx, LifoAlloc& alloc,
|
||||
const ReadOnlyCompileOptions* options,
|
||||
const JS::ReadOnlyCompileOptions* options,
|
||||
ScriptSourceObject** sourceObjectOut,
|
||||
JS::TranscodeBuffer& buffer, size_t cursor = 0)
|
||||
: XDRDecoder(cx, buffer, cursor),
|
||||
|
|
@ -339,7 +340,7 @@ class XDROffThreadDecoder : public XDRDecoder
|
|||
}
|
||||
|
||||
bool hasOptions() const override { return true; }
|
||||
const ReadOnlyCompileOptions& options() override {
|
||||
const JS::ReadOnlyCompileOptions& options() override {
|
||||
return *options_;
|
||||
}
|
||||
bool hasScriptSourceObjectOut() const override { return true; }
|
||||
|
|
|
|||
|
|
@ -6319,7 +6319,7 @@ HandleInstantiationFailure(JSContext* cx, CallArgs args, const AsmJSMetadata& me
|
|||
if (!fun)
|
||||
return false;
|
||||
|
||||
CompileOptions options(cx);
|
||||
JS::CompileOptions options(cx);
|
||||
options.setMutedErrors(source->mutedErrors())
|
||||
.setFile(source->filename())
|
||||
.setNoScriptRval(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue