Backed out 17 changesets (bug 1744178, bug 1734098) for causing leaks. CLOSED TREE

Backed out changeset 08070838c7d2 (bug 1734098)
Backed out changeset cfdf7ed9a5a2 (bug 1734098)
Backed out changeset 02d7ca7fc45c (bug 1734098)
Backed out changeset 7b7c59fc644b (bug 1734098)
Backed out changeset 630055366dac (bug 1734098)
Backed out changeset da83b4571cf2 (bug 1734098)
Backed out changeset 323af9d3e0e1 (bug 1734098)
Backed out changeset cf458ad5345a (bug 1734098)
Backed out changeset a85846f79eb5 (bug 1734098)
Backed out changeset 0d07931e6bc8 (bug 1734098)
Backed out changeset ffd72fa3fc59 (bug 1734098)
Backed out changeset 3174f1ecfd03 (bug 1734098)
Backed out changeset cfb19671fd4e (bug 1734098)
Backed out changeset c3b9c8221059 (bug 1734098)
Backed out changeset 532328aedaaa (bug 1734098)
Backed out changeset 48aa5ca15135 (bug 1734098)
Backed out changeset 6ca5bceb693c (bug 1744178)
This commit is contained in:
Iulian Moraru 2021-12-09 23:36:34 +02:00
Родитель 120bd0a098
Коммит 777ce42897
130 изменённых файлов: 1221 добавлений и 1615 удалений

Просмотреть файл

@ -95,35 +95,18 @@ nsresult JSExecutionContext::JoinCompile(JS::OffThreadToken** aOffThreadToken) {
MOZ_ASSERT(!mWantsReturnValue);
MOZ_ASSERT(!mScript);
JS::InstantiateOptions instantiateOptions(mCompileOptions);
JS::Rooted<JS::InstantiationStorage> storage(mCx);
RefPtr<JS::Stencil> stencil = JS::FinishCompileToStencilOffThread(
mCx, *aOffThreadToken, storage.address());
*aOffThreadToken = nullptr; // Mark the token as having been finished.
if (!stencil) {
mSkip = true;
mRv = EvaluationExceptionToNSResult(mCx);
return mRv;
}
JS::Rooted<JSScript*> script(
mCx, JS::InstantiateGlobalStencil(mCx, instantiateOptions, stencil,
storage.address()));
if (!script) {
mSkip = true;
mRv = EvaluationExceptionToNSResult(mCx);
return mRv;
}
if (mEncodeBytecode) {
if (!JS::StartIncrementalEncoding(mCx, std::move(stencil))) {
mSkip = true;
mRv = EvaluationExceptionToNSResult(mCx);
return mRv;
}
mScript.set(JS::FinishOffThreadScriptAndStartIncrementalEncoding(
mCx, *aOffThreadToken));
} else {
mScript.set(JS::FinishOffThreadScript(mCx, *aOffThreadToken));
}
*aOffThreadToken = nullptr; // Mark the token as having been finished.
if (!mScript) {
mSkip = true;
mRv = EvaluationExceptionToNSResult(mCx);
return mRv;
}
mScript.set(script);
if (!UpdateDebugMetadata()) {
return NS_ERROR_OUT_OF_MEMORY;
@ -248,19 +231,8 @@ nsresult JSExecutionContext::JoinDecode(JS::OffThreadToken** aOffThreadToken) {
}
MOZ_ASSERT(!mWantsReturnValue);
JS::Rooted<JS::InstantiationStorage> storage(mCx);
RefPtr<JS::Stencil> stencil = JS::FinishDecodeStencilOffThread(
mCx, *aOffThreadToken, storage.address());
mScript.set(JS::FinishOffThreadScriptDecoder(mCx, *aOffThreadToken));
*aOffThreadToken = nullptr; // Mark the token as having been finished.
if (!stencil) {
mSkip = true;
mRv = EvaluationExceptionToNSResult(mCx);
return mRv;
}
JS::InstantiateOptions instantiateOptions(mCompileOptions);
mScript.set(JS::InstantiateGlobalStencil(mCx, instantiateOptions, stencil,
storage.address()));
if (!mScript) {
mSkip = true;
mRv = EvaluationExceptionToNSResult(mCx);

Просмотреть файл

@ -250,16 +250,7 @@ nsresult ModuleLoader::CreateModuleScript(ModuleLoadRequest* aRequest) {
if (NS_SUCCEEDED(rv)) {
if (aRequest->mWasCompiledOMT) {
JS::Rooted<JS::InstantiationStorage> storage(cx);
RefPtr<JS::Stencil> stencil = JS::FinishCompileModuleToStencilOffThread(
cx, aRequest->mOffThreadToken, storage.address());
if (stencil) {
JS::InstantiateOptions instantiateOptions(options);
module = JS::InstantiateModuleStencil(cx, instantiateOptions, stencil,
storage.address());
}
module = JS::FinishOffThreadModule(cx, aRequest->mOffThreadToken);
aRequest->mOffThreadToken = nullptr;
rv = module ? NS_OK : NS_ERROR_FAILURE;
} else {

Просмотреть файл

@ -171,12 +171,12 @@ void ScriptLoadRequest::MaybeCancelOffThreadScript() {
JSContext* cx = danger::GetJSContext();
// Follow the same conditions as ScriptLoader::AttemptAsyncScriptCompile
if (IsModuleRequest()) {
JS::CancelCompileModuleToStencilOffThread(cx, mOffThreadToken);
JS::CancelOffThreadModule(cx, mOffThreadToken);
} else if (IsSource()) {
JS::CancelCompileToStencilOffThread(cx, mOffThreadToken);
JS::CancelOffThreadScript(cx, mOffThreadToken);
} else {
MOZ_ASSERT(IsBytecode());
JS::CancelDecodeStencilOffThread(cx, mOffThreadToken);
JS::CancelOffThreadScriptDecoder(cx, mOffThreadToken);
}
// Cancellation request above should guarantee removal of the parse task, so

Просмотреть файл

@ -1840,8 +1840,7 @@ nsresult ScriptLoader::AttemptAsyncScriptCompile(ScriptLoadRequest* aRequest,
size_t length =
aRequest->mScriptBytecode.length() - aRequest->mBytecodeOffset;
JS::DecodeOptions decodeOptions(options);
if (!JS::CanDecodeOffThread(cx, decodeOptions, length)) {
if (!JS::CanDecodeOffThread(cx, options, length)) {
return NS_OK;
}
}
@ -1868,19 +1867,18 @@ nsresult ScriptLoader::AttemptAsyncScriptCompile(ScriptLoadRequest* aRequest,
aRequest->mOffThreadToken =
maybeSource.constructed<SourceText<char16_t>>()
? JS::CompileModuleToStencilOffThread(
? JS::CompileOffThreadModule(
cx, options, maybeSource.ref<SourceText<char16_t>>(),
OffThreadScriptLoaderCallback, static_cast<void*>(runnable))
: JS::CompileModuleToStencilOffThread(
: JS::CompileOffThreadModule(
cx, options, maybeSource.ref<SourceText<Utf8Unit>>(),
OffThreadScriptLoaderCallback, static_cast<void*>(runnable));
if (!aRequest->mOffThreadToken) {
return NS_ERROR_OUT_OF_MEMORY;
}
} else if (aRequest->IsBytecode()) {
JS::DecodeOptions decodeOptions(options);
aRequest->mOffThreadToken = JS::DecodeStencilOffThread(
cx, decodeOptions, aRequest->mScriptBytecode, aRequest->mBytecodeOffset,
aRequest->mOffThreadToken = JS::DecodeOffThreadScript(
cx, options, aRequest->mScriptBytecode, aRequest->mBytecodeOffset,
OffThreadScriptLoaderCallback, static_cast<void*>(runnable));
if (!aRequest->mOffThreadToken) {
return NS_ERROR_OUT_OF_MEMORY;
@ -1908,10 +1906,10 @@ nsresult ScriptLoader::AttemptAsyncScriptCompile(ScriptLoadRequest* aRequest,
aRequest->mOffThreadToken =
maybeSource.constructed<SourceText<char16_t>>()
? JS::CompileToStencilOffThread(
? JS::CompileOffThread(
cx, options, maybeSource.ref<SourceText<char16_t>>(),
OffThreadScriptLoaderCallback, static_cast<void*>(runnable))
: JS::CompileToStencilOffThread(
: JS::CompileOffThread(
cx, options, maybeSource.ref<SourceText<Utf8Unit>>(),
OffThreadScriptLoaderCallback, static_cast<void*>(runnable));
if (!aRequest->mOffThreadToken) {
@ -2182,8 +2180,6 @@ nsresult ScriptLoader::FillCompileOptionsForRequest(
aOptions->borrowBuffer = true;
aOptions->allocateInstantiationStorage = true;
return NS_OK;
}

Просмотреть файл

@ -1855,7 +1855,7 @@ NotifyOffThreadScriptCompletedRunnable::Run() {
return NS_ERROR_UNEXPECTED;
}
JSContext* cx = jsapi.cx();
stencil = JS::FinishCompileToStencilOffThread(cx, mToken);
stencil = JS::FinishOffThreadCompileToStencil(cx, mToken);
}
if (!sReceivers) {

Просмотреть файл

@ -179,11 +179,6 @@ class JS_PUBLIC_API TransitiveCompileOptions {
// called. There is currently no mechanism to release the data sooner.
bool usePinnedBytecode = false;
// When performing off-thread task that generates JS::Stencil as output,
// allocate JS::InstantiationStorage off main thread to reduce the
// main thread allocation.
bool allocateInstantiationStorage = false;
/**
* |introductionType| is a statically allocated C string: one of "eval",
* "Function", or "GeneratorFunction".
@ -503,8 +498,6 @@ class JS_PUBLIC_API DecodeOptions {
public:
bool borrowBuffer = false;
bool usePinnedBytecode = false;
bool allocateInstantiationStorage = false;
bool forceAsync = false;
const char* introducerFilename = nullptr;
@ -519,8 +512,6 @@ class JS_PUBLIC_API DecodeOptions {
explicit DecodeOptions(const ReadOnlyCompileOptions& options)
: borrowBuffer(options.borrowBuffer),
usePinnedBytecode(options.usePinnedBytecode),
allocateInstantiationStorage(options.allocateInstantiationStorage),
forceAsync(options.forceAsync),
introducerFilename(options.introducerFilename()),
introductionType(options.introductionType),
introductionLineno(options.introductionLineno),
@ -529,8 +520,6 @@ class JS_PUBLIC_API DecodeOptions {
void copyTo(CompileOptions& options) const {
options.borrowBuffer = borrowBuffer;
options.usePinnedBytecode = usePinnedBytecode;
options.allocateInstantiationStorage = allocateInstantiationStorage;
options.forceAsync = forceAsync;
options.introducerFilename_ = introducerFilename;
options.introductionType = introductionType;
options.introductionLineno = introductionLineno;

Просмотреть файл

@ -11,13 +11,30 @@
#ifndef js_OffThreadScriptCompilation_h
#define js_OffThreadScriptCompilation_h
#include "mozilla/Range.h" // mozilla::Range
#include "mozilla/Vector.h" // mozilla::Vector
#include <stddef.h> // size_t
#include "jstypes.h" // JS_PUBLIC_API
#include "js/CompileOptions.h" // JS::DecodeOptions, JS::ReadOnlyCompileOptions
#include "js/CompileOptions.h" // JS::ReadOnlyCompileOptions
#include "js/GCVector.h" // JS::GCVector
#include "js/Transcoding.h" // JS::TranscodeSource
struct JS_PUBLIC_API JSContext;
class JS_PUBLIC_API JSScript;
namespace JS {
template <typename UnitT>
class SourceText;
} // namespace JS
namespace mozilla {
union Utf8Unit;
}
namespace JS {
@ -29,29 +46,113 @@ using OffThreadCompileCallback = void (*)(OffThreadToken* token,
/*
* Off thread compilation control flow.
*
* (See also js/public/experimental/JSStencil.h)
*
* After successfully triggering an off thread compile of a script, the
* callback will eventually be invoked with the specified data and a token
* for the compilation. The callback will be invoked while off thread,
* so must ensure that its operations are thread safe. Afterwards, one of the
* following functions must be invoked on the runtime's main thread:
*
* - FinishCompileToStencilOffThread, to get the result stencil (or nullptr on
* failure).
* - CancelCompileToStencilOffThread, to free the resources without creating a
* stencil.
* - FinishOffThreadScript, to get the result script (or nullptr on failure).
* - CancelOffThreadScript, to free the resources without creating a script.
*
* The characters passed in to CompileToStencilOffThread must remain live until
* the callback is invoked.
* The characters passed in to CompileOffThread must remain live until the
* callback is invoked, and the resulting script will be rooted until the call
* to FinishOffThreadScript.
*/
extern JS_PUBLIC_API bool CanCompileOffThread(
JSContext* cx, const ReadOnlyCompileOptions& options, size_t length);
extern JS_PUBLIC_API bool CanDecodeOffThread(JSContext* cx,
const DecodeOptions& options,
size_t length);
extern JS_PUBLIC_API OffThreadToken* CompileOffThread(
JSContext* cx, const ReadOnlyCompileOptions& options,
SourceText<char16_t>& srcBuf, OffThreadCompileCallback callback,
void* callbackData);
// NOTE: Unlike for the normal sync compilation functions, this function NEVER
// INFLATES TO UTF-16. Therefore, it is ALWAYS invoking experimental
// UTF-8 support. Inflate to UTF-16 yourself and use the other overload
// if you're unable to take a risk using unstable functionality.
extern JS_PUBLIC_API OffThreadToken* CompileOffThread(
JSContext* cx, const ReadOnlyCompileOptions& options,
SourceText<mozilla::Utf8Unit>& srcBuf, OffThreadCompileCallback callback,
void* callbackData);
// Finish the off-thread parse/decode task and return the script. Return the
// script on success, or return null on failure (usually with an error reported)
extern JS_PUBLIC_API JSScript* FinishOffThreadScript(JSContext* cx,
OffThreadToken* token);
// Finish the off-thread parse/decode task and return the script, and register
// an encoder on its script source, such that all functions can be encoded as
// they are parsed. This strategy is used to avoid blocking the main thread in
// a non-interruptible way.
//
// See also JS::FinishIncrementalEncoding.
//
// Return the script on success, or return null on failure (usually with an
// error reported)
extern JS_PUBLIC_API JSScript* FinishOffThreadScriptAndStartIncrementalEncoding(
JSContext* cx, OffThreadToken* token);
extern JS_PUBLIC_API void CancelOffThreadScript(JSContext* cx,
OffThreadToken* token);
extern JS_PUBLIC_API void CancelOffThreadCompileToStencil(
JSContext* cx, OffThreadToken* token);
extern JS_PUBLIC_API OffThreadToken* CompileOffThreadModule(
JSContext* cx, const ReadOnlyCompileOptions& options,
SourceText<char16_t>& srcBuf, OffThreadCompileCallback callback,
void* callbackData);
// NOTE: Unlike for the normal sync compilation functions, this function NEVER
// INFLATES TO UTF-16. Therefore, it is ALWAYS invoking experimental
// UTF-8 support. Inflate to UTF-16 yourself and use the other overload
// if you're unable to take a risk using unstable functionality.
extern JS_PUBLIC_API OffThreadToken* CompileOffThreadModule(
JSContext* cx, const ReadOnlyCompileOptions& options,
SourceText<mozilla::Utf8Unit>& srcBuf, OffThreadCompileCallback callback,
void* callbackData);
extern JS_PUBLIC_API JSObject* FinishOffThreadModule(JSContext* cx,
OffThreadToken* token);
extern JS_PUBLIC_API void CancelOffThreadModule(JSContext* cx,
OffThreadToken* token);
extern JS_PUBLIC_API bool CanDecodeOffThread(
JSContext* cx, const ReadOnlyCompileOptions& options, size_t length);
// Decode stencil from the buffer and instantiate JSScript from it.
//
// The start of `buffer` and `cursor` should meet
// IsTranscodingBytecodeAligned and IsTranscodingBytecodeOffsetAligned.
// (This should be handled while encoding).
//
// `buffer` should be alive until the end of `FinishOffThreadScriptDecoder`.
extern JS_PUBLIC_API OffThreadToken* DecodeOffThreadScript(
JSContext* cx, const ReadOnlyCompileOptions& options,
mozilla::Vector<uint8_t>& buffer /* TranscodeBuffer& */, size_t cursor,
OffThreadCompileCallback callback, void* callbackData);
// The start of `range` should be meet IsTranscodingBytecodeAligned and
// AlignTranscodingBytecodeOffset.
// (This should be handled while encoding).
//
// `range` should be alive until the end of `FinishOffThreadScriptDecoder`.
extern JS_PUBLIC_API OffThreadToken* DecodeOffThreadScript(
JSContext* cx, const ReadOnlyCompileOptions& options,
const mozilla::Range<uint8_t>& range /* TranscodeRange& */,
OffThreadCompileCallback callback, void* callbackData);
extern JS_PUBLIC_API JSScript* FinishOffThreadScriptDecoder(
JSContext* cx, OffThreadToken* token);
extern JS_PUBLIC_API void CancelOffThreadScriptDecoder(JSContext* cx,
OffThreadToken* token);
extern JS_PUBLIC_API void CancelMultiOffThreadScriptsDecoder(
JSContext* cx, OffThreadToken* token);
} // namespace JS

Просмотреть файл

@ -110,7 +110,7 @@ extern JS_PUBLIC_API bool FinishIncrementalEncoding(JSContext* cx,
//
// JS::DecodeScript* and JS::DecodeOffThreadScript internally check this.
//
// JS::DecodeMultiStencilsOffThread checks some options shared across multiple
// JS::DecodeMultiOffThreadStencils checks some options shared across multiple
// scripts. Caller is responsible for checking each script with this API when
// using the decoded script instead of compiling a new script wiht the given
// options.

Просмотреть файл

@ -26,20 +26,14 @@
#include "js/CompileOptions.h" // JS::ReadOnlyCompileOptions, JS::InstantiateOptions, JS::DecodeOptions
#include "js/OffThreadScriptCompilation.h" // JS::OffThreadCompileCallback
#include "js/SourceText.h" // JS::SourceText
#include "js/Transcoding.h" // JS::TranscodeSources, JS::TranscodeBuffer, JS::TranscodeRange
#include "js/UniquePtr.h" // js::UniquePtr
#include "js/Transcoding.h" // JS::TranscodeSource
struct JS_PUBLIC_API JSContext;
class JS_PUBLIC_API JSTracer;
// Underlying opaque type.
namespace js {
struct ParseTask;
namespace frontend {
namespace js::frontend {
struct CompilationStencil;
struct CompilationGCOutput;
} // namespace frontend
} // namespace js
};
namespace JS {
@ -47,47 +41,6 @@ class OffThreadToken;
using Stencil = js::frontend::CompilationStencil;
// Temporary storage used during instantiating Stencil.
//
// Off-thread APIs can allocate this instance off main thread, and pass it back
// to the main thread, in order to reduce the main thread allocation.
struct InstantiationStorage {
private:
// Owned CompilationGCOutput.
//
// This uses raw pointer instead of UniquePtr because CompilationGCOutput
// is opaque.
js::frontend::CompilationGCOutput* gcOutput_ = nullptr;
friend JS_PUBLIC_API JSScript* InstantiateGlobalStencil(
JSContext* cx, const InstantiateOptions& options, Stencil* stencil,
InstantiationStorage* storage);
friend JS_PUBLIC_API JSObject* InstantiateModuleStencil(
JSContext* cx, const InstantiateOptions& options, Stencil* stencil,
InstantiationStorage* storage);
friend struct js::ParseTask;
public:
InstantiationStorage() = default;
InstantiationStorage(InstantiationStorage&& other)
: gcOutput_(other.gcOutput_) {
other.gcOutput_ = nullptr;
}
~InstantiationStorage();
private:
InstantiationStorage(const InstantiationStorage& other) = delete;
void operator=(const InstantiationStorage& aOther) = delete;
public:
bool isValid() const { return !!gcOutput_; }
void trace(JSTracer* trc);
};
// These non-member functions let us manipulate the ref counts of the opaque
// Stencil type. The RefPtrTraits below calls these for use when using the
// RefPtr type.
@ -118,12 +71,15 @@ extern JS_PUBLIC_API already_AddRefed<Stencil> CompileModuleScriptToStencil(
JSContext* cx, const ReadOnlyCompileOptions& options,
SourceText<char16_t>& srcBuf);
// Off-thread compilation uses the normal off-thread APIs but uses a special
// finish method to avoid automatic instantiation. This is used for both global
// and modules compiles.
extern JS_PUBLIC_API already_AddRefed<Stencil> FinishOffThreadStencil(
JSContext* cx, JS::OffThreadToken* token);
// Instantiate the Stencil into current Realm and return the JSScript.
extern JS_PUBLIC_API JSScript* InstantiateGlobalStencil(
JSContext* cx, const InstantiateOptions& options, Stencil* stencil);
extern JS_PUBLIC_API JSScript* InstantiateGlobalStencil(
JSContext* cx, const InstantiateOptions& options, Stencil* stencil,
InstantiationStorage* storage);
// Return true if the stencil relies on external data as a result of XDR
// decoding.
@ -136,9 +92,6 @@ extern JS_PUBLIC_API bool StencilCanLazilyParse(Stencil* stencil);
// engine this is a js::ModuleObject.
extern JS_PUBLIC_API JSObject* InstantiateModuleStencil(
JSContext* cx, const InstantiateOptions& options, Stencil* stencil);
extern JS_PUBLIC_API JSObject* InstantiateModuleStencil(
JSContext* cx, const InstantiateOptions& options, Stencil* stencil,
InstantiationStorage* storage);
// Serialize the Stencil into the transcode buffer.
extern JS_PUBLIC_API TranscodeResult EncodeStencil(JSContext* cx,
@ -154,8 +107,6 @@ extern JS_PUBLIC_API TranscodeResult DecodeStencil(JSContext* cx,
extern JS_PUBLIC_API size_t SizeOfStencil(Stencil* stencil,
mozilla::MallocSizeOf mallocSizeOf);
// Start an off-thread task to compile the source text into a JS::Stencil,
// using the provided options.
extern JS_PUBLIC_API OffThreadToken* CompileToStencilOffThread(
JSContext* cx, const ReadOnlyCompileOptions& options,
SourceText<char16_t>& srcBuf, OffThreadCompileCallback callback,
@ -166,82 +117,18 @@ extern JS_PUBLIC_API OffThreadToken* CompileToStencilOffThread(
SourceText<mozilla::Utf8Unit>& srcBuf, OffThreadCompileCallback callback,
void* callbackData);
// Start an off-thread task to compile the module source text into a
// JS::Stencil, using the provided options.
extern JS_PUBLIC_API OffThreadToken* CompileModuleToStencilOffThread(
extern JS_PUBLIC_API already_AddRefed<Stencil> FinishOffThreadCompileToStencil(
JSContext* cx, OffThreadToken* token);
extern JS_PUBLIC_API OffThreadToken* DecodeMultiOffThreadStencils(
JSContext* cx, const ReadOnlyCompileOptions& options,
SourceText<char16_t>& srcBuf, OffThreadCompileCallback callback,
void* callbackData);
extern JS_PUBLIC_API OffThreadToken* CompileModuleToStencilOffThread(
JSContext* cx, const ReadOnlyCompileOptions& options,
SourceText<mozilla::Utf8Unit>& srcBuf, OffThreadCompileCallback callback,
void* callbackData);
// Start an off-thread task to decode stencil.
//
// The start of `buffer` and `cursor` should meet
// IsTranscodingBytecodeAligned and IsTranscodingBytecodeOffsetAligned.
// (This should be handled while encoding).
//
// `buffer` should be alive until the end of `FinishOffThreadScriptDecoder`.
extern JS_PUBLIC_API OffThreadToken* DecodeStencilOffThread(
JSContext* cx, const DecodeOptions& options, const TranscodeBuffer& buffer,
size_t cursor, OffThreadCompileCallback callback, void* callbackData);
// The start of `range` should be meet IsTranscodingBytecodeAligned and
// AlignTranscodingBytecodeOffset.
// (This should be handled while encoding).
//
// `range` should be alive until the end of `FinishOffThreadScriptDecoder`.
extern JS_PUBLIC_API OffThreadToken* DecodeStencilOffThread(
JSContext* cx, const DecodeOptions& options, const TranscodeRange& range,
mozilla::Vector<TranscodeSource>& sources,
OffThreadCompileCallback callback, void* callbackData);
extern JS_PUBLIC_API OffThreadToken* DecodeMultiStencilsOffThread(
JSContext* cx, const DecodeOptions& options, TranscodeSources& sources,
OffThreadCompileCallback callback, void* callbackData);
// Finish the off-thread task to compile the source text into a JS::Stencil,
// started by JS::CompileToStencilOffThread, and return the result JS::Stencil.
//
// If `options.allocateInstantiationStorage` was true in
// JS::CompileToStencilOffThread, pre-allocated JS::InstantiationStorage
// is returned as `storage` out parameter.
extern JS_PUBLIC_API already_AddRefed<Stencil> FinishCompileToStencilOffThread(
JSContext* cx, OffThreadToken* token,
InstantiationStorage* storage = nullptr);
extern JS_PUBLIC_API already_AddRefed<Stencil>
FinishCompileModuleToStencilOffThread(JSContext* cx, OffThreadToken* token,
InstantiationStorage* storage = nullptr);
extern JS_PUBLIC_API already_AddRefed<Stencil> FinishDecodeStencilOffThread(
JSContext* cx, OffThreadToken* token,
InstantiationStorage* storage = nullptr);
extern JS_PUBLIC_API bool FinishDecodeMultiStencilsOffThread(
extern JS_PUBLIC_API bool FinishMultiOffThreadStencilDecoder(
JSContext* cx, OffThreadToken* token,
mozilla::Vector<RefPtr<Stencil>>* stencils);
extern JS_PUBLIC_API void CancelCompileToStencilOffThread(
JSContext* cx, OffThreadToken* token);
extern JS_PUBLIC_API void CancelCompileModuleToStencilOffThread(
JSContext* cx, OffThreadToken* token);
extern JS_PUBLIC_API void CancelDecodeStencilOffThread(JSContext* cx,
OffThreadToken* token);
extern JS_PUBLIC_API void CancelDecodeMultiStencilsOffThread(
JSContext* cx, OffThreadToken* token);
// Register an encoder on its script source, such that all functions can be
// encoded as they are parsed, in the same way as
// JS::CompileAndStartIncrementalEncoding
extern JS_PUBLIC_API bool StartIncrementalEncoding(JSContext* cx,
RefPtr<Stencil>&& stencil);
} // namespace JS
namespace mozilla {

Просмотреть файл

@ -819,4 +819,7 @@ MSG_DEF(JSMSG_BAD_WEAKREF_TARGET, 0, JSEXN_TYPEERR, "cann
// Iterator Helpers
MSG_DEF(JSMSG_NEGATIVE_LIMIT, 0, JSEXN_RANGEERR, "Iterator limits cannot be negative")
// Stencil
MSG_DEF(JSMSG_STENCIL_OPTIONS_MISMATCH, 0, JSEXN_ERR, "CompileOptions mismatch between input and Stencil")
//clang-format on

Просмотреть файл

@ -52,7 +52,9 @@
#include "builtin/Promise.h"
#include "builtin/SelfHostingDefines.h"
#include "builtin/TestingUtility.h" // js::ParseCompileOptions, js::ParseDebugMetadata
#include "frontend/BytecodeCompilation.h" // frontend::CompileGlobalScriptToExtensibleStencil, frontend::DelazifyCanonicalScriptedFunction
#include "frontend/BytecodeCompilation.h" // frontend::CanLazilyParse,
// frontend::CompileGlobalScriptToExtensibleStencil,
// frontend::DelazifyCanonicalScriptedFunction
#include "frontend/BytecodeCompiler.h" // frontend::ParseModuleToExtensibleStencil
#include "frontend/CompilationStencil.h" // frontend::CompilationStencil
#include "gc/Allocator.h"
@ -6277,6 +6279,13 @@ static bool EvalStencil(JSContext* cx, uint32_t argc, Value* vp) {
}
}
if (stencilObj->stencil()->canLazilyParse !=
frontend::CanLazilyParse(options)) {
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
JSMSG_STENCIL_OPTIONS_MISMATCH);
return false;
}
bool useDebugMetadata = !privateValue.isUndefined() || elementAttributeName;
JS::InstantiateOptions instantiateOptions(options);

Просмотреть файл

@ -13,7 +13,7 @@ basic/bug677957-2.js
basic/bug753283.js
basic/bug867946.js
basic/destructuring-iterator.js
basic/offThreadCompileToStencil-01.js
basic/offThreadCompileScript-01.js
basic/testAtomize.js
basic/testBug614653.js
basic/testBug686274.js

Просмотреть файл

@ -1168,18 +1168,6 @@ struct CompilationStencil {
bool isModule() const;
bool hasMultipleReference() const { return refCount > 1; }
bool hasOwnedBorrow() const {
return storageType == StorageType::OwnedExtensible;
}
ExtensibleCompilationStencil* takeOwnedBorrow() {
MOZ_ASSERT(!hasMultipleReference());
MOZ_ASSERT(hasOwnedBorrow());
return ownedBorrowStencil.release();
}
#ifdef DEBUG
void assertNoExternalDependency() const;
#endif
@ -1238,8 +1226,6 @@ struct ExtensibleCompilationStencil {
RefPtr<StencilAsmJSContainer> asmJS;
explicit ExtensibleCompilationStencil(JSContext* cx, ScriptSource* source);
ExtensibleCompilationStencil(JSContext* cx, CompilationInput& input);
ExtensibleCompilationStencil(ExtensibleCompilationStencil&& other) noexcept

Просмотреть файл

@ -1144,12 +1144,6 @@ void CompilationGCOutput::trace(JSTracer* trc) {
scopes.trace(trc);
}
void JS::InstantiationStorage::trace(JSTracer* trc) {
if (gcOutput_) {
gcOutput_->trace(trc);
}
}
RegExpObject* RegExpStencil::createRegExp(
JSContext* cx, const CompilationAtomCache& atomCache) const {
RootedAtom atom(cx, atomCache.getExistingAtomAt(cx, atom_));
@ -2274,12 +2268,6 @@ bool CompilationStencil::deserializeStencils(JSContext* cx,
return true;
}
ExtensibleCompilationStencil::ExtensibleCompilationStencil(JSContext* cx,
ScriptSource* source)
: alloc(CompilationStencil::LifoAllocChunkSize),
source(source),
parserAtoms(cx->runtime(), alloc) {}
ExtensibleCompilationStencil::ExtensibleCompilationStencil(
JSContext* cx, CompilationInput& input)
: canLazilyParse(CanLazilyParse(input.options)),
@ -4392,9 +4380,9 @@ already_AddRefed<JS::Stencil> JS::CompileModuleScriptToStencil(
return CompileModuleScriptToStencilImpl(cx, options, srcBuf);
}
JS_PUBLIC_API JSScript* JS::InstantiateGlobalStencil(
JSContext* cx, const JS::InstantiateOptions& options,
JS::Stencil* stencil) {
JSScript* JS::InstantiateGlobalStencil(JSContext* cx,
const JS::InstantiateOptions& options,
JS::Stencil* stencil) {
CompileOptions compileOptions(cx);
options.copyTo(compileOptions);
Rooted<CompilationInput> input(cx, CompilationInput(compileOptions));
@ -4406,21 +4394,6 @@ JS_PUBLIC_API JSScript* JS::InstantiateGlobalStencil(
return gcOutput.get().script;
}
JS_PUBLIC_API JSScript* JS::InstantiateGlobalStencil(
JSContext* cx, const JS::InstantiateOptions& options, JS::Stencil* stencil,
JS::InstantiationStorage* storage) {
MOZ_ASSERT(storage->isValid());
CompileOptions compileOptions(cx);
options.copyTo(compileOptions);
Rooted<CompilationInput> input(cx, CompilationInput(compileOptions));
if (!InstantiateStencils(cx, input.get(), *stencil, *storage->gcOutput_)) {
return nullptr;
}
return storage->gcOutput_->script;
}
JS_PUBLIC_API bool JS::StencilIsBorrowed(Stencil* stencil) {
return stencil->storageType == CompilationStencil::StorageType::Borrowed;
}
@ -4429,9 +4402,9 @@ JS_PUBLIC_API bool JS::StencilCanLazilyParse(Stencil* stencil) {
return stencil->canLazilyParse;
}
JS_PUBLIC_API JSObject* JS::InstantiateModuleStencil(
JSContext* cx, const JS::InstantiateOptions& options,
JS::Stencil* stencil) {
JSObject* JS::InstantiateModuleStencil(JSContext* cx,
const JS::InstantiateOptions& options,
JS::Stencil* stencil) {
CompileOptions compileOptions(cx);
options.copyTo(compileOptions);
compileOptions.setModule();
@ -4445,23 +4418,6 @@ JS_PUBLIC_API JSObject* JS::InstantiateModuleStencil(
return gcOutput.get().module;
}
JS_PUBLIC_API JSObject* JS::InstantiateModuleStencil(
JSContext* cx, const JS::InstantiateOptions& options, JS::Stencil* stencil,
JS::InstantiationStorage* storage) {
MOZ_ASSERT(storage->isValid());
CompileOptions compileOptions(cx);
options.copyTo(compileOptions);
compileOptions.setModule();
Rooted<CompilationInput> input(cx, CompilationInput(compileOptions));
if (!InstantiateStencils(cx, input.get(), *stencil, *storage->gcOutput_)) {
return nullptr;
}
return storage->gcOutput_->module;
}
JS::TranscodeResult JS::EncodeStencil(JSContext* cx, JS::Stencil* stencil,
TranscodeBuffer& buffer) {
XDRStencilEncoder encoder(cx, buffer);
@ -4493,14 +4449,14 @@ JS::TranscodeResult JS::DecodeStencil(JSContext* cx,
return TranscodeResult::Ok;
}
already_AddRefed<JS::Stencil> JS::FinishOffThreadStencil(
JSContext* cx, JS::OffThreadToken* token) {
MOZ_ASSERT(cx);
MOZ_ASSERT(CurrentThreadCanAccessRuntime(cx->runtime()));
return HelperThreadState().finishStencilParseTask(cx, token);
}
JS_PUBLIC_API size_t JS::SizeOfStencil(Stencil* stencil,
mozilla::MallocSizeOf mallocSizeOf) {
return stencil->sizeOfIncludingThis(mallocSizeOf);
}
JS::InstantiationStorage::~InstantiationStorage() {
if (gcOutput_) {
js_free(gcOutput_);
gcOutput_ = nullptr;
}
}

Просмотреть файл

@ -738,13 +738,8 @@ template <XDRMode mode>
XDRState<mode>* xdr, CompilationStencil& stencil) {
MOZ_ASSERT(!stencil.asmJS);
if constexpr (mode == XDR_DECODE) {
const auto& options = static_cast<XDRStencilDecoder*>(xdr)->options();
if (options.borrowBuffer) {
stencil.storageType = CompilationStencil::StorageType::Borrowed;
} else {
stencil.storageType = CompilationStencil::StorageType::Owned;
}
if (mode == XDR_DECODE) {
stencil.storageType = CompilationStencil::StorageType::Borrowed;
}
MOZ_TRY(CodeMarker(xdr, SectionMarker::ParserAtomData));

Просмотреть файл

@ -81,12 +81,12 @@ function sanitizeGlobal(g) {
setModuleDynamicImportHook: function() {},
finishDynamicModuleImport: function() {},
abortDynamicModuleImport: function() {},
offThreadCompileToStencil: function() {},
finishOffThreadCompileToStencil: function() {},
offThreadCompileModuleToStencil: function() {},
finishOffThreadCompileModuleToStencil: function() {},
offThreadDecodeStencil: function() {},
finishOffThreadDecodeStencil: function() {},
offThreadCompileScript: function() {},
runOffThreadScript: function() {},
offThreadCompileModule: function() {},
finishOffThreadModule: function() {},
offThreadDecodeScript: function() {},
runOffThreadDecodedScript: function() {},
addPromiseReactions: function() {},
ignoreUnhandledRejections: function() {},
enableTrackAllocations: function() {},

Просмотреть файл

@ -1,6 +1,6 @@
// |jit-test| skip-if: helperThreadCount() === 0
offThreadCompileToStencil("\
offThreadCompileScript("\
(function(stdlib, foreign) {\
\"use asm\";\
function() {};\

Просмотреть файл

@ -5,7 +5,7 @@ const maxSize = Math.pow(2, 29) - 1;
// We just don't want to crash during compilation here.
evaluate(`
offThreadCompileToStencil("\\
offThreadCompileScript("\\
g = (function(t,foreign){\\
\\"use asm\\";\\
var ff = foreign.ff;\\
@ -17,7 +17,7 @@ evaluate(`
`);
evaluate(`
offThreadCompileToStencil("\\
offThreadCompileScript("\\
g = (function(t,foreign){\\
\\"use asm\\";\\
var ff = foreign.ff;\\

Просмотреть файл

@ -12,10 +12,9 @@ module += "return f0";
var script = "(function() {\n" + module + "})";
for (var i = 0; i < 10; i++) {
offThreadCompileToStencil(script);
offThreadCompileScript(script);
var f = new Function(module);
var stencil = finishOffThreadCompileToStencil();
var g = evalStencil(stencil);
var g = runOffThreadScript();
assertEq(isAsmJSModule(f), true);
assertEq(isAsmJSModule(g), true);
}

Просмотреть файл

@ -1,6 +1,6 @@
// |jit-test| exitstatus: 6; skip-if: helperThreadCount() == 0
var job = offThreadCompileToStencil(`
runOffThreadScript(offThreadCompileScript(`
function asmModule() {
"use asm";
function f() {
@ -9,9 +9,7 @@ var job = offThreadCompileToStencil(`
}
return f;
}
`);
var stencil = finishOffThreadCompileToStencil(job);
evalStencil(stencil);
`));
timeout(1);
asmModule()();
assertEq(true, false);

Просмотреть файл

@ -1,6 +1,6 @@
// |jit-test| skip-if: !('oomTest' in this)
oomTest(function() {
offThreadCompileToStencil("");
offThreadCompileScript("");
});
"".match();

Просмотреть файл

@ -10,7 +10,7 @@ for (lfLocal in this) {
lfGlobal[lfLocal] = this[lfLocal];
}
}
lfGlobal.offThreadCompileToStencil(`
lfGlobal.offThreadCompileScript(`
if (!("oomAtAllocation" in this && "resetOOMFailure" in this))
gczeal(0);
function oomTest(f) {
@ -30,8 +30,7 @@ var g = newGlobal();
oomTest(function() { new revocable(); });
`);
try {
var stencil = lfGlobal.finishOffThreadCompileToStencil();
lfGlobal.evalStencil(stencil);
lfGlobal.runOffThreadScript();
} catch(e) {
// This can happen if we OOM while bailing out in Ion.
assertEq(e, "out of memory");

Просмотреть файл

@ -6,6 +6,5 @@ lfGlobal = newGlobal()
for (lfLocal in this)
if (!(lfLocal in lfGlobal))
lfGlobal[lfLocal] = this[lfLocal]
offThreadCompileToStencil(lfVarx);
var stencil = lfGlobal.finishOffThreadCompileToStencil();
lfGlobal.evalStencil(stencil);
offThreadCompileScript(lfVarx)
lfGlobal.runOffThreadScript()

Просмотреть файл

@ -1,9 +1,8 @@
// |jit-test| skip-if: !('oomTest' in this)
function parseModule(source) {
offThreadCompileModuleToStencil(source);
var stencil = finishOffThreadCompileModuleToStencil();
return instantiateModuleStencil(stencil);
offThreadCompileModule(source);
return finishOffThreadModule();
}
function loadFile(lfVarx) {
oomTest(function() {

Просмотреть файл

@ -2,17 +2,15 @@
// 1236476
if (typeof oomTest !== 'function' ||
typeof offThreadCompileToStencil !== 'function' ||
typeof finishOffThreadCompileToStencil !== 'function' ||
typeof evalStencil !== 'function')
typeof offThreadCompileScript !== 'function' ||
typeof runOffThreadScript !== 'function')
quit();
oomTest(() => {
offThreadCompileToStencil(`
offThreadCompileScript(`
"use asm";
return assertEq;
`);
var stencil = finishOffThreadCompileToStencil();
evalStencil();
runOffThreadScript();
});

Просмотреть файл

@ -1,6 +1,3 @@
// |jit-test| skip-if: helperThreadCount() === 0
offThreadCompileToStencil(``);
evalInWorker(`
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
`);
offThreadCompileScript(``);
evalInWorker(`runOffThreadScript()`);

Просмотреть файл

@ -1,6 +1,6 @@
// |jit-test| skip-if: helperThreadCount() === 0
function eval(source) {
offThreadCompileModuleToStencil(source);
offThreadCompileModule(source);
}
var N = 10000;
var left = repeat_str('(1&', N);

Просмотреть файл

@ -0,0 +1,20 @@
// |jit-test| skip-if: helperThreadCount() === 0
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/licenses/publicdomain/
// Test off-thread parsing.
load(libdir + 'asserts.js');
offThreadCompileScript('Math.sin(Math.PI/2)');
assertEq(runOffThreadScript(), 1);
offThreadCompileScript('a string which cannot be reduced to the start symbol');
assertThrowsInstanceOf(runOffThreadScript, SyntaxError);
offThreadCompileScript('smerg;');
assertThrowsInstanceOf(runOffThreadScript, ReferenceError);
offThreadCompileScript('throw "blerg";');
assertThrowsValue(runOffThreadScript, 'blerg');

Просмотреть файл

@ -0,0 +1,21 @@
// |jit-test| skip-if: helperThreadCount() === 0
// Test offThreadCompileScript option handling.
offThreadCompileScript("Error()");
assertEq(!!runOffThreadScript().stack.match(/^@<string>:1:1\n/), true);
offThreadCompileScript("Error()", { fileName: "candelabra", lineNumber: 6502 });
assertEq(!!runOffThreadScript().stack.match(/^@candelabra:6502:1\n/), true);
var element = {};
var job = offThreadCompileScript("Error()"); // shouldn't crash
runOffThreadScript(job, { element });
var elementAttributeName = "molybdenum";
elementAttributeName +=
elementAttributeName + elementAttributeName + elementAttributeName;
job = offThreadCompileScript("Error()"); // shouldn't crash
runOffThreadScript(job, {
elementAttributeName,
});

Просмотреть файл

@ -1,38 +1,34 @@
// |jit-test| skip-if: helperThreadCount() === 0
// Test offThreadCompileToStencil for different function types.
// Test offThreadCompileScript for different function types.
load(libdir + 'asserts.js');
var id, stencil;
var id;
id = offThreadCompileToStencil(`
id = offThreadCompileScript(`
function f() { return "pass"; }
f();
`);
stencil = finishOffThreadCompileToStencil(id);
assertEq(evalStencil(stencil), "pass");
assertEq(runOffThreadScript(id), "pass");
id = offThreadCompileToStencil(`
id = offThreadCompileScript(`
function* f() { return "pass"; }
f().next();
`);
stencil = finishOffThreadCompileToStencil(id);
assertDeepEq(evalStencil(stencil), {value: "pass", done: true});
assertDeepEq(runOffThreadScript(id), {value: "pass", done: true});
id = offThreadCompileToStencil(`
id = offThreadCompileScript(`
async function f() { return "pass"; }
f();
`);
stencil = finishOffThreadCompileToStencil(id);
assertEventuallyEq(evalStencil(stencil), "pass");
assertEventuallyEq(runOffThreadScript(id), "pass");
id = offThreadCompileToStencil(`
id = offThreadCompileScript(`
async function* f() { return "pass"; }
f().next();
`);
stencil = finishOffThreadCompileToStencil(id);
assertEventuallyDeepEq(evalStencil(stencil), {value: "pass", done: true});
assertEventuallyDeepEq(runOffThreadScript(id), {value: "pass", done: true});
// Copied from js/src/tests/shell.js
function getPromiseResult(promise) {

Просмотреть файл

@ -1,30 +0,0 @@
// |jit-test| skip-if: helperThreadCount() === 0
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/licenses/publicdomain/
// Test off-thread parsing.
load(libdir + 'asserts.js');
offThreadCompileToStencil('Math.sin(Math.PI/2)');
var stencil = finishOffThreadCompileToStencil();
assertEq(evalStencil(stencil), 1);
offThreadCompileToStencil('a string which cannot be reduced to the start symbol');
assertThrowsInstanceOf(() => {
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
}, SyntaxError);
offThreadCompileToStencil('smerg;');
assertThrowsInstanceOf(() => {
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
}, ReferenceError);
offThreadCompileToStencil('throw "blerg";');
assertThrowsValue(() => {
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
}, 'blerg');

Просмотреть файл

@ -1,25 +0,0 @@
// |jit-test| skip-if: helperThreadCount() === 0
// Test offThreadCompileToStencil/evalStencil option handling.
offThreadCompileToStencil("Error()");
var stencil = finishOffThreadCompileToStencil();
assertEq(!!evalStencil(stencil).stack.match(/^@<string>:1:1\n/), true);
offThreadCompileToStencil("Error()", { fileName: "candelabra", lineNumber: 6502 });
stencil = finishOffThreadCompileToStencil();
assertEq(!!evalStencil(stencil).stack.match(/^@candelabra:6502:1\n/), true);
var element = {};
offThreadCompileToStencil("Error()"); // shouldn't crash
stencil = finishOffThreadCompileToStencil();
evalStencil(stencil, { element });
var elementAttributeName = "molybdenum";
elementAttributeName +=
elementAttributeName + elementAttributeName + elementAttributeName;
offThreadCompileToStencil("Error()"); // shouldn't crash
stencil = finishOffThreadCompileToStencil();
evalStencil(stencil, {
elementAttributeName,
});

Просмотреть файл

@ -34,9 +34,8 @@ assertEq(ex.toString(), "InternalError: unsafe filename: file://foo.js");
// Off-thread parse throws too, when finishing.
if (helperThreadCount() > 0) {
offThreadCompileToStencil('throw 1');
var stencil = finishOffThreadCompileToStencil();
assertThrowsInstanceOf(() => evalStencil(stencil), InternalError);
offThreadCompileScript('throw 1');
assertThrowsInstanceOf(() => runOffThreadScript(), InternalError);
}
// Unsafe filename is accepted if we opt-out.

Просмотреть файл

@ -24,9 +24,8 @@ csoLoop();
// Tests off thread compilation
if (helperThreadCount() !== 0) {
offThreadCompileToStencil("(x=>x)`abc`");
var stencil = finishOffThreadCompileToStencil();
a = evalStencil(stencil);
offThreadCompileScript("(x=>x)`abc`");
a = runOffThreadScript();
check(a, ["abc"]);
check(a.raw, ["abc"]);
assertEq(a === a.raw, false);

Просмотреть файл

@ -1,16 +1,14 @@
// |jit-test| skip-if: helperThreadCount() === 0
var lfGlobal = newGlobal();
lfGlobal.offThreadCompileToStencil(`{ let x; throw 42; }`);
var stencil = lfGlobal.finishOffThreadCompileToStencil();
lfGlobal.offThreadCompileScript(`{ let x; throw 42; }`);
try {
lfGlobal.evalStencil(stencil);
lfGlobal.runOffThreadScript();
} catch (e) {
}
lfGlobal.offThreadCompileToStencil(`function f() { { let x = 42; return x; } }`);
stencil = lfGlobal.finishOffThreadCompileToStencil();
lfGlobal.offThreadCompileScript(`function f() { { let x = 42; return x; } }`);
try {
lfGlobal.evalStencil(stencil);
lfGlobal.runOffThreadScript();
} catch (e) {
}

Просмотреть файл

@ -5,5 +5,5 @@
evalInWorker(`
var lfGlobal = newGlobal();
lfGlobal.offThreadCompileToStencil(\`{ let x; throw 42; }\`);
lfGlobal.offThreadCompileScript(\`{ let x; throw 42; }\`);
`);

Просмотреть файл

@ -2,7 +2,7 @@
assertEq(isLcovEnabled(), true);
offThreadCompileToStencil(`
offThreadCompileScript(`
let hitCount = 0;
function offThreadFun() {
hitCount += 1;
@ -13,8 +13,7 @@ offThreadCompileToStencil(`
offThreadFun();
offThreadFun();
`);
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
runOffThreadScript();
assertEq(hitCount, 4);
let report = getLcovInfo();

Просмотреть файл

@ -2,7 +2,7 @@
assertEq(isLcovEnabled(), true);
offThreadCompileModuleToStencil(`
offThreadCompileModule(`
globalThis.hitCount = 0;
function offThreadFun() {
globalThis.hitCount += 1;
@ -13,8 +13,7 @@ offThreadCompileModuleToStencil(`
offThreadFun();
offThreadFun();
`);
let stencil = finishOffThreadCompileModuleToStencil();
let mod = instantiateModuleStencil(stencil);
let mod = finishOffThreadModule();
mod.declarationInstantiation();
mod.evaluation();
assertEq(hitCount, 4);

Просмотреть файл

@ -14,9 +14,8 @@ assertEq(g.dbg.allowUnobservedAsmJS, false);
enableLastWarning();
var asmFunStr = USE_ASM + 'function f() {} return f';
offThreadCompileToStencil("(function() {" + asmFunStr + "})");
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
offThreadCompileScript("(function() {" + asmFunStr + "})");
runOffThreadScript();
var msg = getLastWarning().message;
assertEq(msg === "asm.js type error: Asm.js optimizer disabled by debugger" ||

Просмотреть файл

@ -9,7 +9,7 @@ root.eval("this.dbg = new Debugger()");
root.dbg.addDebuggee(this);
root.dbg.memory.trackingAllocationSites = true;
offThreadCompileToStencil(
offThreadCompileScript(
"function foo() {\n" +
" print('hello world');\n" +
"}"

Просмотреть файл

@ -18,10 +18,9 @@ dbg.onDebuggerStatement = function (frame) {
assertEq(source.elementAttributeName, 'mass');
};
var job = g.offThreadCompileToStencil('debugger;');
var stencil = g.finishOffThreadCompileToStencil(job);
var job = g.offThreadCompileScript('debugger;');
log += 'o';
g.evalStencil(stencil,
g.runOffThreadScript(job,
{
element: elt,
elementAttributeName: 'mass'

Просмотреть файл

@ -61,16 +61,14 @@ log = '';
g.run(scriptdir + 'Source-introductionType-data');
assertEq(log, 'd');
// Shell 'offThreadCompileToStencil' function.
// Shell 'offThreadCompileScript' function.
dbg.onDebuggerStatement = function (frame) {
log += 'd';
assertEq(frame.script.source.introductionType,
"js shell offThreadCompileToStencil");
assertEq(frame.script.source.introductionType, "js shell offThreadCompileScript");
};
log = '';
g.offThreadCompileToStencil('debugger;');
var stencil = g.finishOffThreadCompileToStencil();
g.evalStencil(stencil);
g.offThreadCompileScript('debugger;');
g.runOffThreadScript();
assertEq(log, 'd');
// Debugger.Frame.prototype.eval

Просмотреть файл

@ -16,7 +16,6 @@ function loadFile(lfVarx) {
for (lfLocal in this)
if (!(lfLocal in lfGlobal))
lfGlobal[lfLocal] = this[lfLocal]
offThreadCompileToStencil(lfVarx);
var stencil = lfGlobal.finishOffThreadCompileToStencil();
lfGlobal.evalStencil(stencil);
offThreadCompileScript(lfVarx)
lfGlobal.runOffThreadScript()
}

Просмотреть файл

@ -8,6 +8,5 @@ for (var i = 0; i < 70000; i++)
evaluate(s);
var g = newGlobal({newCompartment: true});
(new Debugger).addDebuggee(g);
g.offThreadCompileToStencil('debugger;',{});
var stencil = finishOffThreadCompileToStencil();
g.evalStencil(stencil);
g.offThreadCompileScript('debugger;',{});
g.runOffThreadScript();

Просмотреть файл

@ -16,14 +16,13 @@ for (lfLocal in this) {
lfGlobal[lfLocal] = this[lfLocal];
}
}
lfGlobal.offThreadCompileToStencil(`
lfGlobal.offThreadCompileScript(`
var dbg = new Debugger(g);
dbg.onEnterFrame = function (frame) {
var frameThis = frame.this;
}
`);
var stencil = lfGlobal.finishOffThreadCompileToStencil();
lfGlobal.evalStencil(stencil);
lfGlobal.runOffThreadScript();
assertThrowsInstanceOf(test, ReferenceError);
function test() {
function check(fun, msg, todo) {

Просмотреть файл

@ -12,7 +12,6 @@ dbg.onNewScript = function (s) {
}
log = '';
g.offThreadCompileToStencil('"t" + "wine"');
var stencil = g.finishOffThreadCompileToStencil();
assertEq(g.evalStencil(stencil), 'twine');
g.offThreadCompileScript('"t" + "wine"');
assertEq(g.runOffThreadScript(), 'twine');
assertEq(log, 's');

Просмотреть файл

@ -8,6 +8,5 @@ dbg.onNewScript = function (s) {
assertEq(s.getChildScripts().length, 1);
};
global.eval('offThreadCompileToStencil("function inner() { \\\"use asm\\\"; function xxx() {} return xxx; }");');
global.eval('var stencil = finishOffThreadCompileToStencil();');
global.eval('evalStencil(stencil);');
global.eval('offThreadCompileScript("function inner() { \\\"use asm\\\"; function xxx() {} return xxx; }");');
global.eval('runOffThreadScript();');

Просмотреть файл

@ -6,6 +6,5 @@ gc();
schedulezone(this);
startgc(0, "shrinking");
var g = newGlobal();
g.offThreadCompileToStencil('debugger;', {});
var stencil = g.finishOffThreadCompileToStencil();
g.evalStencil(stencil);
g.offThreadCompileScript('debugger;', {});
g.runOffThreadScript();

Просмотреть файл

@ -7,6 +7,5 @@ for (lfLocal in this) {
}
}
const script = 'oomTest(() => getBacktrace({args: true, locals: "123795", thisprops: true}));';
lfGlobal.offThreadCompileToStencil(script);
var stencil = lfGlobal.finishOffThreadCompileToStencil();
lfGlobal.evalStencil(stencil);
lfGlobal.offThreadCompileScript(script);
lfGlobal.runOffThreadScript();

Просмотреть файл

@ -2,6 +2,5 @@
enableGeckoProfiling();
var s = newGlobal();
s.offThreadCompileToStencil('oomTest(() => {});');
var stencil = s.finishOffThreadCompileToStencil();
s.evalStencil(stencil);
s.offThreadCompileScript('oomTest(() => {});');
s.runOffThreadScript();

Просмотреть файл

@ -1,7 +1,6 @@
// |jit-test| skip-if: !('oomTest' in this)
oomTest(() => {
offThreadCompileToStencil(`try {} catch (NaN) {}`);
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
offThreadCompileScript(`try {} catch (NaN) {}`);
runOffThreadScript();
});

Просмотреть файл

@ -1,8 +1,7 @@
// |jit-test| skip-if: helperThreadCount() === 0 || !('oomTest' in this)
offThreadCompileToStencil(`
offThreadCompileScript(`
oomTest(() => "".search(/d/));
fullcompartmentchecks(3);
`);
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
runOffThreadScript();

Просмотреть файл

@ -22,9 +22,8 @@ function loadFile(lfVarx) {
case 5:
var lfGlobal = newGlobal();
for (lfLocal in this) {}
lfGlobal.offThreadCompileToStencil(lfVarx);
var stencil = lfGlobal.finishOffThreadCompileToStencil();
lfGlobal.evalStencil(stencil);
lfGlobal.offThreadCompileScript(lfVarx);
lfGlobal.runOffThreadScript();
}
} else if (!isNaN(lfVarx)) {
lfRunTypeId = parseInt(lfVarx);

Просмотреть файл

@ -11,9 +11,8 @@ oomTest(() => {
} catch (x) {}
gczeal(0);
`;
lfGlobal.offThreadCompileToStencil(lfVarx);
var stencil = lfGlobal.finishOffThreadCompileToStencil();
lfGlobal.evalStencil(stencil);
lfGlobal.offThreadCompileScript(lfVarx);
lfGlobal.runOffThreadScript();
runCount++;
}
});

Просмотреть файл

@ -3,6 +3,6 @@
// This will fail with --no-threads.
verifyprebarriers();
var lfGlobal = newGlobal();
lfGlobal.offThreadCompileToStencil(`
lfGlobal.offThreadCompileScript(`
version(185);
`);

Просмотреть файл

@ -3,7 +3,7 @@
var lfGlobal = newGlobal();
gczeal(4);
for (lfLocal in this) {}
lfGlobal.offThreadCompileToStencil(`
lfGlobal.offThreadCompileScript(`
var desc = {
value: 'bar',
value: false,

Просмотреть файл

@ -7,7 +7,6 @@ gczeal(9);
function rejectionTracker(state) {}
setPromiseRejectionTrackerCallback(rejectionTracker)
lfGlobal = newGlobal();
offThreadCompileToStencil(`new Promise(()=>rej)`);
var stencil = lfGlobal.finishOffThreadCompileToStencil();
lfGlobal.evalStencil(stencil);
offThreadCompileScript(`new Promise(()=>rej)`);
lfGlobal.runOffThreadScript();
for (lfLocal in this);

Просмотреть файл

@ -2,5 +2,5 @@
/x/;
oomTest(function(){
offThreadCompileToStencil('');
offThreadCompileScript('');
})

Просмотреть файл

@ -1,7 +1,7 @@
// |jit-test| skip-if: helperThreadCount() === 0
gczeal(0);
startgc(1, 'shrinking');
offThreadCompileToStencil("");
offThreadCompileScript("");
// Adapted from randomly chosen test: js/src/jit-test/tests/parser/bug-1263355-13.js
gczeal(9);
newGlobal();

Просмотреть файл

@ -3,8 +3,7 @@
m = 'x';
for (var i = 0; i < 10; i++)
m += m;
offThreadCompileToStencil("", ({elementAttributeName: m}));
offThreadCompileScript("", ({elementAttributeName: m}));
var n = newGlobal();
gczeal(2,1);
var stencil = n.finishOffThreadCompileToStencil();
n.evalStencil(stencil);
n.runOffThreadScript();

Просмотреть файл

@ -2,7 +2,7 @@
gczeal(0);
print = function(s) {}
startgc(1);
offThreadCompileToStencil("");
offThreadCompileScript("");
gczeal(10, 3);
for (var count = 0; count < 20; count++) {
print(count);

Просмотреть файл

@ -2,5 +2,5 @@
gczeal(0);
startgc(8301);
offThreadCompileToStencil("(({a,b,c}))");
offThreadCompileScript("(({a,b,c}))");
gcparam("maxBytes", gcparam("gcBytes"));

Просмотреть файл

@ -5,7 +5,7 @@ if (helperThreadCount() === 0)
var lfOffThreadGlobal = newGlobal();
enableShellAllocationMetadataBuilder()
lfOffThreadGlobal.offThreadCompileToStencil(`
lfOffThreadGlobal.offThreadCompileScript(`
if ("gczeal" in this)
gczeal(8, 1)
function recurse(x) {
@ -13,5 +13,4 @@ lfOffThreadGlobal.offThreadCompileToStencil(`
};
recurse(0);
`);
var stencil = lfOffThreadGlobal.finishOffThreadCompileToStencil();
lfOffThreadGlobal.evalStencil(stencil);
lfOffThreadGlobal.runOffThreadScript();

Просмотреть файл

@ -19,4 +19,4 @@ if (typeof oomTest == "function") {
}
deterministicgc(true);
startgc(9469, "shrinking");
offThreadCompileToStencil("");
offThreadCompileScript("");

Просмотреть файл

@ -1,7 +1,6 @@
// |jit-test| skip-if: helperThreadCount() === 0
gczeal(0);
offThreadCompileToStencil("");
offThreadCompileScript("");
startgc(0);
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
runOffThreadScript();

Просмотреть файл

@ -12,7 +12,7 @@ gcparam('allocationThreshold', 1);
gc();
// Start an off-thread parse.
offThreadCompileToStencil("print('Finished')");
offThreadCompileScript("print('Finished')");
// Allocate lots of atoms, parsing occasionally.
for (let i = 0; i < 10; i++) {
@ -23,5 +23,4 @@ for (let i = 0; i < 10; i++) {
}
// Finish the off-thread parse.
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
runOffThreadScript();

Просмотреть файл

@ -2,4 +2,4 @@
var fe = "vv";
for (i = 0; i < 24; i++) fe += fe;
offThreadCompileToStencil(fe, {});
offThreadCompileScript(fe, {});

Просмотреть файл

@ -4,7 +4,7 @@ setGCCallback({
action: "majorGC"
});
gcparam("allocationThreshold", 1);
offThreadCompileToStencil("");
offThreadCompileScript("");
for (let i = 0; i < 40000; i++)
Symbol.for(i);
eval(0);

Просмотреть файл

@ -6,5 +6,5 @@ setGCCallback({
});
gcslice(3);
var lfGlobal = newGlobal();
lfGlobal.offThreadCompileToStencil("");
lfGlobal.offThreadCompileScript("");

Просмотреть файл

@ -1,9 +1,8 @@
// |jit-test| skip-if: helperThreadCount() === 0 || !('oomTest' in this)
oomTest(new Function(`function execOffThread(source) {
offThreadCompileModuleToStencil(source);
var stencil = finishOffThreadCompileModuleToStencil();
return instantiateModuleStencil(stencil);
offThreadCompileModule(source);
return finishOffThreadModule();
}
b = execOffThread("[1, 2, 3]")
`));

Просмотреть файл

@ -4,13 +4,12 @@ gcparam('allocationThreshold', 1);
setGCCallback({
action: "majorGC",
});
offThreadCompileToStencil(('Boolean.prototype.toString.call(new String())'));
offThreadCompileScript(('Boolean.prototype.toString.call(new String())'));
for (let i = 0; i < 10; i++) {
for (let j = 0; j < 10000; j++) Symbol.for(i + 10 * j);
}
try {
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
runOffThreadScript();
} catch (e) {
assertEq(e.constructor, TypeError);
}

Просмотреть файл

@ -1,6 +1,6 @@
// |jit-test| allow-overrecursed; skip-if: helperThreadCount() === 0
function eval(source) {
offThreadCompileModuleToStencil(source);
offThreadCompileModule(source);
let get = (eval("function w(){}") ++);
};
gczeal(21, 10);

Просмотреть файл

@ -20,12 +20,11 @@ evaluate(`
var g = newGlobal({newCompartment: true});
var gw = dbg.addDebuggee(g);
`);
lfOffThreadGlobal.offThreadCompileToStencil(`
lfOffThreadGlobal.offThreadCompileScript(`
gcparam("markStackLimit", 1);
grayRoot()[0] = "foo";
`);
var stencil = lfOffThreadGlobal.finishOffThreadCompileToStencil();
lfOffThreadGlobal.evalStencil(stencil);
lfOffThreadGlobal.runOffThreadScript();
eval(`
var lfOffThreadGlobal = newGlobal({newCompartment: true});
try { evaluate(\`

Просмотреть файл

@ -4,7 +4,7 @@ try {
oomTest(function() {
eval(`
function eval(source) {
offThreadCompileModuleToStencil(source);
offThreadCompileModule(source);
minorgc();
}
eval("");

Просмотреть файл

@ -4,11 +4,10 @@ var g = newGlobal({ newCompartment: true });
var dbg = new Debugger;
var gw = dbg.addDebuggee(g);
lfOffThreadGlobal = g;
lfOffThreadGlobal.offThreadCompileToStencil(`
lfOffThreadGlobal.offThreadCompileScript(`
grayRoot()[0] = "foo";
`);
var stencil = lfOffThreadGlobal.finishOffThreadCompileToStencil();
lfOffThreadGlobal.evalStencil(stencil);
lfOffThreadGlobal.runOffThreadScript();
var g = newGlobal({newCompartment: true});
var gw = dbg.addDebuggee(g);
lfOffThreadGlobal = null;

Просмотреть файл

@ -1,9 +1,8 @@
// |jit-test| skip-if: !('oomTest' in this)
function parseModule(source) {
offThreadCompileModuleToStencil(source);
var stencil = finishOffThreadCompileModuleToStencil();
return instantiateModuleStencil(stencil);
offThreadCompileModule(source);
return finishOffThreadModule();
}
function loadFile(lfVarx) {
oomTest(function() {

Просмотреть файл

@ -1,5 +1,5 @@
// |jit-test| skip-if: helperThreadCount() === 0
verifyprebarriers();
offThreadCompileToStencil('');
offThreadCompileScript('');
var dbg = new Debugger();
var objects = dbg.findObjects();

Просмотреть файл

@ -3,7 +3,7 @@
var g = newGlobal();
gczeal(9, 1);
gczeal(11, 2);
g.offThreadCompileToStencil("");
g.offThreadCompileScript("")
setJitCompilerOption("offthread-compilation.enable", 1);
for (let i = 0 ; i < 3000; i++) {

Просмотреть файл

@ -9,4 +9,4 @@ function a(b) {
});
return c;
}
offThreadDecodeStencil(a(""));
offThreadDecodeScript(a(""));

Просмотреть файл

@ -5,6 +5,5 @@ setGCCallback({
schedulezone(this)
gcslice(3)
var lfGlobal = newGlobal();
lfGlobal.offThreadCompileToStencil("");
var stencil = lfGlobal.finishOffThreadCompileToStencil();
lfGlobal.evalStencil(stencil);
lfGlobal.offThreadCompileScript("");
lfGlobal.runOffThreadScript();

Просмотреть файл

@ -2,4 +2,4 @@
gczeal(0);
startgc(45);
offThreadCompileToStencil("print(1)");
offThreadCompileScript("print(1)");

Просмотреть файл

@ -1,5 +1,5 @@
// |jit-test| skip-if: helperThreadCount() === 0
gczeal(10);
newGlobal();
offThreadCompileToStencil("let x = 1;");
offThreadCompileScript("let x = 1;");
abortgc();

Просмотреть файл

@ -1,3 +1,3 @@
// |jit-test| skip-if: helperThreadCount() === 0
gczeal(4);
offThreadCompileToStencil("let x = 1;");
offThreadCompileScript("let x = 1;");

Просмотреть файл

@ -1,4 +1,4 @@
// |jit-test| skip-if: helperThreadCount() === 0
schedulezone("");
offThreadCompileToStencil("");
offThreadCompileScript("");

Просмотреть файл

@ -1,6 +1,5 @@
// |jit-test| skip-if: !('oomTest' in this)
oomTest(function () {
offThreadCompileModuleToStencil('');
var stencil = finishOffThreadCompileModuleToStencil();
instantiateModuleStencil(stencil);
offThreadCompileModule('');
finishOffThreadModule();
});

Просмотреть файл

@ -1,7 +1,7 @@
// |jit-test| skip-if: !('oomTest' in this) || helperThreadCount() === 0
oomTest(() => {
offThreadCompileToStencil(
offThreadCompileScript(
`
function f(x) {
if (x == 0)
@ -10,6 +10,5 @@ oomTest(() => {
}
f(5);
`);
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
runOffThreadScript();
});

Просмотреть файл

@ -1,7 +1,6 @@
// |jit-test| skip-if: !('oomTest' in this) || helperThreadCount() === 0
oomTest(() => {
offThreadCompileToStencil("function a(x) {");
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
offThreadCompileScript("function a(x) {");
runOffThreadScript();
});

Просмотреть файл

@ -1,7 +1,7 @@
// |jit-test| skip-if: !('oomTest' in this) || helperThreadCount() === 0
oomTest(() => {
offThreadCompileToStencil(`
offThreadCompileScript(`
function f(x) {
class of extends ("ABCDEFGHIJK") {
test() { return true; };
@ -12,6 +12,5 @@ oomTest(() => {
}
return g("try{}catch(e){}", n);
`);
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
runOffThreadScript();
});

Просмотреть файл

@ -3,7 +3,7 @@
// Unhandlable OOM in AlternativeGeneration::AlternativeGeneration.
if (typeof oomAfterAllocations == "function" && helperThreadCount() > 0) {
offThreadCompileToStencil(`
offThreadCompileScript(`
[null, "", ""].forEach(function(locales) {
try {
Intl.NumberFormat(locales)
@ -11,6 +11,5 @@ Intl.NumberFormat(locales)
oomAfterAllocations(100);
})
`);
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
runOffThreadScript();
}

Просмотреть файл

@ -2,17 +2,12 @@
// (1) Poison an element in the ionLazyLinkList with a builder whose
// script is in a different compartment.
evaluate(`
offThreadCompileToStencil("var x = -1");
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
`,
evaluate('offThreadCompileScript("var x = -1"); runOffThreadScript()',
{ global: newGlobal() });
// (2) Spam the ionLazyLinkList with pending builders until it pops off the one
// for the other compartment's script.
for (var i = 0; i < 1000; ++i) {
offThreadCompileToStencil('var x = ' + i);
var stencil = finishOffThreadCompileToStencil();
evalStencil(stencil);
offThreadCompileScript('var x = ' + i);
runOffThreadScript();
}

Просмотреть файл

@ -1,3 +1,3 @@
// |jit-test| error: Error
offThreadCompileToStencil("");
finishOffThreadCompileModuleToStencil();
offThreadCompileScript("");
finishOffThreadModule();

Просмотреть файл

@ -2,9 +2,8 @@
// Overwrite built-in parseModule with off-thread module parser.
function parseModule(source) {
offThreadCompileModuleToStencil(source);
var stencil = finishOffThreadCompileModuleToStencil();
return instantiateModuleStencil(stencil);
offThreadCompileModule(source);
return finishOffThreadModule();
}
// Test case derived from: js/src/jit-test/tests/modules/many-imports.js

Просмотреть файл

@ -1,2 +1,2 @@
// |jit-test| skip-if: helperThreadCount() === 0
offThreadCompileToStencil('import("")', {});
offThreadCompileScript('import("")', {});

Просмотреть файл

@ -1,4 +1,3 @@
// |jit-test| skip-if: helperThreadCount() === 0
offThreadCompileModuleToStencil("");
var stencil = finishOffThreadCompileModuleToStencil();
instantiateModuleStencil(stencil);
offThreadCompileModule("");
finishOffThreadModule();

Просмотреть файл

@ -19,9 +19,8 @@ if (helperThreadCount() == 0)
quit();
function offThreadEvalModuleAndCheck(source, expected) {
offThreadCompileModuleToStencil(source);
let stencil = finishOffThreadCompileModuleToStencil();
let m = instantiateModuleStencil(stencil);
offThreadCompileModule(source);
let m = finishOffThreadModule();
print("compiled");
m.declarationInstantiation();
m.evaluation();

Просмотреть файл

@ -3,8 +3,5 @@
load(libdir + "asserts.js")
// Don't assert.
offThreadCompileModuleToStencil("export { x };");
assertThrowsInstanceOf(() => {
var stencil = finishOffThreadCompileModuleToStencil();
instantiateModuleStencil(stencil);
}, SyntaxError);
offThreadCompileModule("export { x };");
assertThrowsInstanceOf(() => finishOffThreadModule(), SyntaxError);

Просмотреть файл

@ -5,9 +5,8 @@
load(libdir + "asserts.js");
function offThreadParseAndEvaluate(source) {
offThreadCompileModuleToStencil(source);
let stencil = finishOffThreadCompileModuleToStencil();
let m = instantiateModuleStencil(stencil);
offThreadCompileModule(source);
let m = finishOffThreadModule();
m.declarationInstantiation();
return m.evaluation();
}

Просмотреть файл

@ -212,9 +212,8 @@ testMethod(q, "declarationInstantiation");
testMethod(q, "evaluation");
if (helperThreadCount() > 0) {
offThreadCompileModuleToStencil(``);
let stencil = finishOffThreadCompileModuleToStencil();
let r = instantiateModuleStencil(stencil);
offThreadCompileModule(``);
let r = finishOffThreadModule();
r.declarationInstantiation();
r.evaluation();
testMethod(r, "declarationInstantiation");

Просмотреть файл

@ -1,9 +1,8 @@
// |jit-test| skip-if: helperThreadCount() === 0
function eval(source) {
offThreadCompileModuleToStencil(source);
let stencil = finishOffThreadCompileModuleToStencil();
let m = instantiateModuleStencil(stencil);
offThreadCompileModule(source);
let m = finishOffThreadModule();
m.declarationInstantiation();
return m.evaluation();
}

Просмотреть файл

@ -5,16 +5,14 @@
function execOffThread(source)
{
offThreadCompileToStencil(source);
var stencil = finishOffThreadCompileToStencil();
return evalStencil(stencil);
offThreadCompileScript(source);
return runOffThreadScript();
}
function parseModuleOffThread(source)
{
offThreadCompileModuleToStencil(source);
var stencil = finishOffThreadCompileModuleToStencil();
return instantiateModuleStencil(stencil);
offThreadCompileModule(source);
return finishOffThreadModule();
}
let a = { x: 1 };

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше