From 71f34b31f32fce210deb5103eab401a8cf10170a Mon Sep 17 00:00:00 2001 From: Trevor Elliott Date: Fri, 24 Feb 2023 16:48:12 -0800 Subject: [PATCH 01/10] Bring back the JS Streams implementation Revert "Bug 1795914 - Remove JS Streams implementation r=jandem" This reverts commit 4852cc8cc479dd5e4d463360e4d154c246bfccca. Revert "Bug 1807845 - Remove the dom.streams prefs r=evilpie,emilio" This reverts commit 15d6982515a191a1fa619038ba4966315d941d60. Revert "Bug 1755391 - Remove JS Streams implementation of Writable Stream and PipeTo r=jandem" This reverts commit f83d513364b1dd6112b760c93d7192f9f647d720. Revert "Bug 1522136 - Remove javascript.options.streams and other legacy prefs. r=mgaudet,webidl,edgar" This reverts commit c256578f285c499e42a09de03fca0eb480772e7a. Revert "Bug 1765060 - Remove dead JS streams code. r=mgaudet" This reverts commit 75cea938648b566b461695be2e7cdd3978be4411. Revert "Bug 1774691 - Remove unused JSMSGs. r=mgaudet" This reverts commit b54b83321ed3bc0d73c144889e2e3279a33ee270. Revert "Bug 1774672 - Remove no longer neaded JS Streams Magic Values r=iain" This reverts commit d1c4d10de47547ffb088f402207f1c4d05b33f64. Revert "Bug 1776013 - Consume mfbt SIMD for String builtins r=iain" This reverts commit f81ba5c480ddd719b276889287f2c56b9b184a48. Revert "Bug 1779807 - Consume SIMD::memchr64 for array includes/indexof r=iain" This reverts commit 557de269a9fa1d75158d7abf4d82e0fdb9903ffd. Add the 'js/Stream.h' include back into 'vm/Runtime.h' Add JSAPI functions for operating on ReadableStream and WritableStream This adds a few functions for working with ReadableStream, plus introduces a basic set of ones for working with WritableStreams at all. This patch also includes updates to some of the doc comments for the existing streams API: for many functions the doc comment said that they assert that a passed `Handle` is (a wrapper for) a specific type, but in reality the function does a check and throws an error instead of asserting. Since this patch introduces a few functions that actually do assert, it seems important to ensure the different behavior is correctly documented. Fix bug in ReadableStream#pipeTo that causes a failed assert when two actions get queued that trigger a pipeTo shutdown This can happen e.g. when closing the readable and then erroring the writable end of the pipe in the same microtask. The Streams spec guards against this by just making Shutdown and ShutdownWithAction bail early if already shutting down, but the implementation was doing an upwrap of the source or destination stream that fails if not guarded by a shuttingDown check because the streams have already been cleared. Fix bugs in ReadableStream#pipeTo that prevent proper flushing of all pending write requests when the source is closed BYOB streams (#2) Co-authored-by: Jake Champion combine the js streams behind one flag --- dom/base/BodyStream.h | 168 +++ dom/fetch/FetchStreamReader.cpp | 1 + .../test/browser_download_canceled.js | 1 + dom/serviceworkers/test/test_fetch_event.html | 3 + .../test_fetch_event_with_thirdpartypref.html | 1 + dom/streams/ReadableStream.cpp | 11 + .../ReadableByteStreamController.webidl | 2 +- dom/webidl/ReadableStream.webidl | 4 +- dom/webidl/ReadableStreamBYOBReader.webidl | 2 +- dom/webidl/ReadableStreamBYOBRequest.webidl | 2 +- .../ReadableStreamDefaultController.webidl | 2 +- dom/webidl/ReadableStreamDefaultReader.webidl | 3 +- dom/webidl/Response.webidl | 2 +- dom/webidl/TransformStream.webidl | 3 +- .../TransformStreamDefaultController.webidl | 3 +- dom/webidl/WritableStream.webidl | 5 +- .../WritableStreamDefaultController.webidl | 2 +- dom/webidl/WritableStreamDefaultWriter.webidl | 2 +- .../test_readableStream_when_closing.html | 42 +- js/moz.configure | 18 + js/public/ProtoKey.h | 21 +- js/public/RealmOptions.h | 14 + js/public/Stream.h | 734 ++++++++++ js/public/TypeDecls.h | 6 + js/public/Value.h | 18 + js/public/friend/ErrorNumbers.msg | 60 + js/src/builtin/TestingFunctions.cpp | 10 + js/src/builtin/streams/ClassSpecMacro.h | 40 + .../streams/MiscellaneousOperations-inl.h | 115 ++ .../streams/MiscellaneousOperations.cpp | 251 ++++ .../builtin/streams/MiscellaneousOperations.h | 88 ++ js/src/builtin/streams/PipeToState-inl.h | 52 + js/src/builtin/streams/PipeToState.cpp | 1295 +++++++++++++++++ js/src/builtin/streams/PipeToState.h | 291 ++++ js/src/builtin/streams/PullIntoDescriptor.cpp | 48 + js/src/builtin/streams/PullIntoDescriptor.h | 79 + js/src/builtin/streams/QueueWithSizes-inl.h | 77 + js/src/builtin/streams/QueueWithSizes.cpp | 170 +++ js/src/builtin/streams/QueueWithSizes.h | 64 + js/src/builtin/streams/QueueingStrategies.cpp | 231 +++ js/src/builtin/streams/QueueingStrategies.h | 57 + .../streams/ReadableByteStreamController.cpp | 821 +++++++++++ ...ReadableByteStreamControllerOperations.cpp | 1230 ++++++++++++++++ .../ReadableByteStreamControllerOperations.h | 107 ++ js/src/builtin/streams/ReadableStream.cpp | 598 ++++++++ js/src/builtin/streams/ReadableStream.h | 149 ++ .../streams/ReadableStreamBYOBReader.cpp | 569 ++++++++ .../streams/ReadableStreamBYOBRequest.cpp | 261 ++++ .../streams/ReadableStreamBYOBRequest.h | 63 + .../streams/ReadableStreamController.h | 346 +++++ .../ReadableStreamDefaultController.cpp | 532 +++++++ ...dableStreamDefaultControllerOperations.cpp | 700 +++++++++ ...eadableStreamDefaultControllerOperations.h | 74 + .../streams/ReadableStreamDefaultReader.cpp | 376 +++++ .../streams/ReadableStreamInternals.cpp | 534 +++++++ .../builtin/streams/ReadableStreamInternals.h | 62 + .../streams/ReadableStreamOperations.cpp | 693 +++++++++ .../streams/ReadableStreamOperations.h | 45 + .../streams/ReadableStreamReader-inl.h | 70 + .../builtin/streams/ReadableStreamReader.cpp | 259 ++++ js/src/builtin/streams/ReadableStreamReader.h | 172 +++ js/src/builtin/streams/StreamAPI.cpp | 861 +++++++++++ js/src/builtin/streams/StreamController-inl.h | 24 + js/src/builtin/streams/StreamController.h | 51 + js/src/builtin/streams/Streams-inl.h | 60 + js/src/builtin/streams/TeeState.cpp | 53 + js/src/builtin/streams/TeeState.h | 155 ++ js/src/builtin/streams/WritableStream-inl.h | 46 + js/src/builtin/streams/WritableStream.cpp | 285 ++++ js/src/builtin/streams/WritableStream.h | 430 ++++++ .../WritableStreamDefaultController.cpp | 83 ++ .../streams/WritableStreamDefaultController.h | 186 +++ ...tableStreamDefaultControllerOperations.cpp | 1012 +++++++++++++ ...ritableStreamDefaultControllerOperations.h | 107 ++ .../streams/WritableStreamDefaultWriter-inl.h | 39 + .../streams/WritableStreamDefaultWriter.cpp | 526 +++++++ .../streams/WritableStreamDefaultWriter.h | 111 ++ .../streams/WritableStreamOperations.cpp | 922 ++++++++++++ .../streams/WritableStreamOperations.h | 76 + .../WritableStreamWriterOperations.cpp | 444 ++++++ .../streams/WritableStreamWriterOperations.h | 55 + js/src/frontend/FrontendContext.cpp | 4 +- js/src/fuzz-tests/tests.cpp | 5 +- js/src/jsapi-tests/moz.build | 5 + js/src/jsapi-tests/testReadableStream.cpp | 1195 +++++++++++++++ js/src/jsapi-tests/tests.cpp | 4 +- js/src/moz.build | 29 + js/src/shell/js.cpp | 26 + js/src/shell/jsshell.h | 5 + .../ReadableStream/readable-stream-globals.js | 367 +++++ js/src/vm/CommonPropertyNames.h | 12 + js/src/vm/GlobalObject.cpp | 23 + js/src/vm/List-inl.h | 65 +- js/src/vm/List.h | 13 + js/src/vm/NativeObject.h | 2 + js/src/vm/Runtime.h | 25 + js/xpconnect/src/XPCJSRuntime.cpp | 1 + modules/libpref/init/StaticPrefList.yaml | 16 + .../meta/fetch/api/abort/__dir__.ini | 1 + .../meta/fetch/api/basic/__dir__.ini | 1 + .../meta/fetch/api/response/__dir__.ini | 1 + ...sponse-stream-disturbed-by-pipe.any.js.ini | 1 + .../__dir__.ini | 1 + .../webappapis/structured-clone/__dir__.ini | 1 + .../meta/service-workers/__dir__.ini | 2 +- testing/web-platform/meta/streams/__dir__.ini | 1 + .../meta/streams/transferable/__dir__.ini | 1 + .../semantics/interface-objects/__dir__.ini | 1 + .../semantics/structured-clone/__dir__.ini | 1 + testing/web-platform/meta/xhr/__dir__.ini | 1 + 110 files changed, 18957 insertions(+), 38 deletions(-) create mode 100644 dom/base/BodyStream.h create mode 100644 js/public/Stream.h create mode 100644 js/src/builtin/streams/ClassSpecMacro.h create mode 100644 js/src/builtin/streams/MiscellaneousOperations-inl.h create mode 100644 js/src/builtin/streams/MiscellaneousOperations.cpp create mode 100644 js/src/builtin/streams/MiscellaneousOperations.h create mode 100644 js/src/builtin/streams/PipeToState-inl.h create mode 100644 js/src/builtin/streams/PipeToState.cpp create mode 100644 js/src/builtin/streams/PipeToState.h create mode 100644 js/src/builtin/streams/PullIntoDescriptor.cpp create mode 100644 js/src/builtin/streams/PullIntoDescriptor.h create mode 100644 js/src/builtin/streams/QueueWithSizes-inl.h create mode 100644 js/src/builtin/streams/QueueWithSizes.cpp create mode 100644 js/src/builtin/streams/QueueWithSizes.h create mode 100644 js/src/builtin/streams/QueueingStrategies.cpp create mode 100644 js/src/builtin/streams/QueueingStrategies.h create mode 100644 js/src/builtin/streams/ReadableByteStreamController.cpp create mode 100644 js/src/builtin/streams/ReadableByteStreamControllerOperations.cpp create mode 100644 js/src/builtin/streams/ReadableByteStreamControllerOperations.h create mode 100644 js/src/builtin/streams/ReadableStream.cpp create mode 100644 js/src/builtin/streams/ReadableStream.h create mode 100644 js/src/builtin/streams/ReadableStreamBYOBReader.cpp create mode 100644 js/src/builtin/streams/ReadableStreamBYOBRequest.cpp create mode 100644 js/src/builtin/streams/ReadableStreamBYOBRequest.h create mode 100644 js/src/builtin/streams/ReadableStreamController.h create mode 100644 js/src/builtin/streams/ReadableStreamDefaultController.cpp create mode 100644 js/src/builtin/streams/ReadableStreamDefaultControllerOperations.cpp create mode 100644 js/src/builtin/streams/ReadableStreamDefaultControllerOperations.h create mode 100644 js/src/builtin/streams/ReadableStreamDefaultReader.cpp create mode 100644 js/src/builtin/streams/ReadableStreamInternals.cpp create mode 100644 js/src/builtin/streams/ReadableStreamInternals.h create mode 100644 js/src/builtin/streams/ReadableStreamOperations.cpp create mode 100644 js/src/builtin/streams/ReadableStreamOperations.h create mode 100644 js/src/builtin/streams/ReadableStreamReader-inl.h create mode 100644 js/src/builtin/streams/ReadableStreamReader.cpp create mode 100644 js/src/builtin/streams/ReadableStreamReader.h create mode 100644 js/src/builtin/streams/StreamAPI.cpp create mode 100644 js/src/builtin/streams/StreamController-inl.h create mode 100644 js/src/builtin/streams/StreamController.h create mode 100644 js/src/builtin/streams/Streams-inl.h create mode 100644 js/src/builtin/streams/TeeState.cpp create mode 100644 js/src/builtin/streams/TeeState.h create mode 100644 js/src/builtin/streams/WritableStream-inl.h create mode 100644 js/src/builtin/streams/WritableStream.cpp create mode 100644 js/src/builtin/streams/WritableStream.h create mode 100644 js/src/builtin/streams/WritableStreamDefaultController.cpp create mode 100644 js/src/builtin/streams/WritableStreamDefaultController.h create mode 100644 js/src/builtin/streams/WritableStreamDefaultControllerOperations.cpp create mode 100644 js/src/builtin/streams/WritableStreamDefaultControllerOperations.h create mode 100644 js/src/builtin/streams/WritableStreamDefaultWriter-inl.h create mode 100644 js/src/builtin/streams/WritableStreamDefaultWriter.cpp create mode 100644 js/src/builtin/streams/WritableStreamDefaultWriter.h create mode 100644 js/src/builtin/streams/WritableStreamOperations.cpp create mode 100644 js/src/builtin/streams/WritableStreamOperations.h create mode 100644 js/src/builtin/streams/WritableStreamWriterOperations.cpp create mode 100644 js/src/builtin/streams/WritableStreamWriterOperations.h create mode 100644 js/src/jsapi-tests/testReadableStream.cpp create mode 100644 js/src/tests/non262/ReadableStream/readable-stream-globals.js create mode 100644 testing/web-platform/meta/html/infrastructure/safe-passing-of-structured-data/__dir__.ini create mode 100644 testing/web-platform/meta/html/webappapis/structured-clone/__dir__.ini create mode 100644 testing/web-platform/meta/streams/__dir__.ini create mode 100644 testing/web-platform/meta/workers/semantics/interface-objects/__dir__.ini create mode 100644 testing/web-platform/meta/workers/semantics/structured-clone/__dir__.ini diff --git a/dom/base/BodyStream.h b/dom/base/BodyStream.h new file mode 100644 index 0000000000000..61269c32d4e1c --- /dev/null +++ b/dom/base/BodyStream.h @@ -0,0 +1,168 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +#ifndef mozilla_dom_BodyStream_h +#define mozilla_dom_BodyStream_h + +#include "jsapi.h" +#include "js/Stream.h" +#include "mozilla/AlreadyAddRefed.h" +#include "mozilla/dom/ByteStreamHelpers.h" +#include "mozilla/dom/BindingDeclarations.h" +#include "nsIAsyncInputStream.h" +#include "nsCycleCollectionParticipant.h" +#include "nsIObserver.h" +#include "nsISupportsImpl.h" +#include "nsNetCID.h" +#include "nsWeakReference.h" + +class nsIGlobalObject; + +class nsIInputStream; + +namespace mozilla { +class ErrorResult; + +namespace dom { + +class BodyStream; +class StrongWorkerRef; +class ReadableStream; +class ReadableStreamController; + +class BodyStreamUnderlyingSourceAlgorithms; + +class BodyStreamHolder : public nsISupports { + friend class BodyStream; + friend class BodyStreamUnderlyingSourceAlgorithms; + friend class BodyStreamUnderlyingSourceErrorCallbackHelper; + + public: + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_CLASS(BodyStreamHolder) + + BodyStreamHolder(); + + virtual void NullifyStream() { mReadableStreamBody = nullptr; } + + virtual void MarkAsRead() {} + + void SetReadableStreamBody(ReadableStream* aBody) { + mReadableStreamBody = aBody; + } + ReadableStream* GetReadableStreamBody() { return mReadableStreamBody; } + + protected: + virtual ~BodyStreamHolder() = default; + + // This is the ReadableStream exposed to content. It's underlying source is a + // BodyStream object. + RefPtr mReadableStreamBody; + + private: + void StoreBodyStream(BodyStream* aBodyStream); + already_AddRefed TakeBodyStream() { + MOZ_ASSERT_IF(mStreamCreated, mBodyStream); + return mBodyStream.forget(); + } + BodyStream* GetBodyStream() { return mBodyStream; } + + RefPtr mBodyStream; + +#ifdef DEBUG + bool mStreamCreated = false; +#endif +}; + +class BodyStream final : public nsIInputStreamCallback, + public nsIObserver, + public nsSupportsWeakReference { + friend class BodyStreamHolder; + + public: + NS_DECL_ISUPPORTS + NS_DECL_NSIINPUTSTREAMCALLBACK + NS_DECL_NSIOBSERVER + + // This method creates a JS ReadableStream object and it assigns it to the + // aStreamHolder calling SetReadableStreamBody(). + MOZ_CAN_RUN_SCRIPT_BOUNDARY + static void Create(JSContext* aCx, BodyStreamHolder* aStreamHolder, + nsIGlobalObject* aGlobal, nsIInputStream* aInputStream, + ErrorResult& aRv); + + void Close(); + + static nsresult RetrieveInputStream(BodyStreamHolder* aStream, + nsIInputStream** aInputStream); + + private: + BodyStream(nsIGlobalObject* aGlobal, BodyStreamHolder* aStreamHolder, + nsIInputStream* aInputStream); + ~BodyStream(); + + public: + // Pull Callback + already_AddRefed PullCallback(JSContext* aCx, + ReadableStreamController& aController, + ErrorResult& aRv); + + void CloseInputAndReleaseObjects(); + + private: + // Fills a buffer with bytes from the stream. + void WriteIntoReadRequestBuffer(JSContext* aCx, ReadableStream* aStream, + JS::Handle aBuffer, + uint32_t aLength, uint32_t* aByteWritten); + + // This is a script boundary until Bug 1750605 is resolved and allows us + // to replace this with MOZ_CAN_RUN_SCRIPT. + MOZ_CAN_RUN_SCRIPT_BOUNDARY void EnqueueChunkWithSizeIntoStream( + JSContext* aCx, ReadableStream* aStream, uint64_t aAvailableData, + ErrorResult& aRv); + + void ErrorPropagation(JSContext* aCx, ReadableStream* aStream, + nsresult aError); + + // TODO: convert this to MOZ_CAN_RUN_SCRIPT (bug 1750605) + MOZ_CAN_RUN_SCRIPT_BOUNDARY void CloseAndReleaseObjects( + JSContext* aCx, ReadableStream* aStream); + + class WorkerShutdown; + + void ReleaseObjects(); + + // The closed state should ultimately be managed by the source algorithms + // class. See also bug 1815997. + bool IsClosed() { return !mStreamHolder; } + + // Common methods + + // mGlobal is set on creation, and isn't modified off the owning thread. + // It isn't set to nullptr until ReleaseObjects() runs. + nsCOMPtr mGlobal; + // Same for mStreamHolder. mStreamHolder being nullptr means the stream is + // closed. + RefPtr mStreamHolder; + nsCOMPtr mOwningEventTarget; + // Same as mGlobal but set to nullptr on OnInputStreamReady (on the owning + // thread). + RefPtr mPullPromise; + + // This is the original inputStream received during the CTOR. It will be + // converted into an nsIAsyncInputStream and stored into mInputStream at the + // first use. + nsCOMPtr mOriginalInputStream; + nsCOMPtr mInputStream; + + RefPtr mWorkerRef; + RefPtr mAsyncWaitWorkerRef; +}; + +} // namespace dom +} // namespace mozilla + +#endif // mozilla_dom_BodyStream_h diff --git a/dom/fetch/FetchStreamReader.cpp b/dom/fetch/FetchStreamReader.cpp index a4e72a343ec75..d4d6a3d2920e1 100644 --- a/dom/fetch/FetchStreamReader.cpp +++ b/dom/fetch/FetchStreamReader.cpp @@ -7,6 +7,7 @@ #include "FetchStreamReader.h" #include "InternalResponse.h" +#include "js/Stream.h" #include "jsapi.h" #include "mozilla/ConsoleReportCollector.h" #include "mozilla/ErrorResult.h" diff --git a/dom/serviceworkers/test/browser_download_canceled.js b/dom/serviceworkers/test/browser_download_canceled.js index 2deb8389efa2e..937d9cd20a952 100644 --- a/dom/serviceworkers/test/browser_download_canceled.js +++ b/dom/serviceworkers/test/browser_download_canceled.js @@ -138,6 +138,7 @@ add_task(async function interruptedDownloads() { ["dom.serviceWorkers.enabled", true], ["dom.serviceWorkers.exemptFromPerDomainMax", true], ["dom.serviceWorkers.testing.enabled", true], + ["javascript.options.streams", true], ], }); diff --git a/dom/serviceworkers/test/test_fetch_event.html b/dom/serviceworkers/test/test_fetch_event.html index 5227f6ae34308..d9527ffb6f0b7 100644 --- a/dom/serviceworkers/test/test_fetch_event.html +++ b/dom/serviceworkers/test/test_fetch_event.html @@ -68,6 +68,9 @@ ["dom.serviceWorkers.exemptFromPerDomainMax", true], ["dom.serviceWorkers.enabled", true], ["dom.serviceWorkers.testing.enabled", true], + ["browser.opaqueResponseBlocking", true], + ["browser.opaqueResponseBlocking.javascriptValidator", true] + ["javascript.options.streams", true], ]}, runTest); diff --git a/dom/serviceworkers/test/test_fetch_event_with_thirdpartypref.html b/dom/serviceworkers/test/test_fetch_event_with_thirdpartypref.html index 53552e03c3fde..7ab08af9e40b0 100644 --- a/dom/serviceworkers/test/test_fetch_event_with_thirdpartypref.html +++ b/dom/serviceworkers/test/test_fetch_event_with_thirdpartypref.html @@ -82,6 +82,7 @@ ["dom.serviceWorkers.exemptFromPerDomainMax", true], ["dom.serviceWorkers.enabled", true], ["dom.serviceWorkers.testing.enabled", true], + ["javascript.options.streams", true], ["network.cookie.cookieBehavior", COOKIE_BEHAVIOR_REJECTFOREIGN], ]}, runTest); diff --git a/dom/streams/ReadableStream.cpp b/dom/streams/ReadableStream.cpp index 79a16034cc2a6..9e62df9187084 100644 --- a/dom/streams/ReadableStream.cpp +++ b/dom/streams/ReadableStream.cpp @@ -200,6 +200,11 @@ already_AddRefed ReadableStream::Constructor( } // Step 4.3 + if (!StaticPrefs::dom_streams_byte_streams_enabled()) { + aRv.ThrowNotSupportedError("BYOB byte streams not yet supported."); + return nullptr; + } + SetUpReadableByteStreamControllerFromUnderlyingSource( aGlobal.Context(), readableStream, underlyingSourceObj, underlyingSourceDict, highWaterMark, aRv); @@ -708,6 +713,12 @@ void ReadableStream::GetReader(const ReadableStreamGetReaderOptions& aOptions, MOZ_ASSERT(aOptions.mMode.Value() == ReadableStreamReaderMode::Byob); // Step 3. Return ? AcquireReadableStreamBYOBReader(this). + if (!StaticPrefs::dom_streams_byte_streams_enabled()) { + aRv.ThrowTypeError("BYOB byte streams reader not yet supported."); + return; + } + + RefPtr thisRefPtr = this; RefPtr byobReader = AcquireReadableStreamBYOBReader(this, aRv); if (aRv.Failed()) { diff --git a/dom/webidl/ReadableByteStreamController.webidl b/dom/webidl/ReadableByteStreamController.webidl index 74dbfc4c4b911..ae5a724f89557 100644 --- a/dom/webidl/ReadableByteStreamController.webidl +++ b/dom/webidl/ReadableByteStreamController.webidl @@ -7,7 +7,7 @@ * https://streams.spec.whatwg.org/#rbs-controller-class-definition */ -[Exposed=*] +[Exposed=*, Pref="dom.streams.byte_streams.enabled"] interface ReadableByteStreamController { [Throws] // Throws on OOM readonly attribute ReadableStreamBYOBRequest? byobRequest; diff --git a/dom/webidl/ReadableStream.webidl b/dom/webidl/ReadableStream.webidl index 23142da33de02..121a946645d4e 100644 --- a/dom/webidl/ReadableStream.webidl +++ b/dom/webidl/ReadableStream.webidl @@ -23,10 +23,10 @@ interface ReadableStream { [Throws] ReadableStreamReader getReader(optional ReadableStreamGetReaderOptions options = {}); - [Throws] + [Pref="dom.streams.transform_streams.enabled", Throws] ReadableStream pipeThrough(ReadableWritablePair transform, optional StreamPipeOptions options = {}); - [NewObject] + [Pref="dom.streams.pipeTo.enabled", NewObject] Promise pipeTo(WritableStream destination, optional StreamPipeOptions options = {}); [Throws] diff --git a/dom/webidl/ReadableStreamBYOBReader.webidl b/dom/webidl/ReadableStreamBYOBReader.webidl index 1e4e51e5285d2..55a2cca8b07e0 100644 --- a/dom/webidl/ReadableStreamBYOBReader.webidl +++ b/dom/webidl/ReadableStreamBYOBReader.webidl @@ -7,7 +7,7 @@ * https://streams.spec.whatwg.org/#byob-reader-class-definition */ -[Exposed=*] +[Exposed=*, Pref="dom.streams.byte_streams.enabled"] interface ReadableStreamBYOBReader { [Throws] constructor(ReadableStream stream); diff --git a/dom/webidl/ReadableStreamBYOBRequest.webidl b/dom/webidl/ReadableStreamBYOBRequest.webidl index cc9a6b0f44bdf..a37538a0d77df 100644 --- a/dom/webidl/ReadableStreamBYOBRequest.webidl +++ b/dom/webidl/ReadableStreamBYOBRequest.webidl @@ -7,7 +7,7 @@ * https://streams.spec.whatwg.org/#rs-byob-request-class-definition */ -[Exposed=*] +[Exposed=*, Pref="dom.streams.byte_streams.enabled"] interface ReadableStreamBYOBRequest { readonly attribute ArrayBufferView? view; diff --git a/dom/webidl/ReadableStreamDefaultController.webidl b/dom/webidl/ReadableStreamDefaultController.webidl index 0964d4b1d60e1..f526236c25397 100644 --- a/dom/webidl/ReadableStreamDefaultController.webidl +++ b/dom/webidl/ReadableStreamDefaultController.webidl @@ -7,7 +7,7 @@ * https://streams.spec.whatwg.org/#rs-default-controller-class-definition */ -[Exposed=*] +[Exposed=*, Pref="dom.streams.readable_stream_default_controller.enabled"] interface ReadableStreamDefaultController { readonly attribute unrestricted double? desiredSize; diff --git a/dom/webidl/ReadableStreamDefaultReader.webidl b/dom/webidl/ReadableStreamDefaultReader.webidl index 21a9293b0cd0f..959ac2267d5af 100644 --- a/dom/webidl/ReadableStreamDefaultReader.webidl +++ b/dom/webidl/ReadableStreamDefaultReader.webidl @@ -19,7 +19,8 @@ interface mixin ReadableStreamGenericReader { Promise cancel(optional any reason); }; -[Exposed=*] +[Exposed=*, +Pref="dom.streams.readable_stream_default_reader.enabled"] interface ReadableStreamDefaultReader { [Throws] constructor(ReadableStream stream); diff --git a/dom/webidl/Response.webidl b/dom/webidl/Response.webidl index 5257c34176c41..f05105f7a9761 100644 --- a/dom/webidl/Response.webidl +++ b/dom/webidl/Response.webidl @@ -44,7 +44,7 @@ Response includes Body; // This should be part of Body but we don't want to expose body to request yet. // See bug 1387483. partial interface Response { - [GetterThrows] + [GetterThrows, Pref="javascript.options.streams"] readonly attribute ReadableStream? body; }; diff --git a/dom/webidl/TransformStream.webidl b/dom/webidl/TransformStream.webidl index 3dcc74eedd580..16d713510a392 100644 --- a/dom/webidl/TransformStream.webidl +++ b/dom/webidl/TransformStream.webidl @@ -7,7 +7,8 @@ * https://streams.spec.whatwg.org/#ts-class-definition */ -[Exposed=*] // [Transferable] - See Bug 1562065 +[Exposed=*, +Pref="dom.streams.transform_streams.enabled"] // [Transferable] - See Bug 1562065 interface TransformStream { [Throws] constructor(optional object transformer, diff --git a/dom/webidl/TransformStreamDefaultController.webidl b/dom/webidl/TransformStreamDefaultController.webidl index d7808672aab71..08fb25b584bc5 100644 --- a/dom/webidl/TransformStreamDefaultController.webidl +++ b/dom/webidl/TransformStreamDefaultController.webidl @@ -7,7 +7,8 @@ * https://streams.spec.whatwg.org/#ts-default-controller-class-definition */ -[Exposed=*] +[Exposed=*, + Pref="dom.streams.transform_streams.enabled"] interface TransformStreamDefaultController { readonly attribute unrestricted double? desiredSize; [Throws] undefined enqueue(optional any chunk); diff --git a/dom/webidl/WritableStream.webidl b/dom/webidl/WritableStream.webidl index b368de8057511..0b7eb75988fe2 100644 --- a/dom/webidl/WritableStream.webidl +++ b/dom/webidl/WritableStream.webidl @@ -7,7 +7,10 @@ * https://streams.spec.whatwg.org/#ws-class-definition */ -[Exposed=*] // [Transferable] - See Bug 1562065 +[Exposed=*, +//Transferable See Bug 1734240 +Pref="dom.streams.writable_streams.enabled" +] interface WritableStream { [Throws] constructor(optional object underlyingSink, optional QueuingStrategy strategy = {}); diff --git a/dom/webidl/WritableStreamDefaultController.webidl b/dom/webidl/WritableStreamDefaultController.webidl index 70a88122858b2..2a1b11c2a1451 100644 --- a/dom/webidl/WritableStreamDefaultController.webidl +++ b/dom/webidl/WritableStreamDefaultController.webidl @@ -7,7 +7,7 @@ * https://streams.spec.whatwg.org/#ws-default-controller-class-definition */ -[Exposed=*] +[Exposed=*, Pref="dom.streams.writable_streams.enabled"] interface WritableStreamDefaultController { readonly attribute AbortSignal signal; [Throws] diff --git a/dom/webidl/WritableStreamDefaultWriter.webidl b/dom/webidl/WritableStreamDefaultWriter.webidl index e033079f04414..56c6c58ae28d2 100644 --- a/dom/webidl/WritableStreamDefaultWriter.webidl +++ b/dom/webidl/WritableStreamDefaultWriter.webidl @@ -7,7 +7,7 @@ * https://streams.spec.whatwg.org/#default-writer-class-definition */ -[Exposed=*] +[Exposed=*, Pref="dom.streams.writable_streams.enabled"] interface WritableStreamDefaultWriter { [Throws] constructor(WritableStream stream); diff --git a/dom/workers/test/test_readableStream_when_closing.html b/dom/workers/test/test_readableStream_when_closing.html index 24d5bf382172b..2934286289459 100644 --- a/dom/workers/test/test_readableStream_when_closing.html +++ b/dom/workers/test/test_readableStream_when_closing.html @@ -34,28 +34,32 @@ } SimpleTest.waitForExplicitFinish(); +SpecialPowers.pushPrefEnv({"set": [ + ["javascript.options.streams", true], +]}).then(() => { + const b = new Blob([workerCode+'workerCode();']); + const url = URL.createObjectURL(b); + const w = new Worker(url); + w.onmessage = function(e) { + ok(true, 'Worker is reading'); -const b = new Blob([workerCode+'workerCode();']); -const url = URL.createObjectURL(b); -const w = new Worker(url); -w.onmessage = function(e) { - ok(true, 'Worker is reading'); - - const wdm = Cc["@mozilla.org/dom/workers/workerdebuggermanager;1"]. - getService(Ci.nsIWorkerDebuggerManager); - wdm.addListener({ - onUnregister (dbg) { - if (dbg.url == url) { - ok(true, "Debugger with url " + url + " should be unregistered."); - wdm.removeListener(this); - SimpleTest.finish(); + const wdm = Cc["@mozilla.org/dom/workers/workerdebuggermanager;1"]. + getService(Ci.nsIWorkerDebuggerManager); + wdm.addListener({ + onUnregister (dbg) { + if (dbg.url == url) { + ok(true, "Debugger with url " + url + " should be unregistered."); + wdm.removeListener(this); + SimpleTest.finish(); + } } - } - }); + }); + + w.terminate(); + } + w.postMessage("start"); +}); - w.terminate(); -} -w.postMessage("start"); diff --git a/js/moz.configure b/js/moz.configure index 765c1de95f382..a363235983aba 100644 --- a/js/moz.configure +++ b/js/moz.configure @@ -233,6 +233,24 @@ set_config( ) +# Enable JS Streams +# =================================================== +option( + "--enable-js-streams", + default=False, + help="Enable non-default JS Streams implementation", +) + + +@depends("--enable-js-streams") +def enable_js_streams(value): + if value: + return True + + +set_config("MOZ_JS_STREAMS", enable_js_streams) +set_define("MOZ_JS_STREAMS", enable_js_streams) + # JIT support # ======================================================= @depends(target, "--enable-portable-baseline-interp") diff --git a/js/public/ProtoKey.h b/js/public/ProtoKey.h index 7fdafc1956e54..140bb85c0d9e7 100644 --- a/js/public/ProtoKey.h +++ b/js/public/ProtoKey.h @@ -158,7 +158,26 @@ REAL_IF_INTL(PlainYearMonth, OCLASP(temporal::PlainYearMonth)) \ REAL_IF_INTL(PlainTime, OCLASP(temporal::PlainTime)) \ REAL_IF_INTL(TemporalNow, OCLASP(temporal::TemporalNow)) \ - REAL_IF_INTL(ZonedDateTime, OCLASP(temporal::ZonedDateTime)) + REAL_IF_INTL(ZonedDateTime, OCLASP(temporal::ZonedDateTime)) \ + IF_JS_STREAMS(REAL(ReadableStream, &js::ReadableStream::class_)) \ + IF_JS_STREAMS(REAL(ReadableStreamBYOBReader, \ + &js::ReadableStreamBYOBReader::class_)) \ + IF_JS_STREAMS(REAL(ReadableStreamBYOBRequest, \ + &js::ReadableStreamBYOBRequest::class_)) \ + IF_JS_STREAMS(REAL(ReadableStreamDefaultReader, \ + &js::ReadableStreamDefaultReader::class_)) \ + IF_JS_STREAMS(REAL(ReadableStreamDefaultController, \ + &js::ReadableStreamDefaultController::class_)) \ + IF_JS_STREAMS(REAL(ReadableByteStreamController, \ + &js::ReadableByteStreamController::class_)) \ + IF_JS_STREAMS(REAL(WritableStream, &js::WritableStream::class_)) \ + IF_JS_STREAMS(REAL(WritableStreamDefaultController, \ + &js::WritableStreamDefaultController::class_)) \ + IF_JS_STREAMS(REAL(WritableStreamDefaultWriter, \ + &js::WritableStreamDefaultWriter::class_)) \ + IF_JS_STREAMS( \ + REAL(ByteLengthQueuingStrategy, &js::ByteLengthQueuingStrategy::class_)) \ + IF_JS_STREAMS(REAL(CountQueuingStrategy, &js::CountQueuingStrategy::class_)) // DO NOT ADD CONDITIONAL ENTRIES TO THIS LIST! (As in, do not add entries // guarded by #ifdef.) It will break binary compatibility. Instead, create an // IF_ macro and add it to the parameter list below and add a diff --git a/js/public/RealmOptions.h b/js/public/RealmOptions.h index 42b806b020bb6..c9ea131fc65d5 100644 --- a/js/public/RealmOptions.h +++ b/js/public/RealmOptions.h @@ -186,6 +186,19 @@ class JS_PUBLIC_API RealmCreationOptions { bool getCoopAndCoepEnabled() const; RealmCreationOptions& setCoopAndCoepEnabled(bool flag); + bool getStreamsEnabled() const { return streams_; } + RealmCreationOptions& setStreamsEnabled(bool flag) { +#ifdef MOZ_JS_STREAMS +# ifdef MOZ_DOM_STREAMS +# error "JS and DOM streams shouldn't be simultaneously configured" +# endif + streams_ = flag; +#else + MOZ_ASSERT(!streams_); +#endif + return *this; + } + bool getToSourceEnabled() const { return toSource_; } RealmCreationOptions& setToSourceEnabled(bool flag) { toSource_ = flag; @@ -239,6 +252,7 @@ class JS_PUBLIC_API RealmCreationOptions { bool sharedMemoryAndAtomics_ = false; bool defineSharedArrayBufferConstructor_ = true; bool coopAndCoep_ = false; + bool streams_ = false; bool toSource_ = false; bool secureContext_ = false; diff --git a/js/public/Stream.h b/js/public/Stream.h new file mode 100644 index 0000000000000..176a79e2aa3ee --- /dev/null +++ b/js/public/Stream.h @@ -0,0 +1,734 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* + * JSAPI functions and callbacks related to WHATWG Stream objects. + * + * Much of the API here mirrors the standard algorithms and standard JS methods + * of the objects defined in the Streams standard. One difference is that the + * functionality of the JS controller object is exposed to C++ as functions + * taking ReadableStream instances instead, for convenience. + */ + +#ifndef js_Stream_h +#define js_Stream_h + +#include + +#include "jstypes.h" + +#include "js/RootingAPI.h" +#include "js/TypeDecls.h" + +struct JSClass; + +namespace JS { + +/** + * Abstract base class for external underlying sources. + * + * The term "underlying source" is defined in the Streams spec: + * https://streams.spec.whatwg.org/#underlying-source + * + * A `ReadableStreamUnderlyingSource` is an underlying source that is + * implemented in C++ rather than JS. It can be passed to + * `JS::NewReadableExternalSourceStreamObject` to create a custom, + * embedding-defined ReadableStream. + * + * There are several API difference between this class and the standard API for + * underlying sources implemented in JS: + * + * - JS underlying sources can be either byte sources or non-byte sources. + * External underlying source are always byte sources. + * + * - The C++ API does not bother with controller objects. Instead of using + * controller methods, the underlying source directly calls API functions + * like JS::ReadableStream{UpdateDataAvailableFromSource,Close,Error}. + * + * - External readable streams are optimized to allow the embedding to + * interact with them with a minimum of overhead: chunks aren't enqueued as + * individual typed arrays; instead, the embedding only updates the amount + * of data available using + * JS::ReadableStreamUpdateDataAvailableFromSource. When JS requests data + * from a reader, writeIntoReadRequestBuffer is invoked, asking the + * embedding to write data directly into the buffer we're about to hand to + * JS. + * + * - The C++ API provides extra callbacks onClosed() and onErrored(). + * + * - This class has a `finalize()` method, because C++ cares about lifetimes. + * + * Additionally, ReadableStreamGetExternalUnderlyingSource can be used to get + * the pointer to the underlying source. This locks the stream until it is + * released again using JS::ReadableStreamReleaseExternalUnderlyingSource. + * + * Embeddings can use this to optimize away the JS `ReadableStream` overhead + * when an embedding-defined C++ stream is passed to an embedding-defined C++ + * consumer. For example, consider a ServiceWorker piping a `fetch` Response + * body to a TextDecoder. Instead of copying chunks of data into JS typed array + * buffers and creating a Promise per chunk, only to immediately resolve the + * Promises and read the data out again, the embedding can directly feed the + * incoming data to the TextDecoder. + * + * Compartment safety: All methods (except `finalize`) receive `cx` and + * `stream` arguments. SpiderMonkey enters the realm of the stream object + * before invoking these methods, so `stream` is never a wrapper. Other + * arguments may be wrappers. + */ +class JS_PUBLIC_API ReadableStreamUnderlyingSource { + public: + virtual ~ReadableStreamUnderlyingSource() = default; + + /** + * Invoked whenever a reader desires more data from this source. + * + * The given `desiredSize` is the absolute size, not a delta from the + * previous desired size. + */ + virtual void requestData(JSContext* cx, HandleObject stream, + size_t desiredSize) = 0; + + /** + * Invoked to cause the embedding to fill the given `buffer` with data from + * this underlying source. + * + * This is called only after the embedding has updated the amount of data + * available using JS::ReadableStreamUpdateDataAvailableFromSource. If at + * least one read request is pending when + * JS::ReadableStreamUpdateDataAvailableFromSource is called, this method + * is invoked immediately from under the call to + * JS::ReadableStreamUpdateDataAvailableFromSource. If not, it is invoked + * if and when a new read request is made. + * + */ + virtual void writeIntoReadRequestBuffer(JSContext* cx, HandleObject stream, + JS::Handle aChunk, + size_t length, + size_t* bytesWritten) = 0; + + /** + * Invoked in reaction to the ReadableStream being canceled. This is + * equivalent to the `cancel` method on non-external underlying sources + * provided to the ReadableStream constructor in JavaScript. + * + * The underlying source may free up some resources in this method, but + * `*this` must not be destroyed until `finalize()` is called. + * + * The given `reason` is the JS::Value that was passed as an argument to + * ReadableStream#cancel(). + * + * The returned JS::Value will be used to resolve the Promise returned by + * ReadableStream#cancel(). + */ + virtual Value cancel(JSContext* cx, HandleObject stream, + HandleValue reason) = 0; + + /** + * Invoked when the associated ReadableStream becomes closed. + * + * The underlying source may free up some resources in this method, but + * `*this` must not be destroyed until `finalize()` is called. + */ + virtual void onClosed(JSContext* cx, HandleObject stream) = 0; + + /** + * Invoked when the associated ReadableStream becomes errored. + * + * The underlying source may free up some resources in this method, but + * `*this` must not be destroyed until `finalize()` is called. + */ + virtual void onErrored(JSContext* cx, HandleObject stream, + HandleValue reason) = 0; + + /** + * Invoked when the associated ReadableStream object is finalized. The + * stream object is not passed as an argument, as it might not be in a + * valid state anymore. + * + * Note: Finalization can happen on a background thread, so the embedding + * must be prepared for `finalize()` to be invoked from any thread. + */ + virtual void finalize() = 0; +}; + +/** + * Returns a new instance of the ReadableStream builtin class in the current + * compartment, configured as a default stream. + * If a |proto| is passed, that gets set as the instance's [[Prototype]] + * instead of the original value of |ReadableStream.prototype|. + */ +extern JS_PUBLIC_API JSObject* NewReadableDefaultStreamObject( + JSContext* cx, HandleObject underlyingSource = nullptr, + HandleFunction size = nullptr, double highWaterMark = 1, + HandleObject proto = nullptr); + +/** + * Returns a new instance of the ReadableStream builtin class in the current + * compartment. + * + * The instance is a byte stream backed by an embedding-provided underlying + * source, using the virtual methods of `underlyingSource` as callbacks. The + * embedding must ensure that `*underlyingSource` lives as long as the new + * stream object. The JS engine will call the finalize() method when the stream + * object is destroyed. + * + * `nsISupportsObject_alreadyAddreffed` is an optional pointer that can be used + * to make the new stream participate in Gecko's cycle collection. Here are the + * rules for using this parameter properly: + * + * - `*underlyingSource` must not be a cycle-collected object. (It would lead + * to memory leaks as the cycle collector would not be able to collect + * cycles containing that object.) + * + * - `*underlyingSource` must not contain nsCOMPtrs that point to cycle- + * collected objects. (Same reason.) + * + * - `*underlyingSource` may contain a pointer to a single cycle-collected + * object. + * + * - The pointer may be stored in `*underlyingSource` as a raw pointer. + * + * - The pointer to the nsISupports interface of the same object must be + * passed as the `nsISupportsObject_alreadyAddreffed` parameter to this + * function. (This is how the cycle collector knows about it, so omitting + * this would again cause leaks.) + * + * If `proto` is non-null, it is used as the instance's [[Prototype]] instead + * of the original value of `ReadableStream.prototype`. + */ +extern JS_PUBLIC_API JSObject* NewReadableExternalSourceStreamObject( + JSContext* cx, ReadableStreamUnderlyingSource* underlyingSource, + void* nsISupportsObject_alreadyAddreffed = nullptr, + HandleObject proto = nullptr); + +/** + * Returns the embedding-provided underlying source of the given |stream|. + * + * Can be used to optimize operations if both the underlying source and the + * intended sink are embedding-provided. In that case it might be + * preferrable to pipe data directly from source to sink without interacting + * with the stream at all. + * + * Locks the stream until ReadableStreamReleaseExternalUnderlyingSource is + * called. + * + * Throws an exception if the stream is locked, i.e. if a reader has been + * acquired for the stream, or if ReadableStreamGetExternalUnderlyingSource + * has been used previously without releasing the external source again. + * + * Throws an exception if the stream isn't readable, i.e if it is errored or + * closed. This is different from ReadableStreamGetReader because we don't + * have a Promise to resolve/reject, which a reader provides. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. + * + * Asserts that the stream has an embedding-provided underlying source. + */ +extern JS_PUBLIC_API bool ReadableStreamGetExternalUnderlyingSource( + JSContext* cx, HandleObject stream, + ReadableStreamUnderlyingSource** source); + +/** + * Releases the embedding-provided underlying source of the given |stream|, + * returning the stream into an unlocked state. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. + * + * Checks if the stream was locked through + * ReadableStreamGetExternalUnderlyingSource and throws an error if not. + * + * Checks if the stream has an embedding-provided underlying source and + * throws an error if not. + */ +extern JS_PUBLIC_API bool ReadableStreamReleaseExternalUnderlyingSource( + JSContext* cx, HandleObject stream); + +/** + * Update the amount of data available at the underlying source of the given + * |stream|. + * + * Can only be used for streams with an embedding-provided underlying source. + * The JS engine will use the given value to satisfy read requests for the + * stream by invoking the writeIntoReadRequestBuffer method. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. + */ +extern JS_PUBLIC_API bool ReadableStreamUpdateDataAvailableFromSource( + JSContext* cx, HandleObject stream, uint32_t availableData); + +/** + * Break the cycle between this object and the + * nsISupportsObject_alreadyAddreffed passed in + * NewReadableExternalSourceStreamObject(). + */ +extern JS_PUBLIC_API void ReadableStreamReleaseCCObject(JSObject* stream); + +/** + * Returns true if the given object is a ReadableStream object or an + * unwrappable wrapper for one, false otherwise. + */ +extern JS_PUBLIC_API bool IsReadableStream(JSObject* obj); + +/** + * Returns true if the given object is a ReadableStreamBYOBReader object + * or an unwrappable wrapper for one, false otherwise. + */ +extern JS_PUBLIC_API bool IsReadableStreamBYOBReader(JSObject* obj); + +/** + * Returns true if the given object is a ReadableStreamDefaultReader or + * ReadableStreamBYOBReader object or an unwrappable wrapper for one, false + * otherwise. + */ +extern JS_PUBLIC_API bool IsReadableStreamReader(JSObject* obj); + +/** + * Returns true if the given object is a ReadableStreamDefaultReader object + * or an unwrappable wrapper for one, false otherwise. + */ +extern JS_PUBLIC_API bool IsReadableStreamDefaultReader(JSObject* obj); + +/** + * Returns true if the given object is a ReadableStreamDefaultController or + * ReadableByteStreamController object or an unwrappable wrapper for one, + * false otherwise. + */ +extern JS_PUBLIC_API bool IsReadableStreamController(JSObject* obj); + +enum class ReadableStreamMode { Default, Byte, ExternalSource }; + +/** + * Returns the stream's ReadableStreamMode. If the mode is |Byte| or + * |ExternalSource|, it's possible to acquire a BYOB reader for more optimized + * operations. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. + */ +extern JS_PUBLIC_API bool ReadableStreamGetMode(JSContext* cx, + HandleObject stream, + ReadableStreamMode* mode); + +enum class ReadableStreamReaderMode { Default, Byob }; + +/** + * Returns the stream's stored error. + * + * Asserts that |stream| is a ReadableStream object or an unwrappable wrapper + * for one. + */ +extern JS_PUBLIC_API Value ReadableStreamGetStoredError(JSContext* cx, + HandleObject stream); + +/** + * Returns true if the given ReadableStream is readable, false if not. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. + */ +extern JS_PUBLIC_API bool ReadableStreamIsReadable(JSContext* cx, + HandleObject stream, + bool* result); + +/** + * Returns true if the given ReadableStream is locked, false if not. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. + */ +extern JS_PUBLIC_API bool ReadableStreamIsLocked(JSContext* cx, + HandleObject stream, + bool* result); + +/** + * Returns true if the given ReadableStream is disturbed, false if not. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. + */ +extern JS_PUBLIC_API bool ReadableStreamIsDisturbed(JSContext* cx, + HandleObject stream, + bool* result); + +/** + * Returns true if the given ReadableStream is errored, false if not. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. + */ +extern JS_PUBLIC_API bool ReadableStreamIsErrored(JSContext* cx, + HandleObject stream, + bool* result); + +/** + * Cancels the given ReadableStream with the given reason and returns a + * Promise resolved according to the result. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. + */ +extern JS_PUBLIC_API JSObject* ReadableStreamCancel(JSContext* cx, + HandleObject stream, + HandleValue reason); + +/** + * Creates a reader of the type specified by the mode option and locks the + * stream to the new reader. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. The returned object will always be + * created in the current cx compartment. + */ +extern JS_PUBLIC_API JSObject* ReadableStreamGetReader( + JSContext* cx, HandleObject stream, ReadableStreamReaderMode mode); + +/** + * Returns the controller associated with the given ReadableStream. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. + */ +extern JS_PUBLIC_API JSObject* ReadableStreamGetController(JSContext* cx, + HandleObject stream); + +/** + * Returns the underlying source associated with the given + * ReadableStreamController. + * + * Checks if |controller| is a ReadableStreamController object or an + * unwrappable wrapper for one and throws an error if not. The returned + * object will always be created in the current cx compartment. + * + * Note: this is different from ReadableStreamGetExternalUnderlyingSource in + * that it only works for ReadableStreams with a mode of Default or Byte, + * returns a Value, and doesn't lock the stream. + */ +extern JS_PUBLIC_API bool ReadableStreamControllerGetUnderlyingSource( + JSContext* cx, HandleObject controller, MutableHandleValue source); + +/** + * Results in true if the stream associated with the given controller + * is readable, and the closeRequested flag on the controller is false, + * and throws an error and returns false if not. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. + */ +extern JS_PUBLIC_API bool CheckReadableStreamControllerCanCloseOrEnqueue( + JSContext* cx, HandleObject controller, const char* action); + +/** + * The WHATWG Streams spec algorithm ReadableStreamControllerShouldCallPull. + * + * Asserts that |controller| is a ReadableStreamController object or an + * unwrappable wrapper for one. + */ +extern JS_PUBLIC_API bool ReadableStreamControllerShouldCallPull( + JSContext* cx, HandleObject controller); + +/** + * Tees the given ReadableStream and stores the two resulting streams in + * outparams. Returns false if the operation fails, e.g. because the stream is + * locked. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. The returned objects will always be + * created in the current cx compartment. + */ +extern JS_PUBLIC_API bool ReadableStreamTee(JSContext* cx, HandleObject stream, + MutableHandleObject branch1Stream, + MutableHandleObject branch2Stream); + +/** + * Retrieves the desired combined size of additional chunks to fill the given + * ReadableStream's queue. Stores the result in |value| and sets |hasValue| to + * true on success, returns false on failure. + * + * If the stream is errored, the call will succeed but no value will be stored + * in |value| and |hasValue| will be set to false. + * + * Note: This is semantically equivalent to the |desiredSize| getter on + * the stream controller's prototype in JS. We expose it with the stream + * itself as a target for simplicity. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. + */ +extern JS_PUBLIC_API bool ReadableStreamGetDesiredSize(JSContext* cx, + JSObject* stream, + bool* hasValue, + double* value); + +/** + * Close the given ReadableStream. This is equivalent to `controller.close()` + * in JS. + * + * This can fail with or without an exception pending under a variety of + * circumstances. On failure, the stream may or may not be closed, and + * downstream consumers may or may not have been notified. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. + */ +extern JS_PUBLIC_API bool ReadableStreamClose(JSContext* cx, + HandleObject stream); + +/** + * Returns true if the given ReadableStream reader is closed, false otherwise. + * + * checks |reader| is a ReadableStreamDefaultReader or + * ReadableStreamBYOBReader object or an unwrappable wrapper for one and + * throws an error if not. + */ +extern JS_PUBLIC_API bool ReadableStreamReaderIsClosed(JSContext* cx, + HandleObject reader, + bool* result); + +/** + * Enqueues the given chunk in the given ReadableStream. + * + * Throws a TypeError and returns false if the enqueing operation fails. + * + * Note: This is semantically equivalent to the |enqueue| method on + * the stream controller's prototype in JS. We expose it with the stream + * itself as a target for simplicity. + * + * If the ReadableStream has an underlying byte source, the given chunk must + * be a typed array or a DataView. Consider using + * ReadableByteStreamEnqueueBuffer. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. + */ +extern JS_PUBLIC_API bool ReadableStreamEnqueue(JSContext* cx, + HandleObject stream, + HandleValue chunk); + +/** + * Errors the given ReadableStream, causing all future interactions to fail + * with the given error value. + * + * Throws a TypeError and returns false if the erroring operation fails. + * + * Note: This is semantically equivalent to the |error| method on + * the stream controller's prototype in JS. We expose it with the stream + * itself as a target for simplicity. + * + * Checks if |stream| is a ReadableStream object or an unwrappable wrapper + * for one and throws an error if not. + */ +extern JS_PUBLIC_API bool ReadableStreamError(JSContext* cx, + HandleObject stream, + HandleValue error); + +/** + * C++ equivalent of `reader.cancel(reason)` + * (both and + * ). + * + * `reader` must be a stream reader created using `JS::ReadableStreamGetReader` + * or an unwrappable wrapper for one. (This function is meant to support using + * C++ to read from streams. It's not meant to allow C++ code to operate on + * readers created by scripts.) + */ +extern JS_PUBLIC_API bool ReadableStreamReaderCancel(JSContext* cx, + HandleObject reader, + HandleValue reason); + +/** + * C++ equivalent of `reader.releaseLock()` + * (both and + * ). + * + * `reader` must be a stream reader created using `JS::ReadableStreamGetReader` + * or an unwrappable wrapper for one. + */ +extern JS_PUBLIC_API bool ReadableStreamReaderReleaseLock(JSContext* cx, + HandleObject reader); + +/** + * C++ equivalent of the `reader.read()` method on byob readers + * (). + * + * The result is a new Promise object, or null on OOM. + * + * `reader` must be the result of calling `JS::ReadableStreamGetReader` with + * `ReadableStreamReaderMode::Default` mode, or an unwrappable wrapper for such + * a reader. + */ +extern JS_PUBLIC_API JSObject* ReadableStreamBYOBReaderRead(JSContext* cx, + HandleObject reader, + HandleObject view); + +/** + * C++ equivalent of the `reader.read()` method on default readers + * (). + * + * The result is a new Promise object, or null on OOM. + * + * `reader` must be the result of calling `JS::ReadableStreamGetReader` with + * `ReadableStreamReaderMode::Default` mode, or an unwrappable wrapper for such + * a reader. + */ +extern JS_PUBLIC_API JSObject* ReadableStreamDefaultReaderRead( + JSContext* cx, HandleObject reader); + +/** + * Returns a new instance of the WritableStream builtin class in the current + * compartment, configured as a default stream. + * If a |proto| is passed, that gets set as the instance's [[Prototype]] + * instead of the original value of |WritableStream.prototype|. + */ +extern JS_PUBLIC_API JSObject* NewWritableDefaultStreamObject( + JSContext* cx, HandleObject underlyingSink = nullptr, + HandleFunction size = nullptr, double highWaterMark = 1, + HandleObject proto = nullptr); + +/** + * Returns true if the given object is a WritableStream object or an + * unwrappable wrapper for one, false otherwise. + */ +extern JS_PUBLIC_API bool IsWritableStream(JSObject* obj); + +enum class WritableStreamState { Writable, Closed, Erroring, Errored }; + +/** + * Returns the given WritableStream's state. + * + * Asserts that |stream| is a WritableStream object or an unwrappable wrapper + * for one. + */ +extern JS_PUBLIC_API WritableStreamState +WritableStreamGetState(JSContext* cx, HandleObject stream); + +/** + * Returns true if the given WritableStream is locked, false if not. + * + * Asserts that |stream| is a WritableStream object or an unwrappable wrapper + * for one. + */ +extern JS_PUBLIC_API bool WritableStreamIsLocked(JSContext* cx, + HandleObject stream); + +/** + * Returns true if the given object is a WritableStreamDefaultWriter or + * WritableStreamBYOBWriter object or an unwrappable wrapper for one, false + * otherwise. + */ +extern JS_PUBLIC_API bool IsWritableStreamWriter(JSObject* obj); + +/** + * Creates a WritableStreamDefaultWriter and locks the stream to the new + * writer. + * + * Asserts that |stream| is a WritableStream object or an unwrappable wrapper + * for one. The returned object will always be created in the + * current cx compartment. + */ +extern JS_PUBLIC_API JSObject* WritableStreamGetWriter(JSContext* cx, + HandleObject stream); + +/** + * Returns the controller associated with the given WritableStream. + * + * Asserts that |stream| is a WritableStream object or an unwrappable wrapper + * for one. + */ +extern JS_PUBLIC_API JSObject* WritableStreamGetController(JSContext* cx, + HandleObject stream); + +/** + * Returns the underlying sink associated with the given + * WritableStreamDefaultController. + * + * Asserts that |controller| is a WritableStreamDefaultController object or an + * unwrappable wrapper for one. + */ +extern JS_PUBLIC_API Value WritableStreamControllerGetUnderlyingSink( + JSContext* cx, HandleObject controller); + +/** + * Errors the given WritableStream, causing all future interactions to fail + * with the given error value. + * + * Throws a TypeError and returns false if the erroring operation fails. + * + * Note: This is semantically equivalent to the |error| method on + * the stream controller's prototype in JS. We expose it with the stream + * itself as a target for simplicity. + * + * Asserts that |stream| is a WritableStream object or an unwrappable wrapper + * for one. + */ +extern JS_PUBLIC_API bool WritableStreamError(JSContext* cx, + HandleObject stream, + HandleValue error); + +/** + * Returns the stream's stored error. + * + * Asserts that |stream| is a WritableStream object or an unwrappable wrapper + * for one. + */ +extern JS_PUBLIC_API Value WritableStreamGetStoredError(JSContext* cx, + HandleObject stream); + +class JS_PUBLIC_API WritableStreamUnderlyingSink { + public: + virtual ~WritableStreamUnderlyingSink() = default; + + /** + * Invoked when the associated WritableStream object is finalized. The + * stream object is not passed as an argument, as it might not be in a + * valid state anymore. + * + * Note: Finalization can happen on a background thread, so the embedding + * must be prepared for `finalize()` to be invoked from any thread. + */ + virtual void finalize() = 0; +}; + +// ReadableStream.prototype.pipeTo SUPPORT + +/** + * The signature of a function that, when passed an |AbortSignal| instance, will + * return the value of its "aborted" flag. + * + * This function will be called while |signal|'s realm has been entered. + */ +using AbortSignalIsAborted = bool (*)(JSObject* signal); + +/** + * Dictate embedder-specific details necessary to implement certain aspects of + * the |ReadableStream.prototype.pipeTo| function. This should be performed + * exactly once, for a single context associated with a |JSRuntime|. + * + * The |ReadableStream.prototype.pipeTo| function accepts a |signal| argument + * that may be used to abort the piping operation. This argument must be either + * |undefined| (in other words, the piping operation can't be aborted) or an + * |AbortSignal| instance (that may be aborted using the signal's associated + * |AbortController|). |AbortSignal| is defined by WebIDL and the DOM in the + * web embedding. Therefore, embedders must use this function to specify how + * such objects can be recognized and how to perform various essential actions + * upon them. + * + * The provided |isAborted| function will be called with an unwrapped + * |AbortSignal| instance, while that instance's realm has been entered. + * + * If this function isn't called, and a situation arises where an "is this an + * |AbortSignal|?" question must be asked, that question will simply be answered + * "no". + */ +extern JS_PUBLIC_API void InitPipeToHandling(const JSClass* abortSignalClass, + AbortSignalIsAborted isAborted, + JSContext* cx); + +} // namespace JS + +#endif // js_Stream_h diff --git a/js/public/TypeDecls.h b/js/public/TypeDecls.h index ea95dc4e9875d..cde4093aa9936 100644 --- a/js/public/TypeDecls.h +++ b/js/public/TypeDecls.h @@ -138,6 +138,12 @@ using jsid = JS::PropertyKey; # define IF_EXPLICIT_RESOURCE_MANAGEMENT(x, ...) __VA_ARGS__ #endif +#ifdef MOZ_JS_STREAMS +# define IF_JS_STREAMS(x, ...) x +#else +# define IF_JS_STREAMS(x, ...) __VA_ARGS__ +#endif + // Helper macros to combine build flags // TODO: need to find more generalised way to combine build flags #if defined(ENABLE_EXPLICIT_RESOURCE_MANAGEMENT) || defined(ENABLE_DECORATORS) diff --git a/js/public/Value.h b/js/public/Value.h index db428d9387e9a..3a049f281e3aa 100644 --- a/js/public/Value.h +++ b/js/public/Value.h @@ -371,6 +371,24 @@ enum JSWhyMagic { /** for local use */ JS_GENERIC_MAGIC, + /** + * Write records queued up in WritableStreamDefaultController.[[queue]] in the + * spec are either "close" (a String) or Record { [[chunk]]: chunk }, where + * chunk is an arbitrary user-provided (and therefore non-magic) value. + * Represent "close" the String as this magic value; represent Record records + * as the |chunk| value within each of them. + */ + JS_WRITABLESTREAM_CLOSE_RECORD, + + /** + * The ReadableStream pipe-to operation concludes with a "finalize" operation + * that accepts an optional |error| argument. In certain cases that optional + * |error| must be stored in a handler function, for use after a promise has + * settled. We represent the argument not being provided, in those cases, + * using this magic value. + */ + JS_READABLESTREAM_PIPETO_FINALIZE_WITHOUT_ERROR, + /** * When an error object is created without the error cause argument, we set * the error's cause slot to this magic value. diff --git a/js/public/friend/ErrorNumbers.msg b/js/public/friend/ErrorNumbers.msg index 96ce067fcaea2..41e5ef114617a 100644 --- a/js/public/friend/ErrorNumbers.msg +++ b/js/public/friend/ErrorNumbers.msg @@ -808,6 +808,66 @@ MSG_DEF(JSMSG_NOT_AN_ASYNC_GENERATOR, 0, JSEXN_TYPEERR, "Not an async generator MSG_DEF(JSMSG_GET_ASYNC_ITER_RETURNED_PRIMITIVE, 0, JSEXN_TYPEERR, "[Symbol.asyncIterator]() returned a non-object value") MSG_DEF(JSMSG_SUSPENDED_QUEUE_NOT_EMPTY, 0, JSEXN_INTERNALERR, "Async generator is in invalid state due to debugger interaction") +// ReadableStream +MSG_DEF(JSMSG_READABLESTREAM_UNDERLYINGSOURCE_TYPE_WRONG,0, JSEXN_RANGEERR,"'underlyingSource.type' must be \"bytes\" or undefined.") +MSG_DEF(JSMSG_READABLESTREAM_BYTES_TYPE_NOT_IMPLEMENTED, 0, JSEXN_RANGEERR,"support for 'new ReadableStream({ type: \"bytes\" })' is not yet implemented") +MSG_DEF(JSMSG_READABLESTREAM_BYOB_READER_FOR_NON_BYTE_STREAM,0,JSEXN_TYPEERR,"can't get a BYOB reader for a non-byte stream") +MSG_DEF(JSMSG_READABLESTREAM_INVALID_READER_MODE, 0, JSEXN_TYPEERR,"'mode' must be \"byob\" or undefined.") +MSG_DEF(JSMSG_NUMBER_MUST_BE_FINITE_NON_NEGATIVE, 1, JSEXN_RANGEERR, "'{0}' must be a finite, non-negative number.") +MSG_DEF(JSMSG_READABLEBYTESTREAMCONTROLLER_INVALID_BYTESWRITTEN, 0, JSEXN_RANGEERR, "'bytesWritten' exceeds remaining length.") +MSG_DEF(JSMSG_READABLEBYTESTREAMCONTROLLER_INVALID_VIEW_SIZE, 0, JSEXN_RANGEERR, "view size does not match requested data.") +MSG_DEF(JSMSG_READABLEBYTESTREAMCONTROLLER_INVALID_VIEW_OFFSET, 0, JSEXN_RANGEERR, "view offset does not match requested position.") +MSG_DEF(JSMSG_READABLEBYTESTREAMCONTROLLER_EMPTY_VIEW, 0, JSEXN_TYPEERR, "view must contain a length greater than zero for ReadableByteStreamController.enqueue(view).") +MSG_DEF(JSMSG_READABLEBYTESTREAMCONTROLLER_NO_VIEW, 1, JSEXN_TYPEERR, "view must be a valid ArrayBufferView for ReadableByteStreamController.{0}(view).") +MSG_DEF(JSMSG_READABLESTREAM_LOCKED_METHOD, 1, JSEXN_TYPEERR, "'{0}' can't be called on a locked stream.") +MSG_DEF(JSMSG_READABLESTREAM_LOCKED, 0, JSEXN_TYPEERR, "A Reader may only be created for an unlocked ReadableStream.") +MSG_DEF(JSMSG_READABLESTREAM_NOT_BYTE_STREAM_CONTROLLER, 1, JSEXN_TYPEERR, "{0} requires a ReadableByteStreamController.") +MSG_DEF(JSMSG_READABLESTREAM_NOT_DEFAULT_CONTROLLER, 1, JSEXN_TYPEERR, "{0} requires a ReadableStreamDefaultController.") +MSG_DEF(JSMSG_READABLESTREAM_CONTROLLER_SET, 0, JSEXN_TYPEERR, "The ReadableStream already has a controller defined.") +MSG_DEF(JSMSG_READABLESTREAMREADER_NOT_OWNED, 1, JSEXN_TYPEERR, "The ReadableStream reader method '{0}' may only be called on a reader owned by a stream.") +MSG_DEF(JSMSG_READABLESTREAMREADER_NOT_EMPTY, 1, JSEXN_TYPEERR, "The ReadableStream reader method '{0}' may not be called on a reader with read requests.") +MSG_DEF(JSMSG_READABLESTREAMBYOBREADER_READ_NOT_BUFFER, 0, JSEXN_TYPEERR, "ReadableStreamBYOBReader.read() wasn't passed a Buffer, TypedArrayBuffer or view.") +MSG_DEF(JSMSG_READABLESTREAMBYOBREADER_READ_EMPTY_VIEW, 0, JSEXN_TYPEERR, "ReadableStreamBYOBReader.read() was passed an empty zero-len buffer.") +MSG_DEF(JSMSG_READABLESTREAMBYOBREADER_READ_DETACHED, 0, JSEXN_TYPEERR, "ReadableStreamBYOBReader.read() was passed a detached buffer.") + +MSG_DEF(JSMSG_READABLESTREAMREADER_RELEASED, 0, JSEXN_TYPEERR, "The ReadableStream reader was released.") +MSG_DEF(JSMSG_READABLESTREAMCONTROLLER_CLOSED, 1, JSEXN_TYPEERR, "'{0}' called on a stream already closing.") +MSG_DEF(JSMSG_READABLESTREAMCONTROLLER_NOT_READABLE, 1, JSEXN_TYPEERR, "'{0}' may only be called on a stream in the 'readable' state.") +MSG_DEF(JSMSG_READABLEBYTESTREAMCONTROLLER_BAD_CHUNKSIZE,0, JSEXN_RANGEERR, "ReadableByteStreamController requires a positive integer or undefined for 'autoAllocateChunkSize'.") +MSG_DEF(JSMSG_READABLEBYTESTREAMCONTROLLER_BAD_CHUNK, 1, JSEXN_TYPEERR, "{0} passed a bad chunk.") +MSG_DEF(JSMSG_READABLEBYTESTREAMCONTROLLER_DETACHED, 1, JSEXN_TYPEERR, "ReadableByteStreamController.{0}() provided a detached buffer.") +MSG_DEF(JSMSG_READABLEBYTESTREAMCONTROLLER_CLOSE_PENDING_PULL, 0, JSEXN_TYPEERR, "The ReadableByteStreamController cannot be closed while the buffer is being filled.") +MSG_DEF(JSMSG_READABLESTREAMBYOBREQUEST_NO_CONTROLLER, 1, JSEXN_TYPEERR, "ReadableStreamBYOBRequest method '{0}' called on a request with no controller.") +MSG_DEF(JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_INVALID_WRITTEN_LEN, 0, JSEXN_RANGEERR, "ReadableStreamBYOBRequest method 'respond(bytesWritten)' must include a bytesWritten positive integer.") +MSG_DEF(JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_CLOSED, 0, JSEXN_TYPEERR, "ReadableStreamBYOBRequest method 'respond' called with non-zero number of bytes with a closed controller.") +MSG_DEF(JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_DETACHED,0, JSEXN_TYPEERR, "ReadableStreamBYOBRequest method 'respond' called for a detached buffer.") +MSG_DEF(JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_ZERO ,0, JSEXN_TYPEERR, "ReadableStreamBYOBRequest method 'respond' wrote zero bytes.") +MSG_DEF(JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_EXCEED ,0, JSEXN_RANGEERR, "ReadableStreamBYOBRequest method 'respond' byte size exceeded buffer length.") +MSG_DEF(JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_BAD_OFFSET ,0, JSEXN_RANGEERR, "ReadableStreamBYOBRequest method 'respondWithNewView' returned a view with an invalid offset.") +MSG_DEF(JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_BAD_LEN ,0, JSEXN_RANGEERR, "ReadableStreamBYOBRequest method 'respondWithNewView' returned a view with an invalid length.") +MSG_DEF(JSMSG_READABLESTREAM_METHOD_NOT_IMPLEMENTED, 1, JSEXN_TYPEERR, "ReadableStream method {0} not yet implemented") +MSG_DEF(JSMSG_READABLESTREAM_PIPETO_BAD_SIGNAL, 0, JSEXN_TYPEERR, "signal must be either undefined or an AbortSignal") +MSG_DEF(JSMSG_READABLESTREAMTEE_BYOB, 0, JSEXN_ERR, "tee() for readable byte streams is not yet implemented") +MSG_DEF(JSMSG_READABLESTREAMTEE_CLONE, 0, JSEXN_ERR, "tee() support for cloneForBranch2=true is not yet implemented") + +// WritableStream +MSG_DEF(JSMSG_READABLESTREAM_UNDERLYINGSINK_TYPE_WRONG, 0, JSEXN_RANGEERR,"'underlyingSink.type' must be undefined.") +MSG_DEF(JSMSG_WRITABLESTREAMWRITER_NOT_OWNED, 1, JSEXN_TYPEERR, "the WritableStream writer method '{0}' may only be called on a writer owned by a stream") +MSG_DEF(JSMSG_WRITABLESTREAM_CLOSED_OR_ERRORED, 0, JSEXN_TYPEERR, "writable stream is already closed or errored") +MSG_DEF(JSMSG_WRITABLESTREAM_RELEASED_DURING_WRITE, 0, JSEXN_TYPEERR, "writer's lock on the stream was released before writing completed") +MSG_DEF(JSMSG_WRITABLESTREAM_WRITE_CLOSING_OR_CLOSED, 0, JSEXN_TYPEERR, "can't write to a stream that's currently closing or already closed") +MSG_DEF(JSMSG_CANT_USE_LOCKED_WRITABLESTREAM, 1, JSEXN_TYPEERR, "can't {0} a WritableStream that's locked to a writer") +MSG_DEF(JSMSG_WRITABLESTREAM_CLOSE_CLOSING_OR_CLOSED, 0, JSEXN_TYPEERR, "can't close a stream that's currently closing or already closed") +MSG_DEF(JSMSG_WRITABLESTREAM_CANT_RELEASE_ALREADY_CLOSED,0, JSEXN_TYPEERR, "writer has already been released and can't be closed") +MSG_DEF(JSMSG_WRITABLESTREAM_ALREADY_LOCKED, 0, JSEXN_TYPEERR, "writable stream is already locked by another writer") +MSG_DEF(JSMSG_READABLESTREAM_NYI, 0, JSEXN_ERR, "full WritableStream support is not yet implemented") + +// Other Stream-related +MSG_DEF(JSMSG_STREAM_MISSING_HIGHWATERMARK, 0, JSEXN_TYPEERR, "'highWaterMark' must not be undefined.") +MSG_DEF(JSMSG_STREAM_INVALID_HIGHWATERMARK, 0, JSEXN_RANGEERR, "'highWaterMark' must be a non-negative, non-NaN number.") +MSG_DEF(JSMSG_STREAM_AUTOALLOCATECHUNKSIZE_ZERO, 0, JSEXN_TYPEERR, "'autoAllocateChunkSize' must not be 0.") +MSG_DEF(JSMSG_READABLESTREAM_BYOB_SIZE, 0, JSEXN_RANGEERR, "size unsupported for byob streams") + // (wasm) Response-related MSG_DEF(JSMSG_WASM_ERROR_CONSUMING_RESPONSE, 0, JSEXN_TYPEERR, "WebAssembly: There was an error consuming the Response") MSG_DEF(JSMSG_WASM_BAD_RESPONSE_VALUE, 0, JSEXN_TYPEERR, "WebAssembly: Expected Response or Promise resolving to Response") diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index 7d269ff06bd54..eb04d37ce7ef7 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -4962,6 +4962,12 @@ static bool RejectPromise(JSContext* cx, unsigned argc, Value* vp) { return result; } +static bool StreamsAreEnabled(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + args.rval().setBoolean(cx->realm()->creationOptions().getStreamsEnabled()); + return true; +} + static unsigned finalizeCount = 0; static void finalize_counter_finalize(JS::GCContext* gcx, JSObject* obj) { @@ -10334,6 +10340,10 @@ JS_FN_HELP("rejectPromise", RejectPromise, 2, 0, "rejectPromise(promise, reason)", " Reject a Promise by calling the JSAPI function JS::RejectPromise."), +JS_FN_HELP("streamsAreEnabled", StreamsAreEnabled, 0, 0, +"streamsAreEnabled()", +" Returns a boolean indicating whether WHATWG Streams are enabled for the current realm."), + JS_FN_HELP("makeFinalizeObserver", MakeFinalizeObserver, 0, 0, "makeFinalizeObserver()", " Get a special object whose finalization increases the counter returned\n" diff --git a/js/src/builtin/streams/ClassSpecMacro.h b/js/src/builtin/streams/ClassSpecMacro.h new file mode 100644 index 0000000000000..17d1fda9307ce --- /dev/null +++ b/js/src/builtin/streams/ClassSpecMacro.h @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* A JS_STREAMS_CLASS_SPEC macro for defining streams classes. */ + +#ifndef builtin_streams_ClassSpecMacro_h +#define builtin_streams_ClassSpecMacro_h + +#include "gc/AllocKind.h" // js::gc::AllocKind +#include "js/Class.h" // js::ClassSpec, JSClass, JSCLASS_HAS_{CACHED_PROTO,RESERVED_SLOTS}, JS_NULL_CLASS_OPS +#include "js/ProtoKey.h" // JSProto_* +#include "vm/GlobalObject.h" // js::GenericCreate{Constructor,Prototype} + +#define JS_STREAMS_CLASS_SPEC(cls, nCtorArgs, nSlots, specFlags, classFlags, \ + classOps) \ + const js::ClassSpec cls::classSpec_ = { \ + js::GenericCreateConstructor, \ + js::GenericCreatePrototype, \ + nullptr, \ + nullptr, \ + cls##_methods, \ + cls##_properties, \ + nullptr, \ + specFlags}; \ + \ + const JSClass cls::class_ = {#cls, \ + JSCLASS_HAS_RESERVED_SLOTS(nSlots) | \ + JSCLASS_HAS_CACHED_PROTO(JSProto_##cls) | \ + classFlags, \ + classOps, &cls::classSpec_}; \ + \ + const JSClass cls::protoClass_ = {#cls ".prototype", \ + JSCLASS_HAS_CACHED_PROTO(JSProto_##cls), \ + JS_NULL_CLASS_OPS, &cls::classSpec_}; + +#endif // builtin_streams_ClassSpecMacro_h diff --git a/js/src/builtin/streams/MiscellaneousOperations-inl.h b/js/src/builtin/streams/MiscellaneousOperations-inl.h new file mode 100644 index 0000000000000..3334471fb7d30 --- /dev/null +++ b/js/src/builtin/streams/MiscellaneousOperations-inl.h @@ -0,0 +1,115 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Miscellaneous operations. */ + +#ifndef builtin_streams_MiscellaneousOperations_inl_h +#define builtin_streams_MiscellaneousOperations_inl_h + +#include "builtin/streams/MiscellaneousOperations.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT + +#include "js/CallAndConstruct.h" // JS::IsCallable +#include "js/Promise.h" // JS::{Resolve,Reject}Promise +#include "js/RootingAPI.h" // JS::Rooted, JS::{,Mutable}Handle +#include "js/Value.h" // JS::UndefinedHandleValue, JS::Value +#include "vm/Compartment.h" // JS::Compartment +#include "vm/Interpreter.h" // js::Call +#include "vm/JSContext.h" // JSContext +#include "vm/JSObject.h" // JSObject +#include "vm/PromiseObject.h" // js::PromiseObject + +#include "vm/Compartment-inl.h" // JS::Compartment::wrap +#include "vm/JSContext-inl.h" // JSContext::check +#include "vm/JSObject-inl.h" // js::IsCallable + +namespace js { + +/** + * Streams spec, 6.3.5. PromiseCall ( F, V, args ) + * There must be 0-2 |args| arguments, all convertible to JS::Handle. + */ +template +[[nodiscard]] inline JSObject* PromiseCall(JSContext* cx, + JS::Handle F, + JS::Handle V, + Args&&... args) { + cx->check(F); + cx->check(V); + cx->check(args...); + + // Step 1: Assert: ! IsCallable(F) is true. + MOZ_ASSERT(IsCallable(F)); + + // Step 2: Assert: V is not undefined. + MOZ_ASSERT(!V.isUndefined()); + + // Step 3: Assert: args is a List (implicit). + // Step 4: Let returnValue be Call(F, V, args). + JS::Rooted rval(cx); + if (!Call(cx, F, V, args..., &rval)) { + // Step 5: If returnValue is an abrupt completion, return a promise rejected + // with returnValue.[[Value]]. + return PromiseRejectedWithPendingError(cx); + } + + // Step 6: Otherwise, return a promise resolved with returnValue.[[Value]]. + return PromiseObject::unforgeableResolve(cx, rval); +} + +/** + * Resolve the unwrapped promise |unwrappedPromise| with |value|. + */ +[[nodiscard]] inline bool ResolveUnwrappedPromiseWithValue( + JSContext* cx, JSObject* unwrappedPromise, JS::Handle value) { + cx->check(value); + + JS::Rooted promise(cx, unwrappedPromise); + if (!cx->compartment()->wrap(cx, &promise)) { + return false; + } + + return JS::ResolvePromise(cx, promise, value); +} + +/** + * Resolve the unwrapped promise |unwrappedPromise| with |undefined|. + */ +[[nodiscard]] inline bool ResolveUnwrappedPromiseWithUndefined( + JSContext* cx, JSObject* unwrappedPromise) { + return ResolveUnwrappedPromiseWithValue(cx, unwrappedPromise, + JS::UndefinedHandleValue); +} + +/** + * Reject the unwrapped promise |unwrappedPromise| with |error|, overwriting + * |*unwrappedPromise| with its wrapped form. + */ +[[nodiscard]] inline bool RejectUnwrappedPromiseWithError( + JSContext* cx, JS::MutableHandle unwrappedPromise, + JS::Handle error) { + cx->check(error); + + if (!cx->compartment()->wrap(cx, unwrappedPromise)) { + return false; + } + + return JS::RejectPromise(cx, unwrappedPromise, error); +} + +/** + * Reject the unwrapped promise |unwrappedPromise| with |error|. + */ +[[nodiscard]] inline bool RejectUnwrappedPromiseWithError( + JSContext* cx, JSObject* unwrappedPromise, JS::Handle error) { + JS::Rooted promise(cx, unwrappedPromise); + return RejectUnwrappedPromiseWithError(cx, &promise, error); +} + +} // namespace js + +#endif // builtin_streams_MiscellaneousOperations_inl_h diff --git a/js/src/builtin/streams/MiscellaneousOperations.cpp b/js/src/builtin/streams/MiscellaneousOperations.cpp new file mode 100644 index 0000000000000..031cf6e92793a --- /dev/null +++ b/js/src/builtin/streams/MiscellaneousOperations.cpp @@ -0,0 +1,251 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Miscellaneous operations. */ + +#include "builtin/streams/MiscellaneousOperations.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT + +#include "js/CallAndConstruct.h" // JS::IsCallable +#include "js/Conversions.h" // JS::ToNumber +#include "js/ErrorReport.h" // JS_ReportErrorNumberASCII +#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* +#include "js/RootingAPI.h" // JS::{,Mutable}Handle, JS::Rooted +#include "vm/Interpreter.h" // js::{Call,GetAndClearException} +#include "vm/JSContext.h" // JSContext +#include "vm/ObjectOperations.h" // js::GetProperty +#include "vm/PromiseObject.h" // js::PromiseObject +#include "vm/StringType.h" // js::PropertyName + +#include "vm/JSContext-inl.h" // JSContext::check +#include "vm/JSObject-inl.h" // js::IsCallable + +using JS::Handle; +using JS::MutableHandle; +using JS::ToNumber; +using JS::Value; + +// https://streams.spec.whatwg.org/#transfer-array-buffer +// As some parts of the specifcation want to use the abrupt completion value, +// this function may leave a pending exception if it returns nullptr. +[[nodiscard]] JSObject* js::TransferArrayBuffer(JSContext* cx, + JS::Handle buffer) { + // Assert: ! IsDetachedBuffer(O) is false. + MOZ_ASSERT(!JS::IsDetachedArrayBufferObject(buffer)); + + // Let arrayBufferByteLength be O.[[ArrayBufferByteLength]]. + // (must get length before stealing data) + size_t bufferLength = JS::GetArrayBufferByteLength(buffer); + + // Let arrayBufferData be O.[[ArrayBufferData]]. + UniquePtr bufferData{ + JS::StealArrayBufferContents(cx, buffer)}; + + // Perform ? DetachArrayBuffer(O). + if (!JS::DetachArrayBuffer(cx, buffer)) { + return nullptr; + } + + // Return a new ArrayBuffer object, created in the current Realm, whose + // [[ArrayBufferData]] internal slot value is arrayBufferData and whose + // [[ArrayBufferByteLength]] internal slot value is arrayBufferByteLength. + return JS::NewArrayBufferWithContents(cx, bufferLength, std::move(bufferData)); +} + +// https://streams.spec.whatwg.org/#can-transfer-array-buffer +[[nodiscard]] bool js::CanTransferArrayBuffer(JSContext* cx, + JS::Handle buffer) { + // Step 1. Assert: Type(O) is Object. (Implicit in types) + // Step 2. Assert: O has an [[ArrayBufferData]] internal slot. + MOZ_ASSERT(JS::IsArrayBufferObject(buffer)); + + // Step 3. If ! IsDetachedBuffer(O) is true, return false. + if (JS::IsDetachedArrayBufferObject(buffer)) { + return false; + } + + // Step 4. If SameValue(O.[[ArrayBufferDetachKey]], undefined) is false, + // return false. + // Step 5. Return true. + // Note: WASM memories are the only buffers that would qualify + // as having an undefined [[ArrayBufferDetachKey]], + bool hasDefinedArrayBufferDetachKey = false; + if (!JS::HasDefinedArrayBufferDetachKey(cx, buffer, + &hasDefinedArrayBufferDetachKey)) { + return false; + } + return !hasDefinedArrayBufferDetachKey; +} + +[[nodiscard]] js::PromiseObject* js::PromiseRejectedWithPendingError( + JSContext* cx) { + Rooted exn(cx); + if (!cx->isExceptionPending() || !GetAndClearException(cx, &exn)) { + // Uncatchable error. This happens when a slow script is killed or a + // worker is terminated. Propagate the uncatchable error. This will + // typically kill off the calling asynchronous process: the caller + // can't hook its continuation to the new rejected promise. + return nullptr; + } + return PromiseObject::unforgeableReject(cx, exn); +} + +/*** 6.3. Miscellaneous operations ******************************************/ + +/** + * Streams spec, 6.3.1. + * CreateAlgorithmFromUnderlyingMethod ( underlyingObject, methodName, + * algoArgCount, extraArgs ) + * + * This function only partly implements the standard algorithm. We do not + * actually create a new JSFunction completely encapsulating the new algorithm. + * Instead, this just gets the specified method and checks for errors. It's the + * caller's responsibility to make sure that later, when the algorithm is + * "performed", the appropriate steps are carried out. + */ +[[nodiscard]] bool js::CreateAlgorithmFromUnderlyingMethod( + JSContext* cx, Handle underlyingObject, + const char* methodNameForErrorMessage, Handle methodName, + MutableHandle method) { + cx->check(underlyingObject); + cx->check(methodName); + cx->check(method); + + // Step 1: Assert: underlyingObject is not undefined. + MOZ_ASSERT(!underlyingObject.isUndefined()); + + // Step 2: Assert: ! IsPropertyKey(methodName) is true (implicit). + // Step 3: Assert: algoArgCount is 0 or 1 (omitted). + // Step 4: Assert: extraArgs is a List (omitted). + + // Step 5: Let method be ? GetV(underlyingObject, methodName). + if (!GetProperty(cx, underlyingObject, methodName, method)) { + return false; + } + + // Step 6: If method is not undefined, + if (!method.isUndefined()) { + // Step a: If ! IsCallable(method) is false, throw a TypeError + // exception. + if (!IsCallable(method)) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_NOT_FUNCTION, methodNameForErrorMessage); + return false; + } + + // Step b: If algoArgCount is 0, return an algorithm that performs the + // following steps: + // Step i: Return ! PromiseCall(method, underlyingObject, + // extraArgs). + // Step c: Otherwise, return an algorithm that performs the following + // steps, taking an arg argument: + // Step i: Let fullArgs be a List consisting of arg followed by the + // elements of extraArgs in order. + // Step ii: Return ! PromiseCall(method, underlyingObject, + // fullArgs). + // (These steps are deferred to the code that performs the algorithm. + // See Perform{Write,Close}Algorithm, ReadableStreamControllerCancelSteps, + // and ReadableStreamControllerCallPullIfNeeded.) + return true; + } + + // Step 7: Return an algorithm which returns a promise resolved with + // undefined (implicit). + return true; +} + +/** + * Streams spec, 6.3.2. InvokeOrNoop ( O, P, args ) + * As it happens, all callers pass exactly one argument. + */ +[[nodiscard]] bool js::InvokeOrNoop(JSContext* cx, Handle O, + Handle P, Handle arg, + MutableHandle rval) { + cx->check(O, P, arg); + + // Step 1: Assert: O is not undefined. + MOZ_ASSERT(!O.isUndefined()); + + // Step 2: Assert: ! IsPropertyKey(P) is true (implicit). + // Step 3: Assert: args is a List (implicit). + // Step 4: Let method be ? GetV(O, P). + Rooted method(cx); + if (!GetProperty(cx, O, P, &method)) { + return false; + } + + // Step 5: If method is undefined, return. + if (method.isUndefined()) { + return true; + } + + // Step 6: Return ? Call(method, O, args). + return Call(cx, method, O, arg, rval); +} + +/** + * Streams spec, 6.3.7. ValidateAndNormalizeHighWaterMark ( highWaterMark, + * defaultHighWaterMark ) + */ +[[nodiscard]] bool js::ValidateAndNormalizeHighWaterMark( + JSContext* cx, Handle highWaterMarkVal, double* highWaterMark, + double defaultHighWaterMark) { + if (highWaterMarkVal.isUndefined()) { + *highWaterMark = defaultHighWaterMark; + return true; + } + + // Step 1: Set highWaterMark to ? ToNumber(highWaterMark). + if (!ToNumber(cx, highWaterMarkVal, highWaterMark)) { + return false; + } + + // Step 2: If highWaterMark is NaN or highWaterMark < 0, throw a RangeError + // exception. + if (std::isnan(*highWaterMark) || *highWaterMark < 0) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_STREAM_INVALID_HIGHWATERMARK); + return false; + } + + // Step 3: Return highWaterMark. + return true; +} + +/** + * Streams spec, 6.3.8. MakeSizeAlgorithmFromSizeFunction ( size ) + * + * The standard makes a big deal of turning JavaScript functions (grubby, + * touched by users, covered with germs) into algorithms (pristine, + * respectable, purposeful). We don't bother. Here we only check for errors and + * leave `size` unchanged. Then, in ReadableStreamDefaultControllerEnqueue and + * WritableStreamDefaultControllerGetChunkSize where this value is used, we + * check for undefined and behave as if we had "made" an "algorithm" for it. + */ +[[nodiscard]] bool js::MakeSizeAlgorithmFromSizeFunction(JSContext* cx, + Handle size) { + cx->check(size); + + // Step 1: If size is undefined, return an algorithm that returns 1. + if (size.isUndefined()) { + // Deferred. Size algorithm users must check for undefined. + return true; + } + + // Step 2: If ! IsCallable(size) is false, throw a TypeError exception. + if (!IsCallable(size)) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_NOT_FUNCTION, + "ReadableStream argument options.size"); + return false; + } + + // Step 3: Return an algorithm that performs the following steps, taking a + // chunk argument: + // a. Return ? Call(size, undefined, « chunk »). + // Deferred. Size algorithm users must know how to call the size function. + return true; +} diff --git a/js/src/builtin/streams/MiscellaneousOperations.h b/js/src/builtin/streams/MiscellaneousOperations.h new file mode 100644 index 0000000000000..dba8aaa852eee --- /dev/null +++ b/js/src/builtin/streams/MiscellaneousOperations.h @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Miscellaneous operations. */ + +#ifndef builtin_streams_MiscellaneousOperations_h +#define builtin_streams_MiscellaneousOperations_h + +#include "jstypes.h" // JS_PUBLIC_API +#include "js/CallArgs.h" // JS::CallArgs +#include "js/RootingAPI.h" // JS::{,Mutable}Handle +#include "js/Value.h" // JS::Value +#include "vm/JSObject.h" // JSObject +#include "vm/PromiseObject.h" // js::PromiseObject + +struct JS_PUBLIC_API JSContext; + +namespace js { + +class PropertyName; + +[[nodiscard]] extern JSObject* TransferArrayBuffer(JSContext* aCx, JS::Handle aObject); + +[[nodiscard]] extern bool CanTransferArrayBuffer(JSContext* aCx, JS::Handle aObject); + +[[nodiscard]] extern PromiseObject* PromiseRejectedWithPendingError( + JSContext* cx); + +[[nodiscard]] inline bool ReturnPromiseRejectedWithPendingError( + JSContext* cx, const JS::CallArgs& args) { + PromiseObject* promise = PromiseRejectedWithPendingError(cx); + if (!promise) { + return false; + } + + args.rval().setObject(*promise); + return true; +} + +/** + * Streams spec, 6.3.1. + * CreateAlgorithmFromUnderlyingMethod ( underlyingObject, methodName, + * algoArgCount, extraArgs ) + * + * This function only partly implements the standard algorithm. We do not + * actually create a new JSFunction completely encapsulating the new algorithm. + * Instead, this just gets the specified method and checks for errors. It's the + * caller's responsibility to make sure that later, when the algorithm is + * "performed", the appropriate steps are carried out. + */ +[[nodiscard]] extern bool CreateAlgorithmFromUnderlyingMethod( + JSContext* cx, JS::Handle underlyingObject, + const char* methodNameForErrorMessage, JS::Handle methodName, + JS::MutableHandle method); + +/** + * Streams spec, 6.3.2. InvokeOrNoop ( O, P, args ) + * As it happens, all callers pass exactly one argument. + */ +[[nodiscard]] extern bool InvokeOrNoop(JSContext* cx, JS::Handle O, + JS::Handle P, + JS::Handle arg, + JS::MutableHandle rval); + +/** + * Streams spec, 6.3.7. ValidateAndNormalizeHighWaterMark ( highWaterMark ) + */ +[[nodiscard]] extern bool ValidateAndNormalizeHighWaterMark( + JSContext* cx, Handle highWaterMarkVal, double* highWaterMark, + double defaultHighWaterMark); + +/** + * Streams spec, 6.3.8. MakeSizeAlgorithmFromSizeFunction ( size ) + */ +[[nodiscard]] extern bool MakeSizeAlgorithmFromSizeFunction( + JSContext* cx, JS::Handle size); + +template +inline bool IsMaybeWrapped(const JS::Handle v) { + return v.isObject() && v.toObject().canUnwrapAs(); +} + +} // namespace js + +#endif // builtin_streams_MiscellaneousOperations_h diff --git a/js/src/builtin/streams/PipeToState-inl.h b/js/src/builtin/streams/PipeToState-inl.h new file mode 100644 index 0000000000000..97d1798fdc6b8 --- /dev/null +++ b/js/src/builtin/streams/PipeToState-inl.h @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* ReadableStream pipe-to operation captured state. */ + +#ifndef builtin_streams_PipeToState_inl_h +#define builtin_streams_PipeToState_inl_h + +#include "builtin/streams/PipeToState.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT + +#include "jstypes.h" // JS_PUBLIC_API + +#include "js/RootingAPI.h" // JS::Handle +#include "vm/JSContext.h" // JSContext +#include "vm/Runtime.h" // JSRuntime + +#include "vm/Compartment-inl.h" // js::UnwrapAndDowncastValue +#include "vm/JSContext-inl.h" // JSContext::check + +struct JS_PUBLIC_API JSContext; +class JS_PUBLIC_API JSObject; + +namespace js { + +/** + * Returns the unwrapped |AbortSignal| instance associated with a given pipe-to + * operation. + * + * The pipe-to operation must be known to have had an |AbortSignal| associated + * with it. + * + * If the signal is a wrapper, it will be unwrapped, so the result might not be + * an object from the currently active compartment. + */ +[[nodiscard]] inline JSObject* UnwrapSignalFromPipeToState( + JSContext* cx, JS::Handle pipeToState) { + cx->check(pipeToState); + + MOZ_ASSERT(pipeToState->hasSignal()); + return UnwrapAndDowncastValue( + cx, pipeToState->getFixedSlot(PipeToState::Slot_Signal), + cx->runtime()->maybeAbortSignalClass()); +} + +} // namespace js + +#endif // builtin_streams_PipeToState_inl_h diff --git a/js/src/builtin/streams/PipeToState.cpp b/js/src/builtin/streams/PipeToState.cpp new file mode 100644 index 0000000000000..b9d5dd66e3ff3 --- /dev/null +++ b/js/src/builtin/streams/PipeToState.cpp @@ -0,0 +1,1295 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* ReadableStream.prototype.pipeTo state. */ + +#include "builtin/streams/PipeToState-inl.h" + +#ifdef MOZ_DOM_STREAMS +# error "Shouldnt be built" +#endif + +#include "mozilla/Assertions.h" // MOZ_ASSERT +#include "mozilla/Maybe.h" // mozilla::Maybe, mozilla::Nothing, mozilla::Some + +#include "builtin/Promise.h" // js::RejectPromiseWithPendingError +#include "builtin/streams/ReadableStream.h" // js::ReadableStream +#include "builtin/streams/ReadableStreamReader.h" // js::CreateReadableStreamDefaultReader, js::ForAuthorCodeBool, js::ReadableStreamDefaultReader, js::ReadableStreamReaderGenericRelease +#include "builtin/streams/WritableStream.h" // js::WritableStream +#include "builtin/streams/WritableStreamDefaultWriter.h" // js::CreateWritableStreamDefaultWriter, js::WritableStreamDefaultWriter +#include "builtin/streams/WritableStreamOperations.h" // js::WritableStreamCloseQueuedOrInFlight +#include "builtin/streams/WritableStreamWriterOperations.h" // js::WritableStreamDefaultWriter{GetDesiredSize,Release,Write} +#include "js/CallArgs.h" // JS::CallArgsFromVp, JS::CallArgs +#include "js/Class.h" // JSClass, JSCLASS_HAS_RESERVED_SLOTS +#include "js/ErrorReport.h" // JS_ReportErrorNumberASCII +#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* +#include "js/Promise.h" // JS::AddPromiseReactions +#include "js/RootingAPI.h" // JS::Handle, JS::Rooted +#include "js/Value.h" // JS::{,Int32,Magic,Object}Value, JS::UndefinedHandleValue +#include "vm/Interpreter.h" // js::GetAndClearException +#include "vm/JSContext.h" // JSContext +#include "vm/PromiseObject.h" // js::PromiseObject +#include "vm/Runtime.h" // JSRuntime + +#include "builtin/HandlerFunction-inl.h" // js::ExtraValueFromHandler, js::NewHandler{,WithExtraValue}, js::TargetFromHandler +#include "builtin/streams/ReadableStreamReader-inl.h" // js::UnwrapReaderFromStream, js::UnwrapStreamFromReader +#include "builtin/streams/WritableStream-inl.h" // js::UnwrapWriterFromStream +#include "builtin/streams/WritableStreamDefaultWriter-inl.h" // js::UnwrapStreamFromWriter +#include "vm/JSContext-inl.h" // JSContext::check +#include "vm/JSObject-inl.h" // js::NewBuiltinClassInstance +#include "vm/Realm-inl.h" // js::AutoRealm + +using mozilla::Maybe; +using mozilla::Nothing; +using mozilla::Some; + +using JS::CallArgs; +using JS::CallArgsFromVp; +using JS::Handle; +using JS::Int32Value; +using JS::MagicValue; +using JS::ObjectValue; +using JS::Rooted; +using JS::UndefinedHandleValue; +using JS::Value; + +using js::ExtraValueFromHandler; +using js::GetErrorMessage; +using js::NewHandler; +using js::NewHandlerWithExtraValue; +using js::PipeToState; +using js::PromiseObject; +using js::ReadableStream; +using js::ReadableStreamDefaultReader; +using js::ReadableStreamReaderGenericRelease; +using js::TargetFromHandler; +using js::UnwrapReaderFromStream; +using js::UnwrapStreamFromWriter; +using js::UnwrapWriterFromStream; +using js::WritableStream; +using js::WritableStreamDefaultWriter; +using js::WritableStreamDefaultWriterRelease; +using js::WritableStreamDefaultWriterWrite; + +static ReadableStream* GetUnwrappedSource(JSContext* cx, + Handle state) { + cx->check(state); + + Rooted reader(cx, state->reader()); + cx->check(reader); + + return UnwrapStreamFromReader(cx, reader); +} + +static WritableStream* GetUnwrappedDest(JSContext* cx, + Handle state) { + cx->check(state); + + Rooted writer(cx, state->writer()); + cx->check(writer); + + return UnwrapStreamFromWriter(cx, writer); +} + +static bool WritableAndNotClosing(const WritableStream* unwrappedDest) { + return unwrappedDest->writable() && + !WritableStreamCloseQueuedOrInFlight(unwrappedDest); +} + +[[nodiscard]] static bool Finalize(JSContext* cx, Handle state, + Handle> error) { + cx->check(state); + cx->check(error); + + // Step 1: Perform ! WritableStreamDefaultWriterRelease(writer). + Rooted writer(cx, state->writer()); + cx->check(writer); + if (!WritableStreamDefaultWriterRelease(cx, writer)) { + return false; + } + + // Step 2: Perform ! ReadableStreamReaderGenericRelease(reader). + Rooted reader(cx, state->reader()); + cx->check(reader); + if (!ReadableStreamReaderGenericRelease(cx, reader)) { + return false; + } + + // Step 3: If signal is not undefined, remove abortAlgorithm from signal. + // XXX + + Rooted promise(cx, state->promise()); + cx->check(promise); + + // Step 4: If error was given, reject promise with error. + if (error.isSome()) { + Rooted errorVal(cx, *error.get()); + return PromiseObject::reject(cx, promise, errorVal); + } + + // Step 5: Otherwise, resolve promise with undefined. + return PromiseObject::resolve(cx, promise, UndefinedHandleValue); +} + +[[nodiscard]] static bool Finalize(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted state(cx, TargetFromHandler(args)); + cx->check(state); + + Rooted> optionalError(cx, Nothing()); + if (Value maybeError = ExtraValueFromHandler(args); + !maybeError.isMagic(JS_READABLESTREAM_PIPETO_FINALIZE_WITHOUT_ERROR)) { + optionalError = Some(maybeError); + } + cx->check(optionalError); + + if (!Finalize(cx, state, optionalError)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +// Shutdown with an action, steps d-f: +// d. Let p be the result of performing action. +// e. Upon fulfillment of p, finalize, passing along originalError if it was +// given. +// f. Upon rejection of p with reason newError, finalize with newError. +[[nodiscard]] static bool ActAndFinalize(JSContext* cx, + Handle state, + Handle> error) { + // Step d: Let p be the result of performing action. + Rooted p(cx); + switch (state->shutdownAction()) { + // This corresponds to the action performed by |abortAlgorithm| in + // ReadableStreamPipeTo step 14.1.5. + case PipeToState::ShutdownAction::AbortAlgorithm: { + MOZ_ASSERT(error.get().isSome()); + + // From ReadableStreamPipeTo: + // Step 14.1.2: Let actions be an empty ordered set. + // Step 14.1.3: If preventAbort is false, append the following action to + // actions: + // Step 14.1.3.1: If dest.[[state]] is "writable", return + // ! WritableStreamAbort(dest, error). + // Step 14.1.3.2: Otherwise, return a promise resolved with undefined. + // Step 14.1.4: If preventCancel is false, append the following action + // action to actions: + // Step 14.1.4.1.: If source.[[state]] is "readable", return + // ! ReadableStreamCancel(source, error). + // Step 14.1.4.2: Otherwise, return a promise resolved with undefined. + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_METHOD_NOT_IMPLEMENTED, + "any required actions during abortAlgorithm"); + return false; + } + + // This corresponds to the action in "shutdown with an action of + // ! WritableStreamAbort(dest, source.[[storedError]]) and with + // source.[[storedError]]." + case PipeToState::ShutdownAction::AbortDestStream: { + MOZ_ASSERT(error.get().isSome()); + + Rooted unwrappedDest(cx, GetUnwrappedDest(cx, state)); + if (!unwrappedDest) { + return false; + } + + Rooted sourceStoredError(cx, *error.get()); + cx->check(sourceStoredError); + + p = js::WritableStreamAbort(cx, unwrappedDest, sourceStoredError); + break; + } + + // This corresponds to two actions: + // + // * The action in "shutdown with an action of + // ! ReadableStreamCancel(source, dest.[[storedError]]) and with + // dest.[[storedError]]" as used in "Errors must be propagated backward: + // if dest.[[state]] is or becomes 'errored'". + // * The action in "shutdown with an action of + // ! ReadableStreamCancel(source, destClosed) and with destClosed" as used + // in "Closing must be propagated backward: if + // ! WritableStreamCloseQueuedOrInFlight(dest) is true or dest.[[state]] + // is 'closed'". + // + // The different reason-values are passed as |error|. + case PipeToState::ShutdownAction::CancelSource: { + MOZ_ASSERT(error.get().isSome()); + + Rooted unwrappedSource(cx, + GetUnwrappedSource(cx, state)); + if (!unwrappedSource) { + return false; + } + + Rooted reason(cx, *error.get()); + cx->check(reason); + + p = ReadableStreamCancel(cx, unwrappedSource, reason); + break; + } + + // This corresponds to the action in "shutdown with an action of + // ! WritableStreamDefaultWriterCloseWithErrorPropagation(writer)" as done + // in "Closing must be propagated forward: if source.[[state]] is or becomes + // 'closed'". + case PipeToState::ShutdownAction::CloseWriterWithErrorPropagation: { + MOZ_ASSERT(error.get().isNothing()); + + Rooted writer(cx, state->writer()); + cx->check(writer); // just for good measure: we don't depend on this + + p = WritableStreamDefaultWriterCloseWithErrorPropagation(cx, writer); + break; + } + } + if (!p) { + return false; + } + + // Step e: Upon fulfillment of p, finalize, passing along originalError if it + // was given. + Rooted onFulfilled(cx); + { + Rooted optionalError( + cx, error.isSome() + ? *error.get() + : MagicValue(JS_READABLESTREAM_PIPETO_FINALIZE_WITHOUT_ERROR)); + onFulfilled = NewHandlerWithExtraValue(cx, Finalize, state, optionalError); + if (!onFulfilled) { + return false; + } + } + + // Step f: Upon rejection of p with reason newError, finalize with newError. + auto OnRejected = [](JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted state(cx, TargetFromHandler(args)); + cx->check(state); + + Rooted> newError(cx, Some(args[0])); + cx->check(newError); + if (!Finalize(cx, state, newError)) { + return false; + } + + args.rval().setUndefined(); + return true; + }; + + Rooted onRejected(cx, NewHandler(cx, OnRejected, state)); + if (!onRejected) { + return false; + } + + return JS::AddPromiseReactions(cx, p, onFulfilled, onRejected); +} + +[[nodiscard]] static bool ActAndFinalize(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted state(cx, TargetFromHandler(args)); + cx->check(state); + + Rooted> optionalError(cx, Nothing()); + if (Value maybeError = ExtraValueFromHandler(args); + !maybeError.isMagic(JS_READABLESTREAM_PIPETO_FINALIZE_WITHOUT_ERROR)) { + optionalError = Some(maybeError); + } + cx->check(optionalError); + + if (!ActAndFinalize(cx, state, optionalError)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +// Shutdown with an action: if any of the above requirements ask to shutdown +// with an action action, optionally with an error originalError, then: +[[nodiscard]] static bool ShutdownWithAction( + JSContext* cx, Handle state, + PipeToState::ShutdownAction action, Handle> originalError) { + cx->check(state); + cx->check(originalError); + + // Step a: If shuttingDown is true, abort these substeps. + if (state->shuttingDown()) { + return true; + } + + // Step b: Set shuttingDown to true. + state->setShuttingDown(); + + // Save the action away for later, potentially asynchronous, use. + state->setShutdownAction(action); + + // Step c: If dest.[[state]] is "writable" and + // ! WritableStreamCloseQueuedOrInFlight(dest) is false, + WritableStream* unwrappedDest = GetUnwrappedDest(cx, state); + if (!unwrappedDest) { + return false; + } + + if (WritableAndNotClosing(unwrappedDest)) { + // Step c.i: If any chunks have been read but not yet written, write them + // to dest. + // + // Any chunk that has been read, will have been processed and a pending + // write for it created by this point. (A pending read has not been "read". + // And any pending read, will not be processed into a pending write because + // of the |state->setShuttingDown()| above in concert with the early exit + // in this case in |ReadFulfilled|.) + + // Step c.ii: Wait until every chunk that has been read has been written + // (i.e. the corresponding promises have settled). + if (PromiseObject* p = state->lastWriteRequest()) { + Rooted lastWriteRequest(cx, p); + + Rooted extra( + cx, + originalError.isSome() + ? *originalError.get() + : MagicValue(JS_READABLESTREAM_PIPETO_FINALIZE_WITHOUT_ERROR)); + + Rooted actAndfinalize( + cx, NewHandlerWithExtraValue(cx, ActAndFinalize, state, extra)); + if (!actAndfinalize) { + return false; + } + + return JS::AddPromiseReactions(cx, lastWriteRequest, actAndfinalize, + actAndfinalize); + } + + // If no last write request was ever created, we can fall through and + // synchronously perform the remaining steps. + } + + // Step d: Let p be the result of performing action. + // Step e: Upon fulfillment of p, finalize, passing along originalError if it + // was given. + // Step f: Upon rejection of p with reason newError, finalize with newError. + return ActAndFinalize(cx, state, originalError); +} + +// Shutdown: if any of the above requirements or steps ask to shutdown, +// optionally with an error error, then: +[[nodiscard]] static bool Shutdown(JSContext* cx, Handle state, + Handle> error) { + cx->check(state); + cx->check(error); + + // Step a: If shuttingDown is true, abort these substeps. + if (state->shuttingDown()) { + return true; + } + + // Step b: Set shuttingDown to true. + state->setShuttingDown(); + + // Step c: If dest.[[state]] is "writable" and + // ! WritableStreamCloseQueuedOrInFlight(dest) is false, + WritableStream* unwrappedDest = GetUnwrappedDest(cx, state); + if (!unwrappedDest) { + return false; + } + if (WritableAndNotClosing(unwrappedDest)) { + // Step 1: If any chunks have been read but not yet written, write them to + // dest. + // + // Any chunk that has been read, will have been processed and a pending + // write for it created by this point. (A pending read has not been "read". + // And any pending read, will not be processed into a pending write because + // of the |state->setShuttingDown()| above in concert with the early exit + // in this case in |ReadFulfilled|.) + + // Step 2: Wait until every chunk that has been read has been written + // (i.e. the corresponding promises have settled). + if (PromiseObject* p = state->lastWriteRequest()) { + Rooted lastWriteRequest(cx, p); + + Rooted extra( + cx, + error.isSome() + ? *error.get() + : MagicValue(JS_READABLESTREAM_PIPETO_FINALIZE_WITHOUT_ERROR)); + + Rooted finalize( + cx, NewHandlerWithExtraValue(cx, Finalize, state, extra)); + if (!finalize) { + return false; + } + + return JS::AddPromiseReactions(cx, lastWriteRequest, finalize, finalize); + } + + // If no last write request was ever created, we can fall through and + // synchronously perform the remaining steps. + } + + // Step d: Finalize, passing along error if it was given. + return Finalize(cx, state, error); +} + +/** + * Streams spec, 3.4.11. ReadableStreamPipeTo step 14: + * "a. Errors must be propagated forward: if source.[[state]] is or becomes + * 'errored', then..." + */ +[[nodiscard]] static bool OnSourceErrored(JSContext* cx, + Handle state) { + cx->check(state); + + // While Shutdown and ShutdownWithAction return early if shuttingDown is + // true, the unwrapping operation below would fail because the source has + // already been cleared in that case, so we bail early here, too. + if (state->shuttingDown()) { + return true; + } + + Rooted unwrappedSource(cx, GetUnwrappedSource(cx, state)); + if (!unwrappedSource) { + return false; + } + + Rooted> storedError(cx, Some(unwrappedSource->storedError())); + if (!cx->compartment()->wrap(cx, &storedError)) { + return false; + } + + // If |source| becomes errored not during a pending read, it's clear we must + // react immediately. + // + // But what if |source| becomes errored *during* a pending read? Should this + // first error, or the pending-read second error, predominate? Two semantics + // are possible when |source|/|dest| become closed or errored while there's a + // pending read: + // + // 1. Wait until the read fulfills or rejects, then respond to the + // closure/error without regard to the read having fulfilled or rejected. + // (This will simply not react to the read being rejected, or it will + // queue up the read chunk to be written during shutdown.) + // 2. React to the closure/error immediately per "Error and close states + // must be propagated". Then when the read fulfills or rejects later, do + // nothing. + // + // The spec doesn't clearly require either semantics. It requires that + // *already-read* chunks be written (at least if |dest| didn't become errored + // or closed such that no further writes can occur). But it's silent as to + // not-fully-read chunks. (These semantic differences may only be observable + // with very carefully constructed readable/writable streams.) + // + // It seems best, generally, to react to the temporally-earliest problem that + // arises, so we implement option #2. (Blink, in contrast, currently + // implements option #1.) + // + // All specified reactions to a closure/error invoke either the shutdown, or + // shutdown with an action, algorithms. Those algorithms each abort if either + // shutdown algorithm has already been invoked. So we don't need to do + // anything special here to deal with a pending read. + + // ii. Otherwise (if preventAbort is true), shutdown with + // source.[[storedError]]. + if (state->preventAbort()) { + if (!Shutdown(cx, state, storedError)) { + return false; + } + } + // i. (If preventAbort is false,) shutdown with an action of + // ! WritableStreamAbort(dest, source.[[storedError]]) and with + // source.[[storedError]]. + else { + if (!ShutdownWithAction(cx, state, + PipeToState::ShutdownAction::AbortDestStream, + storedError)) { + return false; + } + } + + return true; +} + +/** + * Streams spec, 3.4.11. ReadableStreamPipeTo step 14: + * "b. Errors must be propagated backward: if dest.[[state]] is or becomes + * 'errored', then..." + */ +[[nodiscard]] static bool OnDestErrored(JSContext* cx, + Handle state) { + cx->check(state); + + // While Shutdown and ShutdownWithAction return early if shuttingDown is + // true, the unwrapping operation below would fail because the dest has + // already been cleared in that case, so we bail early here, too. + if (state->shuttingDown()) { + return true; + } + + Rooted unwrappedDest(cx, GetUnwrappedDest(cx, state)); + if (!unwrappedDest) { + return false; + } + + Rooted> storedError(cx, Some(unwrappedDest->storedError())); + if (!cx->compartment()->wrap(cx, &storedError)) { + return false; + } + + // As in |OnSourceErrored| above, we must deal with the case of |dest| + // erroring before a pending read has fulfilled or rejected. + // + // As noted there, we handle the *first* error that arises. And because this + // algorithm immediately invokes a shutdown algorithm, and shutting down will + // inhibit future shutdown attempts, we don't need to do anything special + // *here*, either. + + // ii. Otherwise (if preventCancel is true), shutdown with + // dest.[[storedError]]. + if (state->preventCancel()) { + if (!Shutdown(cx, state, storedError)) { + return false; + } + } + // i. If preventCancel is false, shutdown with an action of + // ! ReadableStreamCancel(source, dest.[[storedError]]) and with + // dest.[[storedError]]. + else { + if (!ShutdownWithAction(cx, state, + PipeToState::ShutdownAction::CancelSource, + storedError)) { + return false; + } + } + + return true; +} + +/** + * Streams spec, 3.4.11. ReadableStreamPipeTo step 14: + * "c. Closing must be propagated forward: if source.[[state]] is or becomes + * 'closed', then..." + */ +[[nodiscard]] static bool OnSourceClosed(JSContext* cx, + Handle state) { + cx->check(state); + + Rooted> noError(cx, Nothing()); + + // While |source| can become closed during a pending read, we guard against + // that in the |then| handler for the reader's [[closedPromise]], so all + // reads are guaranteed to be done by now. + MOZ_ASSERT(!state->hasPendingRead()); + + // ii. Otherwise (if preventClose is true), shutdown. + if (state->preventClose()) { + if (!Shutdown(cx, state, noError)) { + return false; + } + } + // i. If preventClose is false, shutdown with an action of + // ! WritableStreamDefaultWriterCloseWithErrorPropagation(writer). + else { + if (!ShutdownWithAction( + cx, state, + PipeToState::ShutdownAction::CloseWriterWithErrorPropagation, + noError)) { + return false; + } + } + + return true; +} + +/** + * Streams spec, 3.4.11. ReadableStreamPipeTo step 14: + * "d. Closing must be propagated backward: if + * ! WritableStreamCloseQueuedOrInFlight(dest) is true or dest.[[state]] is + * 'closed', then..." + */ +[[nodiscard]] static bool OnDestClosed(JSContext* cx, + Handle state) { + cx->check(state); + + // i. Assert: no chunks have been read or written. + // + // This assertion holds when this function is called by + // |SourceOrDestErroredOrClosed|, before any async internal piping operations + // happen. + // + // But it wouldn't hold for streams that can spontaneously close of their own + // accord, like say a hypothetical DOM TCP socket. I think? + // + // XXX Add this assertion if it really does hold (and is easily performed), + // else report a spec bug. + + // ii. Let destClosed be a new TypeError. + Rooted> destClosed(cx, Nothing()); + { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_WRITABLESTREAM_WRITE_CLOSING_OR_CLOSED); + Rooted v(cx); + if (!cx->isExceptionPending() || !GetAndClearException(cx, &v)) { + return false; + } + + destClosed = Some(v.get()); + } + + // As in all the |On{Source,Dest}{Closed,Errored}| above, we must consider the + // possibility that we're in the middle of a pending read. |state->writer()| + // has a lock on |dest| here, so we know only we can be writing chunks to + // |dest| -- but there's no reason why |dest| couldn't become closed of its + // own accord here (for example, a socket might become closed on its own), and + // such closure may or may not be equivalent to error. + // + // For the reasons noted in |OnSourceErrored|, we process closure in the + // middle of a pending read immediately, without delaying for that read to + // fulfill or reject. We trigger a shutdown operation below, which will + // ensure shutdown only occurs once, so we need not do anything special here. + + // iv. Otherwise (if preventCancel is true), shutdown with destClosed. + if (state->preventCancel()) { + if (!Shutdown(cx, state, destClosed)) { + return false; + } + } + // iii. If preventCancel is false, shutdown with an action of + // ! ReadableStreamCancel(source, destClosed) and with destClosed. + else { + if (!ShutdownWithAction( + cx, state, PipeToState::ShutdownAction::CancelSource, destClosed)) { + return false; + } + } + + return true; +} + +/** + * Streams spec, 3.4.11. ReadableStreamPipeTo step 14: + * "Error and close states must be propagated: the following conditions must be + * applied in order.", as applied at the very start of piping, before any reads + * from source or writes to dest have been triggered. + */ +[[nodiscard]] static bool SourceOrDestErroredOrClosed( + JSContext* cx, Handle state, + Handle unwrappedSource, + Handle unwrappedDest, bool* erroredOrClosed) { + cx->check(state); + + *erroredOrClosed = true; + + // a. Errors must be propagated forward: if source.[[state]] is or becomes + // "errored", then + if (unwrappedSource->errored()) { + return OnSourceErrored(cx, state); + } + + // b. Errors must be propagated backward: if dest.[[state]] is or becomes + // "errored", then + if (unwrappedDest->errored()) { + return OnDestErrored(cx, state); + } + + // c. Closing must be propagated forward: if source.[[state]] is or becomes + // "closed", then + if (unwrappedSource->closed()) { + return OnSourceClosed(cx, state); + } + + // d. Closing must be propagated backward: if + // ! WritableStreamCloseQueuedOrInFlight(dest) is true or dest.[[state]] is + // "closed", then + if (WritableStreamCloseQueuedOrInFlight(unwrappedDest) || + unwrappedDest->closed()) { + return OnDestClosed(cx, state); + } + + *erroredOrClosed = false; + return true; +} + +[[nodiscard]] static bool OnSourceClosed(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted state(cx, TargetFromHandler(args)); + cx->check(state); + + // [[PullSteps]] for ReadableStream controllers is specified to run + // |ReadableStreamClose| before processing the passed-in |readRequest|, so + // the source's reader's [[closedPromise]] can be resolved before the + // promise returned by the last read operation. + // In that case, the last read is still pending when we get here, so instead + // of running the close operation here, we let |ReadFulfilled| take care of + // it. + if (!state->hasPendingRead()) { + if (!OnSourceClosed(cx, state)) { + return false; + } + } + + args.rval().setUndefined(); + return true; +} + +[[nodiscard]] static bool OnSourceErrored(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted state(cx, TargetFromHandler(args)); + cx->check(state); + + if (!OnSourceErrored(cx, state)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +[[nodiscard]] static bool OnDestClosed(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted state(cx, TargetFromHandler(args)); + cx->check(state); + + if (!OnDestClosed(cx, state)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +[[nodiscard]] static bool OnDestErrored(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted state(cx, TargetFromHandler(args)); + cx->check(state); + + if (!OnDestErrored(cx, state)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +template +static inline JSObject* GetClosedPromise( + JSContext* cx, Handle unwrappedStream, + StreamAccessor* (&unwrapAccessorFromStream)(JSContext*, Handle)) { + StreamAccessor* unwrappedAccessor = + unwrapAccessorFromStream(cx, unwrappedStream); + if (!unwrappedAccessor) { + return nullptr; + } + + return unwrappedAccessor->closedPromise(); +} + +[[nodiscard]] static bool ReadFromSource(JSContext* cx, + Handle state); + +static bool ReadFulfilled(JSContext* cx, Handle state, + Handle result) { + cx->check(state); + cx->check(result); + + state->clearPendingRead(); + + // "Shutdown must stop activity: if shuttingDown becomes true, the user agent + // must not initiate further reads from reader, and must only perform writes + // of already-read chunks". + // + // We may reach this point after |On{Source,Dest}{Clos,Error}ed| has responded + // to an out-of-band change. Per the comment in |OnSourceErrored|, we want to + // allow the implicated shutdown to proceed, and we don't want to interfere + // with or additionally alter its operation. Particularly, we don't want to + // queue up the successfully-read chunk (if there was one, and this isn't just + // reporting "done") to be written: it wasn't "already-read" when that + // error/closure happened. + // + // All specified reactions to a closure/error invoke either the shutdown, or + // shutdown with an action, algorithms. Those algorithms each abort if either + // shutdown algorithm has already been invoked. So we check for shutdown here + // in case of asynchronous closure/error and abort if shutdown has already + // started (and possibly finished). + if (state->shuttingDown()) { + return true; + } + + { + bool done; + { + Rooted doneVal(cx); + if (!GetProperty(cx, result, result, cx->names().done, &doneVal)) { + return false; + } + done = doneVal.toBoolean(); + } + + if (done) { + // All chunks have been read from |reader| and written to |writer| (but + // not necessarily fulfilled yet, in the latter case). Proceed as if + // |source| is now closed. (This will asynchronously wait until any + // pending writes have fulfilled.) + return OnSourceClosed(cx, state); + } + } + + // A chunk was read, and *at the time the read was requested*, |dest| was + // ready to accept a write. (Only one read is processed at a time per + // |state->hasPendingRead()|, so this condition remains true now.) Write the + // chunk to |dest|. + { + Rooted chunk(cx); + if (!GetProperty(cx, result, result, cx->names().value, &chunk)) { + return false; + } + + Rooted writer(cx, state->writer()); + cx->check(writer); + + PromiseObject* writeRequest = + WritableStreamDefaultWriterWrite(cx, writer, chunk); + if (!writeRequest) { + return false; + } + + // Stash away this new last write request. (The shutdown process will react + // to this write request to finish shutdown only once all pending writes are + // completed.) + state->updateLastWriteRequest(writeRequest); + } + + // Read another chunk if this write didn't fill up |dest|. + // + // While we (properly) ignored |state->shuttingDown()| earlier, this call will + // *not* initiate a fresh read if |!state->shuttingDown()|. + return ReadFromSource(cx, state); +} + +static bool ReadFulfilled(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + MOZ_ASSERT(args.length() == 1); + + Rooted state(cx, TargetFromHandler(args)); + cx->check(state); + + Rooted result(cx, &args[0].toObject()); + cx->check(result); + + if (!ReadFulfilled(cx, state, result)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +static bool ReadFromSource(JSContext* cx, unsigned argc, Value* vp); + +[[nodiscard]] static bool ReadFromSource(JSContext* cx, + Handle state) { + cx->check(state); + + MOZ_ASSERT(!state->hasPendingRead(), + "should only have one read in flight at a time, because multiple " + "reads could cause the latter read to ignore backpressure " + "signals"); + + // "Shutdown must stop activity: if shuttingDown becomes true, the user agent + // must not initiate further reads from reader..." + if (state->shuttingDown()) { + return true; + } + + Rooted writer(cx, state->writer()); + cx->check(writer); + + // "While WritableStreamDefaultWriterGetDesiredSize(writer) is ≤ 0 or is null, + // the user agent must not read from reader." + Rooted desiredSize(cx); + if (!WritableStreamDefaultWriterGetDesiredSize(cx, writer, &desiredSize)) { + return false; + } + + // If we're in the middle of erroring or are fully errored, either way the + // |dest|-closed reaction queued up in |StartPiping| will do the right + // thing, so do nothing here. + if (desiredSize.isNull()) { +#ifdef DEBUG + { + WritableStream* unwrappedDest = GetUnwrappedDest(cx, state); + if (!unwrappedDest) { + return false; + } + + MOZ_ASSERT(unwrappedDest->erroring() || unwrappedDest->errored()); + } +#endif + + return true; + } + + // If |dest| isn't ready to receive writes yet (i.e. backpressure applies), + // resume when it is. + MOZ_ASSERT(desiredSize.isNumber()); + if (desiredSize.toNumber() <= 0) { + Rooted readyPromise(cx, writer->readyPromise()); + cx->check(readyPromise); + + Rooted readFromSource(cx, + NewHandler(cx, ReadFromSource, state)); + if (!readFromSource) { + return false; + } + + // Resume when there's writable capacity. Don't bother handling rejection: + // if this happens, the stream is going to be errored shortly anyway, and + // |StartPiping| has us ready to react to that already. + // + // XXX Double-check the claim that we need not handle rejections and that a + // rejection of [[readyPromise]] *necessarily* is always followed by + // rejection of [[closedPromise]]. + return JS::AddPromiseReactionsIgnoringUnhandledRejection( + cx, readyPromise, readFromSource, nullptr); + } + + // |dest| is ready to receive at least one write. Read one chunk from the + // reader now that we're not subject to backpressure. + Rooted reader(cx, state->reader()); + cx->check(reader); + + Rooted readRequest( + cx, js::ReadableStreamDefaultReaderRead(cx, reader)); + if (!readRequest) { + return false; + } + + Rooted readFulfilled(cx, NewHandler(cx, ReadFulfilled, state)); + if (!readFulfilled) { + return false; + } + +#ifdef DEBUG + MOZ_ASSERT(!state->pendingReadWouldBeRejected()); + + // The specification for ReadableStreamError ensures that rejecting a read or + // read-into request is immediately followed by rejecting the reader's + // [[closedPromise]]. Therefore, it does not appear *necessary* to handle the + // rejected case -- the [[closedPromise]] reaction will do so for us. + // + // However, this is all very stateful and gnarly, so we implement a rejection + // handler that sets a flag to indicate the read was rejected. Then if the + // [[closedPromise]] reaction function is invoked, we can assert that *if* + // a read is recorded as pending at that instant, a reject handler would have + // been invoked for it. + auto ReadRejected = [](JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + MOZ_ASSERT(args.length() == 1); + + Rooted state(cx, TargetFromHandler(args)); + cx->check(state); + + state->setPendingReadWouldBeRejected(); + + args.rval().setUndefined(); + return true; + }; + + Rooted readRejected(cx, NewHandler(cx, ReadRejected, state)); + if (!readRejected) { + return false; + } +#else + auto readRejected = nullptr; +#endif + + // Once the chunk is read, immediately write it and attempt to read more. + // Don't bother handling a rejection: |source| will be closed/errored, and + // |StartPiping| poised us to react to that already. + if (!JS::AddPromiseReactionsIgnoringUnhandledRejection( + cx, readRequest, readFulfilled, readRejected)) { + return false; + } + + // The spec is clear that a write started before an error/stream-closure is + // encountered must be completed before shutdown. It is *not* clear that a + // read that hasn't yet fulfilled should delay shutdown (or until that read's + // successive write is completed). + // + // It seems easiest to explain, both from a user perspective (no read is ever + // just dropped on the ground) and an implementer perspective (if we *don't* + // delay, then a read could be started, a shutdown could be started, then the + // read could finish but we can't write it which arguably conflicts with the + // requirement that chunks that have been read must be written before shutdown + // completes), to delay. XXX file a spec issue to require this! + state->setPendingRead(); + return true; +} + +static bool ReadFromSource(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted state(cx, TargetFromHandler(args)); + cx->check(state); + + if (!ReadFromSource(cx, state)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +[[nodiscard]] static bool StartPiping(JSContext* cx, Handle state, + Handle unwrappedSource, + Handle unwrappedDest) { + cx->check(state); + + // "Shutdown must stop activity: if shuttingDown becomes true, the user agent + // must not initiate further reads from reader..." + MOZ_ASSERT(!state->shuttingDown(), "can't be shutting down when starting"); + + // "Error and close states must be propagated: the following conditions must + // be applied in order." + // + // Before piping has started, we have to check for source/dest being errored + // or closed manually. + bool erroredOrClosed; + if (!SourceOrDestErroredOrClosed(cx, state, unwrappedSource, unwrappedDest, + &erroredOrClosed)) { + return false; + } + if (erroredOrClosed) { + return true; + } + + // *After* piping has started, add reactions to respond to source/dest + // becoming errored or closed. + { + Rooted unwrappedClosedPromise(cx); + Rooted onClosed(cx); + Rooted onErrored(cx); + + auto ReactWhenClosedOrErrored = + [&unwrappedClosedPromise, &onClosed, &onErrored, &state]( + JSContext* cx, JSNative onClosedFunc, JSNative onErroredFunc) { + onClosed = NewHandler(cx, onClosedFunc, state); + if (!onClosed) { + return false; + } + + onErrored = NewHandler(cx, onErroredFunc, state); + if (!onErrored) { + return false; + } + + return JS::AddPromiseReactions(cx, unwrappedClosedPromise, onClosed, + onErrored); + }; + + unwrappedClosedPromise = + GetClosedPromise(cx, unwrappedSource, UnwrapReaderFromStream); + if (!unwrappedClosedPromise) { + return false; + } + + if (!ReactWhenClosedOrErrored(cx, OnSourceClosed, OnSourceErrored)) { + return false; + } + + unwrappedClosedPromise = + GetClosedPromise(cx, unwrappedDest, UnwrapWriterFromStream); + if (!unwrappedClosedPromise) { + return false; + } + + if (!ReactWhenClosedOrErrored(cx, OnDestClosed, OnDestErrored)) { + return false; + } + } + + return ReadFromSource(cx, state); +} + +/** + * Stream spec, 4.8.1. ReadableStreamPipeTo ( source, dest, + * preventClose, preventAbort, + * preventCancel[, signal] ) + * Step 14.1 abortAlgorithm. + */ +[[nodiscard]] static bool PerformAbortAlgorithm(JSContext* cx, + Handle state) { + cx->check(state); + + // Step 14.1: Let abortAlgorithm be the following steps: + // Step 14.1.1: Let error be a new "AbortError" DOMException. + // Step 14.1.2: Let actions be an empty ordered set. + // Step 14.1.3: If preventAbort is false, append the following action to + // actions: + // Step 14.1.3.1: If dest.[[state]] is "writable", return + // ! WritableStreamAbort(dest, error). + // Step 14.1.3.2: Otherwise, return a promise resolved with undefined. + // Step 14.1.4: If preventCancel is false, append the following action action + // to actions: + // Step 14.1.4.1: If source.[[state]] is "readable", return + // ! ReadableStreamCancel(source, error). + // Step 14.1.4.2: Otherwise, return a promise resolved with undefined. + // Step 14.1.5: Shutdown with an action consisting of getting a promise to + // wait for all of the actions in actions, and with error. + // XXX jwalden + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_METHOD_NOT_IMPLEMENTED, + "abortAlgorithm steps"); + return false; +} + +/** + * Stream spec, 3.4.11. ReadableStreamPipeTo ( source, dest, + * preventClose, preventAbort, + * preventCancel, signal ) + * Steps 4-11, 13-14. + */ +/* static */ PipeToState* PipeToState::create( + JSContext* cx, Handle promise, + Handle unwrappedSource, + Handle unwrappedDest, bool preventClose, bool preventAbort, + bool preventCancel, Handle signal) { + cx->check(promise); + cx->check(signal); + + Rooted state(cx, + NewTenuredBuiltinClassInstance(cx)); + if (!state) { + return nullptr; + } + + // Step 4. Assert: signal is undefined or signal is an instance of the + // AbortSignal interface. + MOZ_ASSERT(state->getFixedSlot(Slot_Signal).isUndefined()); + if (signal) { + // |signal| is double-checked to be an |AbortSignal| further down. + state->initFixedSlot(Slot_Signal, ObjectValue(*signal)); + } + + // Step 5: Assert: ! IsReadableStreamLocked(source) is false. + MOZ_ASSERT(!unwrappedSource->locked()); + + // Step 6: Assert: ! IsWritableStreamLocked(dest) is false. + MOZ_ASSERT(!unwrappedDest->isLocked()); + + MOZ_ASSERT(state->getFixedSlot(Slot_Promise).isUndefined()); + state->initFixedSlot(Slot_Promise, ObjectValue(*promise)); + + // Step 7: If ! IsReadableByteStreamController( + // source.[[readableStreamController]]) is true, let reader + // be either ! AcquireReadableStreamBYOBReader(source) or + // ! AcquireReadableStreamDefaultReader(source), at the user agent’s + // discretion. + // Step 8: Otherwise, let reader be + // ! AcquireReadableStreamDefaultReader(source). + // We don't implement byte streams, so we always acquire a default reader. + { + ReadableStreamDefaultReader* reader = CreateReadableStreamDefaultReader( + cx, unwrappedSource, ForAuthorCodeBool::No); + if (!reader) { + return nullptr; + } + + MOZ_ASSERT(state->getFixedSlot(Slot_Reader).isUndefined()); + state->initFixedSlot(Slot_Reader, ObjectValue(*reader)); + } + + // Step 9: Let writer be ! AcquireWritableStreamDefaultWriter(dest). + { + WritableStreamDefaultWriter* writer = + CreateWritableStreamDefaultWriter(cx, unwrappedDest); + if (!writer) { + return nullptr; + } + + MOZ_ASSERT(state->getFixedSlot(Slot_Writer).isUndefined()); + state->initFixedSlot(Slot_Writer, ObjectValue(*writer)); + } + + // Step 10: Set source.[[disturbed]] to true. + unwrappedSource->setDisturbed(); + + state->initFlags(preventClose, preventAbort, preventCancel); + MOZ_ASSERT(state->preventClose() == preventClose); + MOZ_ASSERT(state->preventAbort() == preventAbort); + MOZ_ASSERT(state->preventCancel() == preventCancel); + + // Step 11: Let shuttingDown be false. + MOZ_ASSERT(!state->shuttingDown(), "should be set to false by initFlags"); + + // Step 12 ("Let promise be a new promise.") was performed by the caller and + // |promise| was its result. + + // XXX This used to be step 13 but is now step 14, all the step-comments of + // the overall algorithm need renumbering. + // Step 13: If signal is not undefined, + if (signal) { + // Step 14.2: If signal’s aborted flag is set, perform abortAlgorithm and + // return promise. + bool aborted; + { + // Sadly, we can't assert |signal| is an |AbortSignal| here because it + // could have become a nuked CCW since it was type-checked. + JSObject* unwrappedSignal = UnwrapSignalFromPipeToState(cx, state); + if (!unwrappedSignal) { + return nullptr; + } + + JSRuntime* rt = cx->runtime(); + MOZ_ASSERT(unwrappedSignal->hasClass(rt->maybeAbortSignalClass())); + + AutoRealm ar(cx, unwrappedSignal); + aborted = rt->abortSignalIsAborted(unwrappedSignal); + } + if (aborted) { + if (!PerformAbortAlgorithm(cx, state)) { + return nullptr; + } + + // Returning |state| here will cause |promise| to be returned by the + // overall algorithm. + return state; + } + + // Step 14.3: Add abortAlgorithm to signal. + // XXX jwalden need JSAPI to add an algorithm/steps to an AbortSignal + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_METHOD_NOT_IMPLEMENTED, + "adding abortAlgorithm to signal"); + return nullptr; + } + + // Step 14: In parallel, using reader and writer, read all chunks from source + // and write them to dest. + if (!StartPiping(cx, state, unwrappedSource, unwrappedDest)) { + return nullptr; + } + + return state; +} + +const JSClass PipeToState::class_ = {"PipeToState", + JSCLASS_HAS_RESERVED_SLOTS(SlotCount)}; diff --git a/js/src/builtin/streams/PipeToState.h b/js/src/builtin/streams/PipeToState.h new file mode 100644 index 0000000000000..b15cacb28fa53 --- /dev/null +++ b/js/src/builtin/streams/PipeToState.h @@ -0,0 +1,291 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* ReadableStream.prototype.pipeTo state. */ + +#ifndef builtin_streams_PipeToState_h +#define builtin_streams_PipeToState_h + +#include "mozilla/Assertions.h" // MOZ_ASSERT +#include "mozilla/WrappingOperations.h" // mozilla::WrapToSigned + +#include // uint32_t + +#include "builtin/streams/ReadableStreamReader.h" // js::ReadableStreamDefaultReader +#include "builtin/streams/WritableStreamDefaultWriter.h" // js::WritableStreamDefaultWriter +#include "js/Class.h" // JSClass +#include "js/RootingAPI.h" // JS::Handle +#include "js/Value.h" // JS::Int32Value, JS::ObjectValue +#include "vm/NativeObject.h" // js::NativeObject +#include "vm/PromiseObject.h" // js::PromiseObject + +class JS_PUBLIC_API JSObject; + +namespace js { + +class ReadableStream; +class WritableStream; + +/** + * PipeToState objects implement the local variables in Streams spec 3.4.11 + * ReadableStreamPipeTo across all sub-operations that occur in that algorithm. + */ +class PipeToState : public NativeObject { + public: + /** + * Memory layout for PipeToState instances. + */ + enum Slots { + /** Integer bit field of various flags. */ + Slot_Flags = 0, + + /** + * The promise resolved or rejected when the overall pipe-to operation + * completes. + * + * This promise is created directly under |ReadableStreamPipeTo|, at the + * same time the corresponding |PipeToState| is created, so it is always + * same-compartment with this and is guaranteed to hold a |PromiseObject*| + * if initialization succeeded. + */ + Slot_Promise, + + /** + * A |ReadableStreamDefaultReader| used to read from the readable stream + * being piped from. + * + * This reader is created at the same time as its |PipeToState|, so this + * reader is same-compartment with this and is guaranteed to be a + * |ReadableStreamDefaultReader*| if initialization succeeds. + */ + Slot_Reader, + + /** + * A |WritableStreamDefaultWriter| used to write to the writable stream + * being piped to. + * + * This writer is created at the same time as its |PipeToState|, so this + * writer is same-compartment with this and is guaranteed to be a + * |WritableStreamDefaultWriter*| if initialization succeeds. + */ + Slot_Writer, + + /** + * The |PromiseObject*| of the last write performed to the destinationg + * |WritableStream| using the writer in |Slot_Writer|. If no writes have + * yet been performed, this slot contains |undefined|. + * + * This promise is created inside a handler function in the same compartment + * and realm as this |PipeToState|, so it is always a |PromiseObject*| and + * never a wrapper around one. + */ + Slot_LastWriteRequest, + + /** + * Either |undefined| or an |AbortSignal| instance specified by the user, + * whose controller may be used to externally abort the piping algorithm. + * + * This signal is user-provided, so it may be a wrapper around an + * |AbortSignal| not from the same compartment as this. + */ + Slot_Signal, + + SlotCount, + }; + + // The set of possible actions to be passed to the "shutdown with an action" + // algorithm. + // + // We store actions as numbers because 1) handler functions already devote + // their extra slots to target and extra value; and 2) storing a full function + // pointer would require an extra slot, while storing as number packs into + // existing flag storage. + enum class ShutdownAction { + /** The action used during |abortAlgorithm|.*/ + AbortAlgorithm, + + /** + * The action taken when |source| errors and aborting is not prevented, to + * abort |dest| with |source|'s error. + */ + AbortDestStream, + + /** + * The action taken when |dest| becomes errored or closed and canceling is + * not prevented, to cancel |source| with |dest|'s error. + */ + CancelSource, + + /** + * The action taken when |source| closes and closing is not prevented, to + * close the writer while propagating any error in it. + */ + CloseWriterWithErrorPropagation, + + }; + + private: + enum Flags : uint32_t { + /** + * The action passed to the "shutdown with an action" algorithm. + * + * Note that because only the first "shutdown" and "shutdown with an action" + * operation has any effect, we can store this action in |PipeToState| in + * the first invocation of either operation without worrying about it being + * overwritten. + * + * Purely for convenience, we encode this in the lowest bits so that the + * result of a mask is the underlying value of the correct |ShutdownAction|. + */ + Flag_ShutdownActionBits = 0b0000'0011, + + Flag_ShuttingDown = 0b0000'0100, + + Flag_PendingRead = 0b0000'1000, +#ifdef DEBUG + Flag_PendingReadWouldBeRejected = 0b0001'0000, +#endif + + Flag_PreventClose = 0b0010'0000, + Flag_PreventAbort = 0b0100'0000, + Flag_PreventCancel = 0b1000'0000, + }; + + uint32_t flags() const { return getFixedSlot(Slot_Flags).toInt32(); } + void setFlags(uint32_t flags) { + setFixedSlot(Slot_Flags, JS::Int32Value(mozilla::WrapToSigned(flags))); + } + + // Flags start out zeroed, so the initially-stored shutdown action value will + // be this value. (This is also the value of an *initialized* shutdown + // action, but it doesn't seem worth the trouble to store an extra bit to + // detect this specific action being recorded multiple times, purely for + // assertions.) + static constexpr ShutdownAction UninitializedAction = + ShutdownAction::AbortAlgorithm; + + static_assert(Flag_ShutdownActionBits & 1, + "shutdown action bits must be low-order bits so that we can " + "cast ShutdownAction values directly to bits to store"); + + static constexpr uint32_t MaxAction = + static_cast(ShutdownAction::CloseWriterWithErrorPropagation); + + static_assert(MaxAction <= Flag_ShutdownActionBits, + "max action shouldn't overflow available bits to store it"); + + public: + static const JSClass class_; + + PromiseObject* promise() const { + return &getFixedSlot(Slot_Promise).toObject().as(); + } + + ReadableStreamDefaultReader* reader() const { + return &getFixedSlot(Slot_Reader) + .toObject() + .as(); + } + + WritableStreamDefaultWriter* writer() const { + return &getFixedSlot(Slot_Writer) + .toObject() + .as(); + } + + PromiseObject* lastWriteRequest() const { + const auto& slot = getFixedSlot(Slot_LastWriteRequest); + if (slot.isUndefined()) { + return nullptr; + } + + return &slot.toObject().as(); + } + + void updateLastWriteRequest(PromiseObject* writeRequest) { + MOZ_ASSERT(writeRequest != nullptr); + setFixedSlot(Slot_LastWriteRequest, JS::ObjectValue(*writeRequest)); + } + + bool hasSignal() const { + JS::Value v = getFixedSlot(Slot_Signal); + MOZ_ASSERT(v.isObject() || v.isUndefined()); + return v.isObject(); + } + + bool shuttingDown() const { return flags() & Flag_ShuttingDown; } + void setShuttingDown() { + MOZ_ASSERT(!shuttingDown()); + setFlags(flags() | Flag_ShuttingDown); + } + + ShutdownAction shutdownAction() const { + MOZ_ASSERT(shuttingDown(), + "must be shutting down to have a shutdown action"); + + uint32_t bits = flags() & Flag_ShutdownActionBits; + static_assert(Flag_ShutdownActionBits & 1, + "shutdown action bits are assumed to be low-order bits that " + "don't have to be shifted down to ShutdownAction's range"); + + MOZ_ASSERT(bits <= MaxAction, "bits must encode a valid action"); + + return static_cast(bits); + } + + void setShutdownAction(ShutdownAction action) { + MOZ_ASSERT(shuttingDown(), + "must be protected by the |shuttingDown| boolean to save the " + "shutdown action"); + MOZ_ASSERT(shutdownAction() == UninitializedAction, + "should only set shutdown action once"); + + setFlags(flags() | static_cast(action)); + } + + bool preventClose() const { return flags() & Flag_PreventClose; } + bool preventAbort() const { return flags() & Flag_PreventAbort; } + bool preventCancel() const { return flags() & Flag_PreventCancel; } + + bool hasPendingRead() const { return flags() & Flag_PendingRead; } + void setPendingRead() { + MOZ_ASSERT(!hasPendingRead()); + setFlags(flags() | Flag_PendingRead); + } + void clearPendingRead() { + MOZ_ASSERT(hasPendingRead()); + setFlags(flags() & ~Flag_PendingRead); + } + +#ifdef DEBUG + bool pendingReadWouldBeRejected() const { + return flags() & Flag_PendingReadWouldBeRejected; + } + void setPendingReadWouldBeRejected() { + MOZ_ASSERT(!pendingReadWouldBeRejected()); + setFlags(flags() | Flag_PendingReadWouldBeRejected); + } +#endif + + void initFlags(bool preventClose, bool preventAbort, bool preventCancel) { + MOZ_ASSERT(getFixedSlot(Slot_Flags).isUndefined()); + + uint32_t flagBits = (preventClose ? Flag_PreventClose : 0) | + (preventAbort ? Flag_PreventAbort : 0) | + (preventCancel ? Flag_PreventCancel : 0); + setFlags(flagBits); + } + + static PipeToState* create(JSContext* cx, JS::Handle promise, + JS::Handle unwrappedSource, + JS::Handle unwrappedDest, + bool preventClose, bool preventAbort, + bool preventCancel, JS::Handle signal); +}; + +} // namespace js + +#endif // builtin_streams_PipeToState_h diff --git a/js/src/builtin/streams/PullIntoDescriptor.cpp b/js/src/builtin/streams/PullIntoDescriptor.cpp new file mode 100644 index 0000000000000..1b6c99a45b618 --- /dev/null +++ b/js/src/builtin/streams/PullIntoDescriptor.cpp @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Pull descriptor objects for tracking byte stream pull-into requests. */ + +#include "builtin/streams/PullIntoDescriptor.h" + +#include // uint32_t + +#include "js/Class.h" // JSClass, JSCLASS_HAS_RESERVED_SLOTS +#include "js/RootingAPI.h" // JS::Handle, JS::Rooted + +#include "vm/JSObject-inl.h" // js::NewBuiltinClassInstance + +using js::PullIntoDescriptor; + +using JS::Handle; +using JS::Int32Value; +using JS::ObjectOrNullValue; +using JS::ObjectValue; +using JS::Rooted; + +/* static */ PullIntoDescriptor* PullIntoDescriptor::create( + JSContext* cx, Handle buffer, uint32_t byteOffset, + uint32_t byteLength, uint32_t bytesFilled, uint32_t elementSize, + Handle ctor, ReaderType readerType) { + Rooted descriptor( + cx, NewBuiltinClassInstance(cx)); + if (!descriptor) { + return nullptr; + } + + descriptor->setFixedSlot(Slot_buffer, ObjectValue(*buffer)); + descriptor->setFixedSlot(Slot_Ctor, ObjectOrNullValue(ctor)); + descriptor->setFixedSlot(Slot_ByteOffset, Int32Value(byteOffset)); + descriptor->setFixedSlot(Slot_ByteLength, Int32Value(byteLength)); + descriptor->setFixedSlot(Slot_BytesFilled, Int32Value(bytesFilled)); + descriptor->setFixedSlot(Slot_ElementSize, Int32Value(elementSize)); + descriptor->setFixedSlot(Slot_ReaderType, + Int32Value(static_cast(readerType))); + return descriptor; +} + +const JSClass PullIntoDescriptor::class_ = { + "PullIntoDescriptor", JSCLASS_HAS_RESERVED_SLOTS(SlotCount)}; diff --git a/js/src/builtin/streams/PullIntoDescriptor.h b/js/src/builtin/streams/PullIntoDescriptor.h new file mode 100644 index 0000000000000..a65dc5633b73f --- /dev/null +++ b/js/src/builtin/streams/PullIntoDescriptor.h @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Pull descriptor objects for tracking byte stream pull-into requests. */ + +#ifndef builtin_streams_PullIntoDescriptor_h +#define builtin_streams_PullIntoDescriptor_h + +#include // int32_t, uint32_t + +#include "js/Class.h" // JSClass +#include "vm/ArrayBufferObject.h" // js::ArrayBufferObject; +#include "vm/NativeObject.h" // js::NativeObject + +namespace js { + +enum class ReaderType : int32_t { None = 0, Default = 1, BYOB = 2 }; + +class PullIntoDescriptor : public NativeObject { + private: + enum Slots { + Slot_buffer, + Slot_ByteOffset, + Slot_ByteLength, + Slot_BytesFilled, + Slot_ElementSize, + Slot_Ctor, + Slot_ReaderType, + SlotCount + }; + + public: + static const JSClass class_; + + JSObject* buffer() { return &getFixedSlot(Slot_buffer).toObject(); } + void setBuffer(JSObject* buffer) { + setFixedSlot(Slot_buffer, ObjectValue(*buffer)); + } + Value ctor() { return getFixedSlot(Slot_Ctor); } + uint32_t byteOffset() const { + return getFixedSlot(Slot_ByteOffset).toInt32(); + } + uint32_t byteLength() const { + return getFixedSlot(Slot_ByteLength).toInt32(); + } + uint32_t bytesFilled() const { + return getFixedSlot(Slot_BytesFilled).toInt32(); + } + void setBytesFilled(int32_t bytes) { + setFixedSlot(Slot_BytesFilled, Int32Value(bytes)); + } + uint32_t elementSize() const { + return getFixedSlot(Slot_ElementSize).toInt32(); + } + ReaderType readerType() const { + int32_t n = getFixedSlot(Slot_ReaderType).toInt32(); + MOZ_ASSERT(n == int32_t(ReaderType::Default) || + n == int32_t(ReaderType::BYOB) || + n == int32_t(ReaderType::None)); + return ReaderType(n); + } + void setReaderType(ReaderType readerType) { + setFixedSlot(Slot_ReaderType, Int32Value(int32_t(readerType))); + } + + static PullIntoDescriptor* create(JSContext* cx, + JS::Handle buffer, + uint32_t byteOffset, uint32_t byteLength, + uint32_t bytesFilled, uint32_t elementSize, + JS::Handle ctor, + ReaderType readerType); +}; + +} // namespace js + +#endif // builtin_streams_PullIntoDescriptor_h diff --git a/js/src/builtin/streams/QueueWithSizes-inl.h b/js/src/builtin/streams/QueueWithSizes-inl.h new file mode 100644 index 0000000000000..fa73cdc7cacce --- /dev/null +++ b/js/src/builtin/streams/QueueWithSizes-inl.h @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Queue-with-sizes operations. */ + +#ifndef builtin_streams_QueueWithSizes_inl_h +#define builtin_streams_QueueWithSizes_inl_h + +#include "builtin/streams/QueueWithSizes.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT + +#include "js/RootingAPI.h" // JS::Handle +#include "js/Value.h" // JS::Value +#include "vm/List.h" // js::ListObject + +#include "vm/List-inl.h" // js::ListObject::* + +struct JS_PUBLIC_API JSContext; + +namespace js { + +namespace detail { + +// The *internal* representation of a queue-with-sizes is a List of even length +// where elements (2 * n, 2 * n + 1) represent the nth (value, size) element in +// the queue. + +inline JS::Value QueueFirstValue(ListObject* unwrappedQueue) { + MOZ_ASSERT(!unwrappedQueue->isEmpty(), + "can't examine first value in an empty queue-with-sizes"); + MOZ_ASSERT((unwrappedQueue->length() % 2) == 0, + "queue-with-sizes must consist of (value, size) element pairs and " + "so must have even length"); + return unwrappedQueue->get(0); +} + +inline double QueueFirstSize(ListObject* unwrappedQueue) { + MOZ_ASSERT(!unwrappedQueue->isEmpty(), + "can't examine first value in an empty queue-with-sizes"); + MOZ_ASSERT((unwrappedQueue->length() % 2) == 0, + "queue-with-sizes must consist of (value, size) element pairs and " + "so must have even length"); + return unwrappedQueue->get(1).toDouble(); +} + +inline void QueueRemoveFirstValueAndSize(ListObject* unwrappedQueue, + JSContext* cx) { + MOZ_ASSERT(!unwrappedQueue->isEmpty(), + "can't remove first value from an empty queue-with-sizes"); + MOZ_ASSERT((unwrappedQueue->length() % 2) == 0, + "queue-with-sizes must consist of (value, size) element pairs and " + "so must have even length"); + unwrappedQueue->popFirstPair(cx); +} + +[[nodiscard]] inline bool QueueAppendValueAndSize( + JSContext* cx, JS::Handle unwrappedQueue, + JS::Handle value, double size) { + return unwrappedQueue->appendValueAndSize(cx, value, size); +} + +} // namespace detail + +/** + * Streams spec, 6.2.3. PeekQueueValue ( container ) nothrow + */ +inline JS::Value PeekQueueValue(ListObject* queue) { + return detail::QueueFirstValue(queue); +} + +} // namespace js + +#endif // builtin_streams_QueueWithSizes_inl_h diff --git a/js/src/builtin/streams/QueueWithSizes.cpp b/js/src/builtin/streams/QueueWithSizes.cpp new file mode 100644 index 0000000000000..f9cb33c47898d --- /dev/null +++ b/js/src/builtin/streams/QueueWithSizes.cpp @@ -0,0 +1,170 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Queue-with-sizes operations. */ + +#include "builtin/streams/QueueWithSizes-inl.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT + +#include "builtin/streams/StreamController.h" // js::StreamController +#include "js/Class.h" // JSClass, JSCLASS_HAS_RESERVED_SLOTS +#include "js/Conversions.h" // JS::ToNumber +#include "js/ErrorReport.h" // JS_ReportErrorNumberASCII +#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* +#include "js/RootingAPI.h" // JS::Rooted +#include "js/Value.h" // JS::Value, JS::{Number,Object}Value +#include "vm/Compartment.h" // JSCompartment +#include "vm/JSContext.h" // JSContext +#include "vm/List.h" // js::ListObject +#include "vm/NativeObject.h" // js::NativeObject + +#include "vm/Compartment-inl.h" // JSCompartment::wrap +#include "vm/JSContext-inl.h" // JSContext::check +#include "vm/JSObject-inl.h" // js::NewBuiltinClassInstance +#include "vm/List-inl.h" // js::ListObject::*, js::StoreNewListInFixedSlot +#include "vm/Realm-inl.h" // js::AutoRealm + +using JS::Handle; +using JS::MutableHandle; +using JS::NumberValue; +using JS::ObjectValue; +using JS::Rooted; +using JS::ToNumber; +using JS::Value; + +/*** 6.2. Queue-with-sizes operations ***************************************/ + +/** + * Streams spec, 6.2.1. DequeueValue ( container ) nothrow + */ +[[nodiscard]] bool js::DequeueValue( + JSContext* cx, Handle unwrappedContainer, + MutableHandle chunk) { + // Step 1: Assert: container has [[queue]] and [[queueTotalSize]] internal + // slots (implicit). + // Step 2: Assert: queue is not empty. + Rooted unwrappedQueue(cx, unwrappedContainer->queue()); + + // Step 3. Let pair be the first element of queue. + double chunkSize = detail::QueueFirstSize(unwrappedQueue); + chunk.set(detail::QueueFirstValue(unwrappedQueue)); + + // Step 4. Remove pair from queue, shifting all other elements downward + // (so that the second becomes the first, and so on). + detail::QueueRemoveFirstValueAndSize(unwrappedQueue, cx); + + // Step 5: Set container.[[queueTotalSize]] to + // container.[[queueTotalSize]] − pair.[[size]]. + // Step 6: If container.[[queueTotalSize]] < 0, set + // container.[[queueTotalSize]] to 0. + // (This can occur due to rounding errors.) + double totalSize = unwrappedContainer->queueTotalSize(); + totalSize -= chunkSize; + if (totalSize < 0) { + totalSize = 0; + } + unwrappedContainer->setQueueTotalSize(totalSize); + + // Step 7: Return pair.[[value]]. + return cx->compartment()->wrap(cx, chunk); +} + +void js::DequeueValue(StreamController* unwrappedContainer, JSContext* cx) { + // Step 1: Assert: container has [[queue]] and [[queueTotalSize]] internal + // slots (implicit). + // Step 2: Assert: queue is not empty. + ListObject* unwrappedQueue = unwrappedContainer->queue(); + + // Step 3. Let pair be the first element of queue. + // (The value is being discarded, so all we must extract is the size.) + double chunkSize = detail::QueueFirstSize(unwrappedQueue); + + // Step 4. Remove pair from queue, shifting all other elements downward + // (so that the second becomes the first, and so on). + detail::QueueRemoveFirstValueAndSize(unwrappedQueue, cx); + + // Step 5: Set container.[[queueTotalSize]] to + // container.[[queueTotalSize]] − pair.[[size]]. + // Step 6: If container.[[queueTotalSize]] < 0, set + // container.[[queueTotalSize]] to 0. + // (This can occur due to rounding errors.) + double totalSize = unwrappedContainer->queueTotalSize(); + totalSize -= chunkSize; + if (totalSize < 0) { + totalSize = 0; + } + unwrappedContainer->setQueueTotalSize(totalSize); + + // Step 7: Return pair.[[value]]. (omitted because not used) +} + +/** + * Streams spec, 6.2.2. EnqueueValueWithSize ( container, value, size ) throws + */ +[[nodiscard]] bool js::EnqueueValueWithSize( + JSContext* cx, Handle unwrappedContainer, + Handle value, Handle sizeVal) { + cx->check(value, sizeVal); + + // Step 1: Assert: container has [[queue]] and [[queueTotalSize]] internal + // slots (implicit). + // Step 2: Let size be ? ToNumber(size). + double size; + if (!ToNumber(cx, sizeVal, &size)) { + return false; + } + + // Step 3: If ! IsFiniteNonNegativeNumber(size) is false, throw a RangeError + // exception. + if (size < 0 || std::isnan(size) || !std::isfinite(size)) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_NUMBER_MUST_BE_FINITE_NON_NEGATIVE, "size"); + return false; + } + + // Step 4: Append Record {[[value]]: value, [[size]]: size} as the last + // element of container.[[queue]]. + { + AutoRealm ar(cx, unwrappedContainer); + Rooted unwrappedQueue(cx, unwrappedContainer->queue()); + Rooted wrappedVal(cx, value); + if (!cx->compartment()->wrap(cx, &wrappedVal)) { + return false; + } + + if (!detail::QueueAppendValueAndSize(cx, unwrappedQueue, wrappedVal, + size)) { + return false; + } + } + + // Step 5: Set container.[[queueTotalSize]] to + // container.[[queueTotalSize]] + size. + unwrappedContainer->setQueueTotalSize(unwrappedContainer->queueTotalSize() + + size); + + return true; +} + +/** + * Streams spec, 6.2.4. ResetQueue ( container ) nothrow + */ +[[nodiscard]] bool js::ResetQueue( + JSContext* cx, Handle unwrappedContainer) { + // Step 1: Assert: container has [[queue]] and [[queueTotalSize]] internal + // slots (implicit). + // Step 2: Set container.[[queue]] to a new empty List. + if (!StoreNewListInFixedSlot(cx, unwrappedContainer, + StreamController::Slot_Queue)) { + return false; + } + + // Step 3: Set container.[[queueTotalSize]] to 0. + unwrappedContainer->setQueueTotalSize(0); + + return true; +} diff --git a/js/src/builtin/streams/QueueWithSizes.h b/js/src/builtin/streams/QueueWithSizes.h new file mode 100644 index 0000000000000..da4f490c76d67 --- /dev/null +++ b/js/src/builtin/streams/QueueWithSizes.h @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Queue-with-sizes operations. */ + +#ifndef builtin_streams_QueueWithSizes_h +#define builtin_streams_QueueWithSizes_h + +#include "mozilla/Assertions.h" // MOZ_ASSERT + +#include "jstypes.h" // JS_PUBLIC_API +#include "js/RootingAPI.h" // JS::{,Mutable}Handle +#include "js/Value.h" // JS::Value +#include "vm/List.h" // js::ListObject + +struct JS_PUBLIC_API JSContext; + +namespace js { + +class StreamController; + +/** + * Streams spec, 6.2.1. DequeueValue ( container ) nothrow + */ +[[nodiscard]] extern bool DequeueValue( + JSContext* cx, JS::Handle unwrappedContainer, + JS::MutableHandle chunk); + +/** + * Streams spec, 6.2.1. DequeueValue ( container ) nothrow + * when the dequeued value is ignored. + */ +extern void DequeueValue(StreamController* unwrappedContainer, JSContext* cx); + +/** + * Streams spec, 6.2.2. EnqueueValueWithSize ( container, value, size ) throws + */ +[[nodiscard]] extern bool EnqueueValueWithSize( + JSContext* cx, JS::Handle unwrappedContainer, + JS::Handle value, JS::Handle sizeVal); + +/** + * Streams spec, 6.2.4. ResetQueue ( container ) nothrow + */ +[[nodiscard]] extern bool ResetQueue( + JSContext* cx, JS::Handle unwrappedContainer); + +inline bool QueueIsEmpty(ListObject* unwrappedQueue) { + if (unwrappedQueue->isEmpty()) { + return true; + } + + MOZ_ASSERT((unwrappedQueue->length() % 2) == 0, + "queue-with-sizes must consist of (value, size) element pairs and " + "so must have even length"); + return false; +} + +} // namespace js + +#endif // builtin_streams_QueueWithSizes_h diff --git a/js/src/builtin/streams/QueueingStrategies.cpp b/js/src/builtin/streams/QueueingStrategies.cpp new file mode 100644 index 0000000000000..2b03d2fec7bc8 --- /dev/null +++ b/js/src/builtin/streams/QueueingStrategies.cpp @@ -0,0 +1,231 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Queuing strategies. */ + +#include "builtin/streams/QueueingStrategies.h" + +#include "builtin/streams/ClassSpecMacro.h" // JS_STREAMS_CLASS_SPEC +#include "js/CallArgs.h" // JS::CallArgs{,FromVp} +#include "js/Class.h" // JS::ObjectOpResult, JS_NULL_CLASS_OPS +#include "js/Conversions.h" // JS::ToNumber +#include "js/PropertySpec.h" // JS{Property,Function}Spec, JS_FN, JS_FS_END, JS_PS_END +#include "js/ProtoKey.h" // JSProto_{ByteLength,Count}QueuingStrategy +#include "js/RootingAPI.h" // JS::{Handle,Rooted} +#include "vm/Interpreter.h" // js::GetProperty +#include "vm/JSObject.h" // js::GetPrototypeFromBuiltinConstructor +#include "vm/ObjectOperations.h" // js::{Define,Get}Property +#include "vm/Runtime.h" // JSAtomState +#include "vm/StringType.h" // js::NameToId, PropertyName + +#include "vm/Compartment-inl.h" // js::UnwrapAndTypeCheckThis +#include "vm/JSObject-inl.h" // js::NewObjectWithClassProto +#include "vm/NativeObject-inl.h" // js::ThrowIfNotConstructing + +using js::ByteLengthQueuingStrategy; +using js::CountQueuingStrategy; +using js::PropertyName; +using js::UnwrapAndTypeCheckThis; + +using JS::CallArgs; +using JS::CallArgsFromVp; +using JS::Handle; +using JS::ObjectOpResult; +using JS::Rooted; +using JS::ToNumber; +using JS::ToObject; +using JS::Value; + +/*** 6.1. Queuing strategies ************************************************/ + +// Streams spec, 6.1.2.2. new ByteLengthQueuingStrategy({ highWaterMark }) +bool js::ByteLengthQueuingStrategy::constructor(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + if (!ThrowIfNotConstructing(cx, args, "ByteLengthQueuingStrategy")) { + return false; + } + + // Implicit in the spec: Create the new strategy object. + Rooted proto(cx); + if (!GetPrototypeFromBuiltinConstructor( + cx, args, JSProto_ByteLengthQueuingStrategy, &proto)) { + return false; + } + Rooted strategy( + cx, NewObjectWithClassProto(cx, proto)); + if (!strategy) { + return false; + } + + // Implicit in the spec: Argument destructuring. + RootedObject argObj(cx, ToObject(cx, args.get(0))); + if (!argObj) { + return false; + } + + // https://heycam.github.io/webidl/#es-dictionary + // 3.2.17. Dictionary types + // Step 4.1.2: Let esMemberValue be an ECMAScript value, + // depending on Type(esDict): ? Get(esDict, key) + RootedValue highWaterMarkV(cx); + if (!GetProperty(cx, argObj, argObj, cx->names().highWaterMark, + &highWaterMarkV)) { + return false; + } + // Step 4.1.5: Otherwise, if esMemberValue is undefined and + // member is required, then throw a TypeError. + if (highWaterMarkV.isUndefined()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_STREAM_MISSING_HIGHWATERMARK); + return false; + } + // Step 4.1.3: If esMemberValue is not undefined, then: + // Let idlMemberValue be the result of converting esMemberValue to + // an IDL value whose type is the type member is declared to be of. + double highWaterMark; + if (!ToNumber(cx, highWaterMarkV, &highWaterMark)) { + return false; + } + + // Step 1: Set this.[[highWaterMark]] to init["highWaterMark"]. + strategy->setHighWaterMark(highWaterMark); + + args.rval().setObject(*strategy); + return true; +} + +static bool ByteLengthQueuingStrategy_highWaterMark(JSContext* cx, + unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted unwrappedStrategy( + cx, UnwrapAndTypeCheckThis( + cx, args, "get highWaterMark")); + if (!unwrappedStrategy) { + return false; + } + + // Step 1: Return this.[[highWaterMark]]. + args.rval().setDouble(unwrappedStrategy->highWaterMark()); + return true; +} + +// Streams spec 6.1.2.3.1. size ( chunk ) +static bool ByteLengthQueuingStrategy_size(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: Return ? GetV(chunk, "byteLength"). + return GetProperty(cx, args.get(0), cx->names().byteLength, args.rval()); +} + +static const JSPropertySpec ByteLengthQueuingStrategy_properties[] = { + JS_PSG("highWaterMark", ByteLengthQueuingStrategy_highWaterMark, + JSPROP_ENUMERATE), + JS_STRING_SYM_PS(toStringTag, "ByteLengthQueuingStrategy", JSPROP_READONLY), + JS_PS_END}; + +static const JSFunctionSpec ByteLengthQueuingStrategy_methods[] = { + JS_FN("size", ByteLengthQueuingStrategy_size, 1, 0), JS_FS_END}; + +JS_STREAMS_CLASS_SPEC(ByteLengthQueuingStrategy, 1, SlotCount, 0, 0, + JS_NULL_CLASS_OPS); + +// Streams spec, 6.1.3.2. new CountQueuingStrategy({ highWaterMark }) +bool js::CountQueuingStrategy::constructor(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + if (!ThrowIfNotConstructing(cx, args, "CountQueuingStrategy")) { + return false; + } + + // Implicit in the spec: Create the new strategy object. + RootedObject proto(cx); + if (!GetPrototypeFromBuiltinConstructor( + cx, args, JSProto_CountQueuingStrategy, &proto)) { + return false; + } + Rooted strategy( + cx, NewObjectWithClassProto(cx, proto)); + if (!strategy) { + return false; + } + + // Implicit in the spec: Argument destructuring. + RootedObject argObj(cx, ToObject(cx, args.get(0))); + if (!argObj) { + return false; + } + // https://heycam.github.io/webidl/#es-dictionary + // 3.2.17. Dictionary types + // Step 4.1.2: Let esMemberValue be an ECMAScript value, + // depending on Type(esDict): ? Get(esDict, key) + RootedValue highWaterMarkV(cx); + if (!GetProperty(cx, argObj, argObj, cx->names().highWaterMark, + &highWaterMarkV)) { + return false; + } + // Step 4.1.5: Otherwise, if esMemberValue is undefined and + // member is required, then throw a TypeError. + if (highWaterMarkV.isUndefined()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_STREAM_MISSING_HIGHWATERMARK); + return false; + } + // Step 4.1.3: If esMemberValue is not undefined, then: + // Let idlMemberValue be the result of converting esMemberValue to + // an IDL value whose type is the type member is declared to be of. + double highWaterMark; + if (!ToNumber(cx, highWaterMarkV, &highWaterMark)) { + return false; + } + + // Step 1: Set this.[[highWaterMark]] to init["highWaterMark"]. + strategy->setHighWaterMark(highWaterMark); + + args.rval().setObject(*strategy); + return true; +} + +static bool CountQueuingStrategy_highWaterMark(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted unwrappedStrategy( + cx, UnwrapAndTypeCheckThis(cx, args, + "get highWaterMark")); + if (!unwrappedStrategy) { + return false; + } + + // Step 1: Return this.[[highWaterMark]]. + args.rval().setDouble(unwrappedStrategy->highWaterMark()); + return true; +} + +// Streams spec 6.1.3.3.1. size ( chunk ) +static bool CountQueuingStrategy_size(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: Return 1. + args.rval().setInt32(1); + return true; +} + +static const JSPropertySpec CountQueuingStrategy_properties[] = { + JS_PSG("highWaterMark", CountQueuingStrategy_highWaterMark, + JSPROP_ENUMERATE), + JS_STRING_SYM_PS(toStringTag, "CountQueuingStrategy", JSPROP_READONLY), + JS_PS_END}; + +static const JSFunctionSpec CountQueuingStrategy_methods[] = { + JS_FN("size", CountQueuingStrategy_size, 0, 0), JS_FS_END}; + +JS_STREAMS_CLASS_SPEC(CountQueuingStrategy, 1, SlotCount, 0, 0, + JS_NULL_CLASS_OPS); diff --git a/js/src/builtin/streams/QueueingStrategies.h b/js/src/builtin/streams/QueueingStrategies.h new file mode 100644 index 0000000000000..6da83e770b3f8 --- /dev/null +++ b/js/src/builtin/streams/QueueingStrategies.h @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Queuing strategies. */ + +#ifndef builtin_stream_QueueingStrategies_h +#define builtin_stream_QueueingStrategies_h + +#include "js/Class.h" // JSClass, js::ClassSpec +#include "js/Value.h" // JS::Value +#include "vm/JSContext.h" // JSContext +#include "vm/NativeObject.h" // js::NativeObject + +namespace js { + +class ByteLengthQueuingStrategy : public NativeObject { + public: + enum Slots { Slot_HighWaterMark, SlotCount }; + + double highWaterMark() const { + return getFixedSlot(Slot_HighWaterMark).toDouble(); + } + void setHighWaterMark(double value) { + setFixedSlot(Slot_HighWaterMark, JS::DoubleValue(value)); + } + + static bool constructor(JSContext* cx, unsigned argc, JS::Value* vp); + static const ClassSpec classSpec_; + static const JSClass class_; + static const ClassSpec protoClassSpec_; + static const JSClass protoClass_; +}; + +class CountQueuingStrategy : public NativeObject { + public: + enum Slots { Slot_HighWaterMark, SlotCount }; + + double highWaterMark() const { + return getFixedSlot(Slot_HighWaterMark).toDouble(); + } + void setHighWaterMark(double value) { + setFixedSlot(Slot_HighWaterMark, JS::DoubleValue(value)); + } + + static bool constructor(JSContext* cx, unsigned argc, JS::Value* vp); + static const ClassSpec classSpec_; + static const JSClass class_; + static const ClassSpec protoClassSpec_; + static const JSClass protoClass_; +}; + +} // namespace js + +#endif // builtin_stream_QueueingStrategies_h diff --git a/js/src/builtin/streams/ReadableByteStreamController.cpp b/js/src/builtin/streams/ReadableByteStreamController.cpp new file mode 100644 index 0000000000000..ee76c26448e7c --- /dev/null +++ b/js/src/builtin/streams/ReadableByteStreamController.cpp @@ -0,0 +1,821 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Class ReadableByteStreamController. */ + +#include "mozilla/Assertions.h" // MOZ_ASSERT{,_IF} + +#include "jsfriendapi.h" // js::AssertSameCompartment + +#include "builtin/streams/ClassSpecMacro.h" // JS_STREAMS_CLASS_SPEC +#include "builtin/streams/MiscellaneousOperations.h" // js::IsMaybeWrapped +#include "builtin/streams/PullIntoDescriptor.h" // js::PullIntoDescriptor +#include "builtin/streams/QueueWithSizes.h" // js::{DequeueValue,ResetQueue} +#include "builtin/streams/ReadableByteStreamControllerOperations.h" // js::ReadableStreamController{CallPullIfNeeded,ClearAlgorithms,Error,GetDesiredSizeUnchecked}, js::ReadableByteStreamController{Close,Enqueue} +#include "builtin/streams/ReadableStream.h" // js::ReadableStream, js::SetUpExternalReadableByteStreamController +#include "builtin/streams/ReadableStreamBYOBRequest.h" // js::ReadableStreamBYOBRequest +#include "builtin/streams/ReadableStreamController.h" // js::ReadableStream{,Default}Controller, js::ReadableByteStreamController, js::CheckReadableStreamControllerCanCloseOrEnqueue, js::ReadableStreamControllerCancelSteps, js::ReadableByteStreamControllerPullSteps, js::ReadableStreamControllerStart{,Failed}Handler +#include "builtin/streams/ReadableStreamInternals.h" // js::ReadableStream{AddReadOrReadIntoRequest,CloseInternal,CreateReadResult} +#include "builtin/streams/ReadableStreamOperations.h" // js::ReadableStreamTee_Cancel +#include "builtin/streams/ReadableStreamReader.h" // js::ReadableStream{,Default}Reader +#include "builtin/streams/StreamController.h" // js::StreamController +#include "builtin/streams/TeeState.h" // js::TeeState +#include "js/ArrayBuffer.h" // JS::NewArrayBuffer +#include "js/Class.h" // js::ClassSpec +#include "js/ErrorReport.h" // JS_ReportErrorNumberASCII +#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* +#include "js/PropertySpec.h" +#include "js/Stream.h" +#include "vm/Interpreter.h" +#include "vm/JSContext.h" +#include "vm/PlainObject.h" // js::PlainObject +#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined +#include "vm/SelfHosting.h" + +#include "builtin/HandlerFunction-inl.h" // js::TargetFromHandler +#include "builtin/streams/MiscellaneousOperations-inl.h" // js::PromiseCall +#include "builtin/streams/ReadableStreamReader-inl.h" // js::UnwrapReaderFromStream +#include "vm/Compartment-inl.h" // JS::Compartment::wrap, js::UnwrapAnd{DowncastObject,TypeCheckThis} +#include "vm/JSContext-inl.h" // JSContext::check +#include "vm/JSObject-inl.h" // js::NewBuiltinClassInstance +#include "vm/List-inl.h" // js::ListObject, js::StoreNewListInFixedSlot +#include "vm/Realm-inl.h" // js::AutoRealm + +using js::ClassSpec; +using js::PromiseObject; +using js::ReadableByteStreamController; +using js::ReadableByteStreamControllerEnqueue; +using js::ReadableStream; +using js::ReadableStreamController; +using js::ReadableStreamControllerCallPullIfNeeded; +using js::ReadableStreamControllerClearAlgorithms; +using js::ReadableStreamControllerError; +using js::ReadableStreamControllerGetDesiredSizeUnchecked; +using js::TargetFromHandler; +using js::UnwrapAndTypeCheckThis; + +using JS::CallArgs; +using JS::CallArgsFromVp; +using JS::Handle; +using JS::ObjectValue; +using JS::Rooted; +using JS::Value; + +using namespace js; + +/** + * Streams spec, 3.9.3. + * new ReadableByteStreamController( stream, underlyingSource, size, + * highWaterMark ) + */ +bool ReadableByteStreamController::constructor(JSContext* cx, unsigned argc, + Value* vp) { + // Step 1: Throw a TypeError. + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_BOGUS_CONSTRUCTOR, + "ReadableByteStreamController"); + return false; +} + +const JSClass ByteStreamChunk::class_ = {"ByteStreamChunk", + JSCLASS_HAS_RESERVED_SLOTS(SlotCount)}; + +ByteStreamChunk* ByteStreamChunk::create(JSContext* cx, HandleObject buffer, + uint32_t byteOffset, + uint32_t byteLength) { + MOZ_ASSERT(buffer); + Rooted chunk(cx, + NewBuiltinClassInstance(cx)); + if (!chunk) { + return nullptr; + } + + chunk->setFixedSlot(Slot_Buffer, ObjectValue(*buffer)); + chunk->setFixedSlot(Slot_ByteOffset, Int32Value(byteOffset)); + chunk->setFixedSlot(Slot_ByteLength, Int32Value(byteLength)); + return chunk; +} + +// Disconnect the source from a controller without calling finalize() on it, +// unless this class is reset(). This ensures that finalize() will not be called +// on the source if setting up the controller fails. +class MOZ_RAII AutoClearUnderlyingSource { + Rooted controller_; + + public: + AutoClearUnderlyingSource(JSContext* cx, ReadableStreamController* controller) + : controller_(cx, controller) {} + + ~AutoClearUnderlyingSource() { + if (controller_) { + ReadableStreamController::clearUnderlyingSource( + controller_, /* finalizeSource */ false); + } + } + + void reset() { controller_ = nullptr; } +}; + +/** + * Version of SetUpReadableByteStreamController that's specialized for handling + * external, embedding-provided, underlying sources. + */ +[[nodiscard]] bool js::SetUpExternalReadableByteStreamController( + JSContext* cx, Handle stream, + JS::ReadableStreamUnderlyingSource* source) { + // Done elsewhere in the standard: Create the controller object. + Rooted controller( + cx, NewBuiltinClassInstance(cx)); + if (!controller) { + return false; + } + + AutoClearUnderlyingSource autoClear(cx, controller); + + // Step 1: Assert: stream.[[readableStreamController]] is undefined. + MOZ_ASSERT(!stream->hasController()); + + // Step 2: If autoAllocateChunkSize is not undefined, [...] + // (It's treated as undefined.) + + // Step 3: Set controller.[[controlledReadableByteStream]] to stream. + controller->setStream(stream); + + // Step 4: Set controller.[[pullAgain]] and controller.[[pulling]] to false. + controller->setFlags(0); + MOZ_ASSERT(!controller->pullAgain()); + MOZ_ASSERT(!controller->pulling()); + + // Step 5: Perform + // ! ReadableByteStreamControllerClearPendingPullIntos(controller). + // Omitted. This step is apparently redundant; see + // . + + // Step 6: Perform ! ResetQueue(this). + controller->setQueueTotalSize(0); + + // Step 7: Set controller.[[closeRequested]] and controller.[[started]] to + // false (implicit). + MOZ_ASSERT(!controller->closeRequested()); + MOZ_ASSERT(!controller->started()); + + // Step 8: Set controller.[[strategyHWM]] to + // ? ValidateAndNormalizeHighWaterMark(highWaterMark). + controller->setStrategyHWM(0); + + // Step 9: Set controller.[[pullAlgorithm]] to pullAlgorithm. + // Step 10: Set controller.[[cancelAlgorithm]] to cancelAlgorithm. + // (These algorithms are given by source's virtual methods.) + controller->setExternalSource(source); + + // Step 11: Set controller.[[autoAllocateChunkSize]] to + // autoAllocateChunkSize (implicit). + MOZ_ASSERT(controller->autoAllocateChunkSize()); + + // Step 12: Set this.[[pendingPullIntos]] to a new empty List. + if (!StoreNewListInFixedSlot( + cx, controller, + ReadableByteStreamController::Slot_PendingPullIntos)) { + return false; + } + + // Step 13: Set stream.[[readableStreamController]] to controller. + stream->setController(controller); + + // Step 14: Let startResult be the result of performing startAlgorithm. + // (For external sources, this algorithm does nothing and returns undefined.) + // Step 15: Let startPromise be a promise resolved with startResult. + Rooted startPromise(cx, PromiseResolvedWithUndefined(cx)); + if (!startPromise) { + return false; + } + + // Step 16: Upon fulfillment of startPromise, [...] + // Step 17: Upon rejection of startPromise with reason r, [...] + RootedObject onStartFulfilled( + cx, NewHandler(cx, ReadableStreamControllerStartHandler, controller)); + if (!onStartFulfilled) { + return false; + } + RootedObject onStartRejected( + cx, + NewHandler(cx, ReadableStreamControllerStartFailedHandler, controller)); + if (!onStartRejected) { + return false; + } + if (!JS::AddPromiseReactions(cx, startPromise, onStartFulfilled, + onStartRejected)) { + return false; + } + + autoClear.reset(); + return true; +} + +static void ReadableByteStreamControllerFinalize(JS::GCContext* gcx, + JSObject* obj) { + ReadableByteStreamController& controller = + obj->as(); + + if (controller.getFixedSlot(ReadableStreamController::Slot_Flags) + .isUndefined()) { + return; + } + + if (!controller.hasExternalSource()) { + return; + } + + controller.externalSource()->finalize(); +} + +// Streams spec, 3.11.5.1. [[CancelSteps]] () +// Unified with 3.9.5.1 above. + +/** + * https://streams.spec.whatwg.org/#rbs-controller-private-pull + */ +[[nodiscard]] extern PromiseObject* js::ReadableByteStreamControllerPullSteps( + JSContext* cx, Handle unwrappedController) { + // Let stream be this.[[stream]]. + Rooted unwrappedStream(cx, unwrappedController->stream()); + + // Assert: ! ReadableStreamHasDefaultReader(stream) is true. + bool result; + if (!ReadableStreamHasDefaultReader(cx, unwrappedStream, &result)) { + return nullptr; + } + MOZ_ASSERT(result); + + RootedValue val(cx); + // If this.[[queueTotalSize]] > 0, + double queueTotalSize = unwrappedController->queueTotalSize(); + + if (queueTotalSize > 0) { + // Assert: ! ReadableStreamGetNumReadRequests(stream) is 0. + MOZ_ASSERT(ReadableStreamGetNumReadRequests(unwrappedStream) == 0); + + RootedObject view(cx); + + // Internal stream functions + if (unwrappedStream->mode() == JS::ReadableStreamMode::ExternalSource) { + JS::ReadableStreamUnderlyingSource* source = + unwrappedController->externalSource(); + + view = JS_NewUint8Array(cx, queueTotalSize); + if (!view) { + return nullptr; + } + + size_t bytesWritten; + { + AutoRealm ar(cx, unwrappedStream); + source->writeIntoReadRequestBuffer(cx, unwrappedStream, view, + queueTotalSize, &bytesWritten); + } + + queueTotalSize = queueTotalSize - bytesWritten; + } else { + // Assert: ! ReadableStreamGetNumReadRequests(stream) is 0. + MOZ_ASSERT(ReadableStreamGetNumReadRequests(unwrappedStream) == 0); + + // Perform ! ReadableByteStreamControllerFillReadRequestFromQueue(this, + // readRequest). + // (inlined here, per initial implementation) + // allows external path above to share end instructions + + // Step 3.b: Let entry be the first element of this.[[queue]]. + // Step 3.c: Remove entry from this.[[queue]], shifting all other + // elements downward (so that the second becomes the + // first, and so on). + Rooted unwrappedQueue(cx, unwrappedController->queue()); + Rooted unwrappedEntry( + cx, UnwrapAndDowncastObject( + cx, &unwrappedQueue->popFirstAs(cx))); + if (!unwrappedEntry) { + return nullptr; + } + + queueTotalSize = queueTotalSize - unwrappedEntry->byteLength(); + + // Step 3.f: Let view be ! Construct(%Uint8Array%, + // « entry.[[buffer]], + // entry.[[byteOffset]], + // entry.[[byteLength]] »). + // (reordered) + RootedObject buffer(cx, unwrappedEntry->buffer()); + if (!cx->compartment()->wrap(cx, &buffer)) { + return nullptr; + } + + uint32_t byteOffset = unwrappedEntry->byteOffset(); + view = JS_NewUint8ArrayWithBuffer(cx, buffer, byteOffset, + unwrappedEntry->byteLength()); + if (!view) { + return nullptr; + } + } + + // Step 3.d: Set this.[[queueTotalSize]] to + // this.[[queueTotalSize]] − entry.[[byteLength]]. + // (reordered) + unwrappedController->setQueueTotalSize(queueTotalSize); + + // Step 3.e: Perform ! ReadableByteStreamControllerHandleQueueDrain(this). + // (reordered) + if (!ReadableByteStreamControllerHandleQueueDrain(cx, + unwrappedController)) { + return nullptr; + } + + // Step 3.g: Return a promise resolved with + // ! ReadableStreamCreateReadResult(view, false, forAuthorCode). + val.setObject(*view); + ReadableStreamReader* unwrappedReader = + UnwrapReaderFromStream(cx, unwrappedStream); + if (!unwrappedReader) { + return nullptr; + } + Rooted readResult( + cx, ReadableStreamCreateReadResult(cx, val, false, + unwrappedReader->forAuthorCode())); + if (!readResult) { + return nullptr; + } + val.setObject(*readResult); + + return PromiseObject::unforgeableResolveWithNonPromise(cx, val); + } + + // Let autoAllocateChunkSize be this.[[autoAllocateChunkSize]]. + // If autoAllocateChunkSize is not undefined, + if (unwrappedController->autoAllocateChunkSize().isSome()) { + uint64_t autoAllocateChunkSize = + unwrappedController->autoAllocateChunkSize().value(); + + // Let buffer be Construct(%ArrayBuffer%, « autoAllocateChunkSize »). + JSObject* bufferObj = JS::NewArrayBuffer(cx, autoAllocateChunkSize); + + // If buffer is an abrupt completion, + if (!bufferObj) { + // Perform readRequest’s error steps, given buffer.[[Value]]. + // Return + return PromiseRejectedWithPendingError(cx); + } + + Rooted buffer(cx, &bufferObj->as()); + + // Let pullIntoDescriptor be a new pull-into descriptor with buffer + // buffer.[[Value]], buffer byte length autoAllocateChunkSize, byte offset + // 0, byte length autoAllocateChunkSize, bytes filled 0, element size 1, + // view constructor %Uint8Array%, and reader type "default". + RootedObject uint8Array(cx, + &cx->global()->getConstructor(JSProto_Uint8Array)); + RootedObject pullIntoDescriptor( + cx, PullIntoDescriptor::create(cx, buffer, 0, autoAllocateChunkSize, 0, + 1, uint8Array, ReaderType::Default)); + if (!pullIntoDescriptor) { + return PromiseRejectedWithPendingError(cx); + } + + // Append pullIntoDescriptor to this.[[pendingPullIntos]]. + if (!AppendToListInFixedSlot( + cx, unwrappedController, + ReadableByteStreamController::Slot_PendingPullIntos, + pullIntoDescriptor)) { + return nullptr; + } + } + + // Perform ! ReadableStreamAddReadRequest(stream, readRequest). + Rooted promise( + cx, ReadableStreamAddReadOrReadIntoRequest(cx, unwrappedStream)); + if (!promise) { + return nullptr; + } + + // Perform ! ReadableByteStreamControllerCallPullIfNeeded(this). + if (!ReadableStreamControllerCallPullIfNeeded(cx, unwrappedController)) { + return nullptr; + } + + return promise; +} + +/*** 3.13. Readable stream BYOB controller abstract operations **************/ + +// Streams spec, 3.13.1. IsReadableStreamBYOBRequest ( x ) +// Implemented via is() + +// Streams spec, 3.13.2. IsReadableByteStreamController ( x ) +// Implemented via is() + +// Streams spec, 3.13.3. +// ReadableByteStreamControllerCallPullIfNeeded ( controller ) +// Unified with 3.9.2 above. + +/** + * https://streams.spec.whatwg.org/#readable-byte-stream-controller-clear-pending-pull-intos + */ +[[nodiscard]] bool js::ReadableByteStreamControllerClearPendingPullIntos( + JSContext* cx, Handle unwrappedController) { + // Perform ! ReadableByteStreamControllerInvalidateBYOBRequest(controller). + if (!ReadableByteStreamControllerInvalidateBYOBRequest(cx, + unwrappedController)) { + return false; + } + + // Set controller.[[pendingPullIntos]] to a new empty list. + return StoreNewListInFixedSlot( + cx, unwrappedController, + ReadableByteStreamController::Slot_PendingPullIntos); +} + +/** + * Streams spec, 3.13.6. ReadableByteStreamControllerClose ( controller ) + */ +[[nodiscard]] bool js::ReadableByteStreamControllerClose( + JSContext* cx, Handle unwrappedController) { + // Step 1: Let stream be controller.[[controlledReadableByteStream]]. + Rooted unwrappedStream(cx, unwrappedController->stream()); + + // Step 2: Assert: controller.[[closeRequested]] is false. + MOZ_ASSERT(!unwrappedController->closeRequested()); + + // Step 3: Assert: stream.[[state]] is "readable". + MOZ_ASSERT(unwrappedStream->readable()); + + // Step 4: If controller.[[queueTotalSize]] > 0, + if (unwrappedController->queueTotalSize() > 0) { + // Step a: Set controller.[[closeRequested]] to true. + unwrappedController->setCloseRequested(); + + // Step b: Return. + return true; + } + + // Step 5: If controller.[[pendingPullIntos]] is not empty, + Rooted unwrappedPendingPullIntos( + cx, unwrappedController->pendingPullIntos()); + if (unwrappedPendingPullIntos->length() != 0) { + // Step a: Let firstPendingPullInto be the first element of + // controller.[[pendingPullIntos]]. + Rooted unwrappedFirstPendingPullInto( + cx, UnwrapAndDowncastObject( + cx, &unwrappedPendingPullIntos->get(0).toObject())); + if (!unwrappedFirstPendingPullInto) { + return false; + } + + // Step b: If firstPendingPullInto.[[bytesFilled]] > 0, + if (unwrappedFirstPendingPullInto->bytesFilled() > 0) { + // Step i: Let e be a new TypeError exception. + JS_ReportErrorNumberASCII( + cx, GetErrorMessage, nullptr, + JSMSG_READABLEBYTESTREAMCONTROLLER_CLOSE_PENDING_PULL); + RootedValue e(cx); + Rooted stack(cx); + if (!cx->isExceptionPending() || + !GetAndClearExceptionAndStack(cx, &e, &stack)) { + // Uncatchable error. Die immediately without erroring the + // stream. + return false; + } + + // Step ii: Perform ! ReadableByteStreamControllerError(controller, e). + if (!ReadableStreamControllerError(cx, unwrappedController, e)) { + return false; + } + + // Step iii: Throw e. + cx->setPendingException(e, stack); + return false; + } + } + + // Step 6: Perform ! ReadableByteStreamControllerClearAlgorithms(controller). + ReadableStreamControllerClearAlgorithms(unwrappedController); + + // Step 7: Perform ! ReadableStreamClose(stream). + return ReadableStreamCloseInternal(cx, unwrappedStream); +} + +// Streams spec, 3.13.11. ReadableByteStreamControllerError ( controller, e ) +// Unified with 3.10.7 above. + +// Streams spec 3.13.14. +// ReadableByteStreamControllerGetDesiredSize ( controller ) +// Unified with 3.10.8 above. + +/** + * Streams spec, 3.13.15. + * ReadableByteStreamControllerHandleQueueDrain ( controller ) + */ + +extern bool js::ReadableByteStreamControllerHandleQueueDrain( + JSContext* cx, Handle unwrappedController) { + // Step 1: Assert: controller.[[controlledReadableStream]].[[state]] + // is "readable". + Rooted unwrappedStream(cx, unwrappedController->stream()); + MOZ_ASSERT(unwrappedStream->readable()); + + // Step 2: If controller.[[queueTotalSize]] is 0 and + // controller.[[closeRequested]] is true, + if (unwrappedController->queueTotalSize() == 0 && + unwrappedController->closeRequested()) { + // Step a: Perform + // ! ReadableByteStreamControllerClearAlgorithms(controller). + ReadableStreamControllerClearAlgorithms(unwrappedController); + + // Step b: Perform + // ! ReadableStreamClose(controller.[[controlledReadableStream]]). + return ReadableStreamCloseInternal(cx, unwrappedStream); + } + + // Step 3: Otherwise, + // Step a: Perform ! ReadableByteStreamControllerCallPullIfNeeded(controller). + return ReadableStreamControllerCallPullIfNeeded(cx, unwrappedController); +} + +/** + * https://streams.spec.whatwg.org/#readable-byte-stream-controller-invalidate-byob-request + */ +[[nodiscard]] bool js::ReadableByteStreamControllerInvalidateBYOBRequest( + JSContext* cx, Handle unwrappedController) { + // If controller.[[byobRequest]] is null, return. + RootedValue unwrappedBYOBRequestVal(cx, unwrappedController->byobRequest()); + if (unwrappedBYOBRequestVal.isNullOrUndefined()) { + return true; + } + + Rooted unwrappedBYOBRequest( + cx, UnwrapAndDowncastValue(cx, unwrappedBYOBRequestVal)); + if (!unwrappedBYOBRequest) { + return false; + } + + // Set controller.[[byobRequest]].[[controller]] to undefined. + unwrappedBYOBRequest->clearController(); + + // Set controller.[[byobRequest]].[[view]] to null. + unwrappedBYOBRequest->clearView(); + + // Set controller.[[byobRequest]] to null. + unwrappedController->clearByobRequest(); + + return true; +} + +// Streams spec, 3.13.25. +// ReadableByteStreamControllerShouldCallPull ( controller ) +// Unified with 3.10.3 above. + +/** + * https://streams.spec.whatwg.org/#abstract-opdef-readablebytestreamcontrollergetbyobrequest + */ +[[nodiscard]] static bool ReadableByteStreamController_byobRequest( + JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + Rooted unwrappedController( + cx, UnwrapAndTypeCheckThis( + cx, args, "get byobRequest")); + if (!unwrappedController) { + return false; + } + + Rooted unwrappedPendingPullIntos( + cx, unwrappedController->pendingPullIntos()); + + // If controller.[[byobRequest]] is null and controller.[[pendingPullIntos]] + // is not empty + if (!unwrappedController->hasByobRequest() && + unwrappedPendingPullIntos->length() > 0) { + // Let firstDescriptor be controller.[[pendingPullIntos]][0]. + Rooted firstDescriptor( + cx, UnwrapAndDowncastObject( + cx, &unwrappedPendingPullIntos->get(0).toObject())); + + // Let view be ! Construct(%Uint8Array%, « firstDescriptor’s buffer, + // firstDescriptor’s byte offset + firstDescriptor’s bytes filled, + // firstDescriptor’s byte length − firstDescriptor’s bytes filled »). + RootedObject buffer(cx, firstDescriptor->buffer()); + if (!cx->compartment()->wrap(cx, &buffer)) { + return false; + } + + uint32_t byteOffset = + firstDescriptor->byteOffset() + firstDescriptor->bytesFilled(); + uint32_t byteLength = + firstDescriptor->byteLength() - firstDescriptor->bytesFilled(); + + RootedObject viewObj( + cx, JS_NewUint8ArrayWithBuffer(cx, buffer, byteOffset, byteLength)); + if (!viewObj) { + return false; + } + + // Let byobRequest be a new ReadableStreamBYOBRequest. + Rooted byobRequest( + cx, NewBuiltinClassInstance(cx)); + + if (!byobRequest) { + return false; + } + + // Set byobRequest.[[controller]] to controller. + byobRequest->setController(unwrappedController); + + // Set byobRequest.[[view]] to view. + RootedValue view(cx); + view.setObject(*viewObj); + byobRequest->setView(view); + + // Set controller.[[byobRequest]] to byobRequest. + unwrappedController->setByobRequest(byobRequest); + } + + args.rval().set(unwrappedController->byobRequest()); + return true; +} + +/** + * https://streams.spec.whatwg.org/#readable-byte-stream-controller-get-desired-size + */ +static bool ReadableByteStreamController_desiredSize(JSContext* cx, + unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + Rooted unwrappedController( + cx, UnwrapAndTypeCheckThis( + cx, args, "get desiredSize")); + if (!unwrappedController) { + return false; + } + + // Let state be controller.[[stream]].[[state]]. + ReadableStream* unwrappedStream = unwrappedController->stream(); + + // If state is "errored", return null. + if (unwrappedStream->errored()) { + args.rval().setNull(); + return true; + } + + // If state is "closed", return 0. + if (unwrappedStream->closed()) { + args.rval().setInt32(0); + return true; + } + + // Return controller.[[strategyHWM]] − controller.[[queueTotalSize]]. + args.rval().setNumber(unwrappedController->strategyHWM() - + unwrappedController->queueTotalSize()); + return true; +} + +/** + * Streams spec, 3.9.4.2 close() + */ +static bool ReadableByteStreamController_close(JSContext* cx, unsigned argc, + Value* vp) { + // Step 1: If ! IsReadableByteStreamController(this) is false, throw a + // TypeError exception. + CallArgs args = CallArgsFromVp(argc, vp); + Rooted unwrappedController( + cx, + UnwrapAndTypeCheckThis(cx, args, "close")); + if (!unwrappedController) { + return false; + } + + // Step 2: If ! ReadableByteStreamControllerCanCloseOrEnqueue(this) is + // false, throw a TypeError exception. + if (!js::CheckReadableStreamControllerCanCloseOrEnqueue( + cx, unwrappedController, "close")) { + return false; + } + + // Step 3: Perform ! ReadableByteStreamControllerClose(this). + if (!ReadableByteStreamControllerClose(cx, unwrappedController)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +/** + * https://streams.spec.whatwg.org/#rbs-controller-enqueue + */ +static bool ReadableByteStreamController_enqueue(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + Rooted unwrappedController( + cx, UnwrapAndTypeCheckThis(cx, args, + "enqueue")); + if (!unwrappedController) { + return false; + } + + if (!args.get(0).isObject()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLEBYTESTREAMCONTROLLER_NO_VIEW, + "enqueue"); + return false; + } + + Rooted chunkObj(cx, &args.get(0).toObject()); + + if (!JS_IsArrayBufferViewObject(chunkObj)) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLEBYTESTREAMCONTROLLER_NO_VIEW, + "enqueue"); + return false; + } + + // If chunk.[[ByteLength]] is 0, throw a TypeError exception. + if (JS_GetArrayBufferViewByteLength(chunkObj) == 0) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLEBYTESTREAMCONTROLLER_EMPTY_VIEW); + return false; + } + // If chunk.[[ViewedArrayBuffer]].[[ArrayBufferByteLength]] is 0, throw a + // TypeError exception. + bool isShared; + JS::Rooted buffer( + cx, JS_GetArrayBufferViewBuffer(cx, chunkObj, &isShared)); + if (!buffer || + buffer->maybeUnwrapAs()->byteLength() == 0) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLEBYTESTREAMCONTROLLER_EMPTY_VIEW); + return false; + } + + // If this.[[closeRequested]] is true, throw a TypeError exception. + // If this.[[stream]].[[state]] is not "readable", throw a TypeError + // exception. + if (!js::CheckReadableStreamControllerCanCloseOrEnqueue( + cx, unwrappedController, "enqueue")) { + return false; + } + + // Return ? ReadableByteStreamControllerEnqueue(this, chunk). + if (!ReadableByteStreamControllerEnqueue(cx, unwrappedController, chunkObj)) { + return false; + } + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 3.9.4.4. error ( e ) + */ +static bool ReadableByteStreamController_error(JSContext* cx, unsigned argc, + Value* vp) { + // Step 1: If ! IsReadableByteStreamController(this) is false, throw a + // TypeError exception. + CallArgs args = CallArgsFromVp(argc, vp); + Rooted unwrappedController( + cx, UnwrapAndTypeCheckThis(cx, args, + "enqueue")); + if (!unwrappedController) { + return false; + } + + // Step 2: Perform ! ReadableByteStreamControllerError(this, e). + if (!ReadableStreamControllerError(cx, unwrappedController, args.get(0))) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +static const JSPropertySpec ReadableByteStreamController_properties[] = { + JS_PSG("byobRequest", ReadableByteStreamController_byobRequest, 0), + JS_PSG("desiredSize", ReadableByteStreamController_desiredSize, 0), + JS_PS_END}; + +static const JSFunctionSpec ReadableByteStreamController_methods[] = { + JS_FN("close", ReadableByteStreamController_close, 0, 0), + JS_FN("enqueue", ReadableByteStreamController_enqueue, 1, 0), + JS_FN("error", ReadableByteStreamController_error, 1, 0), JS_FS_END}; + +static const JSClassOps ReadableByteStreamControllerClassOps = { + nullptr, // addProperty + nullptr, // delProperty + nullptr, // enumerate + nullptr, // newEnumerate + nullptr, // resolve + nullptr, // mayResolve + ReadableByteStreamControllerFinalize, // finalize + nullptr, // call + nullptr, // construct + nullptr, // trace +}; + +JS_STREAMS_CLASS_SPEC(ReadableByteStreamController, 0, SlotCount, 0, + JSCLASS_BACKGROUND_FINALIZE, + &ReadableByteStreamControllerClassOps); diff --git a/js/src/builtin/streams/ReadableByteStreamControllerOperations.cpp b/js/src/builtin/streams/ReadableByteStreamControllerOperations.cpp new file mode 100644 index 0000000000000..ffbc616044ea5 --- /dev/null +++ b/js/src/builtin/streams/ReadableByteStreamControllerOperations.cpp @@ -0,0 +1,1230 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Readable stream default controller abstract operations. */ + +#include "builtin/streams/ReadableByteStreamControllerOperations.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT{,_IF} + +#include "jsfriendapi.h" // js::AssertSameCompartment + +#include "builtin/streams/MiscellaneousOperations.h" // js::CanTransferArrayBuffer, js::CreateAlgorithmFromUnderlyingMethod, js::InvokeOrNoop, js::IsMaybeWrapped +#include "builtin/streams/PullIntoDescriptor.h" // js::PullIntoDescriptor +#include "builtin/streams/QueueWithSizes.h" // js::EnqueueValueWithSize, js::ResetQueue +#include "builtin/streams/ReadableStreamController.h" // js::ReadableStream{,Default}Controller, js::ReadableByteStreamController, js::ReadableStreamControllerStart{,Failed}Handler +#include "builtin/streams/ReadableStreamInternals.h" // js::ReadableStream{CloseInternal,ErrorInternal,FulfillReadOrReadIntoRequest,GetNumReadRequests} +#include "builtin/streams/ReadableStreamOperations.h" // js::ReadableStreamTee_Pull, js::SetUpReadableByteStreamController +#include "builtin/streams/TeeState.h" // js::TeeState +#include "js/CallAndConstruct.h" // JS::IsCallable +#include "js/CallArgs.h" // JS::CallArgs{,FromVp} +#include "js/Promise.h" // JS::AddPromiseReactions +#include "js/RootingAPI.h" // JS::Handle, JS::Rooted +#include "js/Stream.h" // JS::ReadableStreamUnderlyingSource +#include "js/Value.h" // JS::{,Int32,Object}Value, JS::UndefinedHandleValue +#include "vm/Compartment.h" // JS::Compartment +#include "vm/Interpreter.h" // js::Call, js::GetAndClearExceptionAndStack +#include "vm/JSContext.h" // JSContext +#include "vm/JSObject.h" // JSObject +#include "vm/List.h" // js::ListObject +#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined +#include "vm/Runtime.h" // JSAtomState +#include "vm/SavedFrame.h" // js::SavedFrame + +#include "builtin/HandlerFunction-inl.h" // js::NewHandler +#include "builtin/streams/MiscellaneousOperations-inl.h" // js::PromiseCall +#include "builtin/streams/ReadableStreamReader-inl.h" // js::UnwrapReaderFromStreamNoThrow +#include "vm/Compartment-inl.h" // JS::Compartment::wrap, js::UnwrapCalleeSlot +#include "vm/JSContext-inl.h" // JSContext::check +#include "vm/JSObject-inl.h" // js::IsCallable, js::NewBuiltinClassInstance +#include "vm/List-inl.h" // js::ListObject, js::StoreNewListInFixedSlot +#include "vm/Realm-inl.h" // js::AutoRealm + +using js::ByteStreamChunk; +using js::CanTransferArrayBuffer; +using js::PullIntoDescriptor; +using js::ReadableByteStreamController; +using js::ReadableByteStreamControllerInvalidateBYOBRequest; +using js::ReadableStream; +using js::ReadableStreamController; +using js::ReadableStreamControllerCallPullIfNeeded; +using js::ReadableStreamControllerError; +using js::ReadableStreamGetNumReadRequests; +using js::ReaderType; +using js::SavedFrame; +using js::UnwrapCalleeSlot; +using js::UnwrapReaderFromStreamNoThrow; + +using JS::CallArgs; +using JS::CallArgsFromVp; +using JS::Handle; +using JS::Rooted; +using JS::RootedValueArray; +using JS::UndefinedHandleValue; +using JS::Value; + +extern bool js::ReadableByteStreamControllerEnqueueClonedChunkToQueue( + JSContext* cx, JS::Handle controller, + JS::Handle buffer, uint32_t byteOffset, uint32_t byteLength) { + // Let cloneResult be CloneArrayBuffer(buffer, byteOffset, byteLength, + // %ArrayBuffer%). + JS::Rooted cloneResult( + cx, JS::ArrayBufferClone(cx, buffer, byteOffset, byteLength)); + + // If cloneResult is an abrupt completion, + if (!cloneResult) { + Rooted exn(cx); + Rooted stack(cx); + if (!cx->isExceptionPending() || + !GetAndClearExceptionAndStack(cx, &exn, &stack)) { + return false; + } + // Perform ! ReadableByteStreamControllerError(controller, + // cloneResult.[[Value]]). + if (!ReadableStreamControllerError(cx, controller, exn)) { + return false; + } + + return false; + } + + // Perform ! ReadableByteStreamControllerEnqueueChunkToQueue(controller, + // cloneResult.[[Value]], 0, byteLength). + if (!ReadableByteStreamControllerEnqueueChunkToQueue( + cx, controller, cloneResult, 0, byteLength)) { + return false; + } + return true; +} + +/** + * https://streams.spec.whatwg.org/#readable-byte-stream-controller-enqueue-chunk-to-queue + */ +extern bool js::ReadableByteStreamControllerEnqueueChunkToQueue( + JSContext* cx, JS::Handle controller, + JS::Handle buffer, uint32_t byteOffset, uint32_t byteLength) { + MOZ_ASSERT(controller); + MOZ_ASSERT(buffer); + // Append a new readable byte stream queue entry with buffer buffer, byte + // offset byteOffset, and byte length byteLength to controller.[[queue]]. + Rooted chunkVal(cx); + chunkVal.setObject( + *ByteStreamChunk::create(cx, buffer, byteOffset, byteLength)); + + if (!controller->queue()->append(cx, chunkVal)) { + return false; + } + + // Set controller.[[queueTotalSize]] to controller.[[queueTotalSize]] + + // byteLength. + controller->setQueueTotalSize(controller->queueTotalSize() + byteLength); + return true; +} + +extern bool js::ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue( + JSContext* cx, JS::Handle controller, + JS::Handle pullIntoDescriptor) { + // Assert: pullIntoDescriptor’s reader type is "none". + MOZ_ASSERT(pullIntoDescriptor->readerType() == ReaderType::None); + + // If pullIntoDescriptor’s bytes filled > 0, perform ? + // ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, + // pullIntoDescriptor’s buffer, pullIntoDescriptor’s byte offset, + // pullIntoDescriptor’s bytes filled). + Rooted bufferObj(cx, pullIntoDescriptor->buffer()); + if (pullIntoDescriptor->bytesFilled() > 0) { + if (!ReadableByteStreamControllerEnqueueClonedChunkToQueue( + cx, controller, bufferObj, pullIntoDescriptor->byteOffset(), + pullIntoDescriptor->bytesFilled())) { + return false; + } + } + + // Perform ! ReadableByteStreamControllerShiftPendingPullInto(controller). + ReadableByteStreamControllerShiftPendingPullInto(cx, controller); + return true; +} + +/* + * https://streams.spec.whatwg.org/#readable-byte-stream-controller-respond-in-readable-state + */ +extern bool js::ReadableByteStreamControllerRespondInReadableState( + JSContext* cx, JS::Handle controller, + uint64_t bytesWritten, JS::Handle pullIntoDescriptor) { + // Assert: pullIntoDescriptor’s bytes filled + bytesWritten ≤ + // pullIntoDescriptor’s byte length. + MOZ_ASSERT(pullIntoDescriptor->bytesFilled() + bytesWritten <= + pullIntoDescriptor->byteLength()); + + // Perform ! + // ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, + // bytesWritten, pullIntoDescriptor). Assert: either + // controller.[[pendingPullIntos]] is empty, or + // controller.[[pendingPullIntos]][0] is pullIntoDescriptor. + MOZ_ASSERT(controller->pendingPullIntos()->length() == 0 || + &controller->pendingPullIntos()->get(0).toObject() == + &pullIntoDescriptor.get()->as()); + + // Assert: controller.[[byobRequest]] is null. + MOZ_ASSERT(!controller->hasByobRequest()); + + // Set pullIntoDescriptor’s bytes filled to bytes filled + size. + pullIntoDescriptor->setBytesFilled(pullIntoDescriptor->bytesFilled() + + bytesWritten); + + // If pullIntoDescriptor’s reader type is "none", + if (pullIntoDescriptor->readerType() == ReaderType::None) { + // Perform ? + // ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, + // pullIntoDescriptor). + if (!ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue( + cx, controller, pullIntoDescriptor)) { + return false; + } + + // Perform ! + // ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller). + if (!ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue( + cx, controller)) { + return false; + } + + // Return. + return true; + } + + // If pullIntoDescriptor’s bytes filled < pullIntoDescriptor’s element size, + // return. + if (pullIntoDescriptor->bytesFilled() < pullIntoDescriptor->elementSize()) { + return true; + } + + // Perform ! ReadableByteStreamControllerShiftPendingPullInto(controller). + MOZ_ASSERT(!controller->hasByobRequest()); + Rooted firstDescriptor( + cx, UnwrapAndDowncastObject( + cx, &controller->pendingPullIntos()->popFirst(cx).toObject())); + + // Let remainderSize be pullIntoDescriptor’s bytes filled mod + // pullIntoDescriptor’s element size. + uint32_t remainderSize = + pullIntoDescriptor->bytesFilled() % pullIntoDescriptor->elementSize(); + + // If remainderSize > 0, + if (remainderSize > 0) { + // Let end be pullIntoDescriptor’s byte offset + pullIntoDescriptor’s bytes + // filled. + uint32_t end = + pullIntoDescriptor->byteOffset() + pullIntoDescriptor->bytesFilled(); + + // Perform ? + // ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, + // pullIntoDescriptor’s buffer, end − remainderSize, remainderSize). + Rooted bufferObj(cx, pullIntoDescriptor->buffer()); + if (!ReadableByteStreamControllerEnqueueClonedChunkToQueue( + cx, controller, bufferObj, end - remainderSize, remainderSize)) { + return false; + } + } + + // Set pullIntoDescriptor’s bytes filled to pullIntoDescriptor’s bytes filled + // − remainderSize. + pullIntoDescriptor->setBytesFilled(pullIntoDescriptor->bytesFilled() - + remainderSize); + + // Perform ! + // ReadableByteStreamControllerCommitPullIntoDescriptor(controller.[[stream]], + // pullIntoDescriptor). + Rooted stream(cx, controller->stream()); + if (!ReadableByteStreamControllerCommitPullIntoDescriptor( + cx, stream, pullIntoDescriptor)) { + return false; + } + + // Perform ! + // ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller). + if (!ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue( + cx, controller)) { + return false; + } + + return true; +} + +/** + * https://streams.spec.whatwg.org/#readable-byte-stream-controller-process-pull-into-descriptors-using-queue + */ +extern bool +js::ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue( + JSContext* cx, + JS::Handle unwrappedController) { + // Assert: controller.[[closeRequested]] is false. + MOZ_ASSERT(unwrappedController->closeRequested() == false); + + Rooted unwrappedPendingPullIntos( + cx, unwrappedController->pendingPullIntos()); + + // While controller.[[pendingPullIntos]] is not empty, + while (unwrappedPendingPullIntos->length() > 0) { + // If controller.[[queueTotalSize]] is 0, return. + if (unwrappedController->queueTotalSize() == 0) return true; + + // Let pullIntoDescriptor be controller.[[pendingPullIntos]][0]. + Rooted pullIntoDescriptor( + cx, UnwrapAndDowncastObject( + cx, &unwrappedPendingPullIntos->get(0).toObject())); + + // If ! + // ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, + // pullIntoDescriptor) is true, + bool ready; + if (!ReadableByteStreamControllerFillPullIntoDescriptorFromQueue( + cx, unwrappedController, pullIntoDescriptor, &ready)) { + return false; + } + if (ready) { + // Perform ! ReadableByteStreamControllerShiftPendingPullInto(controller). + ReadableByteStreamControllerShiftPendingPullInto(cx, unwrappedController); + + // Perform ! + // ReadableByteStreamControllerCommitPullIntoDescriptor(controller.[[stream]], + // pullIntoDescriptor). + Rooted stream(cx, unwrappedController->stream()); + if (!ReadableByteStreamControllerCommitPullIntoDescriptor( + cx, stream, pullIntoDescriptor)) { + return false; + } + } + } + return true; +} + +/** + * https://streams.spec.whatwg.org/#readable-byte-stream-controller-fill-pull-into-descriptor-from-queue + */ +extern bool js::ReadableByteStreamControllerFillPullIntoDescriptorFromQueue( + JSContext* cx, + JS::Handle unwrappedController, + JS::Handle pullIntoDescriptor, bool* ready) { + // Let elementSize be pullIntoDescriptor.[[elementSize]]. + uint32_t elementSize = pullIntoDescriptor->elementSize(); + + // Let currentAlignedBytes be pullIntoDescriptor’s bytes filled − + // (pullIntoDescriptor’s bytes filled mod elementSize). + uint32_t currentAlignedBytes = + pullIntoDescriptor->bytesFilled() - + (pullIntoDescriptor->bytesFilled() % elementSize); + + // Let maxBytesToCopy be min(controller.[[queueTotalSize]], + // pullIntoDescriptor’s byte length − pullIntoDescriptor’s bytes filled). + uint32_t maxBytesToCopy = + pullIntoDescriptor->byteLength() - pullIntoDescriptor->bytesFilled(); + if (unwrappedController->queueTotalSize() < maxBytesToCopy) { + maxBytesToCopy = unwrappedController->queueTotalSize(); + } + + // Let maxBytesFilled be pullIntoDescriptor’s bytes filled + maxBytesToCopy. + uint32_t maxBytesFilled = pullIntoDescriptor->bytesFilled() + maxBytesToCopy; + + // Let maxAlignedBytes be maxBytesFilled − (maxBytesFilled mod elementSize). + uint32_t maxAlignedBytes = maxBytesFilled - (maxBytesFilled % elementSize); + + // Let totalBytesToCopyRemaining be maxBytesToCopy. + uint32_t totalBytesToCopyRemaining = maxBytesToCopy; + + // Let ready be false. + *ready = false; + + // If maxAlignedBytes > currentAlignedBytes, + if (maxAlignedBytes > currentAlignedBytes) { + // Set totalBytesToCopyRemaining to maxAlignedBytes − pullIntoDescriptor’s + // bytes filled. + totalBytesToCopyRemaining = + maxAlignedBytes - pullIntoDescriptor->bytesFilled(); + + // Set ready to true. + *ready = true; + } + + // Let queue be controller.[[queue]]. + ListObject* queue = unwrappedController->queue(); + + // While totalBytesToCopyRemaining > 0, + while (totalBytesToCopyRemaining > 0) { + // Let headOfQueue be queue[0]. + Rooted headOfQueue( + cx, UnwrapAndDowncastObject( + cx, &queue->get(0).toObject())); + + // Let bytesToCopy be min(totalBytesToCopyRemaining, headOfQueue’s byte + // length). + uint32_t bytesToCopy = totalBytesToCopyRemaining < headOfQueue->byteLength() + ? totalBytesToCopyRemaining + : headOfQueue->byteLength(); + + // Let destStart be pullIntoDescriptor’s byte offset + pullIntoDescriptor’s + // bytes filled. + uint32_t destStart = + pullIntoDescriptor->byteOffset() + pullIntoDescriptor->bytesFilled(); + + // Perform ! CopyDataBlockBytes(pullIntoDescriptor’s + // buffer.[[ArrayBufferData]], destStart, headOfQueue’s + // buffer.[[ArrayBufferData]], headOfQueue’s byte offset, bytesToCopy). + // CopyDataBlockBytes(pullIntoDescriptor->buffer(), destStart, + // headOfQueue->buffer(), headOfQueue->byteOffset(), bytesToCopy); + JS::Rooted descriptorBuffer(cx, pullIntoDescriptor->buffer()); + JS::Rooted queueBuffer(cx, headOfQueue->buffer()); + if (!JS::ArrayBufferCopyData(cx, descriptorBuffer, destStart, queueBuffer, + headOfQueue->byteOffset(), bytesToCopy)) { + return false; + } + + // If headOfQueue’s byte length is bytesToCopy, + if (headOfQueue->byteLength() == bytesToCopy) { + // Remove queue[0]. + queue->popFirst(cx); + } else { + // Otherwise, + + // Set headOfQueue’s byte offset to headOfQueue’s byte offset + + // bytesToCopy. + headOfQueue->setByteOffset(headOfQueue->byteOffset() + bytesToCopy); + + // Set headOfQueue’s byte length to headOfQueue’s byte length − + // bytesToCopy. + headOfQueue->setByteLength(headOfQueue->byteLength() - bytesToCopy); + } + + // Set controller.[[queueTotalSize]] to controller.[[queueTotalSize]] − + // bytesToCopy. + unwrappedController->setQueueTotalSize( + unwrappedController->queueTotalSize() - bytesToCopy); + + // Perform ! + // ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, + // bytesToCopy, pullIntoDescriptor). + ReadableByteStreamControllerFillHeadPullIntoDescriptor( + cx, unwrappedController, bytesToCopy, pullIntoDescriptor); + + // Set totalBytesToCopyRemaining to totalBytesToCopyRemaining − bytesToCopy. + totalBytesToCopyRemaining -= bytesToCopy; + } + + // If ready is false, + if (*ready == false) { + // Assert: controller.[[queueTotalSize]] is 0. + MOZ_ASSERT(unwrappedController->queueTotalSize() == 0); + + // Assert: pullIntoDescriptor’s bytes filled > 0. + MOZ_ASSERT(pullIntoDescriptor->bytesFilled() > 0); + + // Assert: pullIntoDescriptor’s bytes filled < pullIntoDescriptor’s element + // size. + MOZ_ASSERT(pullIntoDescriptor->bytesFilled() < + pullIntoDescriptor->elementSize()); + } + + // Return ready. + return true; +} + +/** + * https://streams.spec.whatwg.org/#readable-byte-stream-controller-fill-head-pull-into-descriptor + */ +extern void js::ReadableByteStreamControllerFillHeadPullIntoDescriptor( + JSContext* cx, + JS::Handle unwrappedController, + uint32_t size, JS::Handle pullIntoDescriptor) { + // Assert: either controller.[[pendingPullIntos]] is empty, or + // controller.[[pendingPullIntos]][0] is pullIntoDescriptor. + MOZ_ASSERT(unwrappedController->pendingPullIntos()->length() == 0 || + &unwrappedController->pendingPullIntos()->get(0).toObject() == + &pullIntoDescriptor.get()->as()); + + // Assert: controller.[[byobRequest]] is null. + MOZ_ASSERT(!unwrappedController->hasByobRequest()); + + // Set pullIntoDescriptor’s bytes filled to bytes filled + size. + pullIntoDescriptor->setBytesFilled(pullIntoDescriptor->bytesFilled() + size); +} + +/** + * https://streams.spec.whatwg.org/#readable-byte-stream-controller-shift-pending-pull-into + */ +extern PullIntoDescriptor* js::ReadableByteStreamControllerShiftPendingPullInto( + JSContext* cx, + JS::Handle unwrappedController) { + // Assert: controller.[[byobRequest]] is null. + MOZ_ASSERT(!unwrappedController->hasByobRequest()); + + // Let descriptor be controller.[[pendingPullIntos]][0]. + // Remove descriptor from controller.[[pendingPullIntos]]. + // Return descriptor. + Rooted unwrappedPendingPullIntos( + cx, unwrappedController->pendingPullIntos()); + + return UnwrapAndDowncastObject( + cx, &unwrappedPendingPullIntos->popFirst(cx).toObject()); +} + +/** + * https://streams.spec.whatwg.org/#readable-byte-stream-controller-commit-pull-into-descriptor + */ +extern bool js::ReadableByteStreamControllerCommitPullIntoDescriptor( + JSContext* cx, JS::Handle stream, + JS::Handle pullIntoDescriptor) { + // Assert: stream.[[state]] is not "errored". + MOZ_ASSERT(!stream->errored()); + + // Assert: pullIntoDescriptor.reader type is not "none". + ReaderType readerType = pullIntoDescriptor->readerType(); + MOZ_ASSERT(readerType != ReaderType::None); + + // Let done be false. + bool done = false; + + // If stream.[[state]] is "closed", + if (stream->closed()) { + // Assert: pullIntoDescriptor’s bytes filled is 0. + MOZ_ASSERT(pullIntoDescriptor->bytesFilled() == 0); + + // Set done to true. + done = true; + } + + // Let filledView be ! + // ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor). + Rooted filledView( + cx, ReadableByteStreamControllerConvertPullIntoDescriptor( + cx, pullIntoDescriptor)); + if (!filledView) { + return false; + } + + Rooted filledViewVal(cx); + filledViewVal.setObject(*filledView.get()); + + // If pullIntoDescriptor’s reader type is "default", + if (readerType == ReaderType::Default) { + // Perform ! ReadableStreamFulfillReadRequest(stream, filledView, done). + if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, stream, filledViewVal, + done)) { + return false; + } + } else { + // Otherwise, + // Assert: pullIntoDescriptor’s reader type is "byob". + MOZ_ASSERT(readerType == ReaderType::BYOB); + // Perform ! ReadableStreamFulfillReadIntoRequest(stream, filledView, done). + if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, stream, filledViewVal, + done)) { + return false; + } + } + return true; +} + +/** + * https://streams.spec.whatwg.org/#readable-byte-stream-controller-respond-with-new-view + */ +extern bool js::ReadableByteStreamControllerRespondWithNewView( + JSContext* cx, Handle unwrappedController, + JS::Handle view) { + // Assert: controller.[[pendingPullIntos]] is not empty. + MOZ_ASSERT(unwrappedController->pendingPullIntos()->length() > 0); + + // Assert: ! IsDetachedBuffer(view.[[ViewedArrayBuffer]]) is false. + + // Let firstDescriptor be controller.[[pendingPullIntos]][0]. + Rooted firstDescriptor( + cx, UnwrapAndDowncastObject( + cx, &unwrappedController->pendingPullIntos()->get(0).toObject())); + + // Let state be controller.[[stream]].[[state]]. + // If state is "closed", + if (unwrappedController->stream()->closed()) { + // If view.[[ByteLength]] is not 0, throw a TypeError exception. + if (JS_GetArrayBufferViewByteLength(view) != 0) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_CLOSED); + return false; + } + } else { + // Otherwise, + + // Assert: state is "readable". + MOZ_ASSERT(unwrappedController->stream()->readable()); + + // If view.[[ByteLength]] is 0, throw a TypeError exception. + if (JS_GetArrayBufferViewByteLength(view) == 0) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_ZERO); + return false; + } + } + + // Let viewByteLength be view.[[ByteLength]]. + uint32_t viewByteLength = JS_GetArrayBufferViewByteLength(view); + + // If firstDescriptor’s byte offset + firstDescriptor’ bytes filled is not + // view.[[ByteOffset]], throw a RangeError exception. + if (firstDescriptor->byteOffset() + firstDescriptor->bytesFilled() != + JS_GetArrayBufferViewByteOffset(view)) { + JS_ReportErrorNumberASCII( + cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_BAD_OFFSET); + return false; + } + + bool isShared; + Rooted viewedArrayBuffer( + cx, JS_GetArrayBufferViewBuffer(cx, view, &isShared)); + + uint8_t* data; + bool is_shared; + size_t len = 0; + + JS::GetArrayBufferLengthAndData(viewedArrayBuffer, &len, &is_shared, &data); + + // If firstDescriptor’s buffer byte length is not + // view.[[ViewedArrayBuffer]].[[ByteLength]], throw a RangeError exception. + if (JS_IsArrayBufferViewObject(firstDescriptor->buffer())) { + if (JS_GetArrayBufferViewByteLength(firstDescriptor->buffer()) != len) { + JS_ReportErrorNumberASCII( + cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_BAD_LEN); + return false; + } + } else { + size_t len2 = 0; + JS::GetArrayBufferLengthAndData(firstDescriptor->buffer(), &len2, + &is_shared, &data); + if (len2 != 0 && len2 != len) { + JS_ReportErrorNumberASCII( + cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_BAD_LEN); + return false; + } + } + + // If firstDescriptor’s bytes filled + view.[[ByteLength]] > firstDescriptor’s + // byte length, throw a RangeError exception. + if (firstDescriptor->bytesFilled() + viewByteLength > + firstDescriptor->byteLength()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_BAD_LEN); + return false; + } + + // Set firstDescriptor’s buffer to ? + // TransferArrayBuffer(view.[[ViewedArrayBuffer]]). + firstDescriptor->setBuffer(TransferArrayBuffer(cx, viewedArrayBuffer)); + + // Perform ? ReadableByteStreamControllerRespondInternal(controller, + // viewByteLength). + return ReadableByteStreamControllerRespondInternal(cx, unwrappedController, + viewByteLength); +} + +/** + * https://streams.spec.whatwg.org/#readable-byte-stream-controller-convert-pull-into-descriptor + */ +extern JSObject* js::ReadableByteStreamControllerConvertPullIntoDescriptor( + JSContext* cx, JS::Handle pullIntoDescriptor) { + // Let bytesFilled be pullIntoDescriptor’s bytes filled. + uint32_t bytesFilled = pullIntoDescriptor->bytesFilled(); + + // Let elementSize be pullIntoDescriptor’s element size. + uint32_t elementSize = pullIntoDescriptor->elementSize(); + + // Assert: bytesFilled ≤ pullIntoDescriptor’s byte length. + MOZ_ASSERT(bytesFilled <= pullIntoDescriptor->byteLength()); + + // Assert: bytesFilled mod elementSize is 0. + MOZ_ASSERT(bytesFilled % elementSize == 0); + + JS::Rooted buffer(cx, pullIntoDescriptor->buffer()); + + // Let buffer be ! TransferArrayBuffer(pullIntoDescriptor’s buffer). + JS::Rooted transferredBuffer(cx, TransferArrayBuffer(cx, buffer)); + + // Return ! Construct(pullIntoDescriptor’s view constructor, « buffer, + // pullIntoDescriptor’s byte offset, bytesFilled ÷ elementSize »). + JS::RootedValueArray<3> args(cx); + args[0].setObject(*transferredBuffer); + args[1].setInt32(pullIntoDescriptor->byteOffset()); + args[2].setDouble(bytesFilled == 0 ? 0 : bytesFilled / elementSize); + + Rooted ctor(cx, pullIntoDescriptor->ctor()); + + Rooted str(cx, JS::ToString(cx, ctor)); + JS::UniqueChars specChars = JS_EncodeStringToUTF8(cx, str); + + JS::Rooted obj(cx); + + if (!JS::Construct(cx, ctor, args, &obj)) { + return nullptr; + } + if (!obj) { + return nullptr; + } + return obj; +} + +/** + * https://streams.spec.whatwg.org/#readable-byte-stream-controller-should-call-pull + */ +[[nodiscard]] bool ReadableByteStreamControllerShouldCallPull( + JSContext* cx, ReadableByteStreamController* unwrappedController) { + // Let stream be controller.[[stream]]. + Rooted unwrappedStream(cx, unwrappedController->stream()); + + // If stream.[[state]] is not "readable", return false. + if (!unwrappedStream->readable()) { + return false; + } + + // If controller.[[closeRequested]] is true, return false. + if (unwrappedController->closeRequested()) { + return false; + } + + // If controller.[[started]] is false, return false. + if (!unwrappedController->started()) { + return false; + } + + // If ! ReadableStreamHasDefaultReader(stream) is true and ! + // ReadableStreamGetNumReadRequests(stream) > 0, return true. + bool hasDefaultReader; + if (!ReadableStreamHasDefaultReader(cx, unwrappedStream, &hasDefaultReader)) { + abort(); + } + if (hasDefaultReader && + ReadableStreamGetNumReadRequests(unwrappedStream) > 0) { + return true; + } + + // If ! ReadableStreamHasBYOBReader(stream) is true and ! + // ReadableStreamGetNumReadIntoRequests(stream) > 0, return true. + bool hasBYOBReader; + if (!ReadableStreamHasBYOBReader(cx, unwrappedStream, &hasBYOBReader)) { + abort(); + } + if (hasBYOBReader && ReadableStreamGetNumReadRequests(unwrappedStream) > 0) { + return true; + } + + // Let desiredSize be ! + // ReadableByteStreamControllerGetDesiredSize(controller). + double desiredSize = + ReadableStreamControllerGetDesiredSizeUnchecked(unwrappedController); + + // Assert: desiredSize is not null. (implicit). + // If desiredSize > 0, return true. + // Return false. + return desiredSize > 0; +} + +/** + * https://streams.spec.whatwg.org/#readable-byte-stream-controller-respond-in-closed-state + */ +extern bool js::ReadableByteStreamControllerRespondInClosedState( + JSContext* cx, JS::Handle controller, + Handle firstDescriptor) { + // Step 1. Assert: firstDescriptor ’s bytes filled is 0. + MOZ_ASSERT(firstDescriptor->bytesFilled() == 0); + + // Step 2. If firstDescriptor’s reader type is "none", + // perform ! ReadableByteStreamControllerShiftPendingPullInto(controller). + if (firstDescriptor->readerType() == ReaderType::None) { + ReadableByteStreamControllerShiftPendingPullInto(cx, controller); + } + + // Step 3. Let stream be controller.[[stream]]. + Rooted stream(cx, controller->stream()); + + // Step 4. If ! ReadableStreamHasBYOBReader(stream) is true, + bool result; + if (!ReadableStreamHasBYOBReader(cx, stream, &result)) { + return false; + } + if (result) { + // Step 4.1. While ! ReadableStreamGetNumReadIntoRequests(stream) > 0, + while (ReadableStreamGetNumReadRequests(stream) > 0) { + // Step 4.1.1. Let pullIntoDescriptor be ! + // ReadableByteStreamControllerShiftPendingPullInto(controller). + Rooted pullIntoDescriptor( + cx, ReadableByteStreamControllerShiftPendingPullInto(cx, controller)); + + // Step 4.1.2. Perform ! + // ReadableByteStreamControllerCommitPullIntoDescriptor(stream, + // pullIntoDescriptor). + if (!ReadableByteStreamControllerCommitPullIntoDescriptor( + cx, stream, pullIntoDescriptor)) { + return false; + } + } + } + return true; +} + +/* + * https://streams.spec.whatwg.org/#readable-byte-stream-controller-respond-internal + */ +[[nodiscard]] bool js::ReadableByteStreamControllerRespondInternal( + JSContext* cx, Handle controller, + uint64_t bytesWritten) { + // Let firstDescriptor be controller.[[pendingPullIntos]][0]. + Rooted unwrappedPendingPullIntos(cx, + controller->pendingPullIntos()); + Rooted firstDescriptor( + cx, UnwrapAndDowncastObject( + cx, &unwrappedPendingPullIntos->get(0).toObject())); + + // Assert: ! CanTransferArrayBuffer(firstDescriptor’s buffer) is true. + RootedObject bufferObj(cx, firstDescriptor->buffer()); + MOZ_ASSERT(CanTransferArrayBuffer(cx, bufferObj)); + + // Perform ! ReadableByteStreamControllerInvalidateBYOBRequest(controller). + if (!ReadableByteStreamControllerInvalidateBYOBRequest(cx, controller)) { + return false; + } + + // Let state be controller.[[stream]].[[state]]. + // If state is "closed", + if (controller->stream()->closed()) { + // Assert: bytesWritten is 0. + MOZ_ASSERT(bytesWritten == 0); + + // Perform ! ReadableByteStreamControllerRespondInClosedState(controller, + // firstDescriptor). + if (!ReadableByteStreamControllerRespondInClosedState(cx, controller, + firstDescriptor)) { + return false; + } + // Otherwise, + } else { + // Assert: state is "readable". + MOZ_ASSERT(controller->stream()->readable()); + + // Assert: bytesWritten > 0. + MOZ_ASSERT(bytesWritten > 0); + + // Perform ? ReadableByteStreamControllerRespondInReadableState(controller, + // bytesWritten, firstDescriptor). + if (!ReadableByteStreamControllerRespondInReadableState( + cx, controller, bytesWritten, firstDescriptor)) { + return false; + } + } + + // Perform ! ReadableByteStreamControllerCallPullIfNeeded(controller). + if (!ReadableStreamControllerCallPullIfNeeded(cx, controller)) { + return false; + } + + return true; +} + +/** + * https://streams.spec.whatwg.org/#readable-byte-stream-controller-enqueue + */ +[[nodiscard]] bool js::ReadableByteStreamControllerEnqueue( + JSContext* cx, Handle unwrappedController, + Handle chunkObj) { + // Let stream be controller.[[stream]]. + Rooted unwrappedStream(cx, unwrappedController->stream()); + + // If controller.[[closeRequested]] is true or stream.[[state]] is not + // "readable", return. + if (unwrappedController->closeRequested() || !unwrappedStream->readable()) { + return true; + } + + // Let buffer be chunk.[[ViewedArrayBuffer]]. + bool isShared; + JS::Rooted buffer( + cx, JS_GetArrayBufferViewBuffer(cx, chunkObj, &isShared)); + + // Let byteOffset be view.[[ByteOffset]]. + size_t byteOffset = JS_GetArrayBufferViewByteOffset(chunkObj); + + // Let byteLength be view.[[ByteLength]]. + size_t byteLength = JS_GetArrayBufferViewByteLength(chunkObj); + + // If ! IsDetachedBuffer(this.[[view]].[[ArrayBuffer]]) is true, throw a + // TypeError exception. + if (buffer->maybeUnwrapAs()->isDetached()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLEBYTESTREAMCONTROLLER_DETACHED); + return false; + } + + // Let transferredBuffer be ? TransferArrayBuffer(buffer). + Rooted transferredBuffer(cx, TransferArrayBuffer(cx, buffer)); + + // If controller.[[pendingPullIntos]] is not empty, + if (unwrappedController->pendingPullIntos()->length() > 0) { + // Let firstPendingPullInto be controller.[[pendingPullIntos]][0]. + Rooted firstPendingPullInto( + cx, + UnwrapAndDowncastObject( + cx, &unwrappedController->pendingPullIntos()->get(0).toObject())); + + Rooted buffer(cx, firstPendingPullInto->buffer()); + + // If ! IsDetachedBuffer(firstPendingPullInto’s buffer) is true, throw a + // TypeError exception. + if (buffer->maybeUnwrapAs()->isDetached()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLEBYTESTREAMCONTROLLER_DETACHED); + return false; + } + + // Perform ! ReadableByteStreamControllerInvalidateBYOBRequest(controller). + if (!ReadableByteStreamControllerInvalidateBYOBRequest( + cx, unwrappedController)) { + return false; + } + + // Set firstPendingPullInto’s buffer to ! + // TransferArrayBuffer(firstPendingPullInto’s buffer). firstPendingPullInto + firstPendingPullInto->setBuffer(TransferArrayBuffer(cx, buffer)); + + // If firstPendingPullInto’s reader type is "none", perform ? + // ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, + // firstPendingPullInto). + if (firstPendingPullInto->readerType() == ReaderType::None) { + if (!ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue( + cx, unwrappedController, firstPendingPullInto)) { + return false; + } + } + } + + // If ! ReadableStreamHasDefaultReader(stream) is true, + bool hasDefaultReader; + if (!ReadableStreamHasDefaultReader(cx, unwrappedStream, &hasDefaultReader)) { + return false; + } + if (hasDefaultReader) { + // Perform ! + // ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller). + + // Let reader be controller.[[stream]].[[reader]]. + ReadableStreamReader* reader = + UnwrapReaderFromStreamNoThrow(unwrappedStream); + + // Assert: reader implements ReadableStreamDefaultReader. + MOZ_ASSERT(reader->is()); + + // While reader.[[readRequests]] is not empty, + while (reader->requests()->length() > 0) { + uint32_t queueTotalSize = unwrappedController->queueTotalSize(); + + // If controller.[[queueTotalSize]] is 0, return. + if (queueTotalSize == 0) { + break; + } + + // Perform ! + // ReadableByteStreamControllerFillReadRequestFromQueue(controller, + // readRequest). + // (inlined here, as with other call site) + + MOZ_ASSERT(unwrappedStream->mode() != + JS::ReadableStreamMode::ExternalSource); + // Let entry be controller.[[queue]][0]. + // Remove entry from controller.[[queue]]. + Rooted unwrappedQueue(cx, unwrappedController->queue()); + Rooted unwrappedEntry( + cx, UnwrapAndDowncastObject( + cx, &unwrappedQueue->popFirstAs(cx))); + if (!unwrappedEntry) { + return false; + } + + // Set controller.[[queueTotalSize]] to controller.[[queueTotalSize]] − + // entry’s byte length. + unwrappedController->setQueueTotalSize(queueTotalSize - + unwrappedEntry->byteLength()); + + // Perform ! ReadableByteStreamControllerHandleQueueDrain(controller). + if (!ReadableByteStreamControllerHandleQueueDrain(cx, + unwrappedController)) { + return false; + } + + // Let view be ! Construct(%Uint8Array%, « entry’s buffer, entry’s byte + // offset, entry’s byte length »). + RootedObject buffer(cx, unwrappedEntry->buffer()); + if (!cx->compartment()->wrap(cx, &buffer)) { + return false; + } + uint32_t byteOffset = unwrappedEntry->byteOffset(); + RootedObject view( + cx, JS_NewUint8ArrayWithBuffer(cx, buffer, byteOffset, + unwrappedEntry->byteLength())); + if (!view) { + return false; + } + + // Perform readRequest’s chunk steps, given view. + RootedValue val(cx); + val.setObject(*view); + + if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, unwrappedStream, val, + false)) { + return false; + } + } + + // If ! ReadableStreamGetNumReadRequests(stream) is 0, + if (ReadableStreamGetNumReadRequests(unwrappedStream) == 0) { + // Assert: controller.[[pendingPullIntos]] is empty. + MOZ_ASSERT(unwrappedController->pendingPullIntos()->length() == 0); + + // Perform ! ReadableByteStreamControllerEnqueueChunkToQueue(controller, + // transferredBuffer, byteOffset, byteLength). + if (!ReadableByteStreamControllerEnqueueChunkToQueue( + cx, unwrappedController, transferredBuffer, byteOffset, + byteLength)) { + return false; + } + } else { + // Otherwise, + + // Assert: controller.[[queue]] is empty. + MOZ_ASSERT(unwrappedController->queueTotalSize() == 0); + + // If controller.[[pendingPullIntos]] is not empty, + if (unwrappedController->pendingPullIntos()->length() > 0) { + // Assert: controller.[[pendingPullIntos]][0]'s reader type is + // "default". + Rooted firstPendingPullInto( + cx, + UnwrapAndDowncastObject( + cx, + &unwrappedController->pendingPullIntos()->get(0).toObject())); + MOZ_ASSERT(firstPendingPullInto->readerType() == ReaderType::Default); + + // Perform ! + // ReadableByteStreamControllerShiftPendingPullInto(controller). + ReadableByteStreamControllerShiftPendingPullInto(cx, + unwrappedController); + } + + // Let transferredView be ! Construct(%Uint8Array%, « transferredBuffer, + // byteOffset, byteLength »). + Rooted transferredViewObj( + cx, JS_NewUint8ArrayWithBuffer(cx, transferredBuffer, byteOffset, + byteLength)); + RootedValue transferredView(cx); + transferredView.setObject(*transferredViewObj); + + // Perform ! ReadableStreamFulfillReadRequest(stream, transferredView, + // false). + if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, unwrappedStream, + transferredView, false)) { + return false; + } + } + } else { + bool hasBYOBReader; + if (!ReadableStreamHasBYOBReader(cx, unwrappedStream, &hasBYOBReader)) { + return false; + } + // Otherwise, if ! ReadableStreamHasBYOBReader(stream) is true, + if (hasBYOBReader) { + // Perform ! ReadableByteStreamControllerEnqueueChunkToQueue(controller, + // transferredBuffer, byteOffset, byteLength). + if (!ReadableByteStreamControllerEnqueueChunkToQueue( + cx, unwrappedController, transferredBuffer, byteOffset, + byteLength)) { + return false; + } + + // Perform ! + // ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller). + if (!ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue( + cx, unwrappedController)) { + return false; + } + } else { + // Otherwise, + + // Assert: ! IsReadableStreamLocked(stream) is false. + MOZ_ASSERT(unwrappedStream->locked() == false); + + // Perform ! ReadableByteStreamControllerEnqueueChunkToQueue(controller, + // transferredBuffer, byteOffset, byteLength). + if (!ReadableByteStreamControllerEnqueueChunkToQueue( + cx, unwrappedController, transferredBuffer, byteOffset, + byteLength)) { + return false; + } + } + } + + // Perform ! ReadableByteStreamControllerCallPullIfNeeded(controller). + return ReadableStreamControllerCallPullIfNeeded(cx, unwrappedController); +} + +// https://streams.spec.whatwg.org/#set-up-readable-byte-stream-controller +[[nodiscard]] bool js::SetUpReadableByteStreamController( + JSContext* cx, Handle stream, + SourceAlgorithms sourceAlgorithms, Handle underlyingSource, + Handle pullMethod, Handle cancelMethod, double highWaterMark, + uint64_t autoAllocateChunkSize) { + MOZ_ASSERT(pullMethod.isUndefined() || IsCallable(pullMethod)); + MOZ_ASSERT(cancelMethod.isUndefined() || IsCallable(cancelMethod)); + MOZ_ASSERT_IF(sourceAlgorithms != SourceAlgorithms::Script, + pullMethod.isUndefined()); + MOZ_ASSERT_IF(sourceAlgorithms != SourceAlgorithms::Script, + cancelMethod.isUndefined()); + MOZ_ASSERT(highWaterMark >= 0); + MOZ_ASSERT(!stream->hasController()); + + // Done elsewhere in the standard: Create the new controller. + Rooted controller( + cx, NewBuiltinClassInstance(cx)); + + if (!controller) { + return false; + } + + controller->setStream(stream); + + controller->clearByobRequest(); + + controller->setQueueTotalSize(0); + + // Set controller.[[started]], controller.[[closeRequested]], + // controller.[[pullAgain]], and controller.[[pulling]] to false. + controller->setFlags(0); + + controller->setStrategyHWM(highWaterMark); + + // Step 6: Set controller.[[pullAlgorithm]] to pullAlgorithm. + // (In this implementation, the pullAlgorithm is determined by the + // underlyingSource in combination with the pullMethod field.) + controller->setUnderlyingSource(underlyingSource); + controller->setPullMethod(pullMethod); + controller->setCancelMethod(cancelMethod); + + if (autoAllocateChunkSize) { + controller->setAutoAllocateChunkSize(autoAllocateChunkSize); + } + + if (!StoreNewListInFixedSlot( + cx, controller, + ReadableByteStreamController::Slot_PendingPullIntos)) { + return false; + } + + if (!StoreNewListInFixedSlot(cx, controller, + ReadableByteStreamController::Slot_Queue)) { + return false; + } + + // // Step 8: Set stream.[[readableStreamController]] to controller. + stream->setController(controller); + + Rooted startResult(cx); + if (sourceAlgorithms == SourceAlgorithms::Script) { + Rooted controllerVal(cx, ObjectValue(*controller)); + if (!InvokeOrNoop(cx, underlyingSource, cx->names().start, controllerVal, + &startResult)) { + return false; + } + } + + RootedObject startPromise(cx, + PromiseObject::unforgeableResolve(cx, startResult)); + if (!startPromise) { + return false; + } + + RootedObject onStartFulfilled( + cx, NewHandler(cx, ReadableStreamControllerStartHandler, controller)); + if (!onStartFulfilled) { + return false; + } + RootedObject onStartRejected( + cx, + NewHandler(cx, ReadableStreamControllerStartFailedHandler, controller)); + if (!onStartRejected) { + return false; + } + if (!JS::AddPromiseReactions(cx, startPromise, onStartFulfilled, + onStartRejected)) { + return false; + } + + // autoClear.reset(); + return true; +} + +// https://streams.spec.whatwg.org/#set-up-readable-byte-stream-controller-from-underlying-source +[[nodiscard]] bool js::SetUpReadableByteStreamControllerFromUnderlyingSource( + JSContext* cx, JS::Handle stream, + JS::Handle underlyingSource, double highWaterMark) { + // Step 1: Assert: underlyingSource is not undefined. + MOZ_ASSERT(!underlyingSource.isUndefined()); + + // Step 2: Let controller be ObjectCreate(the original value of + // ReadableByteStreamController's prototype property). + // (Deferred to SetUpReadableByteStreamController.) + + // Step 3: Let startAlgorithm be the following steps: + // a. Return ? InvokeOrNoop(underlyingSource, "start", + // « controller »). + js::SourceAlgorithms sourceAlgorithms = js::SourceAlgorithms::Script; + + // Step 4: Let pullAlgorithm be + // ? CreateAlgorithmFromUnderlyingMethod(underlyingSource, "pull", + // 0, « controller »). + Rooted pullMethod(cx); + if (!CreateAlgorithmFromUnderlyingMethod(cx, underlyingSource, + "ReadableStream source.pull method", + cx->names().pull, &pullMethod)) { + return false; + } + + // Step 5. Let cancelAlgorithm be + // ? CreateAlgorithmFromUnderlyingMethod(underlyingSource, + // "cancel", 1, « »). + Rooted cancelMethod(cx); + if (!CreateAlgorithmFromUnderlyingMethod( + cx, underlyingSource, "ReadableStream source.cancel method", + cx->names().cancel, &cancelMethod)) { + return false; + } + + Rooted autoAllocateChunkSizeVal(cx); + if (!GetProperty(cx, underlyingSource, cx->names().autoAllocateChunkSize, + &autoAllocateChunkSizeVal)) { + return false; + } + + double autoAllocateChunkSize = 0; + if (!autoAllocateChunkSizeVal.isUndefined()) { + MOZ_ASSERT(autoAllocateChunkSizeVal.isNumber()); + if (!js::ToInteger(cx, autoAllocateChunkSizeVal, &autoAllocateChunkSize)) { + MOZ_ASSERT(false); + } + if (autoAllocateChunkSize == 0) { + JS_ReportErrorNumberASCII(cx, js::GetErrorMessage, nullptr, + JSMSG_STREAM_AUTOALLOCATECHUNKSIZE_ZERO); + return false; + } + } + + return SetUpReadableByteStreamController( + cx, stream, sourceAlgorithms, underlyingSource, pullMethod, cancelMethod, + highWaterMark, static_cast(autoAllocateChunkSize)); +} diff --git a/js/src/builtin/streams/ReadableByteStreamControllerOperations.h b/js/src/builtin/streams/ReadableByteStreamControllerOperations.h new file mode 100644 index 0000000000000..37abeed4c853f --- /dev/null +++ b/js/src/builtin/streams/ReadableByteStreamControllerOperations.h @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Readable stream default controller abstract operations. */ + +#ifndef builtin_streams_ReadableByteStreamControllerOperations_h +#define builtin_streams_ReadableByteStreamControllerOperations_h + +#include "jstypes.h" // JS_PUBLIC_API + +#include "builtin/streams/ReadableStreamDefaultControllerOperations.h" + +#include "js/RootingAPI.h" // JS::Handle +#include "js/Value.h" // JS::Value + +struct JS_PUBLIC_API JSContext; + +namespace js { + +class PullIntoDescriptor; +class ReadableStream; +class ReadableStreamController; +class ReadableByteStreamController; + +[[nodiscard]] extern bool ReadableByteStreamControllerRespondInReadableState( + JSContext* cx, JS::Handle controller, + uint64_t bytesWritten, JS::Handle firstDescriptor); + +[[nodiscard]] extern bool ReadableByteStreamControllerRespondInternal( + JSContext* cx, JS::Handle controller, + uint64_t bytesWritten); + +[[nodiscard]] extern bool ReadableByteStreamControllerEnqueue( + JSContext* cx, + JS::Handle unwrappedController, + JS::Handle chunk); + +[[nodiscard]] extern bool ReadableByteStreamControllerClose( + JSContext* cx, + JS::Handle unwrappedController); + +[[nodiscard]] extern bool SetUpReadableByteStreamController( + JSContext* cx, JS::Handle stream, + SourceAlgorithms sourceAlgorithms, JS::Handle underlyingSource, + JS::Handle pullMethod, JS::Handle cancelMethod, + double highWaterMark, uint64_t autoAllocateChunkSize); + +[[nodiscard]] extern bool SetUpReadableByteStreamControllerFromUnderlyingSource( + JSContext* cx, JS::Handle stream, + JS::Handle underlyingSource, double highWaterMark); + +[[nodiscard]] extern bool ReadableByteStreamControllerCommitPullIntoDescriptor( + JSContext* cx, JS::Handle stream, + JS::Handle firstDescriptor); + +[[nodiscard]] extern bool +ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue( + JSContext* cx, + JS::Handle unwrappedController); + +[[nodiscard]] extern bool +ReadableByteStreamControllerFillPullIntoDescriptorFromQueue( + JSContext* cx, + JS::Handle unwrappedController, + JS::Handle pullIntoDescriptor, bool* ready); + +extern PullIntoDescriptor* ReadableByteStreamControllerShiftPendingPullInto( + JSContext* cx, + JS::Handle unwrappedController); + +[[nodiscard]] extern bool ReadableByteStreamControllerRespondWithNewView( + JSContext* cx, + JS::Handle unwrappedController, + JS::Handle view); + +[[nodiscard]] extern JSObject* +ReadableByteStreamControllerConvertPullIntoDescriptor( + JSContext* cx, JS::Handle pullIntoDescriptor); + +[[nodiscard]] extern bool ReadableByteStreamControllerRespondInClosedState( + JSContext* cx, JS::Handle controller, + JS::Handle firstDescriptor); + +[[nodiscard]] extern bool ReadableByteStreamControllerEnqueueClonedChunkToQueue( + JSContext* cx, JS::Handle controller, + JS::Handle buffer, uint32_t byteOffset, uint32_t bytesFilled); + +[[nodiscard]] extern bool +ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue( + JSContext* cx, JS::Handle controller, + JS::Handle pullIntoDescriptor); + +extern void ReadableByteStreamControllerFillHeadPullIntoDescriptor( + JSContext* cx, + JS::Handle unwrappedController, + uint32_t size, JS::Handle pullIntoDescriptor); + +[[nodiscard]] extern bool ReadableByteStreamControllerEnqueueChunkToQueue( + JSContext* cx, JS::Handle controller, + JS::Handle buffer, uint32_t byteOffset, uint32_t byteLength); + +} // namespace js + +#endif // builtin_streams_ReadableByteStreamControllerOperations_h diff --git a/js/src/builtin/streams/ReadableStream.cpp b/js/src/builtin/streams/ReadableStream.cpp new file mode 100644 index 0000000000000..9d02a5590a091 --- /dev/null +++ b/js/src/builtin/streams/ReadableStream.cpp @@ -0,0 +1,598 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Class ReadableStream. */ + +#include "builtin/streams/ReadableStream.h" + +#include "mozilla/Maybe.h" // mozilla::Maybe, mozilla::Some + +#include "jspubtd.h" // JSProto_ReadableStream + +#include "builtin/Array.h" // js::NewDenseFullyAllocatedArray +#include "builtin/streams/ClassSpecMacro.h" // JS_STREAMS_CLASS_SPEC +#include "builtin/streams/MiscellaneousOperations.h" // js::MakeSizeAlgorithmFromSizeFunction, js::ValidateAndNormalizeHighWaterMark, js::ReturnPromiseRejectedWithPendingError +#include "builtin/streams/ReadableByteStreamControllerOperations.h" // js::SetUpReadableByteStreamControllerFromUnderlyingSource +#include "builtin/streams/ReadableStreamController.h" // js::ReadableStream{,Default}Controller, js::ReadableByteStreamController +#include "builtin/streams/ReadableStreamDefaultControllerOperations.h" // js::SetUpReadableStreamDefaultControllerFromUnderlyingSource +#include "builtin/streams/ReadableStreamInternals.h" // js::ReadableStreamCancel +#include "builtin/streams/ReadableStreamOperations.h" // js::ReadableStream{PipeTo,Tee} +#include "builtin/streams/ReadableStreamReader.h" // js::CreateReadableStream{BYOB,Default}Reader, js::ForAuthorCodeBool +#include "builtin/streams/WritableStream.h" // js::WritableStream +#include "js/CallArgs.h" // JS::CallArgs{,FromVp} +#include "js/Class.h" // JSCLASS_SLOT0_IS_NSISUPPORTS, JS_NULL_CLASS_OPS +#include "js/Conversions.h" // JS::ToBoolean +#include "js/ErrorReport.h" // JS_ReportErrorNumberASCII +#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* +#include "js/PropertySpec.h" // JS{Function,Property}Spec, JS_FN, JS_PSG, JS_{FS,PS}_END +#include "js/RootingAPI.h" // JS::Handle, JS::Rooted, js::CanGC +#include "js/Stream.h" // JS::ReadableStream{Mode,UnderlyingSource} +#include "js/Value.h" // JS::Value +#include "vm/Interpreter.h" // js::GetProperty +#include "vm/JSContext.h" // JSContext +#include "vm/JSObject.h" // js::GetPrototypeFromBuiltinConstructor +#include "vm/ObjectOperations.h" // js::GetProperty +#include "vm/PlainObject.h" // js::PlainObject +#include "vm/Runtime.h" // JSAtomState, JSRuntime +#include "vm/StringType.h" // js::EqualStrings, js::ToString + +#include "vm/Compartment-inl.h" // js::UnwrapAndTypeCheck{Argument,This,Value} +#include "vm/JSObject-inl.h" // js::NewBuiltinClassInstance +#include "vm/NativeObject-inl.h" // js::ThrowIfNotConstructing + +using mozilla::Maybe; +using mozilla::Some; + +using js::CanGC; +using js::ClassSpec; +using js::CreateReadableStreamDefaultReader; +using js::EqualStrings; +using js::ForAuthorCodeBool; +using js::GetErrorMessage; +using js::NativeObject; +using js::NewBuiltinClassInstance; +using js::NewDenseFullyAllocatedArray; +using js::PlainObject; +using js::ReadableStream; +using js::ReadableStreamPipeTo; +using js::ReadableStreamTee; +using js::ReturnPromiseRejectedWithPendingError; +using js::ToString; +using js::UnwrapAndTypeCheckArgument; +using js::UnwrapAndTypeCheckThis; +using js::UnwrapAndTypeCheckValue; +using js::WritableStream; + +using JS::CallArgs; +using JS::CallArgsFromVp; +using JS::Handle; +using JS::ObjectValue; +using JS::Rooted; +using JS::Value; + +/*** 3.2. Class ReadableStream **********************************************/ + +JS::ReadableStreamMode ReadableStream::mode() const { + ReadableStreamController* controller = this->controller(); + if (controller->is()) { + return JS::ReadableStreamMode::Default; + } + return controller->as().hasExternalSource() + ? JS::ReadableStreamMode::ExternalSource + : JS::ReadableStreamMode::Byte; +} + +ReadableStream* ReadableStream::createExternalSourceStream( + JSContext* cx, JS::ReadableStreamUnderlyingSource* source, + void* nsISupportsObject_alreadyAddreffed /* = nullptr */, + Handle proto /* = nullptr */) { + Rooted stream( + cx, create(cx, nsISupportsObject_alreadyAddreffed, proto)); + if (!stream) { + return nullptr; + } + + if (!SetUpExternalReadableByteStreamController(cx, stream, source)) { + return nullptr; + } + + return stream; +} + +/** + * Streams spec, 3.2.3. new ReadableStream(underlyingSource = {}, strategy = {}) + */ +bool ReadableStream::constructor(JSContext* cx, unsigned argc, JS::Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + if (!ThrowIfNotConstructing(cx, args, "ReadableStream")) { + return false; + } + + // Implicit in the spec: argument default values. + Rooted underlyingSource(cx, args.get(0)); + if (underlyingSource.isUndefined()) { + JSObject* emptyObj = NewPlainObject(cx); + if (!emptyObj) { + return false; + } + underlyingSource = ObjectValue(*emptyObj); + } + + Rooted strategy(cx, args.get(1)); + if (strategy.isUndefined()) { + JSObject* emptyObj = NewPlainObject(cx); + if (!emptyObj) { + return false; + } + strategy = ObjectValue(*emptyObj); + } + + // Implicit in the spec: Set this to + // OrdinaryCreateFromConstructor(NewTarget, ...). + // Step 1: Perform ! InitializeReadableStream(this). + Rooted proto(cx); + if (!GetPrototypeFromBuiltinConstructor(cx, args, JSProto_ReadableStream, + &proto)) { + return false; + } + Rooted stream(cx, + ReadableStream::create(cx, nullptr, proto)); + if (!stream) { + return false; + } + + // Step 2: Let size be ? GetV(strategy, "size"). + Rooted size(cx); + if (!GetProperty(cx, strategy, cx->names().size, &size)) { + return false; + } + + // Step 3: Let highWaterMark be ? GetV(strategy, "highWaterMark"). + Rooted highWaterMarkVal(cx); + if (!GetProperty(cx, strategy, cx->names().highWaterMark, + &highWaterMarkVal)) { + return false; + } + + // Step 4: Let type be ? GetV(underlyingSource, "type"). + Rooted type(cx); + if (!GetProperty(cx, underlyingSource, cx->names().type, &type)) { + return false; + } + + // Step 5: Let typeString be ? ToString(type). + Rooted typeString(cx, ToString(cx, type)); + if (!typeString) { + return false; + } + + // Step 6: If typeString is "bytes", + bool equal; + if (!EqualStrings(cx, typeString, cx->names().bytes, &equal)) { + return false; + } + if (equal) { + // If strategy["size"] exists, throw a RangeError exception. + if (!size.isUndefined()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_BYOB_SIZE); + return false; + } + + double highWaterMark = 0; + if (!ValidateAndNormalizeHighWaterMark(cx, highWaterMarkVal, &highWaterMark, + 0)) { + return false; + } + + if (!SetUpReadableByteStreamControllerFromUnderlyingSource( + cx, stream, underlyingSource, highWaterMark)) { + return false; + } + + args.rval().setObject(*stream); + return true; + } + + // Step 7: Otherwise, if type is undefined, + if (type.isUndefined()) { + // Step 7.a: Let sizeAlgorithm be ? MakeSizeAlgorithmFromSizeFunction(size). + if (!MakeSizeAlgorithmFromSizeFunction(cx, size)) { + return false; + } + + // Step 7.b: If highWaterMark is undefined, let highWaterMark be 1. + double highWaterMark; + if (highWaterMarkVal.isUndefined()) { + highWaterMark = 1; + } else { + // Step 7.c: Set highWaterMark to ? + // ValidateAndNormalizeHighWaterMark(highWaterMark). + if (!ValidateAndNormalizeHighWaterMark(cx, highWaterMarkVal, + &highWaterMark, 1)) { + return false; + } + } + + // Step 7.d: Perform + // ? SetUpReadableStreamDefaultControllerFromUnderlyingSource( + // this, underlyingSource, highWaterMark, sizeAlgorithm). + if (!SetUpReadableStreamDefaultControllerFromUnderlyingSource( + cx, stream, underlyingSource, highWaterMark, size)) { + return false; + } + + args.rval().setObject(*stream); + return true; + } + + // Step 8: Otherwise, throw a RangeError exception. + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_UNDERLYINGSOURCE_TYPE_WRONG); + return false; +} + +/** + * Streams spec, 3.2.5.1. get locked + */ +[[nodiscard]] static bool ReadableStream_locked(JSContext* cx, unsigned argc, + JS::Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsReadableStream(this) is false, throw a TypeError exception. + Rooted unwrappedStream( + cx, UnwrapAndTypeCheckThis(cx, args, "get locked")); + if (!unwrappedStream) { + return false; + } + + // Step 2: Return ! IsReadableStreamLocked(this). + args.rval().setBoolean(unwrappedStream->locked()); + return true; +} + +/** + * Streams spec, 3.2.5.2. cancel ( reason ) + */ +[[nodiscard]] static bool ReadableStream_cancel(JSContext* cx, unsigned argc, + JS::Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsReadableStream(this) is false, return a promise rejected + // with a TypeError exception. + Rooted unwrappedStream( + cx, UnwrapAndTypeCheckThis(cx, args, "cancel")); + if (!unwrappedStream) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 2: If ! IsReadableStreamLocked(this) is true, return a promise + // rejected with a TypeError exception. + if (unwrappedStream->locked()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_LOCKED_METHOD, "cancel"); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 3: Return ! ReadableStreamCancel(this, reason). + Rooted cancelPromise( + cx, js::ReadableStreamCancel(cx, unwrappedStream, args.get(0))); + if (!cancelPromise) { + return false; + } + args.rval().setObject(*cancelPromise); + return true; +} + +// Streams spec, 3.2.5.3. +// getIterator({ preventCancel } = {}) +// +// Not implemented. + +/** + * https://streams.spec.whatwg.org/#rs-get-reader + * ReadableStreamReader getReader(optional ReadableStreamGetReaderOptions + * options = {}); + */ +[[nodiscard]] static bool ReadableStream_getReader(JSContext* cx, unsigned argc, + JS::Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Implicit |this| check. + Rooted unwrappedStream( + cx, UnwrapAndTypeCheckThis(cx, args, "getReader")); + if (!unwrappedStream) { + return false; + } + + // Implicit in the spec: Dictionary destructuring. + // https://heycam.github.io/webidl/#es-dictionary + // 3.2.17. Dictionary types + + Rooted optionsVal(cx, args.get(0)); + // Step 1. + if (!optionsVal.isNullOrUndefined() && !optionsVal.isObject()) { + ReportValueError(cx, JSMSG_CANT_CONVERT_TO, JSDVG_IGNORE_STACK, optionsVal, + nullptr, "dictionary"); + return false; + } + + Maybe mode; + // Step 4: ... + // + // - Optimized for one dictionary member. + // - Treat non-object options as non-existing "mode" member. + if (optionsVal.isObject()) { + Rooted modeVal(cx); + if (!GetProperty(cx, optionsVal, cx->names().mode, &modeVal)) { + return false; + } + + // Step 4.1.3: If esMemberValue is not undefined, then: ... + if (!modeVal.isUndefined()) { + // https://heycam.github.io/webidl/#es-enumeration + // 3.2.18. Enumeration types + + // Step 1: Let S be the result of calling ToString(V). + Rooted modeStr(cx, ToString(cx, modeVal)); + if (!modeStr) { + return false; + } + + // Step 2: If S is not one of E's enumeration values, + // then throw a TypeError. + // + // Note: We only have one valid value "byob". + bool equal; + if (!EqualStrings(cx, modeStr, cx->names().byob, &equal)) { + return false; + } + if (!equal) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_INVALID_READER_MODE); + return false; + } + + mode = Some(JS::ReadableStreamReaderMode::Byob); + } + } + + // Step 1: If options["mode"] does not exist, + // return ? AcquireReadableStreamDefaultReader(this). + Rooted reader(cx); + if (mode.isNothing()) { + reader = CreateReadableStreamDefaultReader(cx, unwrappedStream, + ForAuthorCodeBool::Yes); + } else { + // Step 2: Assert: options["mode"] is "byob". + MOZ_ASSERT(mode.value() == JS::ReadableStreamReaderMode::Byob); + + // Step 3: Return ? AcquireReadableStreamBYOBReader(this). + reader = CreateReadableStreamBYOBReader(cx, unwrappedStream, + ForAuthorCodeBool::Yes); + } + + if (!reader) { + return false; + } + + args.rval().setObject(*reader); + return true; +} + +// Streams spec, 3.2.5.5. +// pipeThrough({ writable, readable }, +// { preventClose, preventAbort, preventCancel, signal }) +// +// Not implemented. + +/** + * Streams spec, 3.2.5.6. + * pipeTo(dest, { preventClose, preventAbort, preventCancel, signal } = {}) + */ +static bool ReadableStream_pipeTo(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Implicit in the spec: argument default values. + Rooted options(cx, args.get(1)); + if (options.isUndefined()) { + JSObject* emptyObj = NewPlainObject(cx); + if (!emptyObj) { + return false; + } + options.setObject(*emptyObj); + } + // Step 3 (reordered). + // Implicit in the spec: get the values of the named parameters inside the + // second argument destructuring pattern. But as |ToBoolean| is infallible + // and has no observable side effects, we may as well do step 3 here too. + bool preventClose, preventAbort, preventCancel; + Rooted signalVal(cx); + { + // (P)(Re)use the |signal| root. + auto& v = signalVal; + + if (!GetProperty(cx, options, cx->names().preventClose, &v)) { + return false; + } + preventClose = JS::ToBoolean(v); + + if (!GetProperty(cx, options, cx->names().preventAbort, &v)) { + return false; + } + preventAbort = JS::ToBoolean(v); + + if (!GetProperty(cx, options, cx->names().preventCancel, &v)) { + return false; + } + preventCancel = JS::ToBoolean(v); + } + if (!GetProperty(cx, options, cx->names().signal, &signalVal)) { + return false; + } + + // Step 1: If ! IsReadableStream(this) is false, return a promise rejected + // with a TypeError exception. + Rooted unwrappedThis( + cx, UnwrapAndTypeCheckThis(cx, args, "pipeTo")); + if (!unwrappedThis) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 2: If ! IsWritableStream(dest) is false, return a promise rejected + // with a TypeError exception. + Rooted unwrappedDest( + cx, UnwrapAndTypeCheckArgument(cx, args, "pipeTo", 0)); + if (!unwrappedDest) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 3: Set preventClose to ! ToBoolean(preventClose), set preventAbort to + // ! ToBoolean(preventAbort), and set preventCancel to + // ! ToBoolean(preventCancel). + // This already happened above. + + // Step 4: If signal is not undefined, and signal is not an instance of the + // AbortSignal interface, return a promise rejected with a TypeError + // exception. + Rooted signal(cx, nullptr); + if (!signalVal.isUndefined()) { + if (!UnwrapAndTypeCheckValue( + cx, signalVal, cx->runtime()->maybeAbortSignalClass(), [cx] { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_PIPETO_BAD_SIGNAL); + })) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Note: |signal| can be a wrapper. + signal = &signalVal.toObject(); + } + + // Step 5: If ! IsReadableStreamLocked(this) is true, return a promise + // rejected with a TypeError exception. + if (unwrappedThis->locked()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_LOCKED_METHOD, "pipeTo"); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 6: If ! IsWritableStreamLocked(dest) is true, return a promise + // rejected with a TypeError exception. + if (unwrappedDest->isLocked()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_WRITABLESTREAM_ALREADY_LOCKED); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 7: Return + // ! ReadableStreamPipeTo(this, dest, preventClose, preventAbort, + // preventCancel, signal). + JSObject* promise = + ReadableStreamPipeTo(cx, unwrappedThis, unwrappedDest, preventClose, + preventAbort, preventCancel, signal); + if (!promise) { + return false; + } + + args.rval().setObject(*promise); + return true; +} + +/** + * Streams spec, 3.2.5.7. tee() + */ +static bool ReadableStream_tee(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsReadableStream(this) is false, throw a TypeError exception. + Rooted unwrappedStream( + cx, UnwrapAndTypeCheckThis(cx, args, "tee")); + if (!unwrappedStream) { + return false; + } + + // Step 2: Let branches be ? ReadableStreamTee(this, false). + Rooted branch1(cx); + Rooted branch2(cx); + if (!ReadableStreamTee(cx, unwrappedStream, false, &branch1, &branch2)) { + return false; + } + + // Step 3: Return ! CreateArrayFromList(branches). + Rooted branches(cx, NewDenseFullyAllocatedArray(cx, 2)); + if (!branches) { + return false; + } + branches->setDenseInitializedLength(2); + branches->initDenseElement(0, ObjectValue(*branch1)); + branches->initDenseElement(1, ObjectValue(*branch2)); + + args.rval().setObject(*branches); + return true; +} + +// Streams spec, 3.2.5.8. +// [@@asyncIterator]({ preventCancel } = {}) +// +// Not implemented. + +static const JSFunctionSpec ReadableStream_methods[] = { + JS_FN("cancel", ReadableStream_cancel, 0, JSPROP_ENUMERATE), + JS_FN("getReader", ReadableStream_getReader, 0, JSPROP_ENUMERATE), + // pipeTo is only conditionally supported right now, so it must be manually + // added below if desired. + JS_FN("tee", ReadableStream_tee, 0, JSPROP_ENUMERATE), JS_FS_END}; + +static const JSPropertySpec ReadableStream_properties[] = { + JS_PSG("locked", ReadableStream_locked, JSPROP_ENUMERATE), + JS_STRING_SYM_PS(toStringTag, "ReadableStream", JSPROP_READONLY), + JS_PS_END}; + +static bool FinishReadableStreamClassInit(JSContext* cx, Handle ctor, + Handle proto) { + // This function and everything below should be replaced with + // + // JS_STREAMS_CLASS_SPEC(ReadableStream, 0, SlotCount, 0, + // JSCLASS_SLOT0_IS_NSISUPPORTS, + // JS_NULL_CLASS_OPS); + // + // when "pipeTo" is always enabled. + const auto& rco = cx->realm()->creationOptions(); + if (rco.getStreamsEnabled()) { + Rooted pipeTo(cx, NameToId(cx->names().pipeTo)); + if (!DefineFunction(cx, proto, pipeTo, ReadableStream_pipeTo, 2, + JSPROP_RESOLVING | JSPROP_ENUMERATE)) { + return false; + } + } + + return true; +} + +const ClassSpec ReadableStream::classSpec_ = { + js::GenericCreateConstructor, + js::GenericCreatePrototype, + nullptr, + nullptr, + ReadableStream_methods, + ReadableStream_properties, + FinishReadableStreamClassInit, + 0}; + +const JSClass ReadableStream::class_ = { + "ReadableStream", + JSCLASS_HAS_RESERVED_SLOTS(ReadableStream::SlotCount) | + JSCLASS_HAS_CACHED_PROTO(JSProto_ReadableStream) | + JSCLASS_SLOT0_IS_NSISUPPORTS, + JS_NULL_CLASS_OPS, &ReadableStream::classSpec_}; + +const JSClass ReadableStream::protoClass_ = { + "ReadableStream.prototype", + JSCLASS_HAS_CACHED_PROTO(JSProto_ReadableStream), JS_NULL_CLASS_OPS, + &ReadableStream::classSpec_}; diff --git a/js/src/builtin/streams/ReadableStream.h b/js/src/builtin/streams/ReadableStream.h new file mode 100644 index 0000000000000..4870854cdb1f5 --- /dev/null +++ b/js/src/builtin/streams/ReadableStream.h @@ -0,0 +1,149 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Class ReadableStream. */ + +#ifndef builtin_streams_ReadableStream_h +#define builtin_streams_ReadableStream_h + +#include "mozilla/Assertions.h" // MOZ_ASSERT{,_IF} + +#include // uint32_t + +#include "jstypes.h" // JS_PUBLIC_API +#include "js/Class.h" // JSClass, js::ClassSpec +#include "js/RootingAPI.h" // JS::Handle +#include "js/Stream.h" // JS::ReadableStream{Mode,UnderlyingSource} +#include "js/Value.h" // JS::Int32Value, JS::ObjectValue, JS::UndefinedValue +#include "vm/JSObject.h" // JSObject::is +#include "vm/NativeObject.h" // js::NativeObject + +class JS_PUBLIC_API JSObject; + +namespace js { + +class ReadableStreamController; + +class ReadableStream : public NativeObject { + public: + /** + * Memory layout of Stream instances. + * + * See https://streams.spec.whatwg.org/#rs-internal-slots for details on + * the stored state. [[state]] and [[disturbed]] are stored in + * StreamSlot_State as ReadableStream::State enum values. + * + * Of the stored values, Reader and StoredError might be cross-compartment + * wrappers. This can happen if the Reader was created by applying a + * different compartment's ReadableStream.prototype.getReader method. + * + * A stream's associated controller is always created from under the + * stream's constructor and thus cannot be in a different compartment. + */ + enum Slots { + /** + * Optional pointer to make the stream participate in Gecko's cycle + * collection. See also JSCLASS_SLOT0_IS_NSISUPPORTS. + */ + Slot_ISupports, + + Slot_Controller, + Slot_Reader, + Slot_State, + Slot_StoredError, + SlotCount + }; + + private: + enum StateBits { + Readable = 0, + Closed = 1, + Errored = 2, + StateMask = 0x000000ff, + Disturbed = 0x00000100 + }; + + uint32_t stateBits() const { return getFixedSlot(Slot_State).toInt32(); } + void initStateBits(uint32_t stateBits) { + MOZ_ASSERT((stateBits & ~Disturbed) <= Errored); + setFixedSlot(Slot_State, JS::Int32Value(stateBits)); + } + void setStateBits(uint32_t stateBits) { +#ifdef DEBUG + bool wasDisturbed = disturbed(); + bool wasClosedOrErrored = closed() || errored(); +#endif + initStateBits(stateBits); + MOZ_ASSERT_IF(wasDisturbed, disturbed()); + MOZ_ASSERT_IF(wasClosedOrErrored, !readable()); + } + + StateBits state() const { return StateBits(stateBits() & StateMask); } + void setState(StateBits state) { + MOZ_ASSERT(state <= Errored); + uint32_t current = stateBits() & ~StateMask; + setStateBits(current | state); + } + + public: + bool readable() const { return state() == Readable; } + bool closed() const { return state() == Closed; } + void setClosed() { setState(Closed); } + bool errored() const { return state() == Errored; } + void setErrored() { setState(Errored); } + bool disturbed() const { return stateBits() & Disturbed; } + void setDisturbed() { setStateBits(stateBits() | Disturbed); } + + bool hasController() const { + return !getFixedSlot(Slot_Controller).isUndefined(); + } + inline ReadableStreamController* controller() const; + inline void setController(ReadableStreamController* controller); + void clearController() { + setFixedSlot(Slot_Controller, JS::UndefinedValue()); + } + + bool hasReader() const { + return !getFixedSlot(Slot_Reader).isUndefined(); + } + void setReader(JSObject* reader) { + setFixedSlot(Slot_Reader, JS::ObjectValue(*reader)); + } + void clearReader() { + setFixedSlot(Slot_Reader, JS::UndefinedValue()); + } + + JS::Value storedError() const { return getFixedSlot(Slot_StoredError); } + void setStoredError(JS::Handle value) { + setFixedSlot(Slot_StoredError, value); + } + + JS::ReadableStreamMode mode() const; + + bool locked() const; + + [[nodiscard]] static ReadableStream* create( + JSContext* cx, void* nsISupportsObject_alreadyAddreffed = nullptr, + JS::Handle proto = nullptr); + static ReadableStream* createExternalSourceStream( + JSContext* cx, JS::ReadableStreamUnderlyingSource* source, + void* nsISupportsObject_alreadyAddreffed = nullptr, + JS::Handle proto = nullptr); + + static bool constructor(JSContext* cx, unsigned argc, Value* vp); + static const ClassSpec classSpec_; + static const JSClass class_; + static const ClassSpec protoClassSpec_; + static const JSClass protoClass_; +}; + +[[nodiscard]] extern bool SetUpExternalReadableByteStreamController( + JSContext* cx, JS::Handle stream, + JS::ReadableStreamUnderlyingSource* source); + +} // namespace js + +#endif // builtin_streams_ReadableStream_h diff --git a/js/src/builtin/streams/ReadableStreamBYOBReader.cpp b/js/src/builtin/streams/ReadableStreamBYOBReader.cpp new file mode 100644 index 0000000000000..92f4b2698784a --- /dev/null +++ b/js/src/builtin/streams/ReadableStreamBYOBReader.cpp @@ -0,0 +1,569 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* + * Class ReadableStreamBYOBReader. + */ + +#include "builtin/streams/ClassSpecMacro.h" // JS_STREAMS_CLASS_SPEC +#include "builtin/streams/MiscellaneousOperations.h" // js::ReturnPromiseRejectedWithPendingError +#include "builtin/streams/PullIntoDescriptor.h" // js::PullIntoDescriptor +#include "builtin/streams/ReadableByteStreamControllerOperations.h" // js::ReadableByteStreamControllerFillPullIntoDescriptorFromQueue +#include "builtin/streams/ReadableStream.h" // js::ReadableStream +#include "builtin/streams/ReadableStreamController.h" // js::ReadableStream{,Default}Controller, js::ReadableStreamDefaultControllerPullSteps, js::ReadableStreamControllerStart{,Failed}Handler +#include "builtin/streams/ReadableStreamInternals.h" // js::ReadableStream{Cancel,CreateReadResult} +#include "builtin/streams/ReadableStreamReader.h" // js::ForAuthorCodeBool, js::ReadableStream{,Default}Reader +#include "js/ErrorReport.h" // JS_ReportErrorNumberASCII +#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* + +#include "vm/ArrayBufferViewObject.h" // js::UnwrapArrayBufferView +#include "vm/Interpreter.h" +#include "vm/PromiseObject.h" // js::UnwrapAndTypeCheckThis +#include "vm/SavedFrame.h" // js::SavedFrame +#include "builtin/streams/ReadableStreamReader-inl.h" +#include "vm/Compartment-inl.h" // js::UnwrapAndTypeCheckThis +#include "vm/JSObject-inl.h" // js::NewObjectWithClassProto +#include "vm/List-inl.h" // js::ListObject::append +#include "vm/NativeObject-inl.h" // js::ThrowIfNotConstructing + +using JS::CallArgs; +using JS::Handle; +using JS::ObjectValue; +using JS::Rooted; +using JS::RootedObject; +using JS::RootedValueArray; +using JS::UndefinedHandleValue; +using JS::Value; + +using js::ForAuthorCodeBool; +using js::GetErrorMessage; +using js::ListObject; +using js::NewObjectWithClassProto; +using js::PromiseObject; +using js::PullIntoDescriptor; +using js::ReadableByteStreamController; +using js::ReadableStream; +using js::ReadableStreamBYOBReader; +using js::ReadableStreamReader; +using js::UnwrapAndTypeCheckThis; + +/*** 3.7. Class ReadableStreamBYOBReader *********************************/ + +/** + * Stream spec, 3.7.3. new ReadableStreamBYOBReader ( stream ) + * Steps 2-5. + */ +ReadableStreamBYOBReader* js::CreateReadableStreamBYOBReader( + JSContext* cx, Handle unwrappedStream, + ForAuthorCodeBool forAuthorCode, Handle proto /* = nullptr */) { + Rooted reader( + cx, NewObjectWithClassProto(cx, proto)); + if (!reader) { + return nullptr; + } + + // Step 1: If ! IsReadableStreamLocked(stream) is true, throw a TypeError + // exception. + if (unwrappedStream->locked()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_LOCKED); + return nullptr; + } + + // Step 2: If ! IsReadableByteStreamController( + // stream.[[readableStreamController]]) is false, throw a + // TypeError exception. + if (!unwrappedStream->controller()->is()) { + JS_ReportErrorNumberASCII( + cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_BYOB_READER_FOR_NON_BYTE_STREAM); + return nullptr; + } + + // Step 3: Perform ! ReadableStreamReaderGenericInitialize(this, stream). + // Step 4: Set this.[[readRequests]] to a new empty List. + if (!ReadableStreamReaderGenericInitialize(cx, reader, unwrappedStream, + forAuthorCode)) { + return nullptr; + } + + return reader; +} + +/** + * Stream spec, 3.6.3. new ReadableStreamBYOBReader ( stream ) + */ +bool ReadableStreamBYOBReader::constructor(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + if (!ThrowIfNotConstructing(cx, args, "ReadableStreamBYOBReader")) { + return false; + } + + // Implicit in the spec: Find the prototype object to use. + Rooted proto(cx); + if (!GetPrototypeFromBuiltinConstructor(cx, args, JSProto_Null, &proto)) { + return false; + } + + // Step 1: If ! IsReadableStream(stream) is false, throw a TypeError + // exception. + Rooted unwrappedStream( + cx, UnwrapAndTypeCheckArgument( + cx, args, "ReadableStreamBYOBReader constructor", 0)); + if (!unwrappedStream) { + return false; + } + + Rooted reader( + cx, CreateReadableStreamBYOBReader(cx, unwrappedStream, + ForAuthorCodeBool::Yes, proto)); + if (!reader) { + return false; + } + + args.rval().setObject(*reader); + return true; +} + +/** + * Streams spec, 3.6.4.1 get closed + */ +static bool ReadableStreamBYOBReader_closed(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsReadableStreamBYOBReader(this) is false, return a promise + // rejected with a TypeError exception. + Rooted unwrappedReader( + cx, + UnwrapAndTypeCheckThis(cx, args, "get closed")); + if (!unwrappedReader) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 2: Return this.[[closedPromise]]. + Rooted closedPromise(cx, unwrappedReader->closedPromise()); + if (!cx->compartment()->wrap(cx, &closedPromise)) { + return false; + } + + args.rval().setObject(*closedPromise); + return true; +} + +/** + * https://streams.spec.whatwg.org/#rs-cancel + */ +static bool ReadableStreamBYOBReader_cancel(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsReadableStreamBYOBReader(this) is false, return a promise + // rejected with a TypeError exception. + Rooted unwrappedReader( + cx, UnwrapAndTypeCheckThis(cx, args, "cancel")); + if (!unwrappedReader) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 2: If this.[[ownerReadableStream]] is undefined, return a promise + // rejected with a TypeError exception. + if (!unwrappedReader->hasStream()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMREADER_NOT_OWNED, "cancel"); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 3: Return ! ReadableStreamReaderGenericCancel(this, reason). + JSObject* cancelPromise = + ReadableStreamReaderGenericCancel(cx, unwrappedReader, args.get(0)); + if (!cancelPromise) { + return false; + } + args.rval().setObject(*cancelPromise); + return true; +} + +/** + * https://streams.spec.whatwg.org/#byob-reader-read + */ +static bool ReadableStreamBYOBReader_read(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Handle view = args.get(0); + + if (!view.isObject() || !(JS_IsArrayBufferViewObject(&view.toObject()) || + JS::IsArrayBufferObject(&view.toObject()))) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREADER_READ_NOT_BUFFER); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + RootedObject viewBuffer(cx, &view.toObject()); + uint8_t* data; + bool is_shared; + bool detached; + size_t len = 0; + + if (JS_IsArrayBufferViewObject(viewBuffer)) { + js::GetArrayBufferViewLengthAndData(viewBuffer, &len, &is_shared, &data); + detached = viewBuffer->maybeUnwrapAs() + ->hasDetachedBuffer(); + } else { + JS::GetArrayBufferLengthAndData(viewBuffer, &len, &is_shared, &data); + detached = viewBuffer->maybeUnwrapAs()->isDetached(); + } + + if (len == 0) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREADER_READ_EMPTY_VIEW); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + if (detached) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREADER_READ_DETACHED); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + Rooted unwrappedReader( + cx, UnwrapAndTypeCheckThis(cx, args, "read")); + if (!unwrappedReader) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + if (!unwrappedReader->hasStream()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMREADER_NOT_OWNED, "read"); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + PromiseObject* readPromise = + js::ReadableStreamBYOBReaderRead(cx, unwrappedReader, viewBuffer); + if (!readPromise) { + return false; + } + args.rval().setObject(*readPromise); + + return true; +} + +/** + * https://streams.spec.whatwg.org/#abstract-opdef-readablestreambyobreaderrelease + */ +static bool ReadableStreamBYOBReader_releaseLock(JSContext* cx, unsigned argc, + Value* vp) { + // If ! IsReadableStreamBYOBReader(this) is false, throw a TypeError + // exception. + CallArgs args = CallArgsFromVp(argc, vp); + Rooted reader( + cx, UnwrapAndTypeCheckThis(cx, args, + "releaseLock")); + if (!reader) { + return false; + } + + // If this.[[ownerReadableStream]] is undefined, return. + if (!reader->hasStream()) { + args.rval().setUndefined(); + return true; + } + + // Perform ! ReadableStreamReaderGenericRelease(reader). + if (!js::ReadableStreamReaderGenericRelease(cx, reader)) { + return false; + } + + // Let e be a new TypeError exception. + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMREADER_RELEASED); + JS::RootedValue e(cx); + Rooted stack(cx); + if (!cx->isExceptionPending() || + !GetAndClearExceptionAndStack(cx, &e, &stack)) { + // Uncatchable error. Die immediately without erroring the + // stream. + return false; + } + + // Perform ! ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e). + if (!js::ReadableStreamReaderErrorReadOrReadIntoRequests(cx, reader, e)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +/** + * https://streams.spec.whatwg.org/#readable-stream-byob-reader-read + */ +PromiseObject* js::ReadableStreamBYOBReaderRead( + JSContext* cx, Handle unwrappedReader, + Handle view) { + Rooted unwrappedStream( + cx, UnwrapStreamFromReader(cx, unwrappedReader)); + if (!unwrappedStream) { + return nullptr; + } + + unwrappedStream->setDisturbed(); + + if (unwrappedStream->errored()) { + Rooted storedError(cx, unwrappedStream->storedError()); + if (!cx->compartment()->wrap(cx, &storedError)) { + return nullptr; + } + return PromiseObject::unforgeableReject(cx, storedError); + } + + Rooted unwrappedController( + cx, &unwrappedStream->controller()->as()); + + // https://streams.spec.whatwg.org/#readable-byte-stream-controller-pull-into + + // Let stream be controller.[[stream]]. + + // Let elementSize be 1. + uint32_t elementSize = 1; + + // Let ctor be %DataView%. + Rooted ctor(cx); + + // If view has a [[TypedArrayName]] internal slot (i.e., it is not a + // DataView), + if (JS_IsTypedArrayObject(view)) { + // Set elementSize to the element size specified in the typed array + // constructors table for view.[[TypedArrayName]]. + JS::Scalar::Type type = JS_GetArrayBufferViewType(view); + elementSize = JS::Scalar::byteSize(type); + + // Set ctor to the constructor specified in the typed array constructors + // table for view.[[TypedArrayName]]. + switch (type) { + case JS::Scalar::Type::Uint8Clamped: + ctor.set(cx->global()->getOrCreateConstructor(cx, JSProto_Uint8ClampedArray)); + break; + case JS::Scalar::Type::Int8: + ctor.set(cx->global()->getOrCreateConstructor(cx, JSProto_Int8Array)); + break; + case JS::Scalar::Type::Uint8: + ctor.set(cx->global()->getOrCreateConstructor(cx, JSProto_Uint8Array)); + break; + case JS::Scalar::Type::Int16: + ctor.set(cx->global()->getOrCreateConstructor(cx, JSProto_Int16Array)); + break; + case JS::Scalar::Type::Uint16: + ctor.set(cx->global()->getOrCreateConstructor(cx, JSProto_Uint16Array)); + break; + case JS::Scalar::Type::Int32: + ctor.set(cx->global()->getOrCreateConstructor(cx, JSProto_Int32Array)); + break; + case JS::Scalar::Type::Uint32: + ctor.set(cx->global()->getOrCreateConstructor(cx, JSProto_Uint32Array)); + break; + case JS::Scalar::Type::Float16: + ctor.set(cx->global()->getOrCreateConstructor(cx, JSProto_Float16Array)); + break; + case JS::Scalar::Type::Float32: + ctor.set(cx->global()->getOrCreateConstructor(cx, JSProto_Float32Array)); + break; + case JS::Scalar::Type::Float64: + ctor.set(cx->global()->getOrCreateConstructor(cx, JSProto_Float64Array)); + break; + case JS::Scalar::Type::BigInt64: + ctor.set(cx->global()->getOrCreateConstructor(cx, JSProto_BigInt64Array)); + break; + case JS::Scalar::Type::BigUint64: + ctor.set(cx->global()->getOrCreateConstructor(cx, JSProto_BigUint64Array)); + break; + + case JS::Scalar::Type::MaxTypedArrayViewType: + case JS::Scalar::Type::Int64: + case JS::Scalar::Type::Simd128: + return nullptr; + } + } + + // Let byteOffset be view.[[ByteOffset]]. + size_t byteOffset = JS_GetArrayBufferViewByteOffset(view); + + // Let byteLength be view.[[ByteLength]]. + size_t byteLength = JS_GetArrayBufferViewByteLength(view); + + // Let bufferResult be TransferArrayBuffer(view.[[ViewedArrayBuffer]]). + bool isShared; + Rooted viewedArrayBuffer( + cx, JS_GetArrayBufferViewBuffer(cx, view, &isShared)); + if (!viewedArrayBuffer) { + return PromiseRejectedWithPendingError(cx); + } + Rooted bufferResult(cx, + TransferArrayBuffer(cx, viewedArrayBuffer)); + + // If bufferResult is an abrupt completion, + if (!bufferResult) { + return PromiseRejectedWithPendingError(cx); + } + + // Let buffer be bufferResult.[[Value]]. + + // Let pullIntoDescriptor be a new pull-into descriptor with buffer buffer, + // buffer byte length buffer.[[ArrayBufferByteLength]], byte offset + // byteOffset, byte length byteLength, bytes filled 0, element size + // elementSize, view constructor ctor, and reader type "byob". + Rooted buffer(cx, &bufferResult->as()); + Rooted pullIntoDescriptor( + cx, PullIntoDescriptor::create(cx, buffer, byteOffset, byteLength, 0, + elementSize, ctor, ReaderType::BYOB)); + if (!pullIntoDescriptor) { + return PromiseRejectedWithPendingError(cx); + } + + // If controller.[[pendingPullIntos]] is not empty, + if (unwrappedController->pendingPullIntos()->length() > 0) { + // Append pullIntoDescriptor to controller.[[pendingPullIntos]]. + Rooted pullIntoDescriptorVal(cx); + pullIntoDescriptorVal.setObject(*pullIntoDescriptor); + if (!unwrappedController->pendingPullIntos()->append( + cx, pullIntoDescriptorVal)) { + return nullptr; + } + + // Perform ! ReadableStreamAddReadIntoRequest(stream, readIntoRequest). + // Return. + return ReadableStreamAddReadOrReadIntoRequest(cx, unwrappedStream); + } + + // If stream.[[state]] is "closed", + if (unwrappedStream->closed()) { + // Let emptyView be ! Construct(ctor, « pullIntoDescriptor’s buffer, + // pullIntoDescriptor’s byte offset, 0 »). + RootedValueArray<3> args(cx); + args[0].setObject(*pullIntoDescriptor->buffer()); + args[1].setInt32(pullIntoDescriptor->byteOffset()); + args[2].setInt32(0); + + Rooted obj(cx); + RootedValue ctorVal(cx); + ctorVal.setObject(*ctor); + if (!JS::Construct(cx, ctorVal, args, &obj)) { + return PromiseRejectedWithPendingError(cx); + } + if (!obj) { + return nullptr; + } + + // Perform readIntoRequest’s close steps, given emptyView. + RootedValue objVal(cx); + objVal.setObject(*obj); + PlainObject* iterResult = ReadableStreamCreateReadResult( + cx, objVal, true, unwrappedReader->forAuthorCode()); + if (!iterResult) { + return nullptr; + } + + Rooted iterResultVal(cx, JS::ObjectValue(*iterResult)); + return PromiseObject::unforgeableResolveWithNonPromise(cx, iterResultVal); + } + + // If controller.[[queueTotalSize]] > 0, + if (unwrappedController->queueTotalSize() > 0) { + // If ! + // ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, + // pullIntoDescriptor) is true, + bool ready; + if (!js::ReadableByteStreamControllerFillPullIntoDescriptorFromQueue( + cx, unwrappedController, pullIntoDescriptor, &ready)) { + return nullptr; + } + if (ready) { + // Let filledView be ! + // ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor). + Rooted view( + cx, ReadableByteStreamControllerConvertPullIntoDescriptor( + cx, pullIntoDescriptor)); + + // Perform ! ReadableByteStreamControllerHandleQueueDrain(controller). + if (!ReadableByteStreamControllerHandleQueueDrain(cx, + unwrappedController)) { + return nullptr; + } + + // Perform readIntoRequest’s chunk steps, given filledView. + RootedValue objVal(cx); + objVal.setObject(*view); + PlainObject* iterResult = ReadableStreamCreateReadResult( + cx, objVal, false, unwrappedReader->forAuthorCode()); + if (!iterResult) { + return nullptr; + } + + // Return. + Rooted iterResultVal(cx, JS::ObjectValue(*iterResult)); + return PromiseObject::unforgeableResolveWithNonPromise(cx, iterResultVal); + } + // If controller.[[closeRequested]] is true, + if (unwrappedController->closeRequested()) { + // Let e be a TypeError exception. + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMCONTROLLER_CLOSED, "read"); + Rooted exn(cx); + Rooted stack(cx); + if (!cx->isExceptionPending() || + !GetAndClearExceptionAndStack(cx, &exn, &stack)) { + return nullptr; + } + // Perform ! ReadableByteStreamControllerError(controller, e). + if (!ReadableStreamControllerError(cx, unwrappedController, exn)) { + return nullptr; + } + + // Perform readIntoRequest’s error steps, given e. + // Return. + Rooted storedError(cx, unwrappedStream->storedError()); + if (!cx->compartment()->wrap(cx, &storedError)) { + return nullptr; + } + return PromiseObject::unforgeableReject(cx, storedError); + } + } + + // Append pullIntoDescriptor to controller.[[pendingPullIntos]]. + Rooted pullIntoDescriptorVal(cx); + pullIntoDescriptorVal.setObject(*pullIntoDescriptor); + if (!unwrappedController->pendingPullIntos()->append(cx, + pullIntoDescriptorVal)) { + return nullptr; + } + + // Perform ! ReadableStreamAddReadIntoRequest(stream, readIntoRequest). + PromiseObject* promise = + ReadableStreamAddReadOrReadIntoRequest(cx, unwrappedStream); + + // Perform ! ReadableByteStreamControllerCallPullIfNeeded(controller). + if (!ReadableStreamControllerCallPullIfNeeded(cx, unwrappedController)) { + return nullptr; + } + + return promise; +} + +static const JSFunctionSpec ReadableStreamBYOBReader_methods[] = { + JS_FN("cancel", ReadableStreamBYOBReader_cancel, 1, 0), + JS_FN("read", ReadableStreamBYOBReader_read, 0, 0), + JS_FN("releaseLock", ReadableStreamBYOBReader_releaseLock, 0, 0), + JS_FS_END}; + +static const JSPropertySpec ReadableStreamBYOBReader_properties[] = { + JS_PSG("closed", ReadableStreamBYOBReader_closed, 0), JS_PS_END}; + +JS_STREAMS_CLASS_SPEC(ReadableStreamBYOBReader, 1, + ReadableByteStreamController::Slots::SlotCount, 0, 0, + JS_NULL_CLASS_OPS); diff --git a/js/src/builtin/streams/ReadableStreamBYOBRequest.cpp b/js/src/builtin/streams/ReadableStreamBYOBRequest.cpp new file mode 100644 index 0000000000000..2bdd911360f07 --- /dev/null +++ b/js/src/builtin/streams/ReadableStreamBYOBRequest.cpp @@ -0,0 +1,261 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* + * Class ReadableStreamBYOBRequest. + */ + +#include "builtin/streams/ReadableStreamBYOBRequest.h" // js::ReadableStream +#include "builtin/streams/ClassSpecMacro.h" // JS_STREAMS_CLASS_SPEC +#include "builtin/streams/MiscellaneousOperations.h" // js::TransferArrayBuffer +#include "builtin/streams/PullIntoDescriptor.h" // js::PullIntoDescriptor +#include "builtin/streams/ReadableByteStreamControllerOperations.h" // js::ReadableByteStreamControllerRespondInternal +#include "builtin/streams/ReadableStreamController.h" // js::ReadableByteStreamController +#include "js/ErrorReport.h" // JS_ReportErrorNumberASCII +#include "js/experimental/TypedData.h" // JS_GetArrayBufferViewData, JS_IsUint8Array +#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* +#include "js/PropertySpec.h" +#include "vm/ArrayBufferViewObject.h" // js::UnwrapArrayBufferView +#include "vm/PromiseObject.h" // js::UnwrapAndTypeCheckThis + +#include "builtin/streams/ReadableStreamReader-inl.h" +#include "vm/Compartment-inl.h" // js::UnwrapAndTypeCheckThis +#include "vm/Compartment-inl.h" // JS::Compartment::wrap, js::UnwrapAnd{DowncastObject,TypeCheckThis} +#include "vm/JSObject-inl.h" // js::NewObjectWithClassProto +#include "vm/NativeObject-inl.h" // js::ThrowIfNotConstructing + +using JS::CallArgs; +using JS::Handle; +using JS::Rooted; +using JS::RootedObject; +using JS::RootedValue; +using JS::Value; + +using js::GetErrorMessage; +using js::ListObject; +using js::NewObjectWithClassProto; +using js::PromiseObject; +using js::PullIntoDescriptor; +using js::ReadableByteStreamController; +using js::ReadableStream; +using js::ReadableStreamBYOBRequest; +using js::ReadableStreamReader; +using js::TransferArrayBuffer; +using js::UnwrapAndDowncastObject; +using js::UnwrapAndTypeCheckThis; + +bool ReadableStreamBYOBRequest::constructor(JSContext* cx, unsigned argc, + Value* vp) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_BOGUS_CONSTRUCTOR, + "ReadableStreamBYOBRequest"); + return false; +} + +// https://streams.spec.whatwg.org/#rs-byob-request-view +static bool ReadableStreamBYOBRequest_view(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted unwrappedRequest( + cx, + UnwrapAndTypeCheckThis(cx, args, "get view")); + if (!unwrappedRequest) { + return false; + } + args.rval().set(unwrappedRequest->view()); + return true; +} + +// https://streams.spec.whatwg.org/#rs-byob-request-respond +[[nodiscard]] static bool ReadableStreamBYOBRequest_respond(JSContext* cx, + unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + if (!args.get(0).isNumber() || !(args.get(0).toNumber() >= 0)) { + JS_ReportErrorNumberASCII( + cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_INVALID_WRITTEN_LEN); + return false; + } + + Rooted unwrappedRequest( + cx, + UnwrapAndTypeCheckThis(cx, args, "respond")); + if (!unwrappedRequest) { + return false; + } + + // If this.[[controller]] is undefined, throw a TypeError exception. + if (!unwrappedRequest->hasController()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREQUEST_NO_CONTROLLER, + "respond()"); + return false; + } + + uint64_t bytesWritten = args.get(0).toNumber(); + if (args.get(0).toNumber() - bytesWritten != 0) { + JS_ReportErrorNumberASCII( + cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_INVALID_WRITTEN_LEN); + return false; + } + + bool isShared; + RootedObject viewObj(cx, &unwrappedRequest->view().toObject()); + JS::Rooted buffer( + cx, JS_GetArrayBufferViewBuffer(cx, viewObj, &isShared)); + + if (!buffer) { + return false; + } + + size_t len = 0; + uint8_t* data; + JS::GetArrayBufferLengthAndData(buffer, &len, &isShared, &data); + + // If ! IsDetachedBuffer(this.[[view]].[[ArrayBuffer]]) is true, throw a + // TypeError exception. + if (buffer->maybeUnwrapAs()->isDetached()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_DETACHED); + return false; + } + + Rooted controller( + cx, unwrappedRequest->controller()); + + // Assert: this.[[view]].[[ByteLength]] > 0. + // Assert: this.[[view]].[[ViewedArrayBuffer]].[[ByteLength]] > 0. + // MOZ_ASSERT(len > 0); + + Rooted unwrappedPendingPullIntos(cx, + controller->pendingPullIntos()); + + // Assert: controller.[[pendingPullIntos]] is not empty. + MOZ_ASSERT(unwrappedPendingPullIntos->length() > 0); + + // Let firstDescriptor be controller.[[pendingPullIntos]][0]. + Rooted firstDescriptor( + cx, UnwrapAndDowncastObject( + cx, &unwrappedPendingPullIntos->get(0).toObject())); + + // If state is "closed", + if (controller->stream()->closed()) { + // If bytesWritten is not 0, throw a TypeError exception. + if (bytesWritten != 0) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_CLOSED); + return false; + } + } else { + // Assert: state is "readable". + MOZ_ASSERT(controller->stream()->readable()); + + // If bytesWritten is 0, throw a TypeError exception. + if (bytesWritten == 0) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_ZERO); + return false; + } + + // If firstDescriptor’s bytes filled + bytesWritten > firstDescriptor’s byte + // length, throw a RangeError exception. + if (firstDescriptor->bytesFilled() + bytesWritten > + firstDescriptor->byteLength()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_EXCEED); + return false; + } + } + + // Set firstDescriptor’s buffer to ? + // TransferArrayBuffer(view.[[ViewedArrayBuffer]]). + JS::Rooted transferredBuffer(cx, TransferArrayBuffer(cx, buffer)); + if (!transferredBuffer) { + return false; + } + firstDescriptor->setBuffer(transferredBuffer); + + // Perform ? ReadableByteStreamControllerRespondInternal(controller, + // bytesWritten). + return ReadableByteStreamControllerRespondInternal(cx, controller, + bytesWritten); +} + +// https://streams.spec.whatwg.org/#rs-byob-request-respond-with-new-view +static bool ReadableStreamBYOBRequest_respondWithNewView(JSContext* cx, + unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + if (!args.get(0).isObject()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLEBYTESTREAMCONTROLLER_NO_VIEW, + "respondWithNewView"); + return false; + } + + Rooted view(cx, &args.get(0).toObject()); + + if (!JS_IsArrayBufferViewObject(view)) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLEBYTESTREAMCONTROLLER_NO_VIEW, + "respondWithNewView"); + return false; + } + + Rooted unwrappedRequest( + cx, UnwrapAndTypeCheckThis( + cx, args, "respondWithNewView")); + if (!unwrappedRequest) { + return false; + } + + // If this.[[controller]] is undefined, throw a TypeError exception. + if (!unwrappedRequest->hasController()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREQUEST_NO_CONTROLLER, + "respondWithNewView()"); + return false; + } + + Rooted controller( + cx, unwrappedRequest->controller()); + + // If ! IsDetachedBuffer(view.[[ViewedArrayBuffer]]) is true, throw a + // TypeError exception. + bool isShared; + Rooted viewedArrayBuffer( + cx, JS_GetArrayBufferViewBuffer(cx, view, &isShared)); + + if (viewedArrayBuffer->maybeUnwrapAs()->isDetached()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMBYOBREQUEST_RESPOND_DETACHED); + return false; + } + + // Return ? + // ReadableByteStreamControllerRespondWithNewView(this.[[controller]], view). + if (!ReadableByteStreamControllerRespondWithNewView(cx, controller, view)) { + return false; + } + return true; +} + +static const JSPropertySpec ReadableStreamBYOBRequest_properties[] = { + JS_PSG("view", ReadableStreamBYOBRequest_view, 0), JS_PS_END}; + +static const JSFunctionSpec ReadableStreamBYOBRequest_methods[] = { + JS_FN("respond", ReadableStreamBYOBRequest_respond, 1, 0), + JS_FN("respondWithNewView", ReadableStreamBYOBRequest_respondWithNewView, 1, + 0), + JS_FS_END}; + +JS_STREAMS_CLASS_SPEC(ReadableStreamBYOBRequest, 0, + ReadableStreamBYOBRequest::SlotCount, 0, 0, + JS_NULL_CLASS_OPS); diff --git a/js/src/builtin/streams/ReadableStreamBYOBRequest.h b/js/src/builtin/streams/ReadableStreamBYOBRequest.h new file mode 100644 index 0000000000000..28a7e7f37a12a --- /dev/null +++ b/js/src/builtin/streams/ReadableStreamBYOBRequest.h @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* ReadableStream controller classes and functions. */ + +#ifndef builtin_streams_ReadableStreamBYOBRequest_h +#define builtin_streams_ReadableStreamBYOBRequest_h + +#include "mozilla/Assertions.h" // MOZ_ASSERT +#include "mozilla/Maybe.h" // mozilla::Maybe, mozilla::Some + +#include // uint32_t + +#include "js/Class.h" // JSClass, js::ClassSpec +#include "js/RootingAPI.h" // JS::Handle +#include "js/Value.h" // JS::Value, JS::{Number,Object,Private,Undefined}Value, JS::UndefinedHandleValue +#include "vm/List.h" // js::ListObject +#include "vm/NativeObject.h" // js::NativeObject + +class JS_PUBLIC_API JSObject; + +namespace js { + +class PromiseObject; +class ReadableByteStreamController; + +class ReadableStreamBYOBRequest : public NativeObject { + public: + enum Slots { + /** + * Optional pointer to make the stream participate in Gecko's cycle + * collection. See also JSCLASS_SLOT0_IS_NSISUPPORTS. + */ + Slot_ISupports, + Slot_Controller, + Slot_View, + SlotCount + }; + + inline ReadableByteStreamController* controller() const; + inline void setController(ReadableByteStreamController* controller); + inline bool hasController(); + void clearController() { + setFixedSlot(Slot_Controller, JS::UndefinedValue()); + } + + JS::Value view() const { return getFixedSlot(Slot_View); } + void setView(const JS::Value& view) { setFixedSlot(Slot_View, view); } + void clearView() { setFixedSlot(Slot_View, JS::NullValue()); } + + static bool constructor(JSContext* cx, unsigned argc, JS::Value* vp); + static const ClassSpec classSpec_; + static const JSClass class_; + static const ClassSpec protoClassSpec_; + static const JSClass protoClass_; +}; + +} // namespace js + +#endif // builtin_streams_ReadableStreamsBYOBRequest_h diff --git a/js/src/builtin/streams/ReadableStreamController.h b/js/src/builtin/streams/ReadableStreamController.h new file mode 100644 index 0000000000000..7e22f8f19f338 --- /dev/null +++ b/js/src/builtin/streams/ReadableStreamController.h @@ -0,0 +1,346 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* ReadableStream controller classes and functions. */ + +#ifndef builtin_streams_ReadableStreamController_h +#define builtin_streams_ReadableStreamController_h + +#include "mozilla/Assertions.h" // MOZ_ASSERT +#include "mozilla/Maybe.h" // mozilla::Maybe, mozilla::Some + +#include // uint32_t + +#include "builtin/streams/ReadableStream.h" // js::ReadableStream +#include "builtin/streams/ReadableStreamBYOBRequest.h" // js::ReadableStreamBYOBRequest +#include "builtin/streams/StreamController.h" // js::StreamController +#include "js/Class.h" // JSClass, js::ClassSpec +#include "js/RootingAPI.h" // JS::Handle +#include "js/Stream.h" // JS::ReadableStreamUnderlyingSource +#include "js/Value.h" // JS::Value, JS::{Number,Object,Private,Undefined}Value, JS::UndefinedHandleValue +#include "vm/ArrayBufferObject.h" +#include "vm/List.h" // js::ListObject +#include "vm/NativeObject.h" // js::NativeObject + +namespace js { + +class PromiseObject; +class ReadableStreamBYOBRequest; + +class ReadableStreamController : public StreamController { + public: + /** + * Memory layout for ReadableStream controllers, starting after the slots + * reserved for queue container usage. + * + * Storage of the internal slots listed in the standard is fairly + * straightforward except for [[pullAlgorithm]] and [[cancelAlgorithm]]. + * These algorithms are not stored as JSFunction objects. Rather, there are + * three cases: + * + * - Streams created with `new ReadableStream`: The methods are stored + * in Slot_PullMethod and Slot_CancelMethod. The underlying source + * object (`this` for these methods) is in Slot_UnderlyingSource. + * + * - External source streams. Slot_UnderlyingSource is a PrivateValue + * pointing to the JS::ReadableStreamUnderlyingSource object. The + * algorithms are implemented using the .pull() and .cancel() methods + * of that object. Slot_Pull/CancelMethod are undefined. + * + * - Tee streams. Slot_UnderlyingSource is a TeeState object. The + * pull/cancel algorithms are implemented as separate functions in + * Stream.cpp. Slot_Pull/CancelMethod are undefined. + * + * UnderlyingSource, PullMethod, and CancelMethod can be wrappers to objects + * in other compartments. + * + * StrategyHWM and Flags are both primitive (numeric) values. + */ + enum Slots { + Slot_Stream = StreamController::SlotCount, + Slot_UnderlyingSource, + Slot_PullMethod, + Slot_CancelMethod, + Slot_StrategyHWM, + Slot_Flags, + SlotCount + }; + + enum ControllerFlags { + Flag_Started = 1 << 0, + Flag_Pulling = 1 << 1, + Flag_PullAgain = 1 << 2, + Flag_CloseRequested = 1 << 3, + Flag_TeeBranch1 = 1 << 4, + Flag_TeeBranch2 = 1 << 5, + Flag_ExternalSource = 1 << 6, + Flag_SourceLocked = 1 << 7, + }; + + ReadableStream* stream() const { + return &getFixedSlot(Slot_Stream).toObject().as(); + } + void setStream(ReadableStream* stream) { + setFixedSlot(Slot_Stream, JS::ObjectValue(*stream)); + } + JS::Value underlyingSource() const { + return getFixedSlot(Slot_UnderlyingSource); + } + void setUnderlyingSource(const JS::Value& underlyingSource) { + setFixedSlot(Slot_UnderlyingSource, underlyingSource); + } + JS::Value pullMethod() const { return getFixedSlot(Slot_PullMethod); } + void setPullMethod(const JS::Value& pullMethod) { + setFixedSlot(Slot_PullMethod, pullMethod); + } + JS::Value cancelMethod() const { return getFixedSlot(Slot_CancelMethod); } + void setCancelMethod(const JS::Value& cancelMethod) { + setFixedSlot(Slot_CancelMethod, cancelMethod); + } + JS::ReadableStreamUnderlyingSource* externalSource() const { + static_assert(alignof(JS::ReadableStreamUnderlyingSource) >= 2, + "External underling sources are stored as PrivateValues, " + "so they must have even addresses"); + MOZ_ASSERT(hasExternalSource()); + return static_cast( + underlyingSource().toPrivate()); + } + void setExternalSource(JS::ReadableStreamUnderlyingSource* underlyingSource) { + setUnderlyingSource(JS::PrivateValue(underlyingSource)); + addFlags(Flag_ExternalSource); + } + static void clearUnderlyingSource( + JS::Handle controller, + bool finalizeSource = true) { + if (controller->hasExternalSource()) { + if (finalizeSource) { + controller->externalSource()->finalize(); + } + controller->setFlags(controller->flags() & ~Flag_ExternalSource); + } + controller->setUnderlyingSource(JS::UndefinedHandleValue); + } + double strategyHWM() const { + return getFixedSlot(Slot_StrategyHWM).toNumber(); + } + void setStrategyHWM(double highWaterMark) { + setFixedSlot(Slot_StrategyHWM, NumberValue(highWaterMark)); + } + uint32_t flags() const { return getFixedSlot(Slot_Flags).toInt32(); } + void setFlags(uint32_t flags) { setFixedSlot(Slot_Flags, Int32Value(flags)); } + void addFlags(uint32_t flags) { setFlags(this->flags() | flags); } + void removeFlags(uint32_t flags) { setFlags(this->flags() & ~flags); } + bool started() const { return flags() & Flag_Started; } + void setStarted() { addFlags(Flag_Started); } + bool pulling() const { return flags() & Flag_Pulling; } + void setPulling() { addFlags(Flag_Pulling); } + void clearPullFlags() { removeFlags(Flag_Pulling | Flag_PullAgain); } + bool pullAgain() const { return flags() & Flag_PullAgain; } + void setPullAgain() { addFlags(Flag_PullAgain); } + bool closeRequested() const { return flags() & Flag_CloseRequested; } + void setCloseRequested() { addFlags(Flag_CloseRequested); } + bool isTeeBranch1() const { return flags() & Flag_TeeBranch1; } + void setTeeBranch1() { + MOZ_ASSERT(!isTeeBranch2()); + addFlags(Flag_TeeBranch1); + } + bool isTeeBranch2() const { return flags() & Flag_TeeBranch2; } + void setTeeBranch2() { + MOZ_ASSERT(!isTeeBranch1()); + addFlags(Flag_TeeBranch2); + } + bool hasExternalSource() const { return flags() & Flag_ExternalSource; } + bool sourceLocked() const { return flags() & Flag_SourceLocked; } + void setSourceLocked() { addFlags(Flag_SourceLocked); } + void clearSourceLocked() { removeFlags(Flag_SourceLocked); } +}; + +class ReadableStreamDefaultController : public ReadableStreamController { + private: + /** + * Memory layout for ReadableStreamDefaultControllers, starting after the + * slots shared among all types of controllers. + * + * StrategySize is treated as an opaque value when stored. The only use site + * ensures that it's wrapped into the current cx compartment. + */ + enum Slots { + Slot_StrategySize = ReadableStreamController::SlotCount, + SlotCount + }; + + public: + JS::Value strategySize() const { return getFixedSlot(Slot_StrategySize); } + void setStrategySize(const JS::Value& size) { + setFixedSlot(Slot_StrategySize, size); + } + + static bool constructor(JSContext* cx, unsigned argc, JS::Value* vp); + static const ClassSpec classSpec_; + static const JSClass class_; + static const ClassSpec protoClassSpec_; + static const JSClass protoClass_; +}; + +class ReadableByteStreamController : public ReadableStreamController { + public: + /** + * Memory layout for ReadableByteStreamControllers, starting after the + * slots shared among all types of controllers. + * + * PendingPullIntos is guaranteed to be in the same compartment as the + * controller, but might contain wrappers for objects from other + * compartments. + * + * AutoAllocateSize is a primitive (numeric) value. + */ + enum Slots { + Slot_BYOBRequest = ReadableStreamController::SlotCount, + Slot_PendingPullIntos, + Slot_AutoAllocateSize, + SlotCount + }; + + bool hasByobRequest() const { + return !getFixedSlot(Slot_BYOBRequest).isNullOrUndefined(); + } + JS::Value byobRequest() const { return getFixedSlot(Slot_BYOBRequest); } + void setByobRequest(ReadableStreamBYOBRequest* byobRequest) { + setFixedSlot(Slot_BYOBRequest, JS::ObjectValue(*byobRequest)); + } + void clearByobRequest() { + setFixedSlot(Slot_BYOBRequest, JS::NullValue()); + } + ListObject* pendingPullIntos() const { + return &getFixedSlot(Slot_PendingPullIntos).toObject().as(); + } + void setAutoAllocateChunkSize(uint64_t chunkSize) { + MOZ_ASSERT(chunkSize > 0); + setFixedSlot(Slot_AutoAllocateSize, JS::NumberValue(chunkSize)); + } + void clearAutoAllocateChunkSize() { + setFixedSlot(Slot_AutoAllocateSize, JS::UndefinedValue()); + } + mozilla::Maybe autoAllocateChunkSize() { + if (getFixedSlot(Slot_AutoAllocateSize).isNumber()) { + return mozilla::Some(getFixedSlot(Slot_AutoAllocateSize).toNumber()); + } else { + return mozilla::Nothing(); + } + } + + static bool constructor(JSContext* cx, unsigned argc, JS::Value* vp); + static const ClassSpec classSpec_; + static const JSClass class_; + static const ClassSpec protoClassSpec_; + static const JSClass protoClass_; +}; + +class ByteStreamChunk : public NativeObject { + private: + enum Slots { Slot_Buffer = 0, Slot_ByteOffset, Slot_ByteLength, SlotCount }; + + public: + static const JSClass class_; + + ArrayBufferObject* buffer() { + return &getFixedSlot(Slot_Buffer).toObject().as(); + } + uint32_t byteOffset() { return getFixedSlot(Slot_ByteOffset).toInt32(); } + void setByteOffset(uint32_t offset) { + setFixedSlot(Slot_ByteOffset, Int32Value(offset)); + } + uint32_t byteLength() { return getFixedSlot(Slot_ByteLength).toInt32(); } + void setByteLength(uint32_t length) { + setFixedSlot(Slot_ByteLength, Int32Value(length)); + } + + static ByteStreamChunk* create(JSContext* cx, HandleObject buffer, + uint32_t byteOffset, uint32_t byteLength); +}; + +[[nodiscard]] extern bool CheckReadableStreamControllerCanCloseOrEnqueue( + JSContext* cx, JS::Handle unwrappedController, + const char* action); + +[[nodiscard]] extern JSObject* ReadableStreamControllerCancelSteps( + JSContext* cx, JS::Handle unwrappedController, + JS::Handle reason); + +[[nodiscard]] extern PromiseObject* ReadableStreamDefaultControllerPullSteps( + JSContext* cx, + JS::Handle unwrappedController); + +[[nodiscard]] extern bool ReadableStreamControllerStartHandler(JSContext* cx, + unsigned argc, + JS::Value* vp); + +[[nodiscard]] extern bool ReadableStreamControllerStartFailedHandler( + JSContext* cx, unsigned argc, JS::Value* vp); + +[[nodiscard]] extern bool ReadableByteStreamControllerClearPendingPullIntos( + JSContext* cx, + JS::Handle unwrappedController); + +[[nodiscard]] extern bool ReadableByteStreamControllerClose( + JSContext* cx, + JS::Handle unwrappedController); + +[[nodiscard]] extern PromiseObject* ReadableByteStreamControllerPullSteps( + JSContext* cx, + JS::Handle unwrappedController); + +[[nodiscard]] extern PromiseObject* ReadableByteStreamControllerPullIntoSteps( + JSContext* cx, + JS::Handle unwrappedController); + +[[nodiscard]] extern bool ReadableByteStreamControllerInvalidateBYOBRequest( + JSContext* cx, Handle unwrappedController); + +[[nodiscard]] extern bool ReadableByteStreamControllerHandleQueueDrain( + JSContext* cx, + JS::Handle unwrappedController); + +} // namespace js + +template <> +inline bool JSObject::is() const { + return is() || + is(); +} + +namespace js { + +inline ReadableStreamController* ReadableStream::controller() const { + return &getFixedSlot(Slot_Controller) + .toObject() + .as(); +} + +inline void ReadableStream::setController( + ReadableStreamController* controller) { + setFixedSlot(Slot_Controller, JS::ObjectValue(*controller)); +} + +inline ReadableByteStreamController* ReadableStreamBYOBRequest::controller() + const { + return &getFixedSlot(Slot_Controller) + .toObject() + .as(); +} + +inline void ReadableStreamBYOBRequest::setController( + ReadableByteStreamController* controller) { + setFixedSlot(Slot_Controller, JS::ObjectValue(*controller)); +} + +inline bool ReadableStreamBYOBRequest::hasController() { + return !getFixedSlot(Slot_Controller).isNullOrUndefined(); +} + +} // namespace js + +#endif // builtin_streams_ReadableStreamController_h diff --git a/js/src/builtin/streams/ReadableStreamDefaultController.cpp b/js/src/builtin/streams/ReadableStreamDefaultController.cpp new file mode 100644 index 0000000000000..99e496ddebec6 --- /dev/null +++ b/js/src/builtin/streams/ReadableStreamDefaultController.cpp @@ -0,0 +1,532 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Class ReadableStreamDefaultController. */ + +#include "mozilla/Assertions.h" // MOZ_ASSERT{,_IF} + +#include "jsfriendapi.h" // js::AssertSameCompartment + +#include "builtin/streams/ClassSpecMacro.h" // JS_STREAMS_CLASS_SPEC +#include "builtin/streams/MiscellaneousOperations.h" // js::IsMaybeWrapped +#include "builtin/streams/PullIntoDescriptor.h" // js::PullIntoDescriptor +#include "builtin/streams/QueueWithSizes.h" // js::{DequeueValue,ResetQueue} +#include "builtin/streams/ReadableStream.h" // js::ReadableStream, js::SetUpExternalReadableByteStreamController +#include "builtin/streams/ReadableStreamController.h" // js::ReadableStream{,Default}Controller, js::ReadableByteStreamController, js::CheckReadableStreamControllerCanCloseOrEnqueue, js::ReadableStreamControllerCancelSteps, js::ReadableStreamDefaultControllerPullSteps, js::ReadableStreamControllerStart{,Failed}Handler +#include "builtin/streams/ReadableStreamDefaultControllerOperations.h" // js::ReadableStreamController{CallPullIfNeeded,ClearAlgorithms,Error,GetDesiredSizeUnchecked}, js::ReadableStreamDefaultController{Close,Enqueue} +#include "builtin/streams/ReadableStreamInternals.h" // js::ReadableStream{AddReadOrReadIntoRequest,CloseInternal,CreateReadResult} +#include "builtin/streams/ReadableStreamOperations.h" // js::ReadableStreamTee_Cancel +#include "builtin/streams/ReadableStreamReader.h" // js::ReadableStream{,Default}Reader +#include "builtin/streams/StreamController.h" // js::StreamController +#include "builtin/streams/TeeState.h" // js::TeeState +#include "js/ArrayBuffer.h" // JS::NewArrayBuffer +#include "js/Class.h" // js::ClassSpec +#include "js/ErrorReport.h" // JS_ReportErrorNumberASCII +#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* +#include "js/PropertySpec.h" +#include "vm/Interpreter.h" +#include "vm/JSContext.h" +#include "vm/PlainObject.h" // js::PlainObject +#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined +#include "vm/SelfHosting.h" + +#include "builtin/HandlerFunction-inl.h" // js::TargetFromHandler +#include "builtin/streams/MiscellaneousOperations-inl.h" // js::PromiseCall +#include "builtin/streams/ReadableStreamReader-inl.h" // js::UnwrapReaderFromStream +#include "vm/Compartment-inl.h" // JS::Compartment::wrap, js::UnwrapAnd{DowncastObject,TypeCheckThis} +#include "vm/JSContext-inl.h" // JSContext::check +#include "vm/Realm-inl.h" // js::AutoRealm + +using js::ClassSpec; +using js::PromiseObject; +using js::ReadableStream; +using js::ReadableStreamController; +using js::ReadableStreamControllerCallPullIfNeeded; +using js::ReadableStreamControllerClearAlgorithms; +using js::ReadableStreamControllerError; +using js::ReadableStreamControllerGetDesiredSizeUnchecked; +using js::ReadableStreamDefaultController; +using js::ReadableStreamDefaultControllerClose; +using js::ReadableStreamDefaultControllerEnqueue; +using js::TargetFromHandler; +using js::UnwrapAndTypeCheckThis; + +using JS::CallArgs; +using JS::CallArgsFromVp; +using JS::Handle; +using JS::ObjectValue; +using JS::Rooted; +using JS::Value; + +/*** 3.9. Class ReadableStreamDefaultController *****************************/ + +/** + * Streams spec, 3.10.11. SetUpReadableStreamDefaultController, step 11 + * and + * Streams spec, 3.13.26. SetUpReadableByteStreamController, step 16: + * Upon fulfillment of startPromise, [...] + */ +bool js::ReadableStreamControllerStartHandler(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + Rooted controller( + cx, TargetFromHandler(args)); + + // Step a: Set controller.[[started]] to true. + controller->setStarted(); + + // Step b: Assert: controller.[[pulling]] is false. + MOZ_ASSERT(!controller->pulling()); + + // Step c: Assert: controller.[[pullAgain]] is false. + MOZ_ASSERT(!controller->pullAgain()); + + // Step d: Perform + // ! ReadableStreamDefaultControllerCallPullIfNeeded(controller) + // (or ReadableByteStreamControllerCallPullIfNeeded(controller)). + if (!ReadableStreamControllerCallPullIfNeeded(cx, controller)) { + return false; + } + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 3.10.11. SetUpReadableStreamDefaultController, step 12 + * and + * Streams spec, 3.13.26. SetUpReadableByteStreamController, step 17: + * Upon rejection of startPromise with reason r, [...] + */ +bool js::ReadableStreamControllerStartFailedHandler(JSContext* cx, + unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + Rooted controller( + cx, TargetFromHandler(args)); + + // Step a: Perform + // ! ReadableStreamDefaultControllerError(controller, r) + // (or ReadableByteStreamControllerError(controller, r)). + if (!ReadableStreamControllerError(cx, controller, args.get(0))) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 3.9.3. + * new ReadableStreamDefaultController( stream, underlyingSource, size, + * highWaterMark ) + */ +bool ReadableStreamDefaultController::constructor(JSContext* cx, unsigned argc, + Value* vp) { + // Step 1: Throw a TypeError. + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_BOGUS_CONSTRUCTOR, + "ReadableStreamDefaultController"); + return false; +} + +/** + * Streams spec, 3.9.4.1. get desiredSize + */ +static bool ReadableStreamDefaultController_desiredSize(JSContext* cx, + unsigned argc, + Value* vp) { + // Step 1: If ! IsReadableStreamDefaultController(this) is false, throw a + // TypeError exception. + CallArgs args = CallArgsFromVp(argc, vp); + Rooted unwrappedController( + cx, UnwrapAndTypeCheckThis( + cx, args, "get desiredSize")); + if (!unwrappedController) { + return false; + } + + // 3.10.8. ReadableStreamDefaultControllerGetDesiredSize, steps 1-4. + // 3.10.8. Step 1: Let stream be controller.[[controlledReadableStream]]. + ReadableStream* unwrappedStream = unwrappedController->stream(); + + // 3.10.8. Step 2: Let state be stream.[[state]]. + // 3.10.8. Step 3: If state is "errored", return null. + if (unwrappedStream->errored()) { + args.rval().setNull(); + return true; + } + + // 3.10.8. Step 4: If state is "closed", return 0. + if (unwrappedStream->closed()) { + args.rval().setInt32(0); + return true; + } + + // Step 2: Return ! ReadableStreamDefaultControllerGetDesiredSize(this). + args.rval().setNumber( + ReadableStreamControllerGetDesiredSizeUnchecked(unwrappedController)); + return true; +} + +/** + * Unified implementation of step 2 of 3.9.4.2 and 3.9.4.3, + * and steps 2-3 of 3.11.4.3. + */ +[[nodiscard]] bool js::CheckReadableStreamControllerCanCloseOrEnqueue( + JSContext* cx, Handle unwrappedController, + const char* action) { + // 3.9.4.2. close(), step 2, and + // 3.9.4.3. enqueue(chunk), step 2: + // If ! ReadableStreamDefaultControllerCanCloseOrEnqueue(this) is false, + // throw a TypeError exception. + // RSDCCanCloseOrEnqueue returns false in two cases: (1) + // controller.[[closeRequested]] is true; (2) the stream is not readable, + // i.e. already closed or errored. This amounts to exactly the same thing as + // 3.11.4.3 steps 2-3 below, and we want different error messages for the two + // cases anyway. + + // 3.11.4.3. Step 2: If this.[[closeRequested]] is true, throw a TypeError + // exception. + if (unwrappedController->closeRequested()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMCONTROLLER_CLOSED, action); + return false; + } + + // 3.11.4.3. Step 3: If this.[[controlledReadableByteStream]].[[state]] is + // not "readable", throw a TypeError exception. + ReadableStream* unwrappedStream = unwrappedController->stream(); + if (!unwrappedStream->readable()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMCONTROLLER_NOT_READABLE, + action); + return false; + } + + return true; +} + +/** + * Streams spec, 3.9.4.2 close() + */ +static bool ReadableStreamDefaultController_close(JSContext* cx, unsigned argc, + Value* vp) { + // Step 1: If ! IsReadableStreamDefaultController(this) is false, throw a + // TypeError exception. + CallArgs args = CallArgsFromVp(argc, vp); + Rooted unwrappedController( + cx, UnwrapAndTypeCheckThis(cx, args, + "close")); + if (!unwrappedController) { + return false; + } + + // Step 2: If ! ReadableStreamDefaultControllerCanCloseOrEnqueue(this) is + // false, throw a TypeError exception. + if (!js::CheckReadableStreamControllerCanCloseOrEnqueue( + cx, unwrappedController, "close")) { + return false; + } + + // Step 3: Perform ! ReadableStreamDefaultControllerClose(this). + if (!ReadableStreamDefaultControllerClose(cx, unwrappedController)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 3.9.4.3. enqueue ( chunk ) + */ +static bool ReadableStreamDefaultController_enqueue(JSContext* cx, + unsigned argc, Value* vp) { + // Step 1: If ! IsReadableStreamDefaultController(this) is false, throw a + // TypeError exception. + CallArgs args = CallArgsFromVp(argc, vp); + Rooted unwrappedController( + cx, UnwrapAndTypeCheckThis(cx, args, + "enqueue")); + if (!unwrappedController) { + return false; + } + + // Step 2: If ! ReadableStreamDefaultControllerCanCloseOrEnqueue(this) is + // false, throw a TypeError exception. + if (!js::CheckReadableStreamControllerCanCloseOrEnqueue( + cx, unwrappedController, "enqueue")) { + return false; + } + + // Step 3: Return ! ReadableStreamDefaultControllerEnqueue(this, chunk). + if (!ReadableStreamDefaultControllerEnqueue(cx, unwrappedController, + args.get(0))) { + return false; + } + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 3.9.4.4. error ( e ) + */ +static bool ReadableStreamDefaultController_error(JSContext* cx, unsigned argc, + Value* vp) { + // Step 1: If ! IsReadableStreamDefaultController(this) is false, throw a + // TypeError exception. + CallArgs args = CallArgsFromVp(argc, vp); + Rooted unwrappedController( + cx, UnwrapAndTypeCheckThis(cx, args, + "enqueue")); + if (!unwrappedController) { + return false; + } + + // Step 2: Perform ! ReadableStreamDefaultControllerError(this, e). + if (!ReadableStreamControllerError(cx, unwrappedController, args.get(0))) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +static const JSPropertySpec ReadableStreamDefaultController_properties[] = { + JS_PSG("desiredSize", ReadableStreamDefaultController_desiredSize, 0), + JS_PS_END}; + +static const JSFunctionSpec ReadableStreamDefaultController_methods[] = { + JS_FN("close", ReadableStreamDefaultController_close, 0, 0), + JS_FN("enqueue", ReadableStreamDefaultController_enqueue, 1, 0), + JS_FN("error", ReadableStreamDefaultController_error, 1, 0), JS_FS_END}; + +JS_STREAMS_CLASS_SPEC(ReadableStreamDefaultController, 0, SlotCount, 0, 0, + JS_NULL_CLASS_OPS); + +/** + * Unified implementation of ReadableStream controllers' [[CancelSteps]] + * internal methods. + * Streams spec, 3.9.5.1. [[CancelSteps]] ( reason ) + * and + * Streams spec, 3.11.5.1. [[CancelSteps]] ( reason ) + */ +[[nodiscard]] JSObject* js::ReadableStreamControllerCancelSteps( + JSContext* cx, Handle unwrappedController, + Handle reason) { + AssertSameCompartment(cx, reason); + + // Step 1 of 3.11.5.1: If this.[[pendingPullIntos]] is not empty, + if (!unwrappedController->is()) { + Rooted unwrappedPendingPullIntos( + cx, unwrappedController->as() + .pendingPullIntos()); + + if (unwrappedPendingPullIntos->length() != 0) { + // Step a: Let firstDescriptor be the first element of + // this.[[pendingPullIntos]]. + PullIntoDescriptor* unwrappedDescriptor = + UnwrapAndDowncastObject( + cx, &unwrappedPendingPullIntos->get(0).toObject()); + if (!unwrappedDescriptor) { + return nullptr; + } + + // Step b: Set firstDescriptor.[[bytesFilled]] to 0. + unwrappedDescriptor->setBytesFilled(0); + } + } + + Rooted unwrappedUnderlyingSource( + cx, unwrappedController->underlyingSource()); + + // Step 1 of 3.9.5.1, step 2 of 3.11.5.1: Perform ! ResetQueue(this). + if (!ResetQueue(cx, unwrappedController)) { + return nullptr; + } + + // Step 2 of 3.9.5.1, step 3 of 3.11.5.1: Let result be the result of + // performing this.[[cancelAlgorithm]], passing reason. + // + // Our representation of cancel algorithms is a bit awkward, for + // performance, so we must figure out which algorithm is being invoked. + Rooted result(cx); + if (IsMaybeWrapped(unwrappedUnderlyingSource)) { + // The cancel algorithm given in ReadableStreamTee step 13 or 14. + MOZ_ASSERT(unwrappedUnderlyingSource.toObject().is(), + "tee streams and controllers are always same-compartment with " + "the TeeState object"); + Rooted unwrappedTeeState( + cx, &unwrappedUnderlyingSource.toObject().as()); + Rooted unwrappedDefaultController( + cx, &unwrappedController->as()); + result = ReadableStreamTee_Cancel(cx, unwrappedTeeState, + unwrappedDefaultController, reason); + } else if (unwrappedController->hasExternalSource()) { + // An embedding-provided cancel algorithm. + Rooted rval(cx); + { + AutoRealm ar(cx, unwrappedController); + JS::ReadableStreamUnderlyingSource* source = + unwrappedController->externalSource(); + Rooted stream(cx, unwrappedController->stream()); + Rooted wrappedReason(cx, reason); + if (!cx->compartment()->wrap(cx, &wrappedReason)) { + return nullptr; + } + + cx->check(stream, wrappedReason); + rval = source->cancel(cx, stream, wrappedReason); + } + + // Make sure the ReadableStreamControllerClearAlgorithms call below is + // reached, even on error. + if (!cx->compartment()->wrap(cx, &rval)) { + result = nullptr; + } else { + result = PromiseObject::unforgeableResolve(cx, rval); + } + } else { + // The algorithm created in + // SetUpReadableByteStreamControllerFromUnderlyingSource step 5. + Rooted unwrappedCancelMethod(cx, + unwrappedController->cancelMethod()); + if (unwrappedCancelMethod.isUndefined()) { + // CreateAlgorithmFromUnderlyingMethod step 7. + result = PromiseResolvedWithUndefined(cx); + if (unwrappedController->is()) { + Rooted controller( + cx, &unwrappedController->as()); + + // https://streams.spec.whatwg.org/#rbs-controller-private-cancel + // Perform ! ReadableByteStreamControllerClearPendingPullIntos(this). + if (!ReadableByteStreamControllerClearPendingPullIntos(cx, controller)) { + return nullptr; + } + + // Perform ! ResetQueue(this). + // (already done above) + + // Let result be the result of performing this.[[cancelAlgorithm]], + // passing in reason. + // Return result. + } else { + // CreateAlgorithmFromUnderlyingMethod step 7. + } + } else { + // CreateAlgorithmFromUnderlyingMethod steps 6.c.i-ii. + { + AutoRealm ar(cx, unwrappedController); + + // |unwrappedCancelMethod| and |unwrappedUnderlyingSource| come directly + // from |unwrappedController| slots so must be same-compartment with it. + cx->check(unwrappedCancelMethod); + cx->check(unwrappedUnderlyingSource); + + Rooted wrappedReason(cx, reason); + if (!cx->compartment()->wrap(cx, &wrappedReason)) { + return nullptr; + } + + // If PromiseCall fails, don't bail out until after the + // ReadableStreamControllerClearAlgorithms call below. + result = PromiseCall(cx, unwrappedCancelMethod, + unwrappedUnderlyingSource, wrappedReason); + } + if (!cx->compartment()->wrap(cx, &result)) { + result = nullptr; + } + } + } + + // Step 3 (or 4): Perform + // ! ReadableStreamDefaultControllerClearAlgorithms(this) + // (or ReadableByteStreamControllerClearAlgorithms(this)). + ReadableStreamControllerClearAlgorithms(unwrappedController); + + // Step 4 (or 5): Return result. + return result; +} + +/** + * Streams spec, 3.9.5.2. + * ReadableStreamDefaultController [[PullSteps]]( forAuthorCode ) + */ +PromiseObject* js::ReadableStreamDefaultControllerPullSteps( + JSContext* cx, + Handle unwrappedController) { + // Step 1: Let stream be this.[[controlledReadableStream]]. + Rooted unwrappedStream(cx, unwrappedController->stream()); + + // Step 2: If this.[[queue]] is not empty, + Rooted unwrappedQueue(cx); + Rooted val( + cx, unwrappedController->getFixedSlot(StreamController::Slot_Queue)); + if (val.isObject()) { + unwrappedQueue = &val.toObject().as(); + } + + if (unwrappedQueue && unwrappedQueue->length() != 0) { + // Step a: Let chunk be ! DequeueValue(this). + Rooted chunk(cx); + if (!DequeueValue(cx, unwrappedController, &chunk)) { + return nullptr; + } + + // Step b: If this.[[closeRequested]] is true and this.[[queue]] is empty, + if (unwrappedController->closeRequested() && + unwrappedQueue->length() == 0) { + // Step i: Perform ! ReadableStreamDefaultControllerClearAlgorithms(this). + ReadableStreamControllerClearAlgorithms(unwrappedController); + + // Step ii: Perform ! ReadableStreamClose(stream). + if (!ReadableStreamCloseInternal(cx, unwrappedStream)) { + return nullptr; + } + } + + // Step c: Otherwise, perform + // ! ReadableStreamDefaultControllerCallPullIfNeeded(this). + else { + if (!ReadableStreamControllerCallPullIfNeeded(cx, unwrappedController)) { + return nullptr; + } + } + + // Step d: Return a promise resolved with + // ! ReadableStreamCreateReadResult(chunk, false, forAuthorCode). + cx->check(chunk); + ReadableStreamReader* unwrappedReader = + UnwrapReaderFromStream(cx, unwrappedStream); + if (!unwrappedReader) { + return nullptr; + } + + PlainObject* readResultObj = ReadableStreamCreateReadResult( + cx, chunk, false, unwrappedReader->forAuthorCode()); + if (!readResultObj) { + return nullptr; + } + + Rooted readResult(cx, ObjectValue(*readResultObj)); + return PromiseObject::unforgeableResolveWithNonPromise(cx, readResult); + } + + // Step 3: Let pendingPromise be + // ! ReadableStreamAddReadRequest(stream, forAuthorCode). + Rooted pendingPromise( + cx, ReadableStreamAddReadOrReadIntoRequest(cx, unwrappedStream)); + if (!pendingPromise) { + return nullptr; + } + + // Step 4: Perform ! ReadableStreamDefaultControllerCallPullIfNeeded(this). + if (!ReadableStreamControllerCallPullIfNeeded(cx, unwrappedController)) { + return nullptr; + } + + // Step 5: Return pendingPromise. + return pendingPromise; +} diff --git a/js/src/builtin/streams/ReadableStreamDefaultControllerOperations.cpp b/js/src/builtin/streams/ReadableStreamDefaultControllerOperations.cpp new file mode 100644 index 0000000000000..381802b3d8dec --- /dev/null +++ b/js/src/builtin/streams/ReadableStreamDefaultControllerOperations.cpp @@ -0,0 +1,700 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Readable stream default controller abstract operations. */ + +#include "builtin/streams/ReadableStreamDefaultControllerOperations.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT{,_IF} + +#include "jsfriendapi.h" // js::AssertSameCompartment + +#include "builtin/streams/MiscellaneousOperations.h" // js::CreateAlgorithmFromUnderlyingMethod, js::InvokeOrNoop, js::IsMaybeWrapped +#include "builtin/streams/QueueWithSizes.h" // js::EnqueueValueWithSize, js::ResetQueue +#include "builtin/streams/ReadableStreamController.h" // js::ReadableStream{,Default}Controller, js::ReadableByteStreamController, js::ReadableStreamControllerStart{,Failed}Handler +#include "builtin/streams/ReadableStreamInternals.h" // js::ReadableStream{CloseInternal,ErrorInternal,FulfillReadOrReadIntoRequest,GetNumReadRequests} +#include "builtin/streams/ReadableStreamOperations.h" // js::ReadableStreamTee_Pull, js::SetUpReadableStreamDefaultController +#include "builtin/streams/TeeState.h" // js::TeeState +#include "js/CallAndConstruct.h" // JS::IsCallable +#include "js/CallArgs.h" // JS::CallArgs{,FromVp} +#include "js/Promise.h" // JS::AddPromiseReactions +#include "js/RootingAPI.h" // JS::Handle, JS::Rooted +#include "js/Stream.h" // JS::ReadableStreamUnderlyingSource +#include "js/Value.h" // JS::{,Int32,Object}Value, JS::UndefinedHandleValue +#include "vm/Compartment.h" // JS::Compartment +#include "vm/Interpreter.h" // js::Call, js::GetAndClearExceptionAndStack +#include "vm/JSContext.h" // JSContext +#include "vm/JSObject.h" // JSObject +#include "vm/List.h" // js::ListObject +#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined +#include "vm/Runtime.h" // JSAtomState +#include "vm/SavedFrame.h" // js::SavedFrame + +#include "builtin/HandlerFunction-inl.h" // js::NewHandler +#include "builtin/streams/MiscellaneousOperations-inl.h" // js::PromiseCall +#include "vm/Compartment-inl.h" // JS::Compartment::wrap, js::UnwrapCalleeSlot +#include "vm/JSContext-inl.h" // JSContext::check +#include "vm/JSObject-inl.h" // js::IsCallable, js::NewBuiltinClassInstance +#include "vm/Realm-inl.h" // js::AutoRealm + +using js::ReadableByteStreamController; +using js::ReadableStream; +using js::ReadableStreamController; +using js::ReadableStreamControllerCallPullIfNeeded; +using js::ReadableStreamControllerError; +using js::ReadableStreamGetNumReadRequests; +using js::UnwrapCalleeSlot; + +using JS::CallArgs; +using JS::CallArgsFromVp; +using JS::Handle; +using JS::Rooted; +using JS::UndefinedHandleValue; +using JS::Value; + +/*** 3.10. Readable stream default controller abstract operations ***********/ + +// Streams spec, 3.10.1. IsReadableStreamDefaultController ( x ) +// Implemented via is() + +/** + * Streams spec, 3.10.2 and 3.13.3. step 7: + * Upon fulfillment of pullPromise, [...] + */ +bool DefaultControllerPullHandler(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted unwrappedController( + cx, UnwrapCalleeSlot(cx, args, 0)); + if (!unwrappedController) { + return false; + } + + bool pullAgain = unwrappedController->pullAgain(); + + // Step a: Set controller.[[pulling]] to false. + // Step b.i: Set controller.[[pullAgain]] to false. + unwrappedController->clearPullFlags(); + + // Step b: If controller.[[pullAgain]] is true, + if (pullAgain) { + // Step ii: Perform + // ! ReadableStreamDefaultControllerCallPullIfNeeded(controller) + // (or ReadableByteStreamControllerCallPullIfNeeded(controller)). + if (!ReadableStreamControllerCallPullIfNeeded(cx, unwrappedController)) { + return false; + } + } + + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 3.10.2 and 3.13.3. step 8: + * Upon rejection of pullPromise with reason e, + */ +static bool DefaultControllerPullFailedHandler(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + Handle e = args.get(0); + + Rooted controller( + cx, UnwrapCalleeSlot(cx, args, 0)); + if (!controller) { + return false; + } + + // Step a: Perform ! ReadableStreamDefaultControllerError(controller, e). + // (ReadableByteStreamControllerError in 3.12.3.) + if (!ReadableStreamControllerError(cx, controller, e)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 3.10.2 + * ReadableStreamDefaultControllerCallPullIfNeeded ( controller ) + * ReadableByteStreamControllerCallPullIfNeeded ( controller ) + */ +[[nodiscard]] bool js::ReadableStreamControllerCallPullIfNeeded( + JSContext* cx, Handle unwrappedController) { + // Step 1: Let shouldPull be + // ! ReadableStreamDefaultControllerShouldCallPull(controller). + // (ReadableByteStreamDefaultControllerShouldCallPull in 3.13.3.) + bool shouldPull = + js::ReadableStreamControllerShouldCallPull(cx, unwrappedController); + + // Step 2: If shouldPull is false, return. + if (!shouldPull) { + return true; + } + + // Step 3: If controller.[[pulling]] is true, + if (unwrappedController->pulling()) { + // Step a: Set controller.[[pullAgain]] to true. + unwrappedController->setPullAgain(); + + // Step b: Return. + return true; + } + + // Step 4: Assert: controller.[[pullAgain]] is false. + MOZ_ASSERT(!unwrappedController->pullAgain()); + + // Step 5: Set controller.[[pulling]] to true. + unwrappedController->setPulling(); + + // We use this variable in step 7. For ease of error-handling, we wrap it + // early. + Rooted wrappedController(cx, unwrappedController); + if (!cx->compartment()->wrap(cx, &wrappedController)) { + return false; + } + + // Step 6: Let pullPromise be the result of performing + // controller.[[pullAlgorithm]]. + // Our representation of pull algorithms is a bit awkward, for performance, + // so we must figure out which algorithm is being invoked. + Rooted pullPromise(cx); + Rooted unwrappedUnderlyingSource( + cx, unwrappedController->underlyingSource()); + + if (IsMaybeWrapped(unwrappedUnderlyingSource)) { + // The pull algorithm given in ReadableStreamTee step 12. + MOZ_ASSERT(unwrappedUnderlyingSource.toObject().is(), + "tee streams and controllers are always same-compartment with " + "the TeeState object"); + Rooted unwrappedTeeState( + cx, &unwrappedUnderlyingSource.toObject().as()); + pullPromise = ReadableStreamTee_Pull(cx, unwrappedTeeState); + } else if (unwrappedController->hasExternalSource()) { + // An embedding-provided pull algorithm. + { + AutoRealm ar(cx, unwrappedController); + JS::ReadableStreamUnderlyingSource* source = + unwrappedController->externalSource(); + Rooted stream(cx, unwrappedController->stream()); + double desiredSize = + ReadableStreamControllerGetDesiredSizeUnchecked(unwrappedController); + source->requestData(cx, stream, desiredSize); + } + pullPromise = PromiseResolvedWithUndefined(cx); + } else { + // The pull algorithm created in + // SetUpReadableStreamDefaultControllerFromUnderlyingSource step 4. + Rooted unwrappedPullMethod(cx, unwrappedController->pullMethod()); + if (unwrappedPullMethod.isUndefined()) { + // CreateAlgorithmFromUnderlyingMethod step 7. + pullPromise = PromiseResolvedWithUndefined(cx); + } else { + // CreateAlgorithmFromUnderlyingMethod step 6.b.i. + { + AutoRealm ar(cx, unwrappedController); + + // |unwrappedPullMethod| and |unwrappedUnderlyingSource| come directly + // from |unwrappedController| slots so must be same-compartment with it. + cx->check(unwrappedPullMethod); + cx->check(unwrappedUnderlyingSource); + + Rooted controller(cx, ObjectValue(*unwrappedController)); + cx->check(controller); + + pullPromise = PromiseCall(cx, unwrappedPullMethod, + unwrappedUnderlyingSource, controller); + if (!pullPromise) { + return false; + } + } + if (!cx->compartment()->wrap(cx, &pullPromise)) { + return false; + } + } + } + if (!pullPromise) { + return false; + } + + // Step 7: Upon fulfillment of pullPromise, [...] + // Step 8. Upon rejection of pullPromise with reason e, [...] + Rooted onPullFulfilled( + cx, NewHandler(cx, DefaultControllerPullHandler, wrappedController)); + if (!onPullFulfilled) { + return false; + } + Rooted onPullRejected( + cx, + NewHandler(cx, DefaultControllerPullFailedHandler, wrappedController)); + if (!onPullRejected) { + return false; + } + return JS::AddPromiseReactions(cx, pullPromise, onPullFulfilled, + onPullRejected); +} + +/** + * Streams spec, 3.10.3. + * ReadableStreamDefaultControllerShouldCallPull ( controller ) + * ReadableByteStreamControllerShouldCallPull ( controller ) + */ +[[nodiscard]] bool js::ReadableStreamControllerShouldCallPull( + JSContext* cx, ReadableStreamController* unwrappedController) { + // Step 1: Let stream be controller.[[controlledReadableStream]] + // (or [[controlledReadableByteStream]]). + Rooted unwrappedStream(cx, unwrappedController->stream()); + + // 3.10.3. Step 2: + // If ! ReadableStreamDefaultControllerCanCloseOrEnqueue(controller) + // is false, return false. + // This turns out to be the same as 3.13.25 steps 2-3. + + // 3.13.25 Step 2: If stream.[[state]] is not "readable", return false. + if (!unwrappedStream->readable()) { + return false; + } + + // 3.13.25 Step 3: If controller.[[closeRequested]] is true, return false. + if (unwrappedController->closeRequested()) { + return false; + } + + // Step 3 (or 4): + // If controller.[[started]] is false, return false. + if (!unwrappedController->started()) { + return false; + } + + if (unwrappedController->is()) { + // Default Stream Path + + // 3.10.3. + // Step 4: If ! IsReadableStreamLocked(stream) is true and + // ! ReadableStreamGetNumReadRequests(stream) > 0, return true. + if (unwrappedStream->locked() && + ReadableStreamGetNumReadRequests(unwrappedStream) > 0) { + return true; + } + } else { + // Byte Stream Path + + // If ! ReadableStreamHasDefaultReader(stream) is true and ! + // ReadableStreamGetNumReadRequests(stream) > 0, return true. + + bool hasDefaultReader = false; + if (!js::ReadableStreamHasDefaultReader(cx, unwrappedStream, + &hasDefaultReader)) { + MOZ_ASSERT(false); + } + if (hasDefaultReader && + ReadableStreamGetNumReadRequests(unwrappedStream) > 0) { + return true; + } + + // If ! ReadableStreamHasBYOBReader(stream) is true and ! + // ReadableStreamGetNumReadIntoRequests(stream) > 0, return true. + bool hasBYOBReader = false; + if (!js::ReadableStreamHasBYOBReader(cx, unwrappedStream, &hasBYOBReader)) { + MOZ_ASSERT(false); + } + if (hasBYOBReader && + ReadableStreamGetNumReadRequests(unwrappedStream) > 0) { + return true; + } + } + + // Step 5 (or 7): + // Let desiredSize be + // ! ReadableStreamDefaultControllerGetDesiredSize(controller). + // (ReadableByteStreamControllerGetDesiredSize in 3.13.25.) + double desiredSize = + ReadableStreamControllerGetDesiredSizeUnchecked(unwrappedController); + + // Step 6 (or 8): Assert: desiredSize is not null (implicit). + // Step 7 (or 9): If desiredSize > 0, return true. + // Step 8 (or 10): Return false. + return desiredSize > 0; +} + +/** + * Streams spec, 3.10.4. + * ReadableStreamDefaultControllerClearAlgorithms ( controller ) + * and 3.13.4. + * ReadableByteStreamControllerClearAlgorithms ( controller ) + */ +void js::ReadableStreamControllerClearAlgorithms( + Handle controller) { + // Step 1: Set controller.[[pullAlgorithm]] to undefined. + // Step 2: Set controller.[[cancelAlgorithm]] to undefined. + // (In this implementation, the UnderlyingSource slot is part of the + // representation of these algorithms.) + controller->setPullMethod(UndefinedHandleValue); + controller->setCancelMethod(UndefinedHandleValue); + ReadableStreamController::clearUnderlyingSource(controller); + + // Step 3 (of 3.10.4 only) : Set controller.[[strategySizeAlgorithm]] to + // undefined. + if (controller->is()) { + controller->as().setStrategySize( + UndefinedHandleValue); + } +} + +/** + * Streams spec, 3.10.5. ReadableStreamDefaultControllerClose ( controller ) + */ +[[nodiscard]] bool js::ReadableStreamDefaultControllerClose( + JSContext* cx, + Handle unwrappedController) { + // Step 1: Let stream be controller.[[controlledReadableStream]]. + Rooted unwrappedStream(cx, unwrappedController->stream()); + + // Step 2: Assert: + // ! ReadableStreamDefaultControllerCanCloseOrEnqueue(controller) + // is true. + MOZ_ASSERT(!unwrappedController->closeRequested()); + MOZ_ASSERT(unwrappedStream->readable()); + + // Step 3: Set controller.[[closeRequested]] to true. + unwrappedController->setCloseRequested(); + + // Step 4: If controller.[[queue]] is empty, + Rooted unwrappedQueue(cx, unwrappedController->queue()); + if (unwrappedQueue->length() == 0) { + // Step a: Perform + // ! ReadableStreamDefaultControllerClearAlgorithms(controller). + ReadableStreamControllerClearAlgorithms(unwrappedController); + + // Step b: Perform ! ReadableStreamClose(stream). + return ReadableStreamCloseInternal(cx, unwrappedStream); + } + + return true; +} + +/** + * Streams spec, 3.10.6. + * ReadableStreamDefaultControllerEnqueue ( controller, chunk ) + */ +[[nodiscard]] bool js::ReadableStreamDefaultControllerEnqueue( + JSContext* cx, Handle unwrappedController, + Handle chunk) { + AssertSameCompartment(cx, chunk); + + // Step 1: Let stream be controller.[[controlledReadableStream]]. + Rooted unwrappedStream(cx, unwrappedController->stream()); + + // Step 2: Assert: + // ! ReadableStreamDefaultControllerCanCloseOrEnqueue(controller) is + // true. + MOZ_ASSERT(!unwrappedController->closeRequested()); + MOZ_ASSERT(unwrappedStream->readable()); + + // Step 3: If ! IsReadableStreamLocked(stream) is true and + // ! ReadableStreamGetNumReadRequests(stream) > 0, perform + // ! ReadableStreamFulfillReadRequest(stream, chunk, false). + if (unwrappedStream->locked() && + ReadableStreamGetNumReadRequests(unwrappedStream) > 0) { + if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, unwrappedStream, chunk, + false)) { + return false; + } + } else { + // Step 4: Otherwise, + // Step a: Let result be the result of performing + // controller.[[strategySizeAlgorithm]], passing in chunk, and + // interpreting the result as an ECMAScript completion value. + // Step c: (on success) Let chunkSize be result.[[Value]]. + Rooted chunkSize(cx, Int32Value(1)); + bool success = true; + Rooted strategySize(cx, unwrappedController->strategySize()); + if (!strategySize.isUndefined()) { + if (!cx->compartment()->wrap(cx, &strategySize)) { + return false; + } + success = Call(cx, strategySize, UndefinedHandleValue, chunk, &chunkSize); + } + + // Step d: Let enqueueResult be + // EnqueueValueWithSize(controller, chunk, chunkSize). + if (success) { + success = EnqueueValueWithSize(cx, unwrappedController, chunk, chunkSize); + } + + // Step b: If result is an abrupt completion, + // and + // Step e: If enqueueResult is an abrupt completion, + if (!success) { + Rooted exn(cx); + Rooted stack(cx); + if (!cx->isExceptionPending() || + !GetAndClearExceptionAndStack(cx, &exn, &stack)) { + // Uncatchable error. Die immediately without erroring the + // stream. + return false; + } + + // Step b.i: Perform ! ReadableStreamDefaultControllerError( + // controller, result.[[Value]]). + // Step e.i: Perform ! ReadableStreamDefaultControllerError( + // controller, enqueueResult.[[Value]]). + if (!ReadableStreamControllerError(cx, unwrappedController, exn)) { + return false; + } + + // Step b.ii: Return result. + // Step e.ii: Return enqueueResult. + // (I.e., propagate the exception.) + cx->setPendingException(exn, stack); + return false; + } + } + + // Step 5: Perform + // ! ReadableStreamDefaultControllerCallPullIfNeeded(controller). + return ReadableStreamControllerCallPullIfNeeded(cx, unwrappedController); +} + +/** + * Streams spec, 3.10.7. ReadableStreamDefaultControllerError ( controller, e ) + * Streams spec, 3.13.11. ReadableByteStreamControllerError ( controller, e ) + */ +[[nodiscard]] bool js::ReadableStreamControllerError( + JSContext* cx, Handle unwrappedController, + Handle e) { + MOZ_ASSERT(!cx->isExceptionPending()); + AssertSameCompartment(cx, e); + + // Step 1: Let stream be controller.[[controlledReadableStream]] + // (or controller.[[controlledReadableByteStream]]). + Rooted unwrappedStream(cx, unwrappedController->stream()); + + // Step 2: If stream.[[state]] is not "readable", return. + if (!unwrappedStream->readable()) { + return true; + } + + // Step 3 of 3.13.10: + // Perform ! ReadableByteStreamControllerClearPendingPullIntos(controller). + if (unwrappedController->is()) { + Rooted unwrappedByteStreamController( + cx, &unwrappedController->as()); + if (!ReadableByteStreamControllerClearPendingPullIntos( + cx, unwrappedByteStreamController)) { + return false; + } + } + + // Step 3 (or 4): Perform ! ResetQueue(controller). + if (!ResetQueue(cx, unwrappedController)) { + return false; + } + + // Step 4 (or 5): + // Perform ! ReadableStreamDefaultControllerClearAlgorithms(controller) + // (or ReadableByteStreamControllerClearAlgorithms(controller)). + ReadableStreamControllerClearAlgorithms(unwrappedController); + + // Step 5 (or 6): Perform ! ReadableStreamError(stream, e). + return ReadableStreamErrorInternal(cx, unwrappedStream, e); +} + +/** + * Streams spec, 3.10.8. + * ReadableStreamDefaultControllerGetDesiredSize ( controller ) + * Streams spec 3.13.14. + * ReadableByteStreamControllerGetDesiredSize ( controller ) + */ +[[nodiscard]] double js::ReadableStreamControllerGetDesiredSizeUnchecked( + ReadableStreamController* controller) { + // Steps 1-4 done at callsites, so only assert that they have been done. +#if DEBUG + ReadableStream* stream = controller->stream(); + MOZ_ASSERT(!(stream->errored() || stream->closed())); +#endif // DEBUG + + // Step 5: Return controller.[[strategyHWM]] − controller.[[queueTotalSize]]. + return controller->strategyHWM() - controller->queueTotalSize(); +} + +/** + * Streams spec, 3.10.11. + * SetUpReadableStreamDefaultController(stream, controller, + * startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, + * sizeAlgorithm ) + * + * The standard algorithm takes a `controller` argument which must be a new, + * blank object. This implementation creates a new controller instead. + * + * In the spec, three algorithms (startAlgorithm, pullAlgorithm, + * cancelAlgorithm) are passed as arguments to this routine. This + * implementation passes these "algorithms" as data, using four arguments: + * sourceAlgorithms, underlyingSource, pullMethod, and cancelMethod. The + * sourceAlgorithms argument tells how to interpret the other three: + * + * - SourceAlgorithms::Script - We're creating a stream from a JS source. + * The caller is `new ReadableStream(underlyingSource)` or + * `JS::NewReadableDefaultStreamObject`. `underlyingSource` is the + * source; `pullMethod` and `cancelMethod` are its .pull and + * .cancel methods, which the caller has already extracted and + * type-checked: each one must be either a callable JS object or undefined. + * + * Script streams use the start/pull/cancel algorithms defined in + * 3.10.12. SetUpReadableStreamDefaultControllerFromUnderlyingSource, which + * call JS methods of the underlyingSource. + * + * - SourceAlgorithms::Tee - We're creating a tee stream. `underlyingSource` + * is a TeeState object. `pullMethod` and `cancelMethod` are undefined. + * + * Tee streams use the start/pull/cancel algorithms given in + * 3.4.10. ReadableStreamTee. + * + * Note: All arguments must be same-compartment with cx. ReadableStream + * controllers are always created in the same compartment as the stream. + */ +[[nodiscard]] bool js::SetUpReadableStreamDefaultController( + JSContext* cx, Handle stream, + SourceAlgorithms sourceAlgorithms, Handle underlyingSource, + Handle pullMethod, Handle cancelMethod, double highWaterMark, + Handle size) { + cx->check(stream, underlyingSource, size); + MOZ_ASSERT(pullMethod.isUndefined() || IsCallable(pullMethod)); + MOZ_ASSERT(cancelMethod.isUndefined() || IsCallable(cancelMethod)); + MOZ_ASSERT_IF(sourceAlgorithms != SourceAlgorithms::Script, + pullMethod.isUndefined()); + MOZ_ASSERT_IF(sourceAlgorithms != SourceAlgorithms::Script, + cancelMethod.isUndefined()); + MOZ_ASSERT(highWaterMark >= 0); + MOZ_ASSERT(size.isUndefined() || IsCallable(size)); + + // Done elsewhere in the standard: Create the new controller. + Rooted controller( + cx, NewBuiltinClassInstance(cx)); + if (!controller) { + return false; + } + + // Step 1: Assert: stream.[[readableStreamController]] is undefined. + MOZ_ASSERT(!stream->hasController()); + + // Step 2: Set controller.[[controlledReadableStream]] to stream. + controller->setStream(stream); + + // Step 3: Set controller.[[queue]] and controller.[[queueTotalSize]] to + // undefined (implicit), then perform ! ResetQueue(controller). + if (!ResetQueue(cx, controller)) { + return false; + } + + // Step 4: Set controller.[[started]], controller.[[closeRequested]], + // controller.[[pullAgain]], and controller.[[pulling]] to false. + controller->setFlags(0); + + // Step 5: Set controller.[[strategySizeAlgorithm]] to sizeAlgorithm + // and controller.[[strategyHWM]] to highWaterMark. + controller->setStrategySize(size); + controller->setStrategyHWM(highWaterMark); + + // Step 6: Set controller.[[pullAlgorithm]] to pullAlgorithm. + // (In this implementation, the pullAlgorithm is determined by the + // underlyingSource in combination with the pullMethod field.) + controller->setUnderlyingSource(underlyingSource); + controller->setPullMethod(pullMethod); + + // Step 7: Set controller.[[cancelAlgorithm]] to cancelAlgorithm. + controller->setCancelMethod(cancelMethod); + + // Step 8: Set stream.[[readableStreamController]] to controller. + stream->setController(controller); + + // Step 9: Let startResult be the result of performing startAlgorithm. + Rooted startResult(cx); + if (sourceAlgorithms == SourceAlgorithms::Script) { + Rooted controllerVal(cx, ObjectValue(*controller)); + if (!InvokeOrNoop(cx, underlyingSource, cx->names().start, controllerVal, + &startResult)) { + return false; + } + } + + // Step 10: Let startPromise be a promise resolved with startResult. + Rooted startPromise( + cx, PromiseObject::unforgeableResolve(cx, startResult)); + if (!startPromise) { + return false; + } + + // Step 11: Upon fulfillment of startPromise, [...] + // Step 12: Upon rejection of startPromise with reason r, [...] + Rooted onStartFulfilled( + cx, NewHandler(cx, ReadableStreamControllerStartHandler, controller)); + if (!onStartFulfilled) { + return false; + } + Rooted onStartRejected( + cx, + NewHandler(cx, ReadableStreamControllerStartFailedHandler, controller)); + if (!onStartRejected) { + return false; + } + if (!JS::AddPromiseReactions(cx, startPromise, onStartFulfilled, + onStartRejected)) { + return false; + } + + return true; +} + +/** + * Streams spec, 3.10.12. + * SetUpReadableStreamDefaultControllerFromUnderlyingSource( stream, + * underlyingSource, highWaterMark, sizeAlgorithm ) + */ +[[nodiscard]] bool js::SetUpReadableStreamDefaultControllerFromUnderlyingSource( + JSContext* cx, Handle stream, + Handle underlyingSource, double highWaterMark, + Handle sizeAlgorithm) { + // Step 1: Assert: underlyingSource is not undefined. + MOZ_ASSERT(!underlyingSource.isUndefined()); + + // Step 2: Let controller be ObjectCreate(the original value of + // ReadableStreamDefaultController's prototype property). + // (Deferred to SetUpReadableStreamDefaultController.) + + // Step 3: Let startAlgorithm be the following steps: + // a. Return ? InvokeOrNoop(underlyingSource, "start", + // « controller »). + SourceAlgorithms sourceAlgorithms = SourceAlgorithms::Script; + + // Step 4: Let pullAlgorithm be + // ? CreateAlgorithmFromUnderlyingMethod(underlyingSource, "pull", + // 0, « controller »). + Rooted pullMethod(cx); + if (!CreateAlgorithmFromUnderlyingMethod(cx, underlyingSource, + "ReadableStream source.pull method", + cx->names().pull, &pullMethod)) { + return false; + } + + // Step 5. Let cancelAlgorithm be + // ? CreateAlgorithmFromUnderlyingMethod(underlyingSource, + // "cancel", 1, « »). + Rooted cancelMethod(cx); + if (!CreateAlgorithmFromUnderlyingMethod( + cx, underlyingSource, "ReadableStream source.cancel method", + cx->names().cancel, &cancelMethod)) { + return false; + } + + // Step 6. Perform ? SetUpReadableStreamDefaultController(stream, + // controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, + // highWaterMark, sizeAlgorithm). + return SetUpReadableStreamDefaultController( + cx, stream, sourceAlgorithms, underlyingSource, pullMethod, cancelMethod, + highWaterMark, sizeAlgorithm); +} diff --git a/js/src/builtin/streams/ReadableStreamDefaultControllerOperations.h b/js/src/builtin/streams/ReadableStreamDefaultControllerOperations.h new file mode 100644 index 0000000000000..3dda7cb328be9 --- /dev/null +++ b/js/src/builtin/streams/ReadableStreamDefaultControllerOperations.h @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Readable stream default controller abstract operations. */ + +#ifndef builtin_streams_ReadableStreamDefaultControllerOperations_h +#define builtin_streams_ReadableStreamDefaultControllerOperations_h + +#include "jstypes.h" // JS_PUBLIC_API +#include "js/RootingAPI.h" // JS::Handle +#include "js/Value.h" // JS::Value + +struct JS_PUBLIC_API JSContext; + +namespace js { + +class ReadableStream; +class ReadableStreamController; +class ReadableStreamDefaultController; + +[[nodiscard]] extern bool ReadableStreamDefaultControllerEnqueue( + JSContext* cx, + JS::Handle unwrappedController, + JS::Handle chunk); + +[[nodiscard]] extern bool ReadableStreamControllerError( + JSContext* cx, JS::Handle unwrappedController, + JS::Handle e); + +[[nodiscard]] extern bool ReadableStreamDefaultControllerClose( + JSContext* cx, + JS::Handle unwrappedController); + +[[nodiscard]] extern double ReadableStreamControllerGetDesiredSizeUnchecked( + ReadableStreamController* controller); + +[[nodiscard]] extern bool ReadableStreamControllerCallPullIfNeeded( + JSContext* cx, JS::Handle unwrappedController); + +[[nodiscard]] extern bool ReadableStreamControllerShouldCallPull( + JSContext* cx, ReadableStreamController* unwrappedController); + +extern void ReadableStreamControllerClearAlgorithms( + JS::Handle controller); + +/** + * Characterizes the family of algorithms, (startAlgorithm, pullAlgorithm, + * cancelAlgorithm), associated with a readable stream. + * + * See the comment on SetUpReadableStreamDefaultController(). + */ +enum class SourceAlgorithms { + Script, + Tee, +}; + +[[nodiscard]] extern bool SetUpReadableStreamDefaultController( + JSContext* cx, JS::Handle stream, + SourceAlgorithms sourceAlgorithms, JS::Handle underlyingSource, + JS::Handle pullMethod, JS::Handle cancelMethod, + double highWaterMark, JS::Handle size); + +[[nodiscard]] extern bool +SetUpReadableStreamDefaultControllerFromUnderlyingSource( + JSContext* cx, JS::Handle stream, + JS::Handle underlyingSource, double highWaterMark, + JS::Handle sizeAlgorithm); + +} // namespace js + +#endif // builtin_streams_ReadableStreamDefaultControllerOperations_h diff --git a/js/src/builtin/streams/ReadableStreamDefaultReader.cpp b/js/src/builtin/streams/ReadableStreamDefaultReader.cpp new file mode 100644 index 0000000000000..b2c7b64e511b5 --- /dev/null +++ b/js/src/builtin/streams/ReadableStreamDefaultReader.cpp @@ -0,0 +1,376 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Class ReadableStreamDefaultReader. */ + +#include "builtin/streams/ClassSpecMacro.h" // JS_STREAMS_CLASS_SPEC +#include "builtin/streams/MiscellaneousOperations.h" // js::ReturnPromiseRejectedWithPendingError +#include "builtin/streams/ReadableStream.h" // js::ReadableStream +#include "builtin/streams/ReadableStreamController.h" // js::ReadableStreamController +#include "builtin/streams/ReadableStreamInternals.h" // js::ReadableStream{Cancel,CreateReadResult} +#include "builtin/streams/ReadableStreamReader.h" // js::ForAuthorCodeBool, js::ReadableStream{,Default}Reader +#include "js/CallArgs.h" // JS::CallArgs{,FromVp} +#include "js/Class.h" // JSClass, JS_NULL_CLASS_OPS +#include "js/ErrorReport.h" // JS_ReportErrorNumberASCII +#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* +#include "js/RootingAPI.h" // JS::Handle, JS::Rooted +#include "vm/Interpreter.h" +#include "vm/PromiseObject.h" // js::PromiseObject + +#include "builtin/streams/ReadableStreamReader-inl.h" // js::UnwrapStreamFromReader + +#include "vm/Compartment-inl.h" // js::UnwrapAndTypeCheckThis +#include "vm/JSObject-inl.h" // js::NewObjectWithClassProto +#include "vm/NativeObject-inl.h" // js::ThrowIfNotConstructin + +using JS::Handle; +using JS::Rooted; +using JS::Value; + +using js::PromiseObject; +using js::ReadableStreamController; + +using JS::CallArgs; +using JS::CallArgsFromVp; +using JS::Handle; +using JS::Rooted; +using JS::Value; + +using js::ForAuthorCodeBool; +using js::GetErrorMessage; +using js::ListObject; +using js::NewObjectWithClassProto; +using js::PromiseObject; +using js::ReadableStream; +using js::ReadableStreamDefaultReader; +using js::ReadableStreamReader; +using js::UnwrapAndTypeCheckThis; +using js::UnwrapStreamFromReader; + +/*** 3.6. Class ReadableStreamDefaultReader *********************************/ + +/** + * Stream spec, 3.6.3. new ReadableStreamDefaultReader ( stream ) + * Steps 2-4. + */ +[[nodiscard]] ReadableStreamDefaultReader* +js::CreateReadableStreamDefaultReader(JSContext* cx, + Handle unwrappedStream, + ForAuthorCodeBool forAuthorCode, + Handle proto /* = nullptr */) { + Rooted reader( + cx, NewObjectWithClassProto(cx, proto)); + if (!reader) { + return nullptr; + } + + // Step 2: If ! IsReadableStreamLocked(stream) is true, throw a TypeError + // exception. + if (unwrappedStream->locked()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_LOCKED); + return nullptr; + } + + // Step 3: Perform ! ReadableStreamReaderGenericInitialize(this, stream). + // Step 4: Set this.[[readRequests]] to a new empty List. + if (!ReadableStreamReaderGenericInitialize(cx, reader, unwrappedStream, + forAuthorCode)) { + return nullptr; + } + + return reader; +} + +/** + * Stream spec, 3.6.3. new ReadableStreamDefaultReader ( stream ) + */ +bool ReadableStreamDefaultReader::constructor(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + if (!ThrowIfNotConstructing(cx, args, "ReadableStreamDefaultReader")) { + return false; + } + + // Implicit in the spec: Find the prototype object to use. + Rooted proto(cx); + if (!GetPrototypeFromBuiltinConstructor(cx, args, JSProto_Null, &proto)) { + return false; + } + + // Step 1: If ! IsReadableStream(stream) is false, throw a TypeError + // exception. + Rooted unwrappedStream( + cx, UnwrapAndTypeCheckArgument( + cx, args, "ReadableStreamDefaultReader constructor", 0)); + if (!unwrappedStream) { + return false; + } + + Rooted reader( + cx, CreateReadableStreamDefaultReader(cx, unwrappedStream, + ForAuthorCodeBool::Yes, proto)); + if (!reader) { + return false; + } + + args.rval().setObject(*reader); + return true; +} + +/** + * Streams spec, 3.6.4.1 get closed + */ +[[nodiscard]] static bool ReadableStreamDefaultReader_closed(JSContext* cx, + unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsReadableStreamDefaultReader(this) is false, return a promise + // rejected with a TypeError exception. + Rooted unwrappedReader( + cx, UnwrapAndTypeCheckThis(cx, args, + "get closed")); + if (!unwrappedReader) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 2: Return this.[[closedPromise]]. + Rooted closedPromise(cx, unwrappedReader->closedPromise()); + if (!cx->compartment()->wrap(cx, &closedPromise)) { + return false; + } + + args.rval().setObject(*closedPromise); + return true; +} + +/** + * Streams spec, 3.6.4.2. cancel ( reason ) + */ +[[nodiscard]] static bool ReadableStreamDefaultReader_cancel(JSContext* cx, + unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsReadableStreamDefaultReader(this) is false, return a promise + // rejected with a TypeError exception. + Rooted unwrappedReader( + cx, + UnwrapAndTypeCheckThis(cx, args, "cancel")); + if (!unwrappedReader) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 2: If this.[[ownerReadableStream]] is undefined, return a promise + // rejected with a TypeError exception. + if (!unwrappedReader->hasStream()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMREADER_NOT_OWNED, "cancel"); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 3: Return ! ReadableStreamReaderGenericCancel(this, reason). + JSObject* cancelPromise = + ReadableStreamReaderGenericCancel(cx, unwrappedReader, args.get(0)); + if (!cancelPromise) { + return false; + } + args.rval().setObject(*cancelPromise); + return true; +} + +/** + * Streams spec, 3.6.4.3 read ( ) + */ +[[nodiscard]] static bool ReadableStreamDefaultReader_read(JSContext* cx, + unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsReadableStreamDefaultReader(this) is false, return a promise + // rejected with a TypeError exception. + Rooted unwrappedReader( + cx, + UnwrapAndTypeCheckThis(cx, args, "read")); + if (!unwrappedReader) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 2: If this.[[ownerReadableStream]] is undefined, return a promise + // rejected with a TypeError exception. + if (!unwrappedReader->hasStream()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMREADER_NOT_OWNED, "read"); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 3: Return ! ReadableStreamDefaultReaderRead(this, true). + PromiseObject* readPromise = + js::ReadableStreamDefaultReaderRead(cx, unwrappedReader); + if (!readPromise) { + return false; + } + args.rval().setObject(*readPromise); + return true; +} + +/** + * https://streams.spec.whatwg.org/#abstract-opdef-readablestreamdefaultreadererrorreadrequests + * AND + * https://streams.spec.whatwg.org/#abstract-opdef-readablestreambyobreadererrorreadintorequests + */ +[[nodiscard]] bool js::ReadableStreamReaderErrorReadOrReadIntoRequests( + JSContext* cx, Handle reader, Handle err) { + // Let readRequests be reader.[[readRequests]]. + ListObject* readIntoRequests = reader->requests(); + + if (!readIntoRequests) { + return true; + } + + // Set reader.[[readRequests]] to a new empty list. + reader->clearRequests(); + + // For each readRequest of readRequests, + uint32_t len = readIntoRequests->length(); + Rooted readRequest(cx); + Rooted resultObj(cx); + Rooted resultVal(cx); + for (uint32_t i = 0; i < len; i++) { + // Perform readRequest’s error steps, given e. + readRequest = &readIntoRequests->getAs(i); + if (!RejectPromise(cx, readRequest, err)) { + return false; + } + } + return true; +} + +/** + * https://streams.spec.whatwg.org/#abstract-opdef-readablestreamdefaultreaderrelease + */ +static bool ReadableStreamDefaultReader_releaseLock(JSContext* cx, + unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + Rooted reader( + cx, UnwrapAndTypeCheckThis(cx, args, + "releaseLock")); + if (!reader) { + return false; + } + + // If this.[[stream]] is undefined, return. + if (!reader->hasStream()) { + args.rval().setUndefined(); + return true; + } + + // Perform ! ReadableStreamDefaultReaderRelease(this). + // (inlined) + + // Perform ! ReadableStreamReaderGenericRelease(reader). + if (!js::ReadableStreamReaderGenericRelease(cx, reader)) { + return false; + } + + // Let e be a new TypeError exception. + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMREADER_RELEASED); + JS::RootedValue e(cx); + Rooted stack(cx); + if (!cx->isExceptionPending() || + !GetAndClearExceptionAndStack(cx, &e, &stack)) { + // Uncatchable error. Die immediately without erroring the + // stream. + return false; + } + + // Perform ! ReadableStreamDefaultReaderErrorReadRequests(reader, e). + if (!ReadableStreamReaderErrorReadOrReadIntoRequests(cx, reader, e)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 3.8.7. + * ReadableStreamDefaultReaderRead ( reader [, forAuthorCode ] ) + */ +[[nodiscard]] PromiseObject* js::ReadableStreamDefaultReaderRead( + JSContext* cx, Handle unwrappedReader) { + // Step 1: If forAuthorCode was not passed, set it to false (implicit). + + // Step 2: Let stream be reader.[[ownerReadableStream]]. + // Step 3: Assert: stream is not undefined. + Rooted unwrappedStream( + cx, UnwrapStreamFromReader(cx, unwrappedReader)); + if (!unwrappedStream) { + return nullptr; + } + + // Step 4: Set stream.[[disturbed]] to true. + unwrappedStream->setDisturbed(); + + // Step 5: If stream.[[state]] is "closed", return a promise resolved with + // ! ReadableStreamCreateReadResult(undefined, true, forAuthorCode). + if (unwrappedStream->closed()) { + PlainObject* iterResult = ReadableStreamCreateReadResult( + cx, UndefinedHandleValue, true, unwrappedReader->forAuthorCode()); + if (!iterResult) { + return nullptr; + } + + Rooted iterResultVal(cx, JS::ObjectValue(*iterResult)); + return PromiseObject::unforgeableResolveWithNonPromise(cx, iterResultVal); + } + + // Step 6: If stream.[[state]] is "errored", return a promise rejected + // with stream.[[storedError]]. + if (unwrappedStream->errored()) { + Rooted storedError(cx, unwrappedStream->storedError()); + if (!cx->compartment()->wrap(cx, &storedError)) { + return nullptr; + } + return PromiseObject::unforgeableReject(cx, storedError); + } + + // Step 7: Assert: stream.[[state]] is "readable". + MOZ_ASSERT(unwrappedStream->readable()); + + // Step 8: Return ! stream.[[readableStreamController]].[[PullSteps]](). + Rooted unwrappedController( + cx, unwrappedStream->controller()); + + if (unwrappedController->is()) { + Rooted unwrappedDefaultController( + cx, &unwrappedController->as()); + return ReadableStreamDefaultControllerPullSteps(cx, + unwrappedDefaultController); + } else { + MOZ_ASSERT(unwrappedController->is()); + Rooted unwrappedByteController( + cx, &unwrappedController->as()); + return ReadableByteStreamControllerPullSteps(cx, unwrappedByteController); + } +} + +static const JSFunctionSpec ReadableStreamDefaultReader_methods[] = { + JS_FN("cancel", ReadableStreamDefaultReader_cancel, 1, 0), + JS_FN("read", ReadableStreamDefaultReader_read, 0, 0), + JS_FN("releaseLock", ReadableStreamDefaultReader_releaseLock, 0, 0), + JS_FS_END}; + +static const JSPropertySpec ReadableStreamDefaultReader_properties[] = { + JS_PSG("closed", ReadableStreamDefaultReader_closed, 0), JS_PS_END}; + +const JSClass ReadableStreamReader::class_ = {"ReadableStreamReader"}; + +JS_STREAMS_CLASS_SPEC(ReadableStreamDefaultReader, 1, SlotCount, 0, 0, + JS_NULL_CLASS_OPS); diff --git a/js/src/builtin/streams/ReadableStreamInternals.cpp b/js/src/builtin/streams/ReadableStreamInternals.cpp new file mode 100644 index 0000000000000..9fdfb82c81bf9 --- /dev/null +++ b/js/src/builtin/streams/ReadableStreamInternals.cpp @@ -0,0 +1,534 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* The interface between readable streams and controllers. */ + +#include "builtin/streams/ReadableStreamInternals.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT{,_IF} + +#include // uint32_t + +#include "jsfriendapi.h" // js::AssertSameCompartment + +#include "builtin/streams/ReadableStreamController.h" // js::ReadableStreamController{,CancelSteps} +#include "builtin/streams/ReadableStreamReader.h" // js::ReadableStream{,Default}Reader, js::ForAuthorCodeBool +#include "gc/AllocKind.h" // js::gc::AllocKind +#include "js/CallArgs.h" // JS::CallArgs{,FromVp} +#include "js/GCAPI.h" // JS::AutoSuppressGCAnalysis +#include "js/Promise.h" // JS::CallOriginalPromiseThen, JS::ResolvePromise +#include "js/Result.h" // JS_TRY_VAR_OR_RETURN_NULL +#include "js/RootingAPI.h" // JS::Handle, JS::Rooted +#include "js/Stream.h" // JS::ReadableStreamUnderlyingSource, JS::ReadableStreamMode +#include "js/Value.h" // JS::Value, JS::{Boolean,Object}Value, JS::UndefinedHandleValue +#include "vm/JSContext.h" // JSContext +#include "vm/JSFunction.h" // JSFunction, js::NewNativeFunction +#include "vm/JSObject.h" // js::GenericObject +#include "vm/NativeObject.h" // js::NativeObject, js::PlainObject +#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined +#include "vm/Realm.h" // JS::Realm +#include "vm/StringType.h" // js::PropertyName + +#include "builtin/Promise-inl.h" // js::SetSettledPromiseIsHandled +#include "builtin/streams/MiscellaneousOperations-inl.h" // js::{Reject,Resolve}UnwrappedPromiseWithUndefined +#include "builtin/streams/ReadableStreamReader-inl.h" // js::js::UnwrapReaderFromStream{,NoThrow} +#include "vm/Compartment-inl.h" // JS::Compartment::wrap +#include "vm/JSContext-inl.h" // JSContext::check +#include "vm/List-inl.h" // js::ListObject, js::AppendToListInFixedSlot, js::StoreNewListInFixedSlot +#include "vm/PlainObject-inl.h" // js::PlainObject::createWithTemplate +#include "vm/Realm-inl.h" // JS::Realm + +using JS::BooleanValue; +using JS::CallArgs; +using JS::CallArgsFromVp; +using JS::Handle; +using JS::ObjectValue; +using JS::ResolvePromise; +using JS::Rooted; +using JS::UndefinedHandleValue; +using JS::Value; + +using js::PlainObject; +using js::ReadableStream; + +/*** 3.5. The interface between readable streams and controllers ************/ + +/** + * Streams spec, 3.5.1. + * ReadableStreamAddReadIntoRequest ( stream, forAuthorCode ) + * Streams spec, 3.5.2. + * ReadableStreamAddReadRequest ( stream, forAuthorCode ) + * + * Our implementation does not pass around forAuthorCode parameters in the same + * places as the standard, but the effect is the same. See the comment on + * `ReadableStreamReader::forAuthorCode()`. + */ +[[nodiscard]] js::PromiseObject* js::ReadableStreamAddReadOrReadIntoRequest( + JSContext* cx, Handle unwrappedStream) { + // Step 1: Assert: ! IsReadableStream{BYOB,Default}Reader(stream.[[reader]]) + // is true. + // (Only default readers exist so far.) + Rooted unwrappedReader( + cx, UnwrapReaderFromStream(cx, unwrappedStream)); + if (!unwrappedReader) { + return nullptr; + } + + // Step 2 of 3.5.1: Assert: stream.[[state]] is "readable" or "closed". + // Step 2 of 3.5.2: Assert: stream.[[state]] is "readable". + MOZ_ASSERT(unwrappedStream->readable() || unwrappedStream->closed()); + MOZ_ASSERT_IF(unwrappedReader->is(), + unwrappedStream->readable()); + + // Step 3: Let promise be a new promise. + Rooted promise(cx, PromiseObject::createSkippingExecutor(cx)); + if (!promise) { + return nullptr; + } + + // Step 4: Let read{Into}Request be + // Record {[[promise]]: promise, [[forAuthorCode]]: forAuthorCode}. + // Step 5: Append read{Into}Request as the last element of + // stream.[[reader]].[[read{Into}Requests]]. + // Since we don't need the [[forAuthorCode]] field (see the comment on + // `ReadableStreamReader::forAuthorCode()`), we elide the Record and store + // only the promise. + if (!AppendToListInFixedSlot(cx, unwrappedReader, + ReadableStreamReader::Slot_Requests, promise)) { + return nullptr; + } + + // Step 6: Return promise. + return promise; +} + +/** + * Used for transforming the result of promise fulfillment/rejection. + */ +static bool ReturnUndefined(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 3.5.3. ReadableStreamCancel ( stream, reason ) + */ +[[nodiscard]] JSObject* js::ReadableStreamCancel( + JSContext* cx, Handle unwrappedStream, + Handle reason) { + AssertSameCompartment(cx, reason); + + // Step 1: Set stream.[[disturbed]] to true. + unwrappedStream->setDisturbed(); + + // Step 2: If stream.[[state]] is "closed", return a promise resolved with + // undefined. + if (unwrappedStream->closed()) { + return PromiseResolvedWithUndefined(cx); + } + + // Step 3: If stream.[[state]] is "errored", return a promise rejected with + // stream.[[storedError]]. + if (unwrappedStream->errored()) { + Rooted storedError(cx, unwrappedStream->storedError()); + if (!cx->compartment()->wrap(cx, &storedError)) { + return nullptr; + } + return PromiseObject::unforgeableReject(cx, storedError); + } + + // Step 4: Perform ! ReadableStreamClose(stream). + if (!ReadableStreamCloseInternal(cx, unwrappedStream)) { + return nullptr; + } + + // If reader is not undefined and reader implements ReadableStreamBYOBReader, + if (unwrappedStream->hasReader()) { + Rooted unwrappedReader( + cx, UnwrapReaderFromStream(cx, unwrappedStream)); + if (!unwrappedReader) { + return nullptr; + } + if (unwrappedReader->is()) { + Rooted byobReader( + cx, &unwrappedReader->as()); + + // Let readIntoRequests be reader.[[readIntoRequests]]. + ListObject* readIntoRequests = byobReader->requests(); + + // Set reader.[[readIntoRequests]] to an empty list. + byobReader->clearRequests(); + + // For each readIntoRequest of readIntoRequests, + uint32_t len = readIntoRequests->length(); + Rooted readRequest(cx); + Rooted resultObj(cx); + Rooted resultVal(cx); + for (uint32_t i = 0; i < len; i++) { + // Perform readIntoRequest’s close steps, given undefined. + readRequest = &readIntoRequests->getAs(i); + resultObj = js::ReadableStreamCreateReadResult( + cx, UndefinedHandleValue, true, ForAuthorCodeBool::Yes); + if (!resultObj) { + return nullptr; + } + resultVal = ObjectValue(*resultObj); + if (!ResolvePromise(cx, readRequest, resultVal)) { + return nullptr; + } + } + } + } + + // Step 5: Let sourceCancelPromise be + // ! stream.[[readableStreamController]].[[CancelSteps]](reason). + Rooted unwrappedController( + cx, unwrappedStream->controller()); + Rooted sourceCancelPromise( + cx, ReadableStreamControllerCancelSteps(cx, unwrappedController, reason)); + if (!sourceCancelPromise) { + return nullptr; + } + + // Step 6: Return the result of reacting to sourceCancelPromise with a + // fulfillment step that returns undefined. + Handle funName = cx->names().empty_; + Rooted returnUndefined( + cx, NewNativeFunction(cx, ReturnUndefined, 0, funName, + gc::AllocKind::FUNCTION, GenericObject)); + if (!returnUndefined) { + return nullptr; + } + return JS::CallOriginalPromiseThen(cx, sourceCancelPromise, returnUndefined, + nullptr); +} + +/** + * Streams spec, 3.5.4. ReadableStreamClose ( stream ) + */ +[[nodiscard]] bool js::ReadableStreamCloseInternal( + JSContext* cx, Handle unwrappedStream) { + // Step 1: Assert: stream.[[state]] is "readable". + MOZ_ASSERT(unwrappedStream->readable()); + + // Step 2: Set stream.[[state]] to "closed". + unwrappedStream->setClosed(); + + // Step 4: If reader is undefined, return (reordered). + if (!unwrappedStream->hasReader()) { + return true; + } + + // Step 3: Let reader be stream.[[reader]]. + Rooted unwrappedReader( + cx, UnwrapReaderFromStream(cx, unwrappedStream)); + if (!unwrappedReader) { + return false; + } + + // Step 5: If ! IsReadableStreamDefaultReader(reader) is true, + if (unwrappedReader->is()) { + ForAuthorCodeBool forAuthorCode = unwrappedReader->forAuthorCode(); + + // Step a: Repeat for each readRequest that is an element of + // reader.[[readRequests]], + Rooted unwrappedReadRequests(cx, unwrappedReader->requests()); + uint32_t len = unwrappedReadRequests->length(); + Rooted readRequest(cx); + Rooted resultObj(cx); + Rooted resultVal(cx); + for (uint32_t i = 0; i < len; i++) { + // Step i: Resolve readRequest.[[promise]] with + // ! ReadableStreamCreateReadResult(undefined, true, + // readRequest.[[forAuthorCode]]). + readRequest = &unwrappedReadRequests->getAs(i); + if (!cx->compartment()->wrap(cx, &readRequest)) { + return false; + } + + resultObj = js::ReadableStreamCreateReadResult(cx, UndefinedHandleValue, + true, forAuthorCode); + if (!resultObj) { + return false; + } + resultVal = ObjectValue(*resultObj); + if (!ResolvePromise(cx, readRequest, resultVal)) { + return false; + } + } + + // Step b: Set reader.[[readRequests]] to an empty List. + unwrappedReader->clearRequests(); + } + + // Step 6: Resolve reader.[[closedPromise]] with undefined. + if (!ResolveUnwrappedPromiseWithUndefined(cx, + unwrappedReader->closedPromise())) { + return false; + } + + if (unwrappedStream->mode() == JS::ReadableStreamMode::ExternalSource) { + // Make sure we're in the stream's compartment. + AutoRealm ar(cx, unwrappedStream); + JS::ReadableStreamUnderlyingSource* source = + unwrappedStream->controller()->externalSource(); + source->onClosed(cx, unwrappedStream); + } + + return true; +} + +/** + * Streams spec, 3.5.5. ReadableStreamCreateReadResult ( value, done, + * forAuthorCode ) + */ +[[nodiscard]] PlainObject* js::ReadableStreamCreateReadResult( + JSContext* cx, Handle value, bool done, + ForAuthorCodeBool forAuthorCode) { + // Step 1: Let prototype be null. + // Step 2: If forAuthorCode is true, set prototype to %ObjectPrototype%. + Rooted templateObject( + cx, + forAuthorCode == ForAuthorCodeBool::Yes + ? GlobalObject::getOrCreateIterResultTemplateObject(cx) + : GlobalObject::getOrCreateIterResultWithoutPrototypeTemplateObject( + cx)); + if (!templateObject) { + return nullptr; + } + + // Step 3: Assert: Type(done) is Boolean (implicit). + + // Step 4: Let obj be ObjectCreate(prototype). + PlainObject* obj = PlainObject::createWithTemplate(cx, templateObject); + if (!obj) { + return nullptr; + } + + // Step 5: Perform CreateDataProperty(obj, "value", value). + obj->setSlot(GlobalObject::IterResultObjectValueSlot, value); + + // Step 6: Perform CreateDataProperty(obj, "done", done). + obj->setSlot(GlobalObject::IterResultObjectDoneSlot, BooleanValue(done)); + + // Step 7: Return obj. + return obj; +} + +/** + * Streams spec, 3.5.6. ReadableStreamError ( stream, e ) + */ +[[nodiscard]] bool js::ReadableStreamErrorInternal( + JSContext* cx, Handle unwrappedStream, Handle e) { + // Step 1: Assert: ! IsReadableStream(stream) is true (implicit). + + // Step 2: Assert: stream.[[state]] is "readable". + MOZ_ASSERT(unwrappedStream->readable()); + + // Step 3: Set stream.[[state]] to "errored". + unwrappedStream->setErrored(); + + // Step 4: Set stream.[[storedError]] to e. + { + AutoRealm ar(cx, unwrappedStream); + Rooted wrappedError(cx, e); + if (!cx->compartment()->wrap(cx, &wrappedError)) { + return false; + } + unwrappedStream->setStoredError(wrappedError); + } + + // Step 6: If reader is undefined, return (reordered). + if (!unwrappedStream->hasReader()) { + return true; + } + + // Step 5: Let reader be stream.[[reader]]. + Rooted unwrappedReader( + cx, UnwrapReaderFromStream(cx, unwrappedStream)); + if (!unwrappedReader) { + return false; + } + + // Steps 7-8: (Identical in our implementation.) + // Step 7.a/8.b: Repeat for each read{Into}Request that is an element of + // reader.[[read{Into}Requests]], + { + Rooted unwrappedReadRequests(cx, unwrappedReader->requests()); + Rooted readRequest(cx); + uint32_t len = unwrappedReadRequests->length(); + for (uint32_t i = 0; i < len; i++) { + // Step i: Reject read{Into}Request.[[promise]] with e. + // Responses have to be created in the compartment from which the error + // was triggered, which might not be the same as the one the request was + // created in, so we have to wrap requests here. + readRequest = &unwrappedReadRequests->get(i).toObject(); + if (!RejectUnwrappedPromiseWithError(cx, &readRequest, e)) { + return false; + } + } + } + + // Step 7.b/8.c: Set reader.[[read{Into}Requests]] to a new empty List. + if (!StoreNewListInFixedSlot(cx, unwrappedReader, + ReadableStreamReader::Slot_Requests)) { + return false; + } + + // Step 9: Reject reader.[[closedPromise]] with e. + if (!RejectUnwrappedPromiseWithError(cx, unwrappedReader->closedPromise(), + e)) { + return false; + } + + // Step 10: Set reader.[[closedPromise]].[[PromiseIsHandled]] to true. + // + // `closedPromise` can return a CCW, but that case is filtered out by step 6, + // given the only place that can set [[closedPromise]] to a CCW is + // 3.8.5 ReadableStreamReaderGenericRelease step 4, and + // 3.8.5 ReadableStreamReaderGenericRelease step 6 sets + // stream.[[reader]] to undefined. + Rooted closedPromise(cx, unwrappedReader->closedPromise()); + js::SetSettledPromiseIsHandled(cx, closedPromise.as()); + + if (unwrappedStream->mode() == JS::ReadableStreamMode::ExternalSource) { + // Make sure we're in the stream's compartment. + AutoRealm ar(cx, unwrappedStream); + JS::ReadableStreamUnderlyingSource* source = + unwrappedStream->controller()->externalSource(); + + // Ensure that the embedding doesn't have to deal with + // mixed-compartment arguments to the callback. + Rooted error(cx, e); + if (!cx->compartment()->wrap(cx, &error)) { + return false; + } + source->onErrored(cx, unwrappedStream, error); + } + + return true; +} + +/** + * Streams spec, 3.5.7. + * ReadableStreamFulfillReadIntoRequest( stream, chunk, done ) + * Streams spec, 3.5.8. + * ReadableStreamFulfillReadRequest ( stream, chunk, done ) + * These two spec functions are identical in our implementation. + */ +[[nodiscard]] bool js::ReadableStreamFulfillReadOrReadIntoRequest( + JSContext* cx, Handle unwrappedStream, Handle chunk, + bool done) { + cx->check(chunk); + + // Step 1: Let reader be stream.[[reader]]. + Rooted unwrappedReader( + cx, UnwrapReaderFromStream(cx, unwrappedStream)); + if (!unwrappedReader) { + return false; + } + + // Step 2: Let read{Into}Request be the first element of + // reader.[[read{Into}Requests]]. + // Step 3: Remove read{Into}Request from reader.[[read{Into}Requests]], + // shifting all other elements downward (so that the second becomes + // the first, and so on). + Rooted unwrappedReadIntoRequests(cx, + unwrappedReader->requests()); + Rooted readIntoRequest( + cx, &unwrappedReadIntoRequests->popFirstAs(cx)); + MOZ_ASSERT(readIntoRequest); + if (!cx->compartment()->wrap(cx, &readIntoRequest)) { + return false; + } + + // Step 4: Resolve read{Into}Request.[[promise]] with + // ! ReadableStreamCreateReadResult(chunk, done, + // readIntoRequest.[[forAuthorCode]]). + PlainObject* iterResult = ReadableStreamCreateReadResult( + cx, chunk, done, unwrappedReader->forAuthorCode()); + if (!iterResult) { + return false; + } + + Rooted val(cx, ObjectValue(*iterResult)); + return ResolvePromise(cx, readIntoRequest, val); +} + +/** + * Streams spec, 3.5.9. ReadableStreamGetNumReadIntoRequests ( stream ) + * Streams spec, 3.5.10. ReadableStreamGetNumReadRequests ( stream ) + * (Identical implementation.) + */ +uint32_t js::ReadableStreamGetNumReadRequests(ReadableStream* stream) { + // Step 1: Return the number of elements in + // stream.[[reader]].[[read{Into}Requests]]. + if (!stream->hasReader()) { + return 0; + } + + JS::AutoSuppressGCAnalysis nogc; + ReadableStreamReader* reader = UnwrapReaderFromStreamNoThrow(stream); + + // Reader is a dead wrapper, treat it as non-existent. + if (!reader) { + return 0; + } + + ListObject* requests = reader->requests(); + if (!requests) { + return 0; + } + return requests->length(); +} + +/** + * Streams spec, 3.5.11. ReadableStreamHasBYOBReader ( stream ) + */ +[[nodiscard]] bool js::ReadableStreamHasBYOBReader( + JSContext* cx, Handle unwrappedStream, bool* result) { + MOZ_ASSERT(unwrappedStream); + // Step 1: Let reader be stream.[[reader]]. + // Step 2: If reader is undefined, return false. + if (!unwrappedStream->hasReader()) { + *result = false; + return true; + } + Rooted unwrappedReader( + cx, UnwrapReaderFromStream(cx, unwrappedStream)); + if (!unwrappedReader) { + return false; + } + + // Step 3: If ! ReadableStreamBYOBReader(reader) is false, return false. + // Step 4: Return true. + *result = unwrappedReader->is(); + return true; +} + +/** + * Streams spec 3.5.12. ReadableStreamHasDefaultReader ( stream ) + */ +[[nodiscard]] bool js::ReadableStreamHasDefaultReader( + JSContext* cx, Handle unwrappedStream, bool* result) { + // Step 1: Let reader be stream.[[reader]]. + // Step 2: If reader is undefined, return false. + if (!unwrappedStream->hasReader()) { + *result = false; + return true; + } + Rooted unwrappedReader( + cx, UnwrapReaderFromStream(cx, unwrappedStream)); + if (!unwrappedReader) { + return false; + } + + // Step 3: If ! ReadableStreamDefaultReader(reader) is false, return false. + // Step 4: Return true. + *result = unwrappedReader->is(); + return true; +} diff --git a/js/src/builtin/streams/ReadableStreamInternals.h b/js/src/builtin/streams/ReadableStreamInternals.h new file mode 100644 index 0000000000000..2aa37b45627a0 --- /dev/null +++ b/js/src/builtin/streams/ReadableStreamInternals.h @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* The interface between readable streams and controllers. */ + +#ifndef builtin_streams_ReadableStreamInternals_h +#define builtin_streams_ReadableStreamInternals_h + +#include "jstypes.h" // JS_PUBLIC_API +#include "builtin/streams/ReadableStreamReader.h" // js::ForAuthorCodeBool +#include "js/RootingAPI.h" // JS::Handle +#include "js/Value.h" // JS::Value + +struct JS_PUBLIC_API JSContext; +class JS_PUBLIC_API JSObject; + +namespace js { + +class PlainObject; +class PromiseObject; +class ReadableStream; + +[[nodiscard]] extern PromiseObject* ReadableStreamAddReadOrReadIntoRequest( + JSContext* cx, JS::Handle unwrappedStream); + +[[nodiscard]] extern bool ReadableStreamReaderErrorReadOrReadIntoRequests( + JSContext* cx, JS::Handle reader, + JS::Handle err); + +[[nodiscard]] extern JSObject* ReadableStreamCancel( + JSContext* cx, JS::Handle unwrappedStream, + JS::Handle reason); + +[[nodiscard]] extern bool ReadableStreamCloseInternal( + JSContext* cx, JS::Handle unwrappedStream); + +[[nodiscard]] extern PlainObject* ReadableStreamCreateReadResult( + JSContext* cx, JS::Handle value, bool done, + ForAuthorCodeBool forAuthorCode); + +[[nodiscard]] extern bool ReadableStreamErrorInternal( + JSContext* cx, JS::Handle unwrappedStream, + JS::Handle e); + +[[nodiscard]] extern bool ReadableStreamFulfillReadOrReadIntoRequest( + JSContext* cx, JS::Handle unwrappedStream, + JS::Handle chunk, bool done); + +extern uint32_t ReadableStreamGetNumReadRequests(ReadableStream* stream); + +[[nodiscard]] extern bool ReadableStreamHasBYOBReader( + JSContext* cx, JS::Handle unwrappedStream, bool* result); + +[[nodiscard]] extern bool ReadableStreamHasDefaultReader( + JSContext* cx, JS::Handle unwrappedStream, bool* result); + +} // namespace js + +#endif // builtin_streams_ReadableStreamInternals_h diff --git a/js/src/builtin/streams/ReadableStreamOperations.cpp b/js/src/builtin/streams/ReadableStreamOperations.cpp new file mode 100644 index 0000000000000..e6682e1c449d8 --- /dev/null +++ b/js/src/builtin/streams/ReadableStreamOperations.cpp @@ -0,0 +1,693 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* General readable stream abstract operations. */ + +#include "builtin/streams/ReadableStreamOperations.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT{,_IF} + +#include "builtin/Array.h" // js::NewDenseFullyAllocatedArray +#include "builtin/Promise.h" // js::RejectPromiseWithPendingError +#include "builtin/streams/PipeToState.h" // js::PipeToState +#include "builtin/streams/ReadableStream.h" // js::ReadableStream +#include "builtin/streams/ReadableStreamController.h" // js::ReadableStream{,Default}Controller +#include "builtin/streams/ReadableStreamDefaultControllerOperations.h" // js::ReadableStreamDefaultController{Close,Enqueue}, js::ReadableStreamControllerError, js::SourceAlgorithms +#include "builtin/streams/ReadableStreamInternals.h" // js::ReadableStreamCancel +#include "builtin/streams/ReadableStreamReader.h" // js::CreateReadableStreamDefaultReader, js::ForAuthorCodeBool, js::ReadableStream{,Default}Reader, js::ReadableStreamReaderGenericRead +#include "builtin/streams/TeeState.h" // js::TeeState +#include "js/CallAndConstruct.h" // JS::IsCallable +#include "js/CallArgs.h" // JS::CallArgs{,FromVp} +#include "js/Promise.h" // JS::CallOriginalPromiseThen, JS::AddPromiseReactions +#include "js/RootingAPI.h" // JS::{,Mutable}Handle, JS::Rooted +#include "js/Value.h" // JS::Value, JS::UndefinedHandleValue +#include "vm/JSContext.h" // JSContext +#include "vm/NativeObject.h" // js::NativeObject +#include "vm/ObjectOperations.h" // js::GetProperty +#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined + +#include "builtin/HandlerFunction-inl.h" // js::NewHandler, js::TargetFromHandler +#include "builtin/streams/MiscellaneousOperations-inl.h" // js::ResolveUnwrappedPromiseWithValue +#include "builtin/streams/ReadableStreamReader-inl.h" // js::UnwrapReaderFromStream +#include "vm/Compartment-inl.h" // JS::Compartment::wrap, js::Unwrap{Callee,Internal}Slot +#include "vm/JSContext-inl.h" // JSContext::check +#include "vm/JSObject-inl.h" // js::IsCallable, js::NewObjectWithClassProto +#include "vm/Realm-inl.h" // js::AutoRealm + +using js::IsCallable; +using js::NewHandler; +using js::NewObjectWithClassProto; +using js::PromiseObject; +using js::ReadableStream; +using js::ReadableStreamDefaultController; +using js::ReadableStreamDefaultControllerEnqueue; +using js::ReadableStreamDefaultReader; +using js::ReadableStreamReader; +using js::SourceAlgorithms; +using js::TargetFromHandler; +using js::TeeState; +using js::UnwrapCalleeSlot; + +using JS::CallArgs; +using JS::CallArgsFromVp; +using JS::Handle; +using JS::MutableHandle; +using JS::ObjectValue; +using JS::Rooted; +using JS::UndefinedHandleValue; +using JS::Value; + +/*** 3.4. General readable stream abstract operations ***********************/ + +// Streams spec, 3.4.1. AcquireReadableStreamBYOBReader ( stream ) +// Always inlined. + +// Streams spec, 3.4.2. AcquireReadableStreamDefaultReader ( stream ) +// Always inlined. See CreateReadableStreamDefaultReader. + +/** + * Streams spec, 3.4.3. CreateReadableStream ( + * startAlgorithm, pullAlgorithm, cancelAlgorithm + * [, highWaterMark [, sizeAlgorithm ] ] ) + * + * The start/pull/cancelAlgorithm arguments are represented instead as four + * arguments: sourceAlgorithms, underlyingSource, pullMethod, cancelMethod. + * See the comment on SetUpReadableStreamDefaultController. + */ +[[nodiscard]] static ReadableStream* CreateReadableStream( + JSContext* cx, SourceAlgorithms sourceAlgorithms, + Handle underlyingSource, + Handle pullMethod = UndefinedHandleValue, + Handle cancelMethod = UndefinedHandleValue, double highWaterMark = 1, + Handle sizeAlgorithm = UndefinedHandleValue, + Handle proto = nullptr) { + cx->check(underlyingSource, sizeAlgorithm, proto); + MOZ_ASSERT(sizeAlgorithm.isUndefined() || IsCallable(sizeAlgorithm)); + + // Step 1: If highWaterMark was not passed, set it to 1 (implicit). + // Step 2: If sizeAlgorithm was not passed, set it to an algorithm that + // returns 1 (implicit). + // Step 3: Assert: ! IsNonNegativeNumber(highWaterMark) is true. + MOZ_ASSERT(highWaterMark >= 0); + + // Step 4: Let stream be ObjectCreate(the original value of ReadableStream's + // prototype property). + // Step 5: Perform ! InitializeReadableStream(stream). + Rooted stream(cx, + ReadableStream::create(cx, nullptr, proto)); + if (!stream) { + return nullptr; + } + + // Step 6: Let controller be ObjectCreate(the original value of + // ReadableStreamDefaultController's prototype property). + // Step 7: Perform ? SetUpReadableStreamDefaultController(stream, + // controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, + // highWaterMark, sizeAlgorithm). + if (!SetUpReadableStreamDefaultController( + cx, stream, sourceAlgorithms, underlyingSource, pullMethod, + cancelMethod, highWaterMark, sizeAlgorithm)) { + return nullptr; + } + + // Step 8: Return stream. + return stream; +} + +// Streams spec, 3.4.4. CreateReadableByteStream ( +// startAlgorithm, pullAlgorithm, cancelAlgorithm +// [, highWaterMark [, autoAllocateChunkSize ] ] ) +// Not implemented. + +/** + * Streams spec, 3.4.5. InitializeReadableStream ( stream ) + */ +/* static */ [[nodiscard]] ReadableStream* ReadableStream::create( + JSContext* cx, void* nsISupportsObject_alreadyAddreffed /* = nullptr */, + Handle proto /* = nullptr */) { + // In the spec, InitializeReadableStream is always passed a newly created + // ReadableStream object. We instead create it here and return it below. + Rooted stream( + cx, NewObjectWithClassProto(cx, proto)); + if (!stream) { + return nullptr; + } + + static_assert(Slot_ISupports == 0, + "Must use right slot for JSCLASS_SLOT0_IS_NSISUPPORTS"); + JS::SetObjectISupports(stream, nsISupportsObject_alreadyAddreffed); + + // Step 1: Set stream.[[state]] to "readable". + stream->initStateBits(Readable); + MOZ_ASSERT(stream->readable()); + + // Step 2: Set stream.[[reader]] and stream.[[storedError]] to + // undefined (implicit). + MOZ_ASSERT(!stream->hasReader()); + MOZ_ASSERT(stream->storedError().isUndefined()); + + // Step 3: Set stream.[[disturbed]] to false (done in step 1). + MOZ_ASSERT(!stream->disturbed()); + + return stream; +} + +// Streams spec, 3.4.6. IsReadableStream ( x ) +// Using UnwrapAndTypeCheck templates instead. + +// Streams spec, 3.4.7. IsReadableStreamDisturbed ( stream ) +// Using stream->disturbed() instead. + +/** + * Streams spec, 3.4.8. IsReadableStreamLocked ( stream ) + */ +bool ReadableStream::locked() const { + // Step 1: Assert: ! IsReadableStream(stream) is true (implicit). + // Step 2: If stream.[[reader]] is undefined, return false. + // Step 3: Return true. + // Special-casing for streams with external sources. Those can be locked + // explicitly via JSAPI, which is indicated by a controller flag. + // IsReadableStreamLocked is called from the controller's constructor, at + // which point we can't yet call stream->controller(), but the source also + // can't be locked yet. + if (hasController() && controller()->sourceLocked()) { + return true; + } + return hasReader(); +} + +// Streams spec, 3.4.9. IsReadableStreamAsyncIterator ( x ) +// +// Not implemented. + +/** + * Streams spec, 3.4.10. ReadableStreamTee steps 12.c.i-x. + */ +static bool TeeReaderReadHandler(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted unwrappedTeeState(cx, + UnwrapCalleeSlot(cx, args, 0)); + if (!unwrappedTeeState) { + return false; + } + + Handle resultVal = args.get(0); + + // Step 12.c.i: Set reading to false. + unwrappedTeeState->unsetReading(); + + // Step 12.c.ii: Assert: Type(result) is Object. + Rooted result(cx, &resultVal.toObject()); + + bool done; + { + // Step 12.c.iii: Let done be ? Get(result, "done"). + // (This can fail only if `result` was nuked.) + Rooted doneVal(cx); + if (!GetProperty(cx, result, result, cx->names().done, &doneVal)) { + return false; + } + + // Step 12.c.iv: Assert: Type(done) is Boolean. + done = doneVal.toBoolean(); + } + + if (done) { + // Step 12.3 close steps + + // Step 1: Set reading to false (done unconditionally above). + // Step 2: If canceled1 is false, perform + // ! ReadableStreamDefaultControllerClose(branch1.[[controller]]). + if (!unwrappedTeeState->canceled1()) { + Rooted unwrappedBranch1( + cx, unwrappedTeeState->branch1()); + if (!ReadableStreamDefaultControllerClose(cx, unwrappedBranch1)) { + return false; + } + } + + // Step 3: If canceled2 is false, perform + // ! ReadableStreamDefaultControllerClose(branch2.[[controller]]). + if (!unwrappedTeeState->canceled2()) { + Rooted unwrappedBranch2( + cx, unwrappedTeeState->branch2()); + if (!ReadableStreamDefaultControllerClose(cx, unwrappedBranch2)) { + return false; + } + } + + // Step 4: If canceled1 is false or canceled2 is false, + // resolve cancelPromise with undefined. + if (!unwrappedTeeState->canceled1() || !unwrappedTeeState->canceled2()) { + Rooted unwrappedCancelPromise( + cx, unwrappedTeeState->cancelPromise()); + MOZ_ASSERT(unwrappedCancelPromise != nullptr); + + if (!ResolveUnwrappedPromiseWithUndefined(cx, unwrappedCancelPromise)) { + return false; + } + } + + args.rval().setUndefined(); + return true; + } + + // Step 12.c.vi: Let value be ! Get(result, "value"). + // (This can fail only if `result` was nuked.) + Rooted value(cx); + if (!GetProperty(cx, result, result, cx->names().value, &value)) { + return false; + } + + // Step 12.c.vii: Let value1 and value2 be value. + // Step 12.c.viii: If canceled2 is false and cloneForBranch2 is true, set + // value2 to + // ? StructuredDeserialize(? StructuredSerialize(value2), + // the current Realm Record). + // We don't yet support any specifications that use cloneForBranch2, and + // the Streams spec doesn't offer any way for author code to enable it, + // so it's always false here. + auto& value1 = value; + MOZ_ASSERT(!unwrappedTeeState->cloneForBranch2(), + "support for cloneForBranch2=true is not yet implemented"); + auto& value2 = value; + + Rooted unwrappedController(cx); + + // Step 12.c.ix: If canceled1 is false, perform + // ? ReadableStreamDefaultControllerEnqueue( + // branch1.[[readableStreamController]], value1). + if (!unwrappedTeeState->canceled1()) { + unwrappedController = unwrappedTeeState->branch1(); + if (!ReadableStreamDefaultControllerEnqueue(cx, unwrappedController, + value1)) { + return false; + } + } + + // Step 12.c.x: If canceled2 is false, perform + // ? ReadableStreamDefaultControllerEnqueue( + // branch2.[[readableStreamController]], value2). + if (!unwrappedTeeState->canceled2()) { + unwrappedController = unwrappedTeeState->branch2(); + if (!ReadableStreamDefaultControllerEnqueue(cx, unwrappedController, + value2)) { + return false; + } + } + + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 3.4.10. ReadableStreamTee step 12, "Let pullAlgorithm be the + * following steps:" + */ +[[nodiscard]] PromiseObject* js::ReadableStreamTee_Pull( + JSContext* cx, JS::Handle unwrappedTeeState) { + // Combine step 12.a/12.e far below, and handle steps 12.b-12.d after + // inverting step 12.a's "If reading is true" condition. + if (!unwrappedTeeState->reading()) { + // Step 12.b: Set reading to true. + unwrappedTeeState->setReading(); + + // Implicit in the spec: Unpack `reader` from the TeeState (by way of the + // stream stored in one of its slots). + Rooted unwrappedReader(cx); + { + Rooted unwrappedStream( + cx, UnwrapInternalSlot(cx, unwrappedTeeState, + TeeState::Slot_Stream)); + if (!unwrappedStream) { + return nullptr; + } + ReadableStreamReader* unwrappedReaderObj = + UnwrapReaderFromStream(cx, unwrappedStream); + if (!unwrappedReaderObj) { + return nullptr; + } + + unwrappedReader = &unwrappedReaderObj->as(); + } + + // Step 12.c: Let readPromise be the result of reacting to + // ! ReadableStreamDefaultReaderRead(reader) with the following + // fulfillment steps given the argument result: [...] + // Step 12.d: Set readPromise.[[PromiseIsHandled]] to true. + + // First, perform |ReadableStreamDefaultReaderRead(reader)|. + Rooted readerReadResultPromise( + cx, js::ReadableStreamDefaultReaderRead(cx, unwrappedReader)); + if (!readerReadResultPromise) { + return nullptr; + } + + // Next, create a function to perform the fulfillment steps under step 12.c + // (implemented in the |TeeReaderReadHandler| C++ function). + Rooted teeState(cx, unwrappedTeeState); + if (!cx->compartment()->wrap(cx, &teeState)) { + return nullptr; + } + + Rooted onFulfilled( + cx, NewHandler(cx, TeeReaderReadHandler, teeState)); + if (!onFulfilled) { + return nullptr; + } + + // Finally, perform those fulfillment steps when |readerReadResultPromise| + // fulfills. (Step 12.c doesn't provide rejection steps, so don't handle + // rejection.) + // + // The spec's |readPromise| promise is unobservable, so implement this using + // a JSAPI function that acts as if it created |readPromise| but doesn't + // actually do so. + // + // Step 12.d causes |readPromise| to be treated as handled, even if it + // rejects. Use |JS::AddPromiseReactionsIgnoringUnhandledRejection|, not + // |JS::AddPromiseReactions|, to avoid reporting a freshly-consed-up promise + // as rejected if |readerReadResultPromise| rejects. + if (!JS::AddPromiseReactionsIgnoringUnhandledRejection( + cx, readerReadResultPromise, onFulfilled, nullptr)) { + return nullptr; + } + } + + // Step 12.a: (If reading is true,) return a promise resolved with undefined. + // Step 12.e: Return a promise resolved with undefined. + return PromiseResolvedWithUndefined(cx); +} + +/** + * Cancel one branch of a tee'd stream with the given |reason_|. + * + * Streams spec, 3.4.10. ReadableStreamTee steps 13 and 14: "Let + * cancel1Algorithm/cancel2Algorithm be the following steps, taking a reason + * argument:" + */ +[[nodiscard]] JSObject* js::ReadableStreamTee_Cancel( + JSContext* cx, JS::Handle unwrappedTeeState, + JS::Handle unwrappedBranch, + JS::Handle reason) { + Rooted unwrappedStream( + cx, UnwrapInternalSlot(cx, unwrappedTeeState, + TeeState::Slot_Stream)); + if (!unwrappedStream) { + return nullptr; + } + + bool bothBranchesCanceled = false; + + // Step 13/14.a: Set canceled1/canceled2 to true. + // Step 13/14.b: Set reason1/reason2 to reason. + { + AutoRealm ar(cx, unwrappedTeeState); + + Rooted unwrappedReason(cx, reason); + if (!cx->compartment()->wrap(cx, &unwrappedReason)) { + return nullptr; + } + + if (unwrappedBranch->isTeeBranch1()) { + unwrappedTeeState->setCanceled1(unwrappedReason); + bothBranchesCanceled = unwrappedTeeState->canceled2(); + } else { + MOZ_ASSERT(unwrappedBranch->isTeeBranch2()); + unwrappedTeeState->setCanceled2(unwrappedReason); + bothBranchesCanceled = unwrappedTeeState->canceled1(); + } + } + + Rooted unwrappedCancelPromise( + cx, unwrappedTeeState->cancelPromise()); + MOZ_ASSERT(unwrappedCancelPromise != nullptr); + + // Step 13/14.c: If canceled2/canceled1 is true, + if (bothBranchesCanceled) { + // Step 13/14.c.i: Let compositeReason be + // ! CreateArrayFromList(« reason1, reason2 »). + Rooted compositeReason(cx); + { + Rooted reason1(cx, unwrappedTeeState->reason1()); + Rooted reason2(cx, unwrappedTeeState->reason2()); + if (!cx->compartment()->wrap(cx, &reason1) || + !cx->compartment()->wrap(cx, &reason2)) { + return nullptr; + } + + ArrayObject* reasonArray = NewDenseFullyAllocatedArray(cx, 2); + if (!reasonArray) { + return nullptr; + } + reasonArray->setDenseInitializedLength(2); + reasonArray->initDenseElement(0, reason1); + reasonArray->initDenseElement(1, reason2); + + compositeReason = ObjectValue(*reasonArray); + } + + // Step 13/14.c.ii: Let cancelResult be + // ! ReadableStreamCancel(stream, compositeReason). + // In our implementation, this can fail with OOM. The best course then + // is to reject cancelPromise with an OOM error. + Rooted cancelResult( + cx, js::ReadableStreamCancel(cx, unwrappedStream, compositeReason)); + if (!cancelResult) { + // Handle the OOM case mentioned above. + AutoRealm ar(cx, unwrappedCancelPromise); + if (!RejectPromiseWithPendingError(cx, unwrappedCancelPromise)) { + return nullptr; + } + } else { + // Step 13/14.c.iii: Resolve cancelPromise with cancelResult. + Rooted cancelResultVal(cx, ObjectValue(*cancelResult)); + if (!ResolveUnwrappedPromiseWithValue(cx, unwrappedCancelPromise, + cancelResultVal)) { + return nullptr; + } + } + } + + // Step 13/14.d: Return cancelPromise. + Rooted cancelPromise(cx, unwrappedCancelPromise); + if (!cx->compartment()->wrap(cx, &cancelPromise)) { + return nullptr; + } + + return cancelPromise; +} + +/* + * https://streams.spec.whatwg.org/#readable-stream-tee + * ReadableStreamTee(stream, cloneForBranch2) + * + * Step 18: Upon rejection of reader.[[closedPromise]] with reason r, + */ +static bool TeeReaderErroredHandler(JSContext* cx, unsigned argc, + JS::Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted teeState(cx, TargetFromHandler(args)); + Handle reason = args.get(0); + + Rooted unwrappedBranchController(cx); + + // Step 18.1: Perform + // ! ReadableStreamDefaultControllerError( + // branch1.[[controller]], r). + unwrappedBranchController = teeState->branch1(); + if (!ReadableStreamControllerError(cx, unwrappedBranchController, reason)) { + return false; + } + + // Step 18.2: Perform + // ! ReadableStreamDefaultControllerError( + // branch2.[[controller]], r). + unwrappedBranchController = teeState->branch2(); + if (!ReadableStreamControllerError(cx, unwrappedBranchController, reason)) { + return false; + } + + // Step 18.3: If canceled1 is false or canceled2 is false, + // resolve cancelPromise with undefined. + if (!teeState->canceled1() || !teeState->canceled2()) { + Rooted unwrappedCancelPromise(cx, + teeState->cancelPromise()); + MOZ_ASSERT(unwrappedCancelPromise != nullptr); + + if (!ResolveUnwrappedPromiseWithUndefined(cx, unwrappedCancelPromise)) { + return false; + } + } + + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 3.4.10. ReadableStreamTee ( stream, cloneForBranch2 ) + */ +[[nodiscard]] bool js::ReadableStreamTee( + JSContext* cx, JS::Handle unwrappedStream, + bool cloneForBranch2, JS::MutableHandle branch1Stream, + JS::MutableHandle branch2Stream) { + // BYOB stream tee is unimplemented + if (unwrappedStream->controller()->is()) { + Rooted unwrappedController( + cx, &unwrappedStream->controller()->as()); + if (!unwrappedController->hasExternalSource()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMTEE_BYOB); + return false; + } + } + + // Step 1: Assert: ! IsReadableStream(stream) is true (implicit). + + // Step 2: Assert: Type(cloneForBranch2) is Boolean (implicit). + // + // The streams spec only ever passes |cloneForBranch2 = false|. It's expected + // that external specs that pass |cloneForBranch2 = true| will at some point + // come into existence, but we don't presently implement any such specs. + if (cloneForBranch2) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMTEE_CLONE); + return false; + } + + // Step 3: Let reader be ? AcquireReadableStreamDefaultReader(stream). + Rooted reader( + cx, CreateReadableStreamDefaultReader(cx, unwrappedStream, + ForAuthorCodeBool::No)); + if (!reader) { + return false; + } + + // Several algorithms close over the variables initialized in the next few + // steps, so we allocate them in an object, the TeeState. The algorithms + // also close over `stream` and `reader`, so TeeState gets a reference to + // the stream. + // + // Step 4: Let reading be false. + // Step 5: Let canceled1 be false. + // Step 6: Let canceled2 be false. + // Step 7: Let reason1 be undefined. + // Step 8: Let reason2 be undefined. + // Step 9: Let branch1 be undefined. + // Step 10: Let branch2 be undefined. + // Step 11: Let cancelPromise be a new promise. + Rooted teeState(cx, TeeState::create(cx, unwrappedStream)); + if (!teeState) { + return false; + } + + MOZ_ASSERT(!teeState->reading()); + MOZ_ASSERT(!teeState->canceled1()); + MOZ_ASSERT(!teeState->canceled2()); + + // Step 12: Let pullAlgorithm be the following steps: [...] + // Step 13: Let cancel1Algorithm be the following steps: [...] + // Step 14: Let cancel2Algorithm be the following steps: [...] + // Step 15: Let startAlgorithm be an algorithm that returns undefined. + // + // Implicit. Our implementation does not use objects to represent + // [[pullAlgorithm]], [[cancelAlgorithm]], and so on. Instead, we decide + // which one to perform based on class checks. For example, our + // implementation of ReadableStreamControllerCallPullIfNeeded checks + // whether the stream's underlyingSource is a TeeState object. + + // Step 16: Set branch1 to + // ! CreateReadableStream(startAlgorithm, pullAlgorithm, + // cancel1Algorithm). + Rooted underlyingSource(cx, ObjectValue(*teeState)); + branch1Stream.set( + CreateReadableStream(cx, SourceAlgorithms::Tee, underlyingSource)); + if (!branch1Stream) { + return false; + } + + Rooted branch1(cx); + branch1 = &branch1Stream->controller()->as(); + branch1->setTeeBranch1(); + teeState->setBranch1(branch1); + + // Step 17: Set branch2 to + // ! CreateReadableStream(startAlgorithm, pullAlgorithm, + // cancel2Algorithm). + branch2Stream.set( + CreateReadableStream(cx, SourceAlgorithms::Tee, underlyingSource)); + if (!branch2Stream) { + return false; + } + + Rooted branch2(cx); + branch2 = &branch2Stream->controller()->as(); + branch2->setTeeBranch2(); + teeState->setBranch2(branch2); + + // Step 18: Upon rejection of reader.[[closedPromise]] with reason r, [...] + Rooted closedPromise(cx, reader->closedPromise()); + + Rooted onRejected( + cx, NewHandler(cx, TeeReaderErroredHandler, teeState)); + if (!onRejected) { + return false; + } + + if (!JS::AddPromiseReactions(cx, closedPromise, nullptr, onRejected)) { + return false; + } + + // Step 19: Return « branch1, branch2 ». + return true; +} + +/** + * Streams spec, 3.4.10. + * ReadableStreamPipeTo ( source, dest, preventClose, preventAbort, + * preventCancel, signal ) + */ +PromiseObject* js::ReadableStreamPipeTo(JSContext* cx, + Handle unwrappedSource, + Handle unwrappedDest, + bool preventClose, bool preventAbort, + bool preventCancel, + Handle signal) { + cx->check(signal); + + // Step 1. Assert: ! IsReadableStream(source) is true. + // Step 2. Assert: ! IsWritableStream(dest) is true. + // Step 3. Assert: Type(preventClose) is Boolean, Type(preventAbort) is + // Boolean, and Type(preventCancel) is Boolean. + // (These are guaranteed by the type system.) + + // Step 12: Let promise be a new promise. + // + // We reorder this so that this promise can be rejected and returned in case + // of internal error. + Rooted promise(cx, PromiseObject::createSkippingExecutor(cx)); + if (!promise) { + return nullptr; + } + + // Steps 4-11, 13-14. + Rooted pipeToState( + cx, + PipeToState::create(cx, promise, unwrappedSource, unwrappedDest, + preventClose, preventAbort, preventCancel, signal)); + if (!pipeToState) { + if (!RejectPromiseWithPendingError(cx, promise)) { + return nullptr; + } + + return promise; + } + + // Step 15. + return promise; +} diff --git a/js/src/builtin/streams/ReadableStreamOperations.h b/js/src/builtin/streams/ReadableStreamOperations.h new file mode 100644 index 0000000000000..994d9701eb4c7 --- /dev/null +++ b/js/src/builtin/streams/ReadableStreamOperations.h @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* General readable stream abstract operations. */ + +#ifndef builtin_streams_ReadableStreamOperations_h +#define builtin_streams_ReadableStreamOperations_h + +#include "js/RootingAPI.h" // JS::Handle +#include "js/Value.h" // JS::Value + +class JS_PUBLIC_API JSObject; + +namespace js { + +class PromiseObject; +class ReadableStream; +class ReadableStreamDefaultController; +class TeeState; +class WritableStream; + +[[nodiscard]] extern PromiseObject* ReadableStreamTee_Pull( + JSContext* cx, JS::Handle unwrappedTeeState); + +[[nodiscard]] extern JSObject* ReadableStreamTee_Cancel( + JSContext* cx, JS::Handle unwrappedTeeState, + JS::Handle unwrappedBranch, + JS::Handle reason); + +[[nodiscard]] extern bool ReadableStreamTee( + JSContext* cx, JS::Handle unwrappedStream, + bool cloneForBranch2, JS::MutableHandle branch1Stream, + JS::MutableHandle branch2Stream); + +[[nodiscard]] extern PromiseObject* ReadableStreamPipeTo( + JSContext* cx, JS::Handle unwrappedSource, + JS::Handle unwrappedDest, bool preventClose, + bool preventAbort, bool preventCancel, JS::Handle signal); + +} // namespace js + +#endif // builtin_streams_ReadableStreamOperations_h diff --git a/js/src/builtin/streams/ReadableStreamReader-inl.h b/js/src/builtin/streams/ReadableStreamReader-inl.h new file mode 100644 index 0000000000000..aa4efe7e47e81 --- /dev/null +++ b/js/src/builtin/streams/ReadableStreamReader-inl.h @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +#ifndef builtin_streams_ReadableStreamReader_inl_h +#define builtin_streams_ReadableStreamReader_inl_h + +#include "builtin/streams/ReadableStreamReader.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT + +#include "jsfriendapi.h" // JS_IsDeadWrapper + +#include "builtin/streams/ReadableStream.h" // js::ReadableStream +#include "js/Proxy.h" // js::IsProxy +#include "js/RootingAPI.h" // JS::Handle +#include "vm/NativeObject.h" // js::NativeObject::getFixedSlot + +#include "builtin/streams/Streams-inl.h" // js::UnwrapInternalSlot + +namespace js { + +/** + * Returns the stream associated with the given reader. + */ +[[nodiscard]] inline ReadableStream* UnwrapStreamFromReader( + JSContext* cx, JS::Handle reader) { + MOZ_ASSERT(reader->hasStream()); + return UnwrapInternalSlot(cx, reader, + ReadableStreamReader::Slot_Stream); +} + +/** + * Returns the reader associated with the given stream. + * + * Must only be called on ReadableStreams that already have a reader + * associated with them. + * + * If the reader is a wrapper, it will be unwrapped, so the result might not be + * an object from the currently active compartment. + */ +[[nodiscard]] inline ReadableStreamReader* UnwrapReaderFromStream( + JSContext* cx, JS::Handle stream) { + return UnwrapInternalSlot(cx, stream, + ReadableStream::Slot_Reader); +} + +[[nodiscard]] inline ReadableStreamReader* UnwrapReaderFromStreamNoThrow( + ReadableStream* stream) { + JSObject* readerObj = + &stream->getFixedSlot(ReadableStream::Slot_Reader).toObject(); + if (IsProxy(readerObj)) { + if (JS_IsDeadWrapper(readerObj)) { + return nullptr; + } + + readerObj = readerObj->maybeUnwrapAs(); + if (!readerObj) { + return nullptr; + } + } + + return &readerObj->as(); +} + +} // namespace js + +#endif // builtin_streams_ReadableStreamReader_inl_h diff --git a/js/src/builtin/streams/ReadableStreamReader.cpp b/js/src/builtin/streams/ReadableStreamReader.cpp new file mode 100644 index 0000000000000..360f292bb223c --- /dev/null +++ b/js/src/builtin/streams/ReadableStreamReader.cpp @@ -0,0 +1,259 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* ReadableStream reader abstract operations. */ + +#include "builtin/streams/ReadableStreamReader-inl.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT{,_IF} + +#include "jsfriendapi.h" // JS_ReportErrorNumberASCII + +#include "builtin/streams/PullIntoDescriptor.h" // js::PullIntoDescriptor +#include "builtin/streams/ReadableStream.h" // js::ReadableStream +#include "builtin/streams/ReadableStreamController.h" // js::ReadableStreamController +#include "builtin/streams/ReadableStreamInternals.h" // js::ReadableStream{Cancel,CreateReadResult} +#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* +#include "js/RootingAPI.h" // JS::Handle, JS::Rooted +#include "js/Value.h" // JS::Value, JS::UndefinedHandleValue +#include "vm/Interpreter.h" // js::GetAndClearException +#include "vm/JSContext.h" // JSContext +#include "vm/PlainObject.h" // js::PlainObject +#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined +#include "vm/Runtime.h" // JSRuntime + +#include "builtin/Promise-inl.h" // js::SetSettledPromiseIsHandled +#include "vm/Compartment-inl.h" // JS::Compartment::wrap, js::UnwrapInternalSlot +#include "vm/List-inl.h" // js::StoreNewListInFixedSlot +#include "vm/Realm-inl.h" // js::AutoRealm + +using JS::Handle; +using JS::Rooted; +using JS::Value; + +using js::PromiseObject; +using js::PullIntoDescriptor; +using js::ReadableStreamController; +using js::ReaderType; +using js::UnwrapStreamFromReader; + +/*** 3.8. Readable stream reader abstract operations ************************/ + +// Streams spec, 3.8.1. IsReadableStreamDefaultReader ( x ) +// Implemented via is() + +// Streams spec, 3.8.2. IsReadableStreamBYOBReader ( x ) +// Implemented via is() + +/** + * Streams spec, 3.8.3. ReadableStreamReaderGenericCancel ( reader, reason ) + */ +[[nodiscard]] JSObject* js::ReadableStreamReaderGenericCancel( + JSContext* cx, Handle unwrappedReader, + Handle reason) { + // Step 1: Let stream be reader.[[ownerReadableStream]]. + // Step 2: Assert: stream is not undefined (implicit). + Rooted unwrappedStream( + cx, UnwrapStreamFromReader(cx, unwrappedReader)); + if (!unwrappedStream) { + return nullptr; + } + + // Step 3: Return ! ReadableStreamCancel(stream, reason). + return js::ReadableStreamCancel(cx, unwrappedStream, reason); +} + +/** + * Streams spec, 3.8.4. + * ReadableStreamReaderGenericInitialize ( reader, stream ) + */ +[[nodiscard]] bool js::ReadableStreamReaderGenericInitialize( + JSContext* cx, Handle reader, + Handle unwrappedStream, ForAuthorCodeBool forAuthorCode) { + cx->check(reader); + + // Step 1: Set reader.[[forAuthorCode]] to true. + reader->setForAuthorCode(forAuthorCode); + + // Step 2: Set reader.[[ownerReadableStream]] to stream. + { + Rooted readerCompartmentStream(cx, unwrappedStream); + if (!cx->compartment()->wrap(cx, &readerCompartmentStream)) { + return false; + } + reader->setStream(readerCompartmentStream); + } + + // Step 3 is moved to the end. + + // Step 4: If stream.[[state]] is "readable", + Rooted promise(cx); + if (unwrappedStream->readable()) { + // Step a: Set reader.[[closedPromise]] to a new promise. + promise = PromiseObject::createSkippingExecutor(cx); + } else if (unwrappedStream->closed()) { + // Step 5: Otherwise, if stream.[[state]] is "closed", + // Step a: Set reader.[[closedPromise]] to a promise resolved with + // undefined. + promise = PromiseResolvedWithUndefined(cx); + } else { + // Step 6: Otherwise, + // Step a: Assert: stream.[[state]] is "errored". + MOZ_ASSERT(unwrappedStream->errored()); + + // Step b: Set reader.[[closedPromise]] to a promise rejected with + // stream.[[storedError]]. + Rooted storedError(cx, unwrappedStream->storedError()); + if (!cx->compartment()->wrap(cx, &storedError)) { + return false; + } + promise = PromiseObject::unforgeableReject(cx, storedError); + if (!promise) { + return false; + } + + // Step c. Set reader.[[closedPromise]].[[PromiseIsHandled]] to true. + js::SetSettledPromiseIsHandled(cx, promise); + } + + if (!promise) { + return false; + } + + reader->setClosedPromise(promise); + + // Step 4 of caller 3.6.3. new ReadableStreamDefaultReader(stream): + // Step 5 of caller 3.7.3. new ReadableStreamBYOBReader(stream): + // Set this.[[read{Into}Requests]] to a new empty List. + if (!StoreNewListInFixedSlot(cx, reader, + ReadableStreamReader::Slot_Requests)) { + return false; + } + + // Step 3: Set stream.[[reader]] to reader. + // Doing this last prevents a partially-initialized reader from being + // attached to the stream (and possibly left there on OOM). + { + AutoRealm ar(cx, unwrappedStream); + Rooted streamCompartmentReader(cx, reader); + if (!cx->compartment()->wrap(cx, &streamCompartmentReader)) { + return false; + } + unwrappedStream->setReader(streamCompartmentReader); + } + + return true; +} + +/** + * https://streams.spec.whatwg.org/#readable-stream-reader-generic-release + */ +[[nodiscard]] bool js::ReadableStreamReaderGenericRelease( + JSContext* cx, Handle unwrappedReader) { + // Let stream be reader.[[stream]]. + // Assert: stream is not undefined. + Rooted unwrappedStream( + cx, UnwrapStreamFromReader(cx, unwrappedReader)); + if (!unwrappedStream) { + return false; + } + + // Assert: stream.[[reader]] is reader. +#ifdef DEBUG + // The assertion is weakened a bit to allow for nuked wrappers. + ReadableStreamReader* unwrappedReader2 = + UnwrapReaderFromStreamNoThrow(unwrappedStream); + MOZ_ASSERT_IF(unwrappedReader2, unwrappedReader2 == unwrappedReader); +#endif + + // Create an exception to reject promises with below. We don't have a + // clean way to do this, unfortunately. + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMREADER_RELEASED); + Rooted exn(cx); + if (!cx->isExceptionPending() || !GetAndClearException(cx, &exn)) { + // Uncatchable error. Die immediately without resolving + // reader.[[closedPromise]]. + return false; + } + + // If stream.[[state]] is "readable", reject reader.[[closedPromise]] with a + // TypeError exception. + Rooted unwrappedClosedPromise(cx); + if (unwrappedStream->readable()) { + unwrappedClosedPromise = UnwrapInternalSlot( + cx, unwrappedReader, ReadableStreamReader::Slot_ClosedPromise); + if (!unwrappedClosedPromise) { + return false; + } + + AutoRealm ar(cx, unwrappedClosedPromise); + if (!cx->compartment()->wrap(cx, &exn)) { + return false; + } + if (!PromiseObject::reject(cx, unwrappedClosedPromise, exn)) { + return false; + } + } else { + // Otherwise, set reader.[[closedPromise]] to a promise rejected with a + // TypeError exception. + Rooted closedPromise(cx, + PromiseObject::unforgeableReject(cx, exn)); + if (!closedPromise) { + return false; + } + unwrappedClosedPromise = &closedPromise->as(); + + AutoRealm ar(cx, unwrappedReader); + if (!cx->compartment()->wrap(cx, &closedPromise)) { + return false; + } + unwrappedReader->setClosedPromise(closedPromise); + } + + // Set reader.[[closedPromise]].[[PromiseIsHandled]] to true. + js::SetSettledPromiseIsHandled(cx, unwrappedClosedPromise); + + // Perform ! stream.[[controller]].[[ReleaseSteps]](). + // https://streams.spec.whatwg.org/#abstract-opdef-readablebytestreamcontroller-releasesteps + if (unwrappedStream->controller()->is()) { + Rooted unwrappedController( + cx, &unwrappedStream->controller()->as()); + + // If this.[[pendingPullIntos]] is not empty, + if (unwrappedController->pendingPullIntos()->length() > 0) { + // Let firstPendingPullInto be this.[[pendingPullIntos]][0]. + Rooted firstPendingPullInto( + cx, UnwrapAndDowncastObject( + cx, &unwrappedController->pendingPullIntos() + ->popFirstAs(cx))); + + // Set firstPendingPullInto’s reader type to "none". + firstPendingPullInto->setReaderType(ReaderType::None); + + // Set this.[[pendingPullIntos]] to the list « firstPendingPullInto ». + if (!StoreNewListInFixedSlot( + cx, unwrappedController, + ReadableByteStreamController::Slot_PendingPullIntos)) { + return false; + } + Rooted firstPendingPullIntoValue(cx); + firstPendingPullIntoValue.setObject(*firstPendingPullInto); + if (!unwrappedController->pendingPullIntos()->append( + cx, firstPendingPullIntoValue)) { + return false; + } + } + } + + // Set stream.[[reader]] to undefined. + unwrappedStream->clearReader(); + + // Set reader.[[stream]] to undefined. + unwrappedReader->clearStream(); + + return true; +} diff --git a/js/src/builtin/streams/ReadableStreamReader.h b/js/src/builtin/streams/ReadableStreamReader.h new file mode 100644 index 0000000000000..b88c1a4caf5da --- /dev/null +++ b/js/src/builtin/streams/ReadableStreamReader.h @@ -0,0 +1,172 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* ReadableStream readers and generic reader operations. */ + +#ifndef builtin_streams_ReadableStreamReader_h +#define builtin_streams_ReadableStreamReader_h + +#include "jstypes.h" // JS_PUBLIC_API +#include "js/Class.h" // JSClass, js::ClassSpec +#include "js/RootingAPI.h" // JS::Handle +#include "js/Value.h" // JS::{,Boolean,Object,Undefined}Value +#include "vm/JSObject.h" // JSObject::is +#include "vm/List.h" // js::ListObject +#include "vm/NativeObject.h" // js::NativeObject + +struct JS_PUBLIC_API JSContext; + +namespace js { + +class PromiseObject; +class ReadableStream; + +/** + * Tells whether or not read() result objects inherit from Object.prototype. + * Generally, they should do so only if the reader was created by author code. + * See . + */ +enum class ForAuthorCodeBool { No, Yes }; + +class ReadableStreamReader : public NativeObject { + public: + /** + * Memory layout of Stream Reader instances. + * + * See https://streams.spec.whatwg.org/#default-reader-internal-slots and + * https://streams.spec.whatwg.org/#byob-reader-internal-slots for details. + * + * Note that [[readRequests]] and [[readIntoRequests]] are treated the same + * in our implementation. + * + * Of the stored values, Stream and ClosedPromise might be + * cross-compartment wrapper wrappers. + * + * For Stream, this can happen if the Reader was created by applying a + * different compartment's ReadableStream.prototype.getReader method. + * + * For ClosedPromise, it can be caused by applying a different + * compartment's ReadableStream*Reader.prototype.releaseLock method. + * + * Requests is guaranteed to be in the same compartment as the Reader, but + * can contain wrapped request objects from other globals. + */ + enum Slots { + Slot_Stream, + Slot_Requests, + Slot_ClosedPromise, + Slot_ForAuthorCode, + SlotCount, + }; + + bool hasStream() const { return !getFixedSlot(Slot_Stream).isUndefined(); } + void setStream(JSObject* stream) { + setFixedSlot(Slot_Stream, JS::ObjectValue(*stream)); + } + void clearStream() { setFixedSlot(Slot_Stream, JS::UndefinedValue()); } + bool isClosed() { return !hasStream(); } + + /** + * Tells whether this reader was created by author code. + * + * This returns Yes for readers created using `stream.getReader()`, and No + * for readers created for the internal use of algorithms like + * `stream.tee()` and `new Response(stream)`. + * + * The standard does not have this field. Instead, eight algorithms take a + * forAuthorCode parameter, and a [[forAuthorCode]] field is part of each + * read request. But the behavior is always equivalent to treating readers + * created by author code as having a bit set on them. We implement it that + * way for simplicity. + */ + ForAuthorCodeBool forAuthorCode() const { + return getFixedSlot(Slot_ForAuthorCode).toBoolean() ? ForAuthorCodeBool::Yes + : ForAuthorCodeBool::No; + } + void setForAuthorCode(ForAuthorCodeBool value) { + setFixedSlot(Slot_ForAuthorCode, + JS::BooleanValue(value == ForAuthorCodeBool::Yes)); + } + + ListObject* requests() const { + Value requests = getFixedSlot(Slot_Requests); + if (requests.isUndefined()) { + return nullptr; + } + return &requests.toObject().as(); + } + void clearRequests() { setFixedSlot(Slot_Requests, JS::UndefinedValue()); } + + JSObject* closedPromise() const { + return &getFixedSlot(Slot_ClosedPromise).toObject(); + } + void setClosedPromise(JSObject* wrappedPromise) { + setFixedSlot(Slot_ClosedPromise, JS::ObjectValue(*wrappedPromise)); + } + + static const JSClass class_; +}; + +class ReadableStreamDefaultReader : public ReadableStreamReader { + public: + static bool constructor(JSContext* cx, unsigned argc, JS::Value* vp); + static const ClassSpec classSpec_; + static const JSClass class_; + static const ClassSpec protoClassSpec_; + static const JSClass protoClass_; +}; + +[[nodiscard]] extern ReadableStreamDefaultReader* +CreateReadableStreamDefaultReader(JSContext* cx, + JS::Handle unwrappedStream, + ForAuthorCodeBool forAuthorCode, + JS::Handle proto = nullptr); + +[[nodiscard]] extern PromiseObject* ReadableStreamDefaultReaderRead( + JSContext* cx, JS::Handle unwrappedReader); + +[[nodiscard]] extern JSObject* ReadableStreamReaderGenericCancel( + JSContext* cx, JS::Handle unwrappedReader, + JS::Handle reason); + +[[nodiscard]] extern bool ReadableStreamReaderGenericInitialize( + JSContext* cx, JS::Handle reader, + JS::Handle unwrappedStream, + ForAuthorCodeBool forAuthorCode); + +[[nodiscard]] extern bool ReadableStreamReaderGenericRelease( + JSContext* cx, JS::Handle unwrappedReader); + +} // namespace js + +namespace js { + +class ReadableStreamBYOBReader : public ReadableStreamReader { + public: + static bool constructor(JSContext* cx, unsigned argc, JS::Value* vp); + static const ClassSpec classSpec_; + static const JSClass class_; + static const ClassSpec protoClassSpec_; + static const JSClass protoClass_; +}; + +[[nodiscard]] extern ReadableStreamBYOBReader* CreateReadableStreamBYOBReader( + JSContext* cx, JS::Handle unwrappedStream, + ForAuthorCodeBool forAuthorCode, JS::Handle proto = nullptr); + +[[nodiscard]] extern PromiseObject* ReadableStreamBYOBReaderRead( + JSContext* cx, JS::Handle unwrappedReader, + JS::Handle view); + +} // namespace js + +template <> +inline bool JSObject::is() const { + return is() || + is(); +} + +#endif // builtin_streams_ReadableStreamReader_h diff --git a/js/src/builtin/streams/StreamAPI.cpp b/js/src/builtin/streams/StreamAPI.cpp new file mode 100644 index 0000000000000..b403ca3cfe2a2 --- /dev/null +++ b/js/src/builtin/streams/StreamAPI.cpp @@ -0,0 +1,861 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Public and friend stream APIs for external use. */ + +#include "mozilla/Assertions.h" // MOZ_ASSERT{,_IF} + +#include // uint32_t, uintptr_t + +#include "jsfriendapi.h" // js::IsObjectInContextCompartment +#include "jstypes.h" // JS_{FRIEND,PUBLIC}_API + +#include "builtin/streams/ReadableStream.h" // js::ReadableStream +#include "builtin/streams/ReadableStreamController.h" // js::CheckReadableStreamControllerCanCloseOrEnqueue +#include "builtin/streams/ReadableStreamDefaultControllerOperations.h" // js::ReadableStreamController{Error,GetDesiredSizeUnchecked}, js::SetUpReadableStreamDefaultControllerFromUnderlyingSource +#include "builtin/streams/ReadableStreamInternals.h" // js::ReadableStream{Cancel,FulfillReadOrReadIntoRequest,GetNumReadRequests,HasDefaultReader} +#include "builtin/streams/ReadableStreamOperations.h" // js::ReadableStreamTee +#include "builtin/streams/ReadableStreamReader.h" // js::ReadableStream{,Default}Reader, js::ForAuthorCodeBool +#include "builtin/streams/StreamController.h" // js::StreamController +#include "builtin/streams/WritableStream.h" // js::WritableStream +#include "builtin/streams/WritableStreamDefaultController.h" // js::WritableStreamDefaultController +#include "builtin/streams/WritableStreamDefaultControllerOperations.h" // js::WritableStreamDefaultControllerError, js::SetUpWritableStreamDefaultControllerFromUnderlyingSink +#include "builtin/streams/WritableStreamDefaultWriter.h" // js::CreateWritableStreamDefaultWriter +#include "gc/Zone.h" // JS::Zone +#include "js/Context.h" // js::AssertHeapIsIdle +#include "js/ErrorReport.h" // JS_ReportErrorNumberASCII +#include "js/experimental/TypedData.h" // JS_GetArrayBufferViewData, JS_NewUint8Array +#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* +#include "js/GCAPI.h" // JS::AutoCheckCannotGC, JS::AutoSuppressGCAnalysis +#include "js/Object.h" // JS::SetObjectISupports +#include "js/RootingAPI.h" // JS::{,Mutable}Handle, JS::Rooted +#include "js/Stream.h" // JS::ReadableStreamUnderlyingSource +#include "js/Value.h" // JS::{,Object,Undefined}Value +#include "vm/ArrayBufferViewObject.h" // js::ArrayBufferViewObject +#include "vm/JSContext.h" // JSContext, CHECK_THREAD +#include "vm/JSObject.h" // JSObject +#include "vm/PlainObject.h" // js::PlainObject +#include "vm/PromiseObject.h" // js::PromiseObject + +#include "builtin/streams/ReadableStreamReader-inl.h" // js::UnwrapStreamFromReader +#include "vm/Compartment-inl.h" // JS::Compartment::wrap, js::UnwrapAndDowncastObject +#include "vm/JSObject-inl.h" // js::NewBuiltinClassInstance +#include "vm/Realm-inl.h" // js::AutoRealm + +using js::ArrayBufferViewObject; +using js::AssertHeapIsIdle; +using js::AutoRealm; +using js::ForAuthorCodeBool; +using js::GetErrorMessage; +using js::IsObjectInContextCompartment; +using js::NewBuiltinClassInstance; +using js::PlainObject; +using js::ReadableByteStreamController; +using js::ReadableByteStreamControllerClose; +using js::ReadableStream; +using js::ReadableStreamBYOBReader; +using js::ReadableStreamController; +using js::ReadableStreamControllerError; +using js::ReadableStreamControllerGetDesiredSizeUnchecked; +using js::ReadableStreamDefaultController; +using js::ReadableStreamDefaultControllerClose; +using js::ReadableStreamDefaultReader; +using js::ReadableStreamFulfillReadOrReadIntoRequest; +using js::ReadableStreamGetNumReadRequests; +using js::ReadableStreamHasBYOBReader; +using js::ReadableStreamHasDefaultReader; +using js::ReadableStreamReader; +using js::ReadableStreamTee; +using js::SetUpReadableStreamDefaultControllerFromUnderlyingSource; +using js::SetUpWritableStreamDefaultControllerFromUnderlyingSink; +using js::StreamController; +using js::UnwrapAndDowncastObject; +using js::UnwrapStreamFromReader; +using js::WritableStream; +using js::WritableStreamDefaultController; +using js::WritableStreamDefaultControllerError; +using js::WritableStreamDefaultWriter; + +JS_PUBLIC_API JSObject* js::UnwrapReadableStream(JSObject* obj) { + return obj->maybeUnwrapIf(); +} + +JS_PUBLIC_API JSObject* JS::NewReadableDefaultStreamObject( + JSContext* cx, JS::Handle underlyingSource /* = nullptr */, + JS::Handle size /* = nullptr */, + double highWaterMark /* = 1 */, + JS::Handle proto /* = nullptr */) { + MOZ_ASSERT(!cx->zone()->isAtomsZone()); + AssertHeapIsIdle(); + CHECK_THREAD(cx); + cx->check(underlyingSource, size, proto); + MOZ_ASSERT(highWaterMark >= 0); + + // A copy of ReadableStream::constructor, with most of the + // argument-checking done implicitly by C++ type checking. + Rooted stream(cx, ReadableStream::create(cx)); + if (!stream) { + return nullptr; + } + Rooted sourceVal(cx); + if (underlyingSource) { + sourceVal.setObject(*underlyingSource); + } else { + JSObject* source = NewPlainObject(cx); + if (!source) { + return nullptr; + } + sourceVal.setObject(*source); + } + Rooted sizeVal(cx, size ? ObjectValue(*size) : UndefinedValue()); + + if (!SetUpReadableStreamDefaultControllerFromUnderlyingSource( + cx, stream, sourceVal, highWaterMark, sizeVal)) { + return nullptr; + } + + return stream; +} + +JS_PUBLIC_API JSObject* JS::NewReadableExternalSourceStreamObject( + JSContext* cx, JS::ReadableStreamUnderlyingSource* underlyingSource, + void* nsISupportsObject_alreadyAddreffed /* = nullptr */, + Handle proto /* = nullptr */) { + MOZ_ASSERT(!cx->zone()->isAtomsZone()); + AssertHeapIsIdle(); + CHECK_THREAD(cx); + MOZ_ASSERT(underlyingSource); + MOZ_ASSERT((uintptr_t(underlyingSource) & 1) == 0, + "external underlying source pointers must be aligned"); + cx->check(proto); + + return ReadableStream::createExternalSourceStream( + cx, underlyingSource, nsISupportsObject_alreadyAddreffed, proto); +} + +JS_PUBLIC_API bool JS::IsReadableStream(JSObject* obj) { + return obj->canUnwrapAs(); +} + +JS_PUBLIC_API bool JS::IsReadableStreamReader(JSObject* obj) { + return obj->canUnwrapAs(); +} + +JS_PUBLIC_API bool JS::IsReadableStreamBYOBReader(JSObject* obj) { + return obj->canUnwrapAs(); +} + +JS_PUBLIC_API bool JS::IsReadableStreamDefaultReader(JSObject* obj) { + return obj->canUnwrapAs(); +} + +template +[[nodiscard]] static T* APIUnwrapAndDowncast(JSContext* cx, JSObject* obj) { + cx->check(obj); + return UnwrapAndDowncastObject(cx, obj); +} + +JS_PUBLIC_API bool JS::ReadableStreamIsReadable(JSContext* cx, + Handle streamObj, + bool* result) { + ReadableStream* unwrappedStream = + APIUnwrapAndDowncast(cx, streamObj); + if (!unwrappedStream) { + return false; + } + + *result = unwrappedStream->readable(); + return true; +} + +JS_PUBLIC_API bool JS::ReadableStreamIsLocked(JSContext* cx, + Handle streamObj, + bool* result) { + ReadableStream* unwrappedStream = + APIUnwrapAndDowncast(cx, streamObj); + if (!unwrappedStream) { + return false; + } + + *result = unwrappedStream->locked(); + return true; +} + +JS_PUBLIC_API bool JS::ReadableStreamIsDisturbed(JSContext* cx, + Handle streamObj, + bool* result) { + ReadableStream* unwrappedStream = + APIUnwrapAndDowncast(cx, streamObj); + if (!unwrappedStream) { + return false; + } + + *result = unwrappedStream->disturbed(); + return true; +} + +JS_PUBLIC_API bool JS::ReadableStreamIsErrored(JSContext* cx, + Handle streamObj, + bool* result) { + ReadableStream* unwrappedStream = + APIUnwrapAndDowncast(cx, streamObj); + if (!unwrappedStream) { + return false; + } + + *result = unwrappedStream->errored(); + return true; +} + +JS_PUBLIC_API JSObject* JS::ReadableStreamCancel(JSContext* cx, + Handle streamObj, + Handle reason) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + cx->check(reason); + + Rooted unwrappedStream( + cx, APIUnwrapAndDowncast(cx, streamObj)); + if (!unwrappedStream) { + return nullptr; + } + + return js::ReadableStreamCancel(cx, unwrappedStream, reason); +} + +JS_PUBLIC_API bool JS::ReadableStreamGetMode(JSContext* cx, + Handle streamObj, + JS::ReadableStreamMode* mode) { + ReadableStream* unwrappedStream = + APIUnwrapAndDowncast(cx, streamObj); + if (!unwrappedStream) { + return false; + } + + *mode = unwrappedStream->mode(); + return true; +} + +JS_PUBLIC_API JSObject* JS::ReadableStreamGetReader( + JSContext* cx, Handle streamObj, ReadableStreamReaderMode mode) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + Rooted unwrappedStream( + cx, APIUnwrapAndDowncast(cx, streamObj)); + if (!unwrappedStream) { + return nullptr; + } + + JSObject* result = CreateReadableStreamDefaultReader(cx, unwrappedStream, + ForAuthorCodeBool::No); + MOZ_ASSERT_IF(result, IsObjectInContextCompartment(result, cx)); + return result; +} + +JS_PUBLIC_API JS::Value JS::ReadableStreamGetStoredError( + JSContext* cx, JS::Handle streamObj) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + Rooted unwrappedStream( + cx, APIUnwrapAndDowncast(cx, streamObj)); + MOZ_ASSERT(unwrappedStream); + + return unwrappedStream->storedError(); +} + +JS_PUBLIC_API bool JS::ReadableStreamControllerShouldCallPull( + JSContext* cx, JS::Handle controllerObj) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + Rooted unwrappedController( + cx, APIUnwrapAndDowncast(cx, controllerObj)); + MOZ_ASSERT(unwrappedController); + + return js::ReadableStreamControllerShouldCallPull(cx, unwrappedController); +} + +JS_PUBLIC_API JSObject* JS::ReadableStreamGetController( + JSContext* cx, Handle streamObj) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + Rooted unwrappedStream( + cx, APIUnwrapAndDowncast(cx, streamObj)); + if (!unwrappedStream) { + return nullptr; + } + + return unwrappedStream->controller(); +} + +JS_PUBLIC_API bool JS::ReadableStreamControllerGetUnderlyingSource( + JSContext* cx, Handle controllerObj, + MutableHandle source) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + Rooted unwrappedController( + cx, APIUnwrapAndDowncast(cx, controllerObj)); + if (!unwrappedController) { + return false; + } + + source.set(unwrappedController->underlyingSource()); + return true; +} + +JS_PUBLIC_API bool JS::CheckReadableStreamControllerCanCloseOrEnqueue( + JSContext* cx, Handle controllerObj, const char* action) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + Rooted unwrappedController( + cx, APIUnwrapAndDowncast(cx, controllerObj)); + if (!unwrappedController) { + return false; + } + + return js::CheckReadableStreamControllerCanCloseOrEnqueue( + cx, unwrappedController, action); +} + +JS_PUBLIC_API bool JS::ReadableStreamGetExternalUnderlyingSource( + JSContext* cx, Handle streamObj, + JS::ReadableStreamUnderlyingSource** source) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + Rooted unwrappedStream( + cx, APIUnwrapAndDowncast(cx, streamObj)); + if (!unwrappedStream) { + return false; + } + + MOZ_ASSERT(unwrappedStream->mode() == JS::ReadableStreamMode::ExternalSource); + if (unwrappedStream->locked()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_LOCKED); + return false; + } + if (!unwrappedStream->readable()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMCONTROLLER_NOT_READABLE, + "ReadableStreamGetExternalUnderlyingSource"); + return false; + } + + auto unwrappedController = + &unwrappedStream->controller()->as(); + unwrappedController->setSourceLocked(); + *source = unwrappedController->externalSource(); + return true; +} + +JS_PUBLIC_API bool JS::ReadableStreamReleaseExternalUnderlyingSource( + JSContext* cx, Handle streamObj) { + ReadableStream* unwrappedStream = + APIUnwrapAndDowncast(cx, streamObj); + if (!unwrappedStream) { + return false; + } + + MOZ_ASSERT(unwrappedStream->mode() == JS::ReadableStreamMode::ExternalSource); + MOZ_ASSERT(unwrappedStream->locked()); + MOZ_ASSERT(unwrappedStream->controller()->sourceLocked()); + unwrappedStream->controller()->clearSourceLocked(); + return true; +} + +JS_PUBLIC_API bool JS::ReadableStreamUpdateDataAvailableFromSource( + JSContext* cx, JS::Handle streamObj, uint32_t availableData) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + Rooted unwrappedStream( + cx, APIUnwrapAndDowncast(cx, streamObj)); + if (!unwrappedStream) { + return false; + } + + // This is based on Streams spec 3.11.4.4. enqueue(chunk) steps 1-3 and + // 3.13.9. ReadableByteStreamControllerEnqueue(controller, chunk) steps + // 8-9. + // + // Adapted to handling updates signaled by the embedding for streams with + // external underlying sources. + // + // The remaining steps of those two functions perform checks and asserts + // that don't apply to streams with external underlying sources. + + Rooted unwrappedController( + cx, &unwrappedStream->controller()->as()); + + // Step 2: If this.[[closeRequested]] is true, throw a TypeError exception. + if (unwrappedController->closeRequested()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMCONTROLLER_CLOSED, "enqueue"); + return false; + } + + // Step 3: If this.[[controlledReadableStream]].[[state]] is not "readable", + // throw a TypeError exception. + if (!unwrappedController->stream()->readable()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAMCONTROLLER_NOT_READABLE, + "enqueue"); + return false; + } + + unwrappedController->clearPullFlags(); + +#if DEBUG + uint32_t oldAvailableData = + unwrappedController->getFixedSlot(StreamController::Slot_TotalSize) + .toInt32(); +#endif // DEBUG + unwrappedController->setQueueTotalSize(availableData); + + // 3.139. ReadableByteStreamControllerEnqueue + // Step 8.a: If ! ReadableStreamGetNumReadRequests(stream) is 0, + // Reordered because for externally-sourced streams it applies regardless + // of reader type. + if (ReadableStreamGetNumReadRequests(unwrappedStream) == 0) { + return true; + } + + // Step 8: If ! ReadableStreamHasDefaultReader(stream) is true + bool hasDefaultReader; + if (!ReadableStreamHasDefaultReader(cx, unwrappedStream, &hasDefaultReader)) { + return false; + } + if (hasDefaultReader) { + // Step b: Otherwise, + // Step i: Assert: controller.[[queue]] is empty. + MOZ_ASSERT(oldAvailableData == 0); + + // Step ii: Let transferredView be + // ! Construct(%Uint8Array%, transferredBuffer, + // byteOffset, byteLength). + JSObject* viewObj = JS_NewUint8Array(cx, availableData); + if (!viewObj) { + return false; + } + Rooted transferredView( + cx, &viewObj->as()); + if (!transferredView) { + return false; + } + + JS::ReadableStreamUnderlyingSource* source = + unwrappedController->externalSource(); + + size_t bytesWritten; + { + AutoRealm ar(cx, unwrappedStream); + source->writeIntoReadRequestBuffer(cx, unwrappedStream, transferredView, + availableData, &bytesWritten); + } + + // Step iii: Perform ! ReadableStreamFulfillReadRequest(stream, + // transferredView, + // false). + Rooted chunk(cx, ObjectValue(*transferredView)); + if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, unwrappedStream, chunk, + false)) { + return false; + } + + unwrappedController->setQueueTotalSize(availableData - bytesWritten); + } else { + // Step 9: Otherwise, if ! ReadableStreamHasBYOBReader(stream) is true, + // [...] + // (Omitted. BYOB readers are not implemented.) + + // Step 10: Otherwise, + // Step a: Assert: ! IsReadableStreamLocked(stream) is false. + MOZ_ASSERT(!unwrappedStream->locked()); + + // Step b: Perform ! ReadableByteStreamControllerEnqueueChunkToQueue( + // controller, transferredBuffer, byteOffset, byteLength). + // (Not needed for external underlying sources.) + } + + return true; +} + +JS_PUBLIC_API void JS::ReadableStreamReleaseCCObject(JSObject* streamObj) { + MOZ_ASSERT(JS::IsReadableStream(streamObj)); + JS::SetObjectISupports(streamObj, nullptr); +} + +JS_PUBLIC_API bool JS::ReadableStreamTee(JSContext* cx, + Handle streamObj, + MutableHandle branch1Obj, + MutableHandle branch2Obj) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + Rooted unwrappedStream( + cx, APIUnwrapAndDowncast(cx, streamObj)); + if (!unwrappedStream) { + return false; + } + + Rooted branch1Stream(cx); + Rooted branch2Stream(cx); + if (!ReadableStreamTee(cx, unwrappedStream, false, &branch1Stream, + &branch2Stream)) { + return false; + } + + branch1Obj.set(branch1Stream); + branch2Obj.set(branch2Stream); + return true; +} + +JS_PUBLIC_API bool JS::ReadableStreamGetDesiredSize(JSContext* cx, + JSObject* streamObj, + bool* hasValue, + double* value) { + ReadableStream* unwrappedStream = + APIUnwrapAndDowncast(cx, streamObj); + if (!unwrappedStream) { + return false; + } + + if (unwrappedStream->errored()) { + *hasValue = false; + return true; + } + + *hasValue = true; + + if (unwrappedStream->closed()) { + *value = 0; + return true; + } + + *value = ReadableStreamControllerGetDesiredSizeUnchecked( + unwrappedStream->controller()); + return true; +} + +JS_PUBLIC_API bool JS::ReadableStreamClose(JSContext* cx, + Handle streamObj) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + Rooted unwrappedStream( + cx, APIUnwrapAndDowncast(cx, streamObj)); + if (!unwrappedStream) { + return false; + } + + Rooted unwrappedControllerObj( + cx, unwrappedStream->controller()); + if (!js::CheckReadableStreamControllerCanCloseOrEnqueue( + cx, unwrappedControllerObj, "close")) { + return false; + } + + if (unwrappedControllerObj->is()) { + Rooted unwrappedController(cx); + unwrappedController = + &unwrappedControllerObj->as(); + return ReadableStreamDefaultControllerClose(cx, unwrappedController); + } + + Rooted unwrappedController(cx); + unwrappedController = + &unwrappedControllerObj->as(); + return ReadableByteStreamControllerClose(cx, unwrappedController); +} + +JS_PUBLIC_API bool JS::ReadableStreamEnqueue(JSContext* cx, + Handle streamObj, + Handle chunk) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + cx->check(chunk); + + Rooted unwrappedStream( + cx, APIUnwrapAndDowncast(cx, streamObj)); + if (!unwrappedStream) { + return false; + } + + if (unwrappedStream->mode() != JS::ReadableStreamMode::Default) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_NOT_DEFAULT_CONTROLLER, + "JS::ReadableStreamEnqueue"); + return false; + } + + Rooted unwrappedController(cx); + unwrappedController = + &unwrappedStream->controller()->as(); + + MOZ_ASSERT(!unwrappedController->closeRequested()); + MOZ_ASSERT(unwrappedStream->readable()); + + return ReadableStreamDefaultControllerEnqueue(cx, unwrappedController, chunk); +} + +JS_PUBLIC_API bool JS::ReadableStreamError(JSContext* cx, + Handle streamObj, + Handle error) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + cx->check(error); + + Rooted unwrappedStream( + cx, APIUnwrapAndDowncast(cx, streamObj)); + if (!unwrappedStream) { + return false; + } + + Rooted unwrappedController( + cx, unwrappedStream->controller()); + return ReadableStreamControllerError(cx, unwrappedController, error); +} + +JS_PUBLIC_API bool JS::ReadableStreamReaderIsClosed(JSContext* cx, + Handle readerObj, + bool* result) { + Rooted unwrappedReader( + cx, APIUnwrapAndDowncast(cx, readerObj)); + if (!unwrappedReader) { + return false; + } + + *result = unwrappedReader->isClosed(); + return true; +} + +JS_PUBLIC_API bool JS::ReadableStreamReaderCancel(JSContext* cx, + Handle readerObj, + Handle reason) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + cx->check(reason); + + Rooted unwrappedReader( + cx, APIUnwrapAndDowncast(cx, readerObj)); + if (!unwrappedReader) { + return false; + } + MOZ_ASSERT(unwrappedReader->forAuthorCode() == ForAuthorCodeBool::No, + "C++ code should not touch readers created by scripts"); + + return ReadableStreamReaderGenericCancel(cx, unwrappedReader, reason); +} + +JS_PUBLIC_API bool JS::ReadableStreamReaderReleaseLock( + JSContext* cx, Handle readerObj) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + Rooted unwrappedReader( + cx, APIUnwrapAndDowncast(cx, readerObj)); + if (!unwrappedReader) { + return false; + } + MOZ_ASSERT(unwrappedReader->forAuthorCode() == ForAuthorCodeBool::No, + "C++ code should not touch readers created by scripts"); + +#ifdef DEBUG + Rooted unwrappedStream( + cx, UnwrapStreamFromReader(cx, unwrappedReader)); + if (!unwrappedStream) { + return false; + } + MOZ_ASSERT(ReadableStreamGetNumReadRequests(unwrappedStream) == 0); +#endif // DEBUG + + return ReadableStreamReaderGenericRelease(cx, unwrappedReader); +} + +JS_PUBLIC_API JSObject* JS::ReadableStreamBYOBReaderRead( + JSContext* cx, Handle readerObj, Handle view) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + Rooted unwrappedReader( + cx, APIUnwrapAndDowncast(cx, readerObj)); + if (!unwrappedReader) { + return nullptr; + } + MOZ_ASSERT(unwrappedReader->forAuthorCode() == ForAuthorCodeBool::No, + "C++ code should not touch readers created by scripts"); + + return js::ReadableStreamBYOBReaderRead(cx, unwrappedReader, view); +} + +JS_PUBLIC_API JSObject* JS::ReadableStreamDefaultReaderRead( + JSContext* cx, Handle readerObj) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + Rooted unwrappedReader( + cx, APIUnwrapAndDowncast(cx, readerObj)); + if (!unwrappedReader) { + return nullptr; + } + MOZ_ASSERT(unwrappedReader->forAuthorCode() == ForAuthorCodeBool::No, + "C++ code should not touch readers created by scripts"); + + return js::ReadableStreamDefaultReaderRead(cx, unwrappedReader); +} + +JS_PUBLIC_API JSObject* JS::NewWritableDefaultStreamObject( + JSContext* cx, JS::Handle underlyingSink /* = nullptr */, + JS::Handle size /* = nullptr */, + double highWaterMark /* = 1 */, + JS::Handle proto /* = nullptr */) { + MOZ_ASSERT(!cx->zone()->isAtomsZone()); + AssertHeapIsIdle(); + CHECK_THREAD(cx); + cx->check(underlyingSink, size, proto); + MOZ_ASSERT(highWaterMark >= 0); + + // A copy of WritableStream::constructor, with most of the + // argument-checking done implicitly by C++ type checking. + Rooted stream(cx, WritableStream::create(cx)); + if (!stream) { + return nullptr; + } + Rooted sinkVal(cx); + if (underlyingSink) { + sinkVal.setObject(*underlyingSink); + } else { + JSObject* sink = NewPlainObject(cx); + if (!sink) { + return nullptr; + } + sinkVal.setObject(*sink); + } + Rooted sizeVal(cx, size ? ObjectValue(*size) : UndefinedValue()); + + if (!SetUpWritableStreamDefaultControllerFromUnderlyingSink( + cx, stream, sinkVal, highWaterMark, sizeVal)) { + return nullptr; + } + + return stream; +} + +JS_PUBLIC_API bool JS::IsWritableStream(JSObject* obj) { + return obj->canUnwrapAs(); +} + +JS_PUBLIC_API JS::WritableStreamState JS::WritableStreamGetState( + JSContext* cx, Handle streamObj) { + WritableStream* unwrappedStream = + APIUnwrapAndDowncast(cx, streamObj); + MOZ_ASSERT(unwrappedStream); + + if (unwrappedStream->writable()) { + return JS::WritableStreamState::Writable; + } + + if (unwrappedStream->closed()) { + return JS::WritableStreamState::Closed; + } + + if (unwrappedStream->erroring()) { + return JS::WritableStreamState::Erroring; + } + + MOZ_ASSERT(unwrappedStream->errored()); + return JS::WritableStreamState::Errored; +} + +JS_PUBLIC_API bool JS::WritableStreamIsLocked(JSContext* cx, + Handle streamObj) { + WritableStream* unwrappedStream = + APIUnwrapAndDowncast(cx, streamObj); + MOZ_ASSERT(unwrappedStream); + + return unwrappedStream->isLocked(); +} + +JS_PUBLIC_API bool JS::IsWritableStreamWriter(JSObject* obj) { + return obj->canUnwrapAs(); +} + +JS_PUBLIC_API JSObject* JS::WritableStreamGetWriter( + JSContext* cx, Handle streamObj) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + Rooted unwrappedStream( + cx, APIUnwrapAndDowncast(cx, streamObj)); + MOZ_ASSERT(unwrappedStream); + + JSObject* result = CreateWritableStreamDefaultWriter(cx, unwrappedStream); + MOZ_ASSERT_IF(result, IsObjectInContextCompartment(result, cx)); + return result; +} + +JS_PUBLIC_API JSObject* JS::WritableStreamGetController( + JSContext* cx, Handle streamObj) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + WritableStream* unwrappedStream = + APIUnwrapAndDowncast(cx, streamObj); + MOZ_ASSERT(unwrappedStream); + + return unwrappedStream->controller(); +} + +JS_PUBLIC_API JS::Value JS::WritableStreamControllerGetUnderlyingSink( + JSContext* cx, Handle controllerObj) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + WritableStreamDefaultController* unwrappedController = + APIUnwrapAndDowncast(cx, controllerObj); + MOZ_ASSERT(unwrappedController); + + return unwrappedController->underlyingSink(); +} + +JS_PUBLIC_API bool JS::WritableStreamError(JSContext* cx, + Handle streamObj, + Handle error) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + cx->check(error); + + Rooted unwrappedStream( + cx, APIUnwrapAndDowncast(cx, streamObj)); + MOZ_ASSERT(unwrappedStream); + + Rooted unwrappedController( + cx, unwrappedStream->controller()); + return WritableStreamDefaultControllerError(cx, unwrappedController, error); +} + +JS_PUBLIC_API JS::Value JS::WritableStreamGetStoredError( + JSContext* cx, JS::Handle streamObj) { + AssertHeapIsIdle(); + CHECK_THREAD(cx); + + Rooted unwrappedStream( + cx, APIUnwrapAndDowncast(cx, streamObj)); + MOZ_ASSERT(unwrappedStream); + + return unwrappedStream->storedError(); +} + +void JS::InitPipeToHandling(const JSClass* abortSignalClass, + AbortSignalIsAborted isAborted, JSContext* cx) { + cx->runtime()->initPipeToHandling(abortSignalClass, isAborted); +} diff --git a/js/src/builtin/streams/StreamController-inl.h b/js/src/builtin/streams/StreamController-inl.h new file mode 100644 index 0000000000000..4672004772e64 --- /dev/null +++ b/js/src/builtin/streams/StreamController-inl.h @@ -0,0 +1,24 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Base stream controller inlines. */ + +#ifndef builtin_streams_StreamController_inl_h +#define builtin_streams_StreamController_inl_h + +#include "builtin/streams/StreamController.h" // js::StreamController +#include "builtin/streams/ReadableStreamController.h" // js::Readable{ByteStream,StreamDefault}Controller +#include "builtin/streams/WritableStreamDefaultController.h" // js::WritableStreamDefaultController +#include "vm/JSObject.h" // JSObject + +template <> +inline bool JSObject::is() const { + return is() || + is() || + is(); +} + +#endif // builtin_streams_ReadableStreamController_inl_h diff --git a/js/src/builtin/streams/StreamController.h b/js/src/builtin/streams/StreamController.h new file mode 100644 index 0000000000000..4986421ab0d5e --- /dev/null +++ b/js/src/builtin/streams/StreamController.h @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Base class for readable and writable stream controllers. */ + +#ifndef builtin_streams_StreamController_h +#define builtin_streams_StreamController_h + +#include "js/Value.h" // JS::Value, JS::NumberValue +#include "vm/JSObject.h" // JSObject +#include "vm/List.h" // js::ListObject +#include "vm/NativeObject.h" // js::NativeObject + +namespace js { + +/** + * Common base class of both readable and writable stream controllers. + */ +class StreamController : public NativeObject { + public: + /** + * Memory layout for stream controllers. + * + * Both ReadableStreamDefaultController and ReadableByteStreamController + * are queue containers and must have these slots at identical offsets. + * + * The queue is guaranteed to be in the same compartment as the container, + * but might contain wrappers for objects from other compartments. + */ + enum Slots { Slot_Queue, Slot_TotalSize, SlotCount }; + + ListObject* queue() const { + return &getFixedSlot(Slot_Queue).toObject().as(); + } + double queueTotalSize() const { + return getFixedSlot(Slot_TotalSize).toNumber(); + } + void setQueueTotalSize(double size) { + setFixedSlot(Slot_TotalSize, JS::NumberValue(size)); + } +}; + +} // namespace js + +template <> +inline bool JSObject::is() const; + +#endif // builtin_streams_StreamController_h diff --git a/js/src/builtin/streams/Streams-inl.h b/js/src/builtin/streams/Streams-inl.h new file mode 100644 index 0000000000000..2ce735ac47b50 --- /dev/null +++ b/js/src/builtin/streams/Streams-inl.h @@ -0,0 +1,60 @@ +// +// Created by Till Schneidereit on 25.07.25. +// + +#ifndef STREAMS_INL_H +#define STREAMS_INL_H + +#include "vm/Compartment-inl.h" + +namespace js { + +extern JS_PUBLIC_API JSObject* UnwrapReadableStream(JSObject* obj); + +/** + * Read a private slot that is known to point to a particular type of object. + * + * Some internal slots specified in various standards effectively have static + * types. For example, the [[ownerReadableStream]] slot of a stream reader is + * guaranteed to be a ReadableStream. However, because of compartments, we + * sometimes store a cross-compartment wrapper in that slot. And since wrappers + * can be nuked, that wrapper may become a dead object proxy. + * + * UnwrapInternalSlot() copes with the cross-compartment and dead object cases, + * but not plain bugs where the slot hasn't been initialized or doesn't contain + * the expected type of object. Call this only if the slot is certain to + * contain either an instance of T, a wrapper for a T, or a dead object. + * + * `cx` and `unwrappedObj` are not required to be same-compartment. + * + * DANGER: The result may not be same-compartment with either `cx` or `obj`. + */ +template +[[nodiscard]] inline T* UnwrapInternalSlot(JSContext* cx, + Handle unwrappedObj, + uint32_t slot) { + static_assert(!std::is_convertible_v, + "T can't be a Wrapper type; this function discards wrappers"); + + return UnwrapAndDowncastValue(cx, unwrappedObj->getFixedSlot(slot)); +} + +/** + * Read a function slot that is known to point to a particular type of object. + * + * This is like UnwrapInternalSlot, but for extended function slots. Call this + * only if the specified slot is known to have been initialized with an object + * of class T or a wrapper for such an object. + * + * DANGER: The result may not be same-compartment with `cx`. + */ +template +[[nodiscard]] T* UnwrapCalleeSlot(JSContext* cx, CallArgs& args, + size_t extendedSlot) { + JSFunction& func = args.callee().as(); + return UnwrapAndDowncastValue(cx, func.getExtendedSlot(extendedSlot)); +} + +} // namespace js + +#endif //STREAMS_INL_H diff --git a/js/src/builtin/streams/TeeState.cpp b/js/src/builtin/streams/TeeState.cpp new file mode 100644 index 0000000000000..b5faa96f8c891 --- /dev/null +++ b/js/src/builtin/streams/TeeState.cpp @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Stream teeing state. */ + +#include "builtin/streams/TeeState.h" + +#include "builtin/streams/ReadableStream.h" // js::ReadableStream +#include "js/Class.h" // JSClass, JSCLASS_HAS_RESERVED_SLOTS +#include "js/RootingAPI.h" // JS::Handle, JS::Rooted +#include "vm/Compartment.h" // JS::Compartment +#include "vm/JSContext.h" // JSContext +#include "vm/PromiseObject.h" // js::PromiseObject + +#include "vm/JSObject-inl.h" // js::NewBuiltinClassInstance + +using js::ReadableStream; +using js::TeeState; + +using JS::Handle; +using JS::Int32Value; +using JS::ObjectValue; +using JS::Rooted; + +/* static */ TeeState* TeeState::create( + JSContext* cx, Handle unwrappedStream) { + Rooted state(cx, NewBuiltinClassInstance(cx)); + if (!state) { + return nullptr; + } + + Rooted cancelPromise( + cx, PromiseObject::createSkippingExecutor(cx)); + if (!cancelPromise) { + return nullptr; + } + + state->setFixedSlot(Slot_Flags, Int32Value(0)); + state->setFixedSlot(Slot_CancelPromise, ObjectValue(*cancelPromise)); + Rooted wrappedStream(cx, unwrappedStream); + if (!cx->compartment()->wrap(cx, &wrappedStream)) { + return nullptr; + } + state->setFixedSlot(Slot_Stream, JS::ObjectValue(*wrappedStream)); + + return state; +} + +const JSClass TeeState::class_ = {"TeeState", + JSCLASS_HAS_RESERVED_SLOTS(SlotCount)}; diff --git a/js/src/builtin/streams/TeeState.h b/js/src/builtin/streams/TeeState.h new file mode 100644 index 0000000000000..beb42ff8e6757 --- /dev/null +++ b/js/src/builtin/streams/TeeState.h @@ -0,0 +1,155 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Stream teeing state. */ + +#ifndef builtin_streams_TeeState_h +#define builtin_streams_TeeState_h + +#include "mozilla/Assertions.h" // MOZ_ASSERT + +#include // uint32_t + +#include "builtin/streams/ReadableStreamController.h" // js::ReadableStreamDefaultController +#include "js/Class.h" // JSClass +#include "js/Value.h" // JS::{Int32,Object}Value +#include "vm/NativeObject.h" // js::NativeObject +#include "vm/PromiseObject.h" // js::PromiseObject + +namespace js { + +/** + * TeeState objects implement the local variables in Streams spec 3.3.9 + * ReadableStreamTee, which are accessed by several algorithms. + */ +class TeeState : public NativeObject { + public: + /** + * Memory layout for TeeState instances. + * + * The Reason1 and Reason2 slots store opaque values, which might be + * wrapped objects from other compartments. Since we don't treat them as + * objects in Streams-specific code, we don't have to worry about that + * apart from ensuring that the values are properly wrapped before storing + * them. + * + * CancelPromise is always created in TeeState::create below, so is + * guaranteed to be in the same compartment as the TeeState instance + * itself. + * + * Stream can be from another compartment. It is automatically wrapped + * before storing it and unwrapped upon retrieval. That means that + * TeeState consumers need to be able to deal with unwrapped + * ReadableStream instances from non-current compartments. + * + * Branch1 and Branch2 are always created in the same compartment as the + * TeeState instance, so cannot be from another compartment. + */ + enum Slots { + Slot_Flags = 0, + Slot_Reason1, + Slot_Reason2, + Slot_CancelPromise, + Slot_Stream, + Slot_Branch1, + Slot_Branch2, + SlotCount + }; + + private: + enum Flags { + Flag_Reading = 1 << 0, + Flag_Canceled1 = 1 << 1, + Flag_Canceled2 = 1 << 2, + + // No internal user ever sets the cloneForBranch2 flag to true, and the + // streams spec doesn't expose a way to set the flag to true. So for the + // moment, don't even reserve flag-space to store it. + // Flag_CloneForBranch2 = 1 << 3, + }; + uint32_t flags() const { return getFixedSlot(Slot_Flags).toInt32(); } + void setFlags(uint32_t flags) { + setFixedSlot(Slot_Flags, JS::Int32Value(flags)); + } + + public: + static const JSClass class_; + + // Consistent with not even storing this always-false flag, expose it as + // compile-time constant false. + static constexpr bool cloneForBranch2() { return false; } + + bool reading() const { return flags() & Flag_Reading; } + void setReading() { + MOZ_ASSERT(!(flags() & Flag_Reading)); + setFlags(flags() | Flag_Reading); + } + void unsetReading() { + MOZ_ASSERT(flags() & Flag_Reading); + setFlags(flags() & ~Flag_Reading); + } + + bool canceled1() const { return flags() & Flag_Canceled1; } + void setCanceled1(HandleValue reason) { + MOZ_ASSERT(!(flags() & Flag_Canceled1)); + setFlags(flags() | Flag_Canceled1); + setFixedSlot(Slot_Reason1, reason); + } + + bool canceled2() const { return flags() & Flag_Canceled2; } + void setCanceled2(HandleValue reason) { + MOZ_ASSERT(!(flags() & Flag_Canceled2)); + setFlags(flags() | Flag_Canceled2); + setFixedSlot(Slot_Reason2, reason); + } + + JS::Value reason1() const { + MOZ_ASSERT(canceled1()); + return getFixedSlot(Slot_Reason1); + } + + JS::Value reason2() const { + MOZ_ASSERT(canceled2()); + return getFixedSlot(Slot_Reason2); + } + + PromiseObject* cancelPromise() { + return &getFixedSlot(Slot_CancelPromise).toObject().as(); + } + + ReadableStreamDefaultController* branch1() { + ReadableStreamDefaultController* controller = + &getFixedSlot(Slot_Branch1) + .toObject() + .as(); + MOZ_ASSERT(controller->isTeeBranch1()); + return controller; + } + void setBranch1(ReadableStreamDefaultController* controller) { + MOZ_ASSERT(controller->isTeeBranch1()); + setFixedSlot(Slot_Branch1, JS::ObjectValue(*controller)); + } + + ReadableStreamDefaultController* branch2() { + ReadableStreamDefaultController* controller = + &getFixedSlot(Slot_Branch2) + .toObject() + .as(); + MOZ_ASSERT(controller->isTeeBranch2()); + return controller; + } + void setBranch2(ReadableStreamDefaultController* controller) { + MOZ_ASSERT(controller->isTeeBranch2()); + setFixedSlot(Slot_Branch2, JS::ObjectValue(*controller)); + } + + static TeeState* create(JSContext* cx, + Handle unwrappedStream); +}; + +} // namespace js + +#endif // builtin_streams_TeeState_h diff --git a/js/src/builtin/streams/WritableStream-inl.h b/js/src/builtin/streams/WritableStream-inl.h new file mode 100644 index 0000000000000..bd6656fb33e82 --- /dev/null +++ b/js/src/builtin/streams/WritableStream-inl.h @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Class WritableStream. */ + +#ifndef builtin_streams_WritableStream_inl_h +#define builtin_streams_WritableStream_inl_h + +#include "builtin/streams/WritableStream.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT + +#include "jstypes.h" // JS_PUBLIC_API + +#include "builtin/streams/WritableStreamDefaultWriter.h" // js::WritableStreamDefaultWriter +#include "js/RootingAPI.h" // JS::Handle +#include "js/Value.h" // JS::{,Object}Value + +#include "builtin/streams/Streams-inl.h" // js::UnwrapInternalSlot + +struct JS_PUBLIC_API JSContext; + +namespace js { + +/** + * Returns the writer associated with the given stream. + * + * Must only be called on WritableStreams that already have a writer + * associated with them. + * + * If the writer is a wrapper, it will be unwrapped, so the result might not be + * an object from the currently active compartment. + */ +[[nodiscard]] inline WritableStreamDefaultWriter* UnwrapWriterFromStream( + JSContext* cx, JS::Handle unwrappedStream) { + MOZ_ASSERT(unwrappedStream->hasWriter()); + return UnwrapInternalSlot( + cx, unwrappedStream, WritableStream::Slot_Writer); +} + +} // namespace js + +#endif // builtin_streams_WritableStream_inl_h diff --git a/js/src/builtin/streams/WritableStream.cpp b/js/src/builtin/streams/WritableStream.cpp new file mode 100644 index 0000000000000..4f93999c9720d --- /dev/null +++ b/js/src/builtin/streams/WritableStream.cpp @@ -0,0 +1,285 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Class WritableStream. */ + +#include "builtin/streams/WritableStream.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT + +#include "jspubtd.h" // JSProto_WritableStream + +#include "builtin/streams/ClassSpecMacro.h" // JS_STREAMS_CLASS_SPEC +#include "builtin/streams/MiscellaneousOperations.h" // js::MakeSizeAlgorithmFromSizeFunction, js::ReturnPromiseRejectedWithPendingError, js::ValidateAndNormalizeHighWaterMark +#include "builtin/streams/WritableStreamDefaultControllerOperations.h" // js::SetUpWritableStreamDefaultControllerFromUnderlyingSink +#include "builtin/streams/WritableStreamDefaultWriter.h" // js::CreateWritableStreamDefaultWriter +#include "builtin/streams/WritableStreamOperations.h" // js::WritableStream{Abort,Close{,QueuedOrInFlight}} +#include "js/CallArgs.h" // JS::CallArgs{,FromVp} +#include "js/Class.h" // JS{Function,Property}Spec, JS_{FS,PS}_END, JSCLASS_SLOT0_IS_NSISUPPORTS, JS_NULL_CLASS_OPS +#include "js/ErrorReport.h" // JS_ReportErrorNumberASCII +#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* +#include "js/RealmOptions.h" // JS::RealmCreationOptions +#include "js/RootingAPI.h" // JS::Handle, JS::Rooted +#include "js/Value.h" // JS::{,Object}Value +#include "vm/JSContext.h" // JSContext +#include "vm/JSObject.h" // js::GetPrototypeFromBuiltinConstructor +#include "vm/ObjectOperations.h" // js::GetProperty +#include "vm/PlainObject.h" // js::PlainObject +#include "vm/Realm.h" // JS::Realm + +#include "vm/Compartment-inl.h" // js::UnwrapAndTypeCheckThis +#include "vm/JSContext-inl.h" // JSContext::check +#include "vm/JSObject-inl.h" // js::NewBuiltinClassInstance +#include "vm/NativeObject-inl.h" // js::ThrowIfNotConstructing + +using js::CreateWritableStreamDefaultWriter; +using js::GetErrorMessage; +using js::ReturnPromiseRejectedWithPendingError; +using js::UnwrapAndTypeCheckThis; +using js::WritableStream; +using js::WritableStreamAbort; +using js::WritableStreamClose; +using js::WritableStreamCloseQueuedOrInFlight; + +using JS::CallArgs; +using JS::CallArgsFromVp; +using JS::Handle; +using JS::ObjectValue; +using JS::Rooted; +using JS::Value; + +/*** 4.2. Class WritableStream **********************************************/ + +/** + * Streams spec, 4.2.3. new WritableStream(underlyingSink = {}, strategy = {}) + */ +bool WritableStream::constructor(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + if (!ThrowIfNotConstructing(cx, args, "WritableStream")) { + return false; + } + + // Implicit in the spec: argument default values. + Rooted underlyingSinkVal(cx, args.get(0)); + Rooted underlyingSink(cx); + if (underlyingSinkVal.isUndefined()) { + JSObject* emptyObj = NewPlainObject(cx); + if (!emptyObj) { + return false; + } + underlyingSink.set(emptyObj); + underlyingSinkVal.setObject(*underlyingSink); + } else { + underlyingSink.set(&underlyingSinkVal.toObject()); + } + + Rooted strategyVal(cx, args.get(1)); + Rooted strategy(cx); + if (strategyVal.isUndefined()) { + JSObject* emptyObj = NewPlainObject(cx); + if (!emptyObj) { + return false; + } + strategy.set(emptyObj); + } else { + strategy.set(&strategyVal.toObject()); + } + + // Implicit in the spec: Set this to + // OrdinaryCreateFromConstructor(NewTarget, ...). + // Step 1: Perform ! InitializeWritableStream(this). + Rooted proto(cx); + if (!GetPrototypeFromBuiltinConstructor(cx, args, JSProto_WritableStream, + &proto)) { + return false; + } + Rooted stream(cx, + WritableStream::create(cx, nullptr, proto)); + if (!stream) { + return false; + } + + // Step 2: Let size be ? GetV(strategy, "size"). + Rooted size(cx); + if (!GetProperty(cx, strategy, strategyVal, cx->names().size, &size)) { + return false; + } + + // Step 3: Let highWaterMark be ? GetV(strategy, "highWaterMark"). + Rooted highWaterMarkVal(cx); + if (!GetProperty(cx, strategy, strategyVal, cx->names().highWaterMark, + &highWaterMarkVal)) { + return false; + } + + // Step 4: Let type be ? GetV(underlyingSink, "type"). + Rooted type(cx); + if (!GetProperty(cx, underlyingSink, underlyingSinkVal, cx->names().type, + &type)) { + return false; + } + + // Step 5: If type is not undefined, throw a RangeError exception. + if (!type.isUndefined()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_READABLESTREAM_UNDERLYINGSINK_TYPE_WRONG); + return false; + } + + // Step 6: Let sizeAlgorithm be ? MakeSizeAlgorithmFromSizeFunction(size). + if (!MakeSizeAlgorithmFromSizeFunction(cx, size)) { + return false; + } + + // Step 7: If highWaterMark is undefined, let highWaterMark be 1. + double highWaterMark; + if (highWaterMarkVal.isUndefined()) { + highWaterMark = 1; + } else { + // Step 8: Set highWaterMark to ? + // ValidateAndNormalizeHighWaterMark(highWaterMark). + if (!ValidateAndNormalizeHighWaterMark(cx, highWaterMarkVal, &highWaterMark, + 1)) { + return false; + } + } + + // Step 9: Perform + // ? SetUpWritableStreamDefaultControllerFromUnderlyingSink( + // this, underlyingSink, highWaterMark, sizeAlgorithm). + if (!SetUpWritableStreamDefaultControllerFromUnderlyingSink( + cx, stream, underlyingSinkVal, highWaterMark, size)) { + return false; + } + + args.rval().setObject(*stream); + return true; +} + +/** + * Streams spec, 4.2.5.1. get locked + */ +static bool WritableStream_locked(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! WritableStream(this) is false, throw a TypeError exception. + Rooted unwrappedStream( + cx, UnwrapAndTypeCheckThis(cx, args, "get locked")); + if (!unwrappedStream) { + return false; + } + + // Step 2: Return ! IsWritableStreamLocked(this). + args.rval().setBoolean(unwrappedStream->isLocked()); + return true; +} + +/** + * Streams spec, 4.2.5.2. abort(reason) + */ +static bool WritableStream_abort(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsWritableStream(this) is false, return a promise rejected + // with a TypeError exception. + Rooted unwrappedStream( + cx, UnwrapAndTypeCheckThis(cx, args, "abort")); + if (!unwrappedStream) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 2: If ! IsWritableStreamLocked(this) is true, return a promise + // rejected with a TypeError exception. + if (unwrappedStream->isLocked()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_CANT_USE_LOCKED_WRITABLESTREAM, "abort"); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 3: Return ! WritableStreamAbort(this, reason). + JSObject* promise = js::WritableStreamAbort(cx, unwrappedStream, args.get(0)); + if (!promise) { + return false; + } + cx->check(promise); + + args.rval().setObject(*promise); + return true; +} + +/** + * Streams spec, 4.2.5.3. close() + */ +static bool WritableStream_close(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsWritableStream(this) is false, return a promise rejected + // with a TypeError exception. + Rooted unwrappedStream( + cx, UnwrapAndTypeCheckThis(cx, args, "close")); + if (!unwrappedStream) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 2: If ! IsWritableStreamLocked(this) is true, return a promise + // rejected with a TypeError exception. + if (unwrappedStream->isLocked()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_CANT_USE_LOCKED_WRITABLESTREAM, "close"); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 3: If ! WritableStreamCloseQueuedOrInFlight(this) is true, return a + // promise rejected with a TypeError exception. + if (WritableStreamCloseQueuedOrInFlight(unwrappedStream)) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_WRITABLESTREAM_CLOSE_CLOSING_OR_CLOSED); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 4: Return ! WritableStreamClose(this). + JSObject* promise = WritableStreamClose(cx, unwrappedStream); + if (!promise) { + return false; + } + + args.rval().setObject(*promise); + return true; +} + +/** + * Streams spec, 4.2.5.4. getWriter() + */ +static bool WritableStream_getWriter(JSContext* cx, unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! WritableStream(this) is false, throw a TypeError exception. + Rooted unwrappedStream( + cx, UnwrapAndTypeCheckThis(cx, args, "getWriter")); + if (!unwrappedStream) { + return false; + } + + auto* writer = CreateWritableStreamDefaultWriter(cx, unwrappedStream); + if (!writer) { + return false; + } + + args.rval().setObject(*writer); + return true; +} + +static const JSFunctionSpec WritableStream_methods[] = { + JS_FN("abort", WritableStream_abort, 1, 0), + JS_FN("close", WritableStream_close, 0, 0), + JS_FN("getWriter", WritableStream_getWriter, 0, 0), JS_FS_END}; + +static const JSPropertySpec WritableStream_properties[] = { + JS_PSG("locked", WritableStream_locked, 0), JS_PS_END}; + +JS_STREAMS_CLASS_SPEC(WritableStream, 0, SlotCount, 0, + JSCLASS_SLOT0_IS_NSISUPPORTS, JS_NULL_CLASS_OPS); diff --git a/js/src/builtin/streams/WritableStream.h b/js/src/builtin/streams/WritableStream.h new file mode 100644 index 0000000000000..cde623f2c87dd --- /dev/null +++ b/js/src/builtin/streams/WritableStream.h @@ -0,0 +1,430 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Class WritableStream. */ + +#ifndef builtin_streams_WritableStream_h +#define builtin_streams_WritableStream_h + +#include "mozilla/Assertions.h" // MOZ_ASSERT +#include "mozilla/Casting.h" // mozilla::AssertedCast +#include "mozilla/MathAlgorithms.h" // mozilla::IsPowerOfTwo + +#include // uint32_t + +#include "jstypes.h" // JS_PUBLIC_API +#include "js/Class.h" // JSClass, js::ClassSpec +#include "js/RootingAPI.h" // JS::Handle +#include "js/Value.h" // JS::{,Int32,Object,Undefined}Value +#include "vm/List.h" // js::ListObject +#include "vm/NativeObject.h" // js::NativeObject + +struct JS_PUBLIC_API JSContext; + +namespace js { + +class PromiseObject; +class WritableStreamDefaultController; +class WritableStreamDefaultWriter; + +class WritableStream : public NativeObject { + public: + enum Slots { + /** + * Optional pointer to make the stream participate in Gecko's cycle + * collection. See also JSCLASS_SLOT0_IS_NSISUPPORTS. + */ + Slot_ISupports, + + /** + * A WritableStream's associated controller is always created from under the + * stream's constructor and thus cannot be in a different compartment. + */ + Slot_Controller, + + /** + * Either |undefined| if no writer has been created yet for |this|, or a + * |WritableStreamDefaultWriter| object that writes to this. Writers are + * created under |WritableStream.prototype.getWriter|, which may not be + * same-compartment with |this|, so this object may be a wrapper. + */ + Slot_Writer, + + /** + * A bit field that stores both [[state]] and the [[backpressure]] spec + * fields in a WritableStream::State 32-bit integer. + */ + Slot_State, + + /** + * Either |undefined| if this stream hasn't yet started erroring, or an + * arbitrary value indicating the reason for the error (e.g. the + * reason-value passed to a related |abort(reason)| or |error(e)| function). + * + * This value can be an arbitrary user-provided value, so it might be a + * cross-comaprtment wrapper. + */ + Slot_StoredError, + + /** + * Very briefly for newborn writable streams before they are initialized, + * |undefined|. + * + * After initialization, a |ListObject| consisting of the value of the + * [[inFlightWriteRequest]] spec field (if it is not |undefined|) followed + * by the elements of the [[queue]] List. |this| and the |ListObject| are + * same-compartment. + * + * After a stream has gone irrevocably into an error state (specifically, + * |stream.[[state]]| is "errored") and requests can no longer be enqueued, + * |undefined| yet again. + * + * If the |HaveInFlightWriteRequest| flag is set, the first element of this + * List is the non-|undefined| value of [[inFlightWriteRequest]]. If it is + * unset, [[inFlightWriteRequest]] has the value |undefined|. + */ + Slot_WriteRequests, + + /** + * A slot storing both [[closeRequest]] and [[inFlightCloseRequest]]. This + * value is created under |WritableStreamDefaultWriterClose|, so it may be a + * wrapper around a promise rather than directly a |PromiseObject|. + * + * If this slot has the value |undefined|, then [[inFlightCloseRequest]] + * and [[closeRequest]] are both |undefined|. Otherwise one field has the + * value |undefined| and the other has the value of this slot, and the value + * of the |HaveInFlightCloseRequest| flag indicates which field is set. + */ + Slot_CloseRequest, + + /** + * In the spec the [[pendingAbortRequest]] field is either |undefined| or + * Record { [[promise]]: Object, [[reason]]: value, [[wasAlreadyErroring]]: + * boolean }. We represent this as follows: + * + * 1) If Slot_PendingAbortRequestPromise contains |undefined|, then the + * spec field is |undefined|; + * 2) Otherwise Slot_PendingAbortRequestPromise contains the value of + * [[pendingAbortRequest]].[[promise]], Slot_PendingAbortRequestReason + * contains the value of [[pendingAbortRequest]].[[reason]], and the + * |PendingAbortRequestWasAlreadyErroring| flag stores the value of + * [[pendingAbortRequest]].[[wasAlreadyErroring]]. + */ + Slot_PendingAbortRequestPromise, + Slot_PendingAbortRequestReason, + + SlotCount + }; + + private: + enum State : uint32_t { + Writable = 0x0000'0000, + Closed = 0x0000'0001, + Erroring = 0x0000'0002, + Errored = 0x0000'0003, + StateBits = 0x0000'0003, + StateMask = 0x0000'00ff, + + Backpressure = 0x0000'0100, + HaveInFlightWriteRequest = 0x0000'0200, + HaveInFlightCloseRequest = 0x0000'0400, + PendingAbortRequestWasAlreadyErroring = 0x0000'0800, + FlagBits = Backpressure | HaveInFlightWriteRequest | + HaveInFlightCloseRequest | PendingAbortRequestWasAlreadyErroring, + FlagMask = 0x0000'ff00, + + SettableBits = uint32_t(StateBits | FlagBits) + }; + + bool stateIsInitialized() const { return getFixedSlot(Slot_State).isInt32(); } + + State state() const { + MOZ_ASSERT(stateIsInitialized()); + + uint32_t v = getFixedSlot(Slot_State).toInt32(); + MOZ_ASSERT((v & ~SettableBits) == 0); + + return static_cast(v & StateMask); + } + + State flags() const { + MOZ_ASSERT(stateIsInitialized()); + + uint32_t v = getFixedSlot(Slot_State).toInt32(); + MOZ_ASSERT((v & ~SettableBits) == 0); + + return static_cast(v & FlagMask); + } + + void initWritableState() { + MOZ_ASSERT(!stateIsInitialized()); + + setFixedSlot(Slot_State, JS::Int32Value(Writable)); + + MOZ_ASSERT(writable()); + MOZ_ASSERT(!backpressure()); + } + + void setState(State newState) { + MOZ_ASSERT(stateIsInitialized()); + MOZ_ASSERT((newState & ~StateBits) == 0); + MOZ_ASSERT(newState <= Errored); + +#ifdef DEBUG + { + auto current = state(); + if (current == Writable) { + MOZ_ASSERT(newState == Closed || newState == Erroring); + } else if (current == Erroring) { + MOZ_ASSERT(newState == Errored || newState == Closed); + } else if (current == Closed || current == Errored) { + MOZ_ASSERT_UNREACHABLE( + "closed/errored stream shouldn't undergo state transitions"); + } else { + MOZ_ASSERT_UNREACHABLE("smashed state bits?"); + } + } +#endif + + uint32_t newValue = static_cast(newState) | + (getFixedSlot(Slot_State).toInt32() & FlagMask); + setFixedSlot(Slot_State, + JS::Int32Value(mozilla::AssertedCast(newValue))); + } + + void setFlag(State flag, bool set) { + MOZ_ASSERT(stateIsInitialized()); + MOZ_ASSERT(mozilla::IsPowerOfTwo(uint32_t(flag))); + MOZ_ASSERT((flag & FlagBits) != 0); + + uint32_t v = getFixedSlot(Slot_State).toInt32(); + MOZ_ASSERT((v & ~SettableBits) == 0); + + uint32_t newValue = set ? (v | flag) : (v & ~flag); + setFixedSlot(Slot_State, + JS::Int32Value(mozilla::AssertedCast(newValue))); + } + + public: + bool writable() const { return state() == Writable; } + + bool closed() const { return state() == Closed; } + void setClosed() { setState(Closed); } + + bool erroring() const { return state() == Erroring; } + void setErroring() { setState(Erroring); } + + bool errored() const { return state() == Errored; } + void setErrored() { setState(Errored); } + + bool backpressure() const { return flags() & Backpressure; } + void setBackpressure(bool pressure) { setFlag(Backpressure, pressure); } + + bool haveInFlightWriteRequest() const { + return flags() & HaveInFlightWriteRequest; + } + void setHaveInFlightWriteRequest() { + MOZ_ASSERT(!haveInFlightWriteRequest()); + MOZ_ASSERT(writeRequests()->length() > 0); + setFlag(HaveInFlightWriteRequest, true); + } + + bool haveInFlightCloseRequest() const { + return flags() & HaveInFlightCloseRequest; + } + + bool hasController() const { + return !getFixedSlot(Slot_Controller).isUndefined(); + } + inline WritableStreamDefaultController* controller() const; + inline void setController(WritableStreamDefaultController* controller); + void clearController() { + setFixedSlot(Slot_Controller, JS::UndefinedValue()); + } + + bool hasWriter() const { return !getFixedSlot(Slot_Writer).isUndefined(); } + bool isLocked() const { return hasWriter(); } + void setWriter(JSObject* writer) { + MOZ_ASSERT(!hasWriter()); + setFixedSlot(Slot_Writer, JS::ObjectValue(*writer)); + } + void clearWriter() { setFixedSlot(Slot_Writer, JS::UndefinedValue()); } + + JS::Value storedError() const { return getFixedSlot(Slot_StoredError); } + void setStoredError(JS::Handle value) { + setFixedSlot(Slot_StoredError, value); + } + void clearStoredError() { + setFixedSlot(Slot_StoredError, JS::UndefinedValue()); + } + + JS::Value inFlightWriteRequest() const { + MOZ_ASSERT(stateIsInitialized()); + + // The in-flight write request is the first element of |writeRequests()| -- + // if there is a request in flight. + if (haveInFlightWriteRequest()) { + MOZ_ASSERT(writeRequests()->length() > 0); + return writeRequests()->get(0); + } + + return JS::UndefinedValue(); + } + + void clearInFlightWriteRequest(JSContext* cx); + + JS::Value closeRequest() const { + JS::Value v = getFixedSlot(Slot_CloseRequest); + if (v.isUndefined()) { + // In principle |haveInFlightCloseRequest()| only distinguishes whether + // the close-request slot is [[closeRequest]] or [[inFlightCloseRequest]]. + // In practice, for greater implementation strictness to try to head off + // more bugs, we require that the HaveInFlightCloseRequest flag be unset + // when [[closeRequest]] and [[inFlightCloseRequest]] are both undefined. + MOZ_ASSERT(!haveInFlightCloseRequest()); + return JS::UndefinedValue(); + } + + if (!haveInFlightCloseRequest()) { + return v; + } + + return JS::UndefinedValue(); + } + + void setCloseRequest(JSObject* closeRequest) { + MOZ_ASSERT(!haveCloseRequestOrInFlightCloseRequest()); + setFixedSlot(Slot_CloseRequest, JS::ObjectValue(*closeRequest)); + MOZ_ASSERT(!haveInFlightCloseRequest()); + } + + void clearCloseRequest() { + MOZ_ASSERT(!haveInFlightCloseRequest()); + MOZ_ASSERT(!getFixedSlot(Slot_CloseRequest).isUndefined()); + setFixedSlot(Slot_CloseRequest, JS::UndefinedValue()); + } + + JS::Value inFlightCloseRequest() const { + JS::Value v = getFixedSlot(Slot_CloseRequest); + if (v.isUndefined()) { + // In principle |haveInFlightCloseRequest()| only distinguishes whether + // the close-request slot is [[closeRequest]] or [[inFlightCloseRequest]]. + // In practice, for greater implementation strictness to try to head off + // more bugs, we require that the HaveInFlightCloseRequest flag be unset + // when [[closeRequest]] and [[inFlightCloseRequest]] are both undefined. + MOZ_ASSERT(!haveInFlightCloseRequest()); + return JS::UndefinedValue(); + } + + if (haveInFlightCloseRequest()) { + return v; + } + + return JS::UndefinedValue(); + } + + bool haveCloseRequestOrInFlightCloseRequest() const { + // Slot_CloseRequest suffices to store both [[closeRequest]] and + // [[inFlightCloseRequest]], with the precisely-set field determined by + // |haveInFlightCloseRequest()|. If both are undefined, then per above, for + // extra implementation rigor, |haveInFlightCloseRequest()| will be false, + // so additionally assert that. + if (getFixedSlot(Slot_CloseRequest).isUndefined()) { + MOZ_ASSERT(!haveInFlightCloseRequest()); + return false; + } + + return true; + } + + void convertCloseRequestToInFlightCloseRequest() { + MOZ_ASSERT(stateIsInitialized()); + MOZ_ASSERT(!haveInFlightCloseRequest()); + setFlag(HaveInFlightCloseRequest, true); + MOZ_ASSERT(haveInFlightCloseRequest()); + } + + void clearInFlightCloseRequest() { + MOZ_ASSERT(stateIsInitialized()); + MOZ_ASSERT(haveInFlightCloseRequest()); + MOZ_ASSERT(!getFixedSlot(Slot_CloseRequest).isUndefined()); + + // As noted above, for greater rigor we require HaveInFlightCloseRequest be + // unset when [[closeRequest]] and [[inFlightCloseRequest]] are both + // undefined. + setFlag(HaveInFlightCloseRequest, false); + setFixedSlot(Slot_CloseRequest, JS::UndefinedValue()); + } + + ListObject* writeRequests() const { + MOZ_ASSERT(!getFixedSlot(Slot_WriteRequests).isUndefined(), + "shouldn't be accessing [[writeRequests]] on a newborn and " + "uninitialized stream, or on a stream that's errored and no " + "longer has any write requests"); + return &getFixedSlot(Slot_WriteRequests).toObject().as(); + } + void clearWriteRequests() { + // Setting [[writeRequests]] to an empty List in the irrevocably-in-error + // case (in which [[writeRequests]] is never again accessed) is optimized to + // just clearing the field. See the comment on the slot constant above. + MOZ_ASSERT(stateIsInitialized()); + MOZ_ASSERT(!haveInFlightWriteRequest(), + "must clear the in-flight request flag before clearing " + "requests"); + setFixedSlot(Slot_WriteRequests, JS::UndefinedValue()); + } + + bool hasPendingAbortRequest() const { + MOZ_ASSERT(stateIsInitialized()); + return !getFixedSlot(Slot_PendingAbortRequestPromise).isUndefined(); + } + JSObject* pendingAbortRequestPromise() const { + MOZ_ASSERT(hasPendingAbortRequest()); + return &getFixedSlot(Slot_PendingAbortRequestPromise).toObject(); + } + JS::Value pendingAbortRequestReason() const { + MOZ_ASSERT(hasPendingAbortRequest()); + return getFixedSlot(Slot_PendingAbortRequestReason); + } + bool pendingAbortRequestWasAlreadyErroring() const { + MOZ_ASSERT(hasPendingAbortRequest()); + return flags() & PendingAbortRequestWasAlreadyErroring; + } + + void setPendingAbortRequest(JSObject* promise, const JS::Value& reason, + bool wasAlreadyErroring) { + MOZ_ASSERT(!hasPendingAbortRequest()); + MOZ_ASSERT(!(flags() & PendingAbortRequestWasAlreadyErroring)); + setFixedSlot(Slot_PendingAbortRequestPromise, JS::ObjectValue(*promise)); + setFixedSlot(Slot_PendingAbortRequestReason, reason); + setFlag(PendingAbortRequestWasAlreadyErroring, wasAlreadyErroring); + } + + void clearPendingAbortRequest() { + MOZ_ASSERT(stateIsInitialized()); + MOZ_ASSERT(hasPendingAbortRequest()); + + // [[pendingAbortRequest]] is { [[promise]], [[reason]] } in the spec but + // separate slots in our implementation, so both must be cleared. + setFixedSlot(Slot_PendingAbortRequestPromise, JS::UndefinedValue()); + setFixedSlot(Slot_PendingAbortRequestReason, JS::UndefinedValue()); + } + + [[nodiscard]] static WritableStream* create( + JSContext* cx, void* nsISupportsObject_alreadyAddreffed = nullptr, + JS::Handle proto = nullptr); + + static bool constructor(JSContext* cx, unsigned argc, JS::Value* vp); + + static const ClassSpec classSpec_; + static const JSClass class_; + static const ClassSpec protoClassSpec_; + static const JSClass protoClass_; +}; + +} // namespace js + +#endif // builtin_streams_WritableStream_h diff --git a/js/src/builtin/streams/WritableStreamDefaultController.cpp b/js/src/builtin/streams/WritableStreamDefaultController.cpp new file mode 100644 index 0000000000000..8f9022459f2d9 --- /dev/null +++ b/js/src/builtin/streams/WritableStreamDefaultController.cpp @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Class WritableStreamDefaultController. */ + +#include "builtin/streams/WritableStreamDefaultController.h" + +#include "builtin/streams/ClassSpecMacro.h" // JS_STREAMS_CLASS_SPEC +#include "builtin/streams/WritableStream.h" // js::WritableStream +#include "builtin/streams/WritableStreamDefaultControllerOperations.h" // js::WritableStreamDefaultControllerError +#include "js/CallArgs.h" // JS::CallArgs{,FromVp} +#include "js/Class.h" // js::ClassSpec, JS_NULL_CLASS_OPS +#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* +#include "js/PropertySpec.h" // JS{Function,Property}Spec, JS_{FS,PS}_END +#include "js/Value.h" // JS::Value + +#include "vm/Compartment-inl.h" // js::UnwrapAndTypeCheckThis + +using JS::CallArgs; +using JS::CallArgsFromVp; +using JS::Rooted; +using JS::Value; + +using js::ClassSpec; +using js::UnwrapAndTypeCheckThis; +using js::WritableStreamDefaultController; +using js::WritableStreamDefaultControllerError; + +/*** 4.7. Class WritableStreamDefaultController *****************************/ + +/** + * Streams spec, 4.7.3. + * new WritableStreamDefaultController() + */ +bool WritableStreamDefaultController::constructor(JSContext* cx, unsigned argc, + Value* vp) { + // Step 1: Throw a TypeError. + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_BOGUS_CONSTRUCTOR, + "WritableStreamDefaultController"); + return false; +} + +/** + * Streams spec, 4.7.4.1. error(e) + */ +static bool WritableStreamDefaultController_error(JSContext* cx, unsigned argc, + Value* vp) { + // Step 1: If ! IsWritableStreamDefaultController(this) is false, throw a + // TypeError exception. + CallArgs args = CallArgsFromVp(argc, vp); + Rooted unwrappedController( + cx, UnwrapAndTypeCheckThis(cx, args, + "error")); + if (!unwrappedController) { + return false; + } + + // Step 2: Let state be this.[[controlledWritableStream]].[[state]]. + // Step 3: If state is not "writable", return. + if (unwrappedController->stream()->writable()) { + // Step 4: Perform ! WritableStreamDefaultControllerError(this, e). + if (!WritableStreamDefaultControllerError(cx, unwrappedController, + args.get(0))) { + return false; + } + } + + args.rval().setUndefined(); + return true; +} + +static const JSPropertySpec WritableStreamDefaultController_properties[] = { + JS_PS_END}; + +static const JSFunctionSpec WritableStreamDefaultController_methods[] = { + JS_FN("error", WritableStreamDefaultController_error, 1, 0), JS_FS_END}; + +JS_STREAMS_CLASS_SPEC(WritableStreamDefaultController, 0, SlotCount, + ClassSpec::DontDefineConstructor, 0, JS_NULL_CLASS_OPS); diff --git a/js/src/builtin/streams/WritableStreamDefaultController.h b/js/src/builtin/streams/WritableStreamDefaultController.h new file mode 100644 index 0000000000000..44f3d237a9971 --- /dev/null +++ b/js/src/builtin/streams/WritableStreamDefaultController.h @@ -0,0 +1,186 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* WritableStream controller classes and functions. */ + +#ifndef builtin_streams_WritableStreamDefaultController_h +#define builtin_streams_WritableStreamDefaultController_h + +#include "mozilla/Assertions.h" // MOZ_ASSERT + +#include // uint32_t + +#include "builtin/streams/StreamController.h" // js::StreamController +#include "builtin/streams/WritableStream.h" // js::WritableStream +#include "js/Class.h" // JSClass, js::ClassSpec +#include "js/RootingAPI.h" // JS::Handle +#include "js/Stream.h" // JS::WritableStreamUnderlyingSink +#include "js/Value.h" // JS::Value, JS::{Number,Object,Private,Undefined}Value, JS::UndefinedHandleValue +#include "vm/NativeObject.h" // js::NativeObject + +namespace js { + +class WritableStreamDefaultController : public StreamController { + public: + /** + * Memory layout for WritableStream default controllers, starting after the + * slots reserved for queue container usage. (Note that this is the only + * writable stream controller class in the spec: ReadableByteStreamController + * exists, but WritableByteStreamController does not.) + */ + enum Slots { + /** + * The stream that this controller controls. Stream and controller are + * initialized at the same time underneath the |WritableStream| constructor, + * so they are same-compartment with each other. + */ + Slot_Stream = StreamController::SlotCount, + + /** + * The underlying sink object that this controller and its associated stream + * write to. + * + * This is a user-provided value, the first argument passed to + * |new WritableStream|, so it may be a cross-compartment wrapper around an + * object from another realm. + */ + Slot_UnderlyingSink, + + /** Number stored as DoubleValue. */ + Slot_StrategyHWM, + + /** + * Either undefined if each chunk has size 1, or a callable object to be + * invoked on each chunk to determine its size. See + * MakeSizeAlgorithmFromSizeFunction. + */ + Slot_StrategySize, + + /** + * Slots containing the core of each of the write/close/abort algorithms the + * spec creates from the underlying sink passed in when creating a + * |WritableStream|. ("core", as in the value produced by + * |CreateAlgorithmFromUnderlyingMethod| after validating the user-provided + * input.) + * + * These slots are initialized underneath the |WritableStream| constructor, + * so they are same-compartment with both stream and controller. (They + * could be wrappers around arbitrary callable objects from other + * compartments, tho.) + */ + Slot_WriteMethod, + Slot_CloseMethod, + Slot_AbortMethod, + + /** Bit field stored as Int32Value. */ + Slot_Flags, + + SlotCount + }; + + enum ControllerFlags { + Flag_Started = 0b0001, + Flag_ExternalSink = 0b0010, + }; + + WritableStream* stream() const { + return &getFixedSlot(Slot_Stream).toObject().as(); + } + void setStream(WritableStream* stream) { + setFixedSlot(Slot_Stream, JS::ObjectValue(*stream)); + } + + JS::Value underlyingSink() const { return getFixedSlot(Slot_UnderlyingSink); } + void setUnderlyingSink(const JS::Value& underlyingSink) { + setFixedSlot(Slot_UnderlyingSink, underlyingSink); + } + + JS::WritableStreamUnderlyingSink* externalSink() const { + static_assert(alignof(JS::WritableStreamUnderlyingSink) >= 2, + "external underling sinks are stored as PrivateValues, so " + "they must have even addresses"); + MOZ_ASSERT(hasExternalSink()); + return static_cast( + underlyingSink().toPrivate()); + } + void setExternalSink(JS::WritableStreamUnderlyingSink* underlyingSink) { + setUnderlyingSink(JS::PrivateValue(underlyingSink)); + addFlags(Flag_ExternalSink); + } + static void clearUnderlyingSink( + JS::Handle controller, + bool finalizeSink = true) { + if (controller->hasExternalSink()) { + if (finalizeSink) { + controller->externalSink()->finalize(); + } + controller->setFlags(controller->flags() & ~Flag_ExternalSink); + } + controller->setUnderlyingSink(JS::UndefinedHandleValue); + } + + JS::Value writeMethod() const { return getFixedSlot(Slot_WriteMethod); } + void setWriteMethod(const JS::Value& writeMethod) { + setFixedSlot(Slot_WriteMethod, writeMethod); + } + void clearWriteMethod() { setWriteMethod(JS::UndefinedValue()); } + + JS::Value closeMethod() const { return getFixedSlot(Slot_CloseMethod); } + void setCloseMethod(const JS::Value& closeMethod) { + setFixedSlot(Slot_CloseMethod, closeMethod); + } + void clearCloseMethod() { setCloseMethod(JS::UndefinedValue()); } + + JS::Value abortMethod() const { return getFixedSlot(Slot_AbortMethod); } + void setAbortMethod(const JS::Value& abortMethod) { + setFixedSlot(Slot_AbortMethod, abortMethod); + } + void clearAbortMethod() { setAbortMethod(JS::UndefinedValue()); } + + double strategyHWM() const { + return getFixedSlot(Slot_StrategyHWM).toDouble(); + } + void setStrategyHWM(double highWaterMark) { + setFixedSlot(Slot_StrategyHWM, DoubleValue(highWaterMark)); + } + + JS::Value strategySize() const { return getFixedSlot(Slot_StrategySize); } + void setStrategySize(const JS::Value& size) { + setFixedSlot(Slot_StrategySize, size); + } + void clearStrategySize() { setStrategySize(JS::UndefinedValue()); } + + uint32_t flags() const { return getFixedSlot(Slot_Flags).toInt32(); } + void setFlags(uint32_t flags) { setFixedSlot(Slot_Flags, Int32Value(flags)); } + void addFlags(uint32_t flags) { setFlags(this->flags() | flags); } + void removeFlags(uint32_t flags) { setFlags(this->flags() & ~flags); } + + bool started() const { return flags() & Flag_Started; } + void setStarted() { addFlags(Flag_Started); } + + bool hasExternalSink() const { return flags() & Flag_ExternalSink; } + + static bool constructor(JSContext* cx, unsigned argc, JS::Value* vp); + static const ClassSpec classSpec_; + static const JSClass class_; + static const ClassSpec protoClassSpec_; + static const JSClass protoClass_; +}; + +inline WritableStreamDefaultController* WritableStream::controller() const { + return &getFixedSlot(Slot_Controller) + .toObject() + .as(); +} + +inline void WritableStream::setController( + WritableStreamDefaultController* controller) { + setFixedSlot(Slot_Controller, JS::ObjectValue(*controller)); +} + +} // namespace js + +#endif // builtin_streams_WritableStreamDefaultController_h diff --git a/js/src/builtin/streams/WritableStreamDefaultControllerOperations.cpp b/js/src/builtin/streams/WritableStreamDefaultControllerOperations.cpp new file mode 100644 index 0000000000000..9bf794bfb9d40 --- /dev/null +++ b/js/src/builtin/streams/WritableStreamDefaultControllerOperations.cpp @@ -0,0 +1,1012 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Writable stream default controller abstract operations. */ + +#include "builtin/streams/WritableStreamDefaultControllerOperations.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT + +#include "builtin/streams/MiscellaneousOperations.h" // js::CreateAlgorithmFromUnderlyingMethod, js::InvokeOrNoop +#include "builtin/streams/QueueWithSizes.h" // js::{EnqueueValueWithSize,QueueIsEmpty,ResetQueue} +#include "builtin/streams/WritableStream.h" // js::WritableStream +#include "builtin/streams/WritableStreamDefaultController.h" // js::WritableStreamDefaultController +#include "builtin/streams/WritableStreamOperations.h" // js::WritableStream{CloseQueuedOrInFlight,DealWithRejection,{Start,Finish}Erroring,UpdateBackpressure,Mark{Close,FirstWrite}RequestInFlight} +#include "js/CallAndConstruct.h" // JS::IsCallable +#include "js/CallArgs.h" // JS::CallArgs{,FromVp} +#include "js/Promise.h" // JS::AddPromiseReactions +#include "js/RootingAPI.h" // JS::Handle, JS::Rooted +#include "js/Value.h" // JS::{,Int32,Magic,Object}Value, JS::UndefinedHandleValue, JS_WRITABLESTREAM_CLOSE_RECORD +#include "vm/Compartment.h" // JS::Compartment +#include "vm/JSContext.h" // JSContext +#include "vm/JSObject.h" // JSObject +#include "vm/List.h" // js::ListObject +#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined +#include "vm/Runtime.h" // JSAtomState + +#include "builtin/HandlerFunction-inl.h" // js::TargetFromHandler +#include "builtin/streams/MiscellaneousOperations-inl.h" // js::PromiseCall +#include "builtin/streams/QueueWithSizes-inl.h" // js::PeekQueueValue +#include "vm/Compartment-inl.h" // JS::Compartment::wrap +#include "vm/JSContext-inl.h" // JSContext::check +#include "vm/JSObject-inl.h" // js::IsCallable, js::NewBuiltinClassInstance, js::NewObjectWithClassProto +#include "vm/Realm-inl.h" // js::AutoRealm + +using JS::CallArgs; +using JS::CallArgsFromVp; +using JS::Handle; +using JS::Int32Value; +using JS::MagicValue; +using JS::ObjectValue; +using JS::Rooted; +using JS::UndefinedHandleValue; +using JS::Value; + +using js::IsCallable; +using js::ListObject; +using js::NewHandler; +using js::PeekQueueValue; +using js::PromiseObject; +using js::PromiseResolvedWithUndefined; +using js::TargetFromHandler; +using js::WritableStream; +using js::WritableStreamCloseQueuedOrInFlight; +using js::WritableStreamDefaultController; +using js::WritableStreamFinishErroring; +using js::WritableStreamMarkCloseRequestInFlight; +using js::WritableStreamMarkFirstWriteRequestInFlight; +using js::WritableStreamUpdateBackpressure; + +/*** 4.7. Writable stream default controller internal methods ***************/ + +/** + * Streams spec, 4.7.5.1. + * [[AbortSteps]]( reason ) + */ +JSObject* js::WritableStreamControllerAbortSteps( + JSContext* cx, Handle unwrappedController, + Handle reason) { + cx->check(reason); + + // Step 1: Let result be the result of performing this.[[abortAlgorithm]], + // passing reason. + // CreateAlgorithmFromUnderlyingMethod(underlyingSink, "abort", 1, « ») + Rooted unwrappedAbortMethod(cx, unwrappedController->abortMethod()); + Rooted result(cx); + if (unwrappedAbortMethod.isUndefined()) { + // CreateAlgorithmFromUnderlyingMethod step 7. + result = PromiseResolvedWithUndefined(cx); + if (!result) { + return nullptr; + } + } else { + // CreateAlgorithmFromUnderlyingMethod step 6.c.i-ii. + { + AutoRealm ar(cx, unwrappedController); + cx->check(unwrappedAbortMethod); + + Rooted underlyingSink(cx, unwrappedController->underlyingSink()); + cx->check(underlyingSink); + + Rooted wrappedReason(cx, reason); + if (!cx->compartment()->wrap(cx, &wrappedReason)) { + return nullptr; + } + + result = + PromiseCall(cx, unwrappedAbortMethod, underlyingSink, wrappedReason); + if (!result) { + return nullptr; + } + } + if (!cx->compartment()->wrap(cx, &result)) { + return nullptr; + } + } + + // Step 2: Perform ! WritableStreamDefaultControllerClearAlgorithms(this). + WritableStreamDefaultControllerClearAlgorithms(unwrappedController); + + // Step 3: Return result. + return result; +} + +/** + * Streams spec, 4.7.5.2. + * [[ErrorSteps]]() + */ +bool js::WritableStreamControllerErrorSteps( + JSContext* cx, + Handle unwrappedController) { + // Step 1: Perform ! ResetQueue(this). + return ResetQueue(cx, unwrappedController); +} + +/*** 4.8. Writable stream default controller abstract operations ************/ + +[[nodiscard]] static bool WritableStreamDefaultControllerAdvanceQueueIfNeeded( + JSContext* cx, + Handle unwrappedController); + +/** + * Streams spec, 4.8.2. SetUpWritableStreamDefaultController, step 16: + * Upon fulfillment of startPromise, [...] + */ +bool js::WritableStreamControllerStartHandler(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + Rooted unwrappedController( + cx, TargetFromHandler(args)); + + // Step a: Assert: stream.[[state]] is "writable" or "erroring". +#ifdef DEBUG + const auto* unwrappedStream = unwrappedController->stream(); + MOZ_ASSERT(unwrappedStream->writable() ^ unwrappedStream->erroring()); +#endif + + // Step b: Set controller.[[started]] to true. + unwrappedController->setStarted(); + + // Step c: Perform + // ! WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller). + if (!WritableStreamDefaultControllerAdvanceQueueIfNeeded( + cx, unwrappedController)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 4.8.2. SetUpWritableStreamDefaultController, step 17: + * Upon rejection of startPromise with reason r, [...] + */ +bool js::WritableStreamControllerStartFailedHandler(JSContext* cx, + unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + Rooted unwrappedController( + cx, TargetFromHandler(args)); + + Rooted unwrappedStream(cx, unwrappedController->stream()); + + // Step a: Assert: stream.[[state]] is "writable" or "erroring". + MOZ_ASSERT(unwrappedStream->writable() ^ unwrappedStream->erroring()); + + // Step b: Set controller.[[started]] to true. + unwrappedController->setStarted(); + + // Step c: Perform ! WritableStreamDealWithRejection(stream, r). + if (!WritableStreamDealWithRejection(cx, unwrappedStream, args.get(0))) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 4.8.2. + * SetUpWritableStreamDefaultController(stream, controller, + * startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, + * highWaterMark, sizeAlgorithm ) + * + * The standard algorithm takes a `controller` argument which must be a new, + * blank object. This implementation creates a new controller instead. + * + * In the spec, four algorithms (startAlgorithm, writeAlgorithm, closeAlgorithm, + * abortAlgorithm) are passed as arguments to this routine. This implementation + * passes these "algorithms" as data, using five arguments: sinkAlgorithms, + * underlyingSink, writeMethod, closeMethod, and abortMethod. The sinkAlgorithms + * argument tells how to interpret the other three: + * + * - SinkAlgorithms::Script - We're creating a stream from a JS source. The + * caller is `new WritableStream(underlyingSink)` or + * `JS::NewWritableDefaultStreamObject`. `underlyingSink` is the sink; + * `writeMethod`, `closeMethod`, and `abortMethod` are its .write, .close, + * and .abort methods, which the caller has already extracted and + * type-checked: each one must be either a callable JS object or undefined. + * + * Script streams use the start/write/close/abort algorithms defined in + * 4.8.3. SetUpWritableStreamDefaultControllerFromUnderlyingSink, which + * call JS methods of the underlyingSink. + * + * - SinkAlgorithms::Transform - We're creating a transform stream. + * `underlyingSink` is a Transform object. `writeMethod`, `closeMethod, and + * `abortMethod` are undefined. + * + * Transform streams use the write/close/abort algorithms given in + * 5.3.2 InitializeTransformStream. + * + * An additional sizeAlgorithm in the spec is an algorithm used to compute the + * size of a chunk. Per MakeSizeAlgorithmFromSizeFunction, we just save the + * |size| value used to create that algorithm, then -- inline -- perform the + * requisite algorithm steps. (Hence the unadorned name |size|.) + * + * Note: All arguments must be same-compartment with cx. WritableStream + * controllers are always created in the same compartment as the stream. + */ +[[nodiscard]] bool js::SetUpWritableStreamDefaultController( + JSContext* cx, Handle stream, + SinkAlgorithms sinkAlgorithms, Handle underlyingSink, + Handle writeMethod, Handle closeMethod, + Handle abortMethod, double highWaterMark, Handle size) { + cx->check(stream); + cx->check(underlyingSink); + cx->check(writeMethod); + MOZ_ASSERT(writeMethod.isUndefined() || IsCallable(writeMethod)); + cx->check(closeMethod); + MOZ_ASSERT(closeMethod.isUndefined() || IsCallable(closeMethod)); + cx->check(abortMethod); + MOZ_ASSERT(abortMethod.isUndefined() || IsCallable(abortMethod)); + MOZ_ASSERT(highWaterMark >= 0); + cx->check(size); + MOZ_ASSERT(size.isUndefined() || IsCallable(size)); + + // Done elsewhere in the standard: Create the new controller. + Rooted controller( + cx, NewBuiltinClassInstance(cx)); + if (!controller) { + return false; + } + + // Step 1: Assert: ! IsWritableStream(stream) is true. + // (guaranteed by |stream|'s type) + + // Step 2: Assert: stream.[[writableStreamController]] is undefined. + MOZ_ASSERT(!stream->hasController()); + + // Step 3: Set controller.[[controlledWritableStream]] to stream. + controller->setStream(stream); + + // Step 4: Set stream.[[writableStreamController]] to controller. + stream->setController(controller); + + // Step 5: Perform ! ResetQueue(controller). + if (!ResetQueue(cx, controller)) { + return false; + } + + // Step 6: Set controller.[[started]] to false. + controller->setFlags(0); + MOZ_ASSERT(!controller->started()); + + // Step 7: Set controller.[[strategySizeAlgorithm]] to sizeAlgorithm. + controller->setStrategySize(size); + + // Step 8: Set controller.[[strategyHWM]] to highWaterMark. + controller->setStrategyHWM(highWaterMark); + + // Step 9: Set controller.[[writeAlgorithm]] to writeAlgorithm. + // Step 10: Set controller.[[closeAlgorithm]] to closeAlgorithm. + // Step 11: Set controller.[[abortAlgorithm]] to abortAlgorithm. + // (In this implementation, all [[*Algorithm]] are determined by the + // underlyingSink in combination with the corresponding *Method field.) + controller->setUnderlyingSink(underlyingSink); + controller->setWriteMethod(writeMethod); + controller->setCloseMethod(closeMethod); + controller->setAbortMethod(abortMethod); + + // Step 12: Let backpressure be + // ! WritableStreamDefaultControllerGetBackpressure(controller). + bool backpressure = + WritableStreamDefaultControllerGetBackpressure(controller); + + // Step 13: Perform ! WritableStreamUpdateBackpressure(stream, backpressure). + if (!WritableStreamUpdateBackpressure(cx, stream, backpressure)) { + return false; + } + + // Step 14: Let startResult be the result of performing startAlgorithm. (This + // may throw an exception.) + Rooted startResult(cx); + if (sinkAlgorithms == SinkAlgorithms::Script) { + Rooted controllerVal(cx, ObjectValue(*controller)); + if (!InvokeOrNoop(cx, underlyingSink, cx->names().start, controllerVal, + &startResult)) { + return false; + } + } + + // Step 15: Let startPromise be a promise resolved with startResult. + Rooted startPromise( + cx, PromiseObject::unforgeableResolve(cx, startResult)); + if (!startPromise) { + return false; + } + + // Step 16: Upon fulfillment of startPromise, + // Assert: stream.[[state]] is "writable" or "erroring". + // Set controller.[[started]] to true. + // Perform ! WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller). + // Step 17: Upon rejection of startPromise with reason r, + // Assert: stream.[[state]] is "writable" or "erroring". + // Set controller.[[started]] to true. + // Perform ! WritableStreamDealWithRejection(stream, r). + Rooted onStartFulfilled( + cx, NewHandler(cx, WritableStreamControllerStartHandler, controller)); + if (!onStartFulfilled) { + return false; + } + Rooted onStartRejected( + cx, + NewHandler(cx, WritableStreamControllerStartFailedHandler, controller)); + if (!onStartRejected) { + return false; + } + + return JS::AddPromiseReactions(cx, startPromise, onStartFulfilled, + onStartRejected); +} + +/** + * Streams spec, 4.8.3. + * SetUpWritableStreamDefaultControllerFromUnderlyingSink( stream, + * underlyingSink, highWaterMark, sizeAlgorithm ) + */ +[[nodiscard]] bool js::SetUpWritableStreamDefaultControllerFromUnderlyingSink( + JSContext* cx, Handle stream, Handle underlyingSink, + double highWaterMark, Handle sizeAlgorithm) { + cx->check(stream); + cx->check(underlyingSink); + cx->check(sizeAlgorithm); + + // Step 1: Assert: underlyingSink is not undefined. + MOZ_ASSERT(!underlyingSink.isUndefined()); + + // Step 2: Let controller be ObjectCreate(the original value of + // WritableStreamDefaultController's prototype property). + // (Deferred to SetUpWritableStreamDefaultController.) + + // Step 3: Let startAlgorithm be the following steps: + // a. Return ? InvokeOrNoop(underlyingSink, "start", + // « controller »). + SinkAlgorithms sinkAlgorithms = SinkAlgorithms::Script; + + // Step 4: Let writeAlgorithm be + // ? CreateAlgorithmFromUnderlyingMethod(underlyingSink, "write", 1, + // « controller »). + Rooted writeMethod(cx); + if (!CreateAlgorithmFromUnderlyingMethod(cx, underlyingSink, + "WritableStream sink.write method", + cx->names().write, &writeMethod)) { + return false; + } + + // Step 5: Let closeAlgorithm be + // ? CreateAlgorithmFromUnderlyingMethod(underlyingSink, "close", 0, + // « »). + Rooted closeMethod(cx); + if (!CreateAlgorithmFromUnderlyingMethod(cx, underlyingSink, + "WritableStream sink.close method", + cx->names().close, &closeMethod)) { + return false; + } + + // Step 6: Let abortAlgorithm be + // ? CreateAlgorithmFromUnderlyingMethod(underlyingSink, "abort", 1, + // « »). + Rooted abortMethod(cx); + if (!CreateAlgorithmFromUnderlyingMethod(cx, underlyingSink, + "WritableStream sink.abort method", + cx->names().abort, &abortMethod)) { + return false; + } + + // Step 6. Perform ? SetUpWritableStreamDefaultController(stream, + // controller, startAlgorithm, writeAlgorithm, closeAlgorithm, + // abortAlgorithm, highWaterMark, sizeAlgorithm). + return SetUpWritableStreamDefaultController( + cx, stream, sinkAlgorithms, underlyingSink, writeMethod, closeMethod, + abortMethod, highWaterMark, sizeAlgorithm); +} + +/** + * Streams spec, 4.8.4. + * WritableStreamDefaultControllerClearAlgorithms ( controller ) + */ +void js::WritableStreamDefaultControllerClearAlgorithms( + WritableStreamDefaultController* unwrappedController) { + // Note: This operation will be performed multiple times in some edge cases, + // so it can't assert that the various algorithms initially haven't been + // cleared. + + // Step 1: Set controller.[[writeAlgorithm]] to undefined. + unwrappedController->clearWriteMethod(); + + // Step 2: Set controller.[[closeAlgorithm]] to undefined. + unwrappedController->clearCloseMethod(); + + // Step 3: Set controller.[[abortAlgorithm]] to undefined. + unwrappedController->clearAbortMethod(); + + // Step 4: Set controller.[[strategySizeAlgorithm]] to undefined. + unwrappedController->clearStrategySize(); +} + +/** + * Streams spec, 4.8.5. + * WritableStreamDefaultControllerClose ( controller ) + */ +bool js::WritableStreamDefaultControllerClose( + JSContext* cx, + Handle unwrappedController) { + // Step 1: Perform ! EnqueueValueWithSize(controller, "close", 0). + { + Rooted v(cx, MagicValue(JS_WRITABLESTREAM_CLOSE_RECORD)); + Rooted size(cx, Int32Value(0)); + if (!EnqueueValueWithSize(cx, unwrappedController, v, size)) { + return false; + } + } + + // Step 2: Perform + // ! WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller). + return WritableStreamDefaultControllerAdvanceQueueIfNeeded( + cx, unwrappedController); +} + +/** + * Streams spec, 4.8.6. + * WritableStreamDefaultControllerGetChunkSize ( controller, chunk ) + */ +bool js::WritableStreamDefaultControllerGetChunkSize( + JSContext* cx, Handle unwrappedController, + Handle chunk, MutableHandle returnValue) { + cx->check(chunk); + + // Step 1: Let returnValue be the result of performing + // controller.[[strategySizeAlgorithm]], passing in chunk, and + // interpreting the result as an ECMAScript completion value. + + // We don't store a literal [[strategySizeAlgorithm]], only the value that if + // passed through |MakeSizeAlgorithmFromSizeFunction| wouldn't have triggered + // an error. Perform the algorithm that function would return. + Rooted unwrappedStrategySize(cx, unwrappedController->strategySize()); + if (unwrappedStrategySize.isUndefined()) { + // 6.3.8 step 1: If size is undefined, return an algorithm that returns 1. + // ...and then from this function... + // Step 3: Return returnValue.[[Value]]. + returnValue.setInt32(1); + return true; + } + + MOZ_ASSERT(IsCallable(unwrappedStrategySize)); + + { + bool success; + { + AutoRealm ar(cx, unwrappedController); + cx->check(unwrappedStrategySize); + + Rooted wrappedChunk(cx, chunk); + if (!cx->compartment()->wrap(cx, &wrappedChunk)) { + return false; + } + + // 6.3.8 step 3 (of |MakeSizeAlgorithmFromSizeFunction|): + // Return an algorithm that performs the following steps, taking a + // chunk argument: + // a. Return ? Call(size, undefined, « chunk »). + success = Call(cx, unwrappedStrategySize, UndefinedHandleValue, + wrappedChunk, returnValue); + } + + // Step 3: (If returnValue is [not] an abrupt completion, ) + // Return returnValue.[[Value]]. (reordered for readability) + if (success) { + return cx->compartment()->wrap(cx, returnValue); + } + } + + // Step 2: If returnValue is an abrupt completion, + if (!cx->isExceptionPending() || !cx->getPendingException(returnValue)) { + // Uncatchable error. Die immediately without erroring the stream. + return false; + } + cx->check(returnValue); + + cx->clearPendingException(); + + // Step 2.a: Perform + // ! WritableStreamDefaultControllerErrorIfNeeded( + // controller, returnValue.[[Value]]). + if (!WritableStreamDefaultControllerErrorIfNeeded(cx, unwrappedController, + returnValue)) { + return false; + } + + // Step 2.b: Return 1. + returnValue.setInt32(1); + return true; +} + +/** + * Streams spec, 4.8.7. + * WritableStreamDefaultControllerGetDesiredSize ( controller ) + */ +double js::WritableStreamDefaultControllerGetDesiredSize( + const WritableStreamDefaultController* controller) { + return controller->strategyHWM() - controller->queueTotalSize(); +} + +/** + * Streams spec, 4.8.8. + * WritableStreamDefaultControllerWrite ( controller, chunk, chunkSize ) + */ +bool js::WritableStreamDefaultControllerWrite( + JSContext* cx, Handle unwrappedController, + Handle chunk, Handle chunkSize) { + MOZ_ASSERT(!chunk.isMagic()); + cx->check(chunk); + cx->check(chunkSize); + + // Step 1: Let writeRecord be Record {[[chunk]]: chunk}. + // Step 2: Let enqueueResult be + // EnqueueValueWithSize(controller, writeRecord, chunkSize). + bool succeeded = + EnqueueValueWithSize(cx, unwrappedController, chunk, chunkSize); + + // Step 3: If enqueueResult is an abrupt completion, + if (!succeeded) { + Rooted enqueueResult(cx); + if (!cx->isExceptionPending() || !cx->getPendingException(&enqueueResult)) { + // Uncatchable error. Die immediately without erroring the stream. + return false; + } + cx->check(enqueueResult); + + cx->clearPendingException(); + + // Step 3.a: Perform ! WritableStreamDefaultControllerErrorIfNeeded( + // controller, enqueueResult.[[Value]]). + // Step 3.b: Return. + return WritableStreamDefaultControllerErrorIfNeeded(cx, unwrappedController, + enqueueResult); + } + + // Step 4: Let stream be controller.[[controlledWritableStream]]. + Rooted unwrappedStream(cx, unwrappedController->stream()); + + // Step 5: If ! WritableStreamCloseQueuedOrInFlight(stream) is false and + // stream.[[state]] is "writable", + if (!WritableStreamCloseQueuedOrInFlight(unwrappedStream) && + unwrappedStream->writable()) { + // Step 5.a: Let backpressure be + // ! WritableStreamDefaultControllerGetBackpressure(controller). + bool backpressure = + WritableStreamDefaultControllerGetBackpressure(unwrappedController); + + // Step 5.b: Perform + // ! WritableStreamUpdateBackpressure(stream, backpressure). + if (!WritableStreamUpdateBackpressure(cx, unwrappedStream, backpressure)) { + return false; + } + } + + // Step 6: Perform + // ! WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller). + return WritableStreamDefaultControllerAdvanceQueueIfNeeded( + cx, unwrappedController); +} + +[[nodiscard]] static bool WritableStreamDefaultControllerProcessIfNeeded( + JSContext* cx, + Handle unwrappedController); + +/** + * Streams spec, 4.8.9. + * WritableStreamDefaultControllerAdvanceQueueIfNeeded ( controller ) + */ +[[nodiscard]] bool WritableStreamDefaultControllerAdvanceQueueIfNeeded( + JSContext* cx, + Handle unwrappedController) { + // Step 2: If controller.[[started]] is false, return. + if (!unwrappedController->started()) { + return true; + } + + // Step 1: Let stream be controller.[[controlledWritableStream]]. + Rooted unwrappedStream(cx, unwrappedController->stream()); + + // Step 3: If stream.[[inFlightWriteRequest]] is not undefined, return. + if (!unwrappedStream->inFlightWriteRequest().isUndefined()) { + return true; + } + + // Step 4: Let state be stream.[[state]]. + // Step 5: Assert: state is not "closed" or "errored". + // Step 6: If state is "erroring", + MOZ_ASSERT(!unwrappedStream->closed()); + MOZ_ASSERT(!unwrappedStream->errored()); + if (unwrappedStream->erroring()) { + // Step 6a: Perform ! WritableStreamFinishErroring(stream). + // Step 6b: Return. + return WritableStreamFinishErroring(cx, unwrappedStream); + } + + // Step 7: If controller.[[queue]] is empty, return. + // Step 8: Let writeRecord be ! PeekQueueValue(controller). + // Step 9: If writeRecord is "close", perform + // ! WritableStreamDefaultControllerProcessClose(controller). + // Step 10: Otherwise, perform + // ! WritableStreamDefaultControllerProcessWrite( + // controller, writeRecord.[[chunk]]). + return WritableStreamDefaultControllerProcessIfNeeded(cx, + unwrappedController); +} + +/** + * Streams spec, 4.8.10. + * WritableStreamDefaultControllerErrorIfNeeded ( controller, error ) + */ +bool js::WritableStreamDefaultControllerErrorIfNeeded( + JSContext* cx, Handle unwrappedController, + Handle error) { + cx->check(error); + + // Step 1: If controller.[[controlledWritableStream]].[[state]] is "writable", + // perform ! WritableStreamDefaultControllerError(controller, error). + if (unwrappedController->stream()->writable()) { + if (!WritableStreamDefaultControllerError(cx, unwrappedController, error)) { + return false; + } + } + + return true; +} + +// 4.8.11 step 5: Let sinkClosePromise be the result of performing +// controller.[[closeAlgorithm]]. +[[nodiscard]] static JSObject* PerformCloseAlgorithm( + JSContext* cx, + Handle unwrappedController) { + // 4.8.3 step 5: Let closeAlgorithm be + // ? CreateAlgorithmFromUnderlyingMethod(underlyingSink, + // "close", 0, « »). + + // Step 1: Assert: underlyingObject is not undefined. + // Step 2: Assert: ! IsPropertyKey(methodName) is true (implicit). + // Step 3: Assert: algoArgCount is 0 or 1 (omitted). + // Step 4: Assert: extraArgs is a List (omitted). + // Step 5: Let method be ? GetV(underlyingObject, methodName). + // + // These steps were performed in |CreateAlgorithmFromUnderlyingMethod|. The + // spec stores away algorithms for later invocation; we instead store the + // value that determines the algorithm to be created -- either |undefined|, or + // a callable object that's called with context-specific arguments. + + // Step 7: (If method is undefined,) Return an algorithm which returns a + // promise resolved with undefined (implicit). + if (unwrappedController->closeMethod().isUndefined()) { + return PromiseResolvedWithUndefined(cx); + } + + // Step 6: If method is not undefined, + + // Step 6.a: If ! IsCallable(method) is false, throw a TypeError exception. + MOZ_ASSERT(IsCallable(unwrappedController->closeMethod())); + + // Step 6.b: If algoArgCount is 0, return an algorithm that performs the + // following steps: + // Step 6.b.ii: Return ! PromiseCall(method, underlyingObject, extraArgs). + Rooted closeMethod(cx, unwrappedController->closeMethod()); + if (!cx->compartment()->wrap(cx, &closeMethod)) { + return nullptr; + } + + Rooted underlyingSink(cx, unwrappedController->underlyingSink()); + if (!cx->compartment()->wrap(cx, &underlyingSink)) { + return nullptr; + } + + return PromiseCall(cx, closeMethod, underlyingSink); +} + +// 4.8.12 step 3: Let sinkWritePromise be the result of performing +// controller.[[writeAlgorithm]], passing in chunk. +[[nodiscard]] static JSObject* PerformWriteAlgorithm( + JSContext* cx, Handle unwrappedController, + Handle chunk) { + cx->check(chunk); + + // 4.8.3 step 4: Let writeAlgorithm be + // ? CreateAlgorithmFromUnderlyingMethod(underlyingSink, + // "write", 1, + // « controller »). + + // Step 1: Assert: underlyingObject is not undefined. + // Step 2: Assert: ! IsPropertyKey(methodName) is true (implicit). + // Step 3: Assert: algoArgCount is 0 or 1 (omitted). + // Step 4: Assert: extraArgs is a List (omitted). + // Step 5: Let method be ? GetV(underlyingObject, methodName). + // + // These steps were performed in |CreateAlgorithmFromUnderlyingMethod|. The + // spec stores away algorithms for later invocation; we instead store the + // value that determines the algorithm to be created -- either |undefined|, or + // a callable object that's called with context-specific arguments. + + // Step 7: (If method is undefined,) Return an algorithm which returns a + // promise resolved with undefined (implicit). + if (unwrappedController->writeMethod().isUndefined()) { + return PromiseResolvedWithUndefined(cx); + } + + // Step 6: If method is not undefined, + + // Step 6.a: If ! IsCallable(method) is false, throw a TypeError exception. + MOZ_ASSERT(IsCallable(unwrappedController->writeMethod())); + + // Step 6.c: Otherwise (if algoArgCount is not 0), return an algorithm that + // performs the following steps, taking an arg argument: + // Step 6.c.i: Let fullArgs be a List consisting of arg followed by the + // elements of extraArgs in order. + // Step 6.c.ii: Return ! PromiseCall(method, underlyingObject, fullArgs). + Rooted writeMethod(cx, unwrappedController->writeMethod()); + if (!cx->compartment()->wrap(cx, &writeMethod)) { + return nullptr; + } + + Rooted underlyingSink(cx, unwrappedController->underlyingSink()); + if (!cx->compartment()->wrap(cx, &underlyingSink)) { + return nullptr; + } + + Rooted controller(cx, ObjectValue(*unwrappedController)); + if (!cx->compartment()->wrap(cx, &controller)) { + return nullptr; + } + + return PromiseCall(cx, writeMethod, underlyingSink, chunk, controller); +} + +/** + * Streams spec, 4.8.11 step 7: + * Upon fulfillment of sinkClosePromise, + */ +[[nodiscard]] static bool WritableStreamCloseHandler(JSContext* cx, + unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted unwrappedStream( + cx, TargetFromHandler(args)); + + // Step 7.a: Perform ! WritableStreamFinishInFlightClose(stream). + if (!WritableStreamFinishInFlightClose(cx, unwrappedStream)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 4.8.11 step 8: + * Upon rejection of sinkClosePromise with reason reason, + */ +[[nodiscard]] static bool WritableStreamCloseFailedHandler(JSContext* cx, + unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted unwrappedStream( + cx, TargetFromHandler(args)); + + // Step 8.a: Perform + // ! WritableStreamFinishInFlightCloseWithError(stream, reason). + if (!WritableStreamFinishInFlightCloseWithError(cx, unwrappedStream, + args.get(0))) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 4.8.12 step 4: + * Upon fulfillment of sinkWritePromise, + */ +[[nodiscard]] static bool WritableStreamWriteHandler(JSContext* cx, + unsigned argc, Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted unwrappedStream( + cx, TargetFromHandler(args)); + + // Step 4.a: Perform ! WritableStreamFinishInFlightWrite(stream). + if (!WritableStreamFinishInFlightWrite(cx, unwrappedStream)) { + return false; + } + + // Step 4.b: Let state be stream.[[state]]. + // Step 4.c: Assert: state is "writable" or "erroring". + MOZ_ASSERT(unwrappedStream->writable() ^ unwrappedStream->erroring()); + + // Step 4.d: Perform ! DequeueValue(controller). + DequeueValue(unwrappedStream->controller(), cx); + + // Step 4.e: If ! WritableStreamCloseQueuedOrInFlight(stream) is false and + // state is "writable", + if (!WritableStreamCloseQueuedOrInFlight(unwrappedStream) && + unwrappedStream->writable()) { + // Step 4.e.i: Let backpressure be + // ! WritableStreamDefaultControllerGetBackpressure( + // controller). + bool backpressure = WritableStreamDefaultControllerGetBackpressure( + unwrappedStream->controller()); + + // Step 4.e.ii: Perform + // ! WritableStreamUpdateBackpressure(stream, backpressure). + if (!WritableStreamUpdateBackpressure(cx, unwrappedStream, backpressure)) { + return false; + } + } + + // Step 4.f: Perform + // ! WritableStreamDefaultControllerAdvanceQueueIfNeeded( + // controller). + Rooted unwrappedController( + cx, unwrappedStream->controller()); + if (!WritableStreamDefaultControllerAdvanceQueueIfNeeded( + cx, unwrappedController)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 4.8.12 step 5: + * Upon rejection of sinkWritePromise with reason, + */ +[[nodiscard]] static bool WritableStreamWriteFailedHandler(JSContext* cx, + unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + Rooted unwrappedStream( + cx, TargetFromHandler(args)); + + // Step 5.a: If stream.[[state]] is "writable", perform + // ! WritableStreamDefaultControllerClearAlgorithms(controller). + if (unwrappedStream->writable()) { + WritableStreamDefaultControllerClearAlgorithms( + unwrappedStream->controller()); + } + + // Step 5.b: Perform + // ! WritableStreamFinishInFlightWriteWithError(stream, reason). + if (!WritableStreamFinishInFlightWriteWithError(cx, unwrappedStream, + args.get(0))) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 4.8.9 (steps 7-10), + * WritableStreamDefaultControllerAdvanceQueueIfNeeded ( controller ) + * Streams spec, 4.8.11. + * WritableStreamDefaultControllerProcessClose ( controller ) + * Streams spec, 4.8.12. + * WritableStreamDefaultControllerProcessWrite ( controller, chunk ) + */ +bool WritableStreamDefaultControllerProcessIfNeeded( + JSContext* cx, + Handle unwrappedController) { + // Step 7: If controller.[[queue]] is empty, return. + ListObject* unwrappedQueue = unwrappedController->queue(); + if (QueueIsEmpty(unwrappedQueue)) { + return true; + } + + // Step 8: Let writeRecord be ! PeekQueueValue(controller). + // Step 9: If writeRecord is "close", perform + // ! WritableStreamDefaultControllerProcessClose(controller). + // Step 10: Otherwise, perform + // ! WritableStreamDefaultControllerProcessWrite( + // controller, writeRecord.[[chunk]]). + Rooted sinkWriteOrClosePromise(cx); + JSNative onFulfilledFunc, onRejectedFunc; + if (PeekQueueValue(unwrappedQueue).isMagic(JS_WRITABLESTREAM_CLOSE_RECORD)) { + MOZ_ASSERT(unwrappedQueue->length() == 2); + + onFulfilledFunc = WritableStreamCloseHandler; + onRejectedFunc = WritableStreamCloseFailedHandler; + + // 4.8.11 step 1: Let stream be controller.[[controlledWritableStream]]. + // 4.8.11 step 2: Perform ! WritableStreamMarkCloseRequestInFlight(stream). + WritableStreamMarkCloseRequestInFlight(unwrappedController->stream()); + + // 4.8.11 step 3: Perform ! DequeueValue(controller). + DequeueValue(unwrappedController, cx); + + // 4.8.11 step 4: Assert: controller.[[queue]] is empty. + MOZ_ASSERT(unwrappedQueue->isEmpty()); + + // 4.8.11 step 5: Let sinkClosePromise be the result of performing + // controller.[[closeAlgorithm]]. + sinkWriteOrClosePromise = PerformCloseAlgorithm(cx, unwrappedController); + } else { + onFulfilledFunc = WritableStreamWriteHandler; + onRejectedFunc = WritableStreamWriteFailedHandler; + + Rooted chunk(cx, PeekQueueValue(unwrappedQueue)); + if (!cx->compartment()->wrap(cx, &chunk)) { + return false; + } + + // 4.8.12 step 1: Let stream be controller.[[controlledWritableStream]]. + // 4.8.12 step 2: Perform + // ! WritableStreamMarkFirstWriteRequestInFlight(stream). + WritableStreamMarkFirstWriteRequestInFlight(unwrappedController->stream()); + + // 4.8.12 step 3: Let sinkWritePromise be the result of performing + // controller.[[writeAlgorithm]], passing in chunk. + sinkWriteOrClosePromise = + PerformWriteAlgorithm(cx, unwrappedController, chunk); + } + if (!sinkWriteOrClosePromise) { + return false; + } + + Rooted stream(cx, unwrappedController->stream()); + if (!cx->compartment()->wrap(cx, &stream)) { + return false; + } + + // Step 7: Upon fulfillment of sinkClosePromise, + // Step 4: Upon fulfillment of sinkWritePromise, + // Step 8: Upon rejection of sinkClosePromise with reason reason, + // Step 5: Upon rejection of sinkWritePromise with reason, + Rooted onFulfilled(cx, NewHandler(cx, onFulfilledFunc, stream)); + if (!onFulfilled) { + return false; + } + Rooted onRejected(cx, NewHandler(cx, onRejectedFunc, stream)); + if (!onRejected) { + return false; + } + return JS::AddPromiseReactions(cx, sinkWriteOrClosePromise, onFulfilled, + onRejected); +} + +/** + * Streams spec, 4.8.13. + * WritableStreamDefaultControllerGetBackpressure ( controller ) + */ +bool js::WritableStreamDefaultControllerGetBackpressure( + const WritableStreamDefaultController* unwrappedController) { + return WritableStreamDefaultControllerGetDesiredSize(unwrappedController) <= + 0.0; +} + +/** + * Streams spec, 4.8.14. + * WritableStreamDefaultControllerError ( controller, error ) + */ +bool js::WritableStreamDefaultControllerError( + JSContext* cx, Handle unwrappedController, + Handle error) { + cx->check(error); + + // Step 1: Let stream be controller.[[controlledWritableStream]]. + Rooted unwrappedStream(cx, unwrappedController->stream()); + + // Step 2: Assert: stream.[[state]] is "writable". + MOZ_ASSERT(unwrappedStream->writable()); + + // Step 3: Perform + // ! WritableStreamDefaultControllerClearAlgorithms(controller). + WritableStreamDefaultControllerClearAlgorithms(unwrappedController); + + // Step 4: Perform ! WritableStreamStartErroring(stream, error). + return WritableStreamStartErroring(cx, unwrappedStream, error); +} diff --git a/js/src/builtin/streams/WritableStreamDefaultControllerOperations.h b/js/src/builtin/streams/WritableStreamDefaultControllerOperations.h new file mode 100644 index 0000000000000..e7fdd7fe24927 --- /dev/null +++ b/js/src/builtin/streams/WritableStreamDefaultControllerOperations.h @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Writable stream default controller abstract operations. */ + +#ifndef builtin_streams_WritableStreamDefaultControllerOperations_h +#define builtin_streams_WritableStreamDefaultControllerOperations_h + +#include "jstypes.h" // JS_PUBLIC_API +#include "js/RootingAPI.h" // JS::Handle +#include "js/Value.h" // JS::Value + +struct JS_PUBLIC_API JSContext; + +namespace js { + +class WritableStream; +class WritableStreamDefaultController; + +extern JSObject* WritableStreamControllerAbortSteps( + JSContext* cx, + JS::Handle unwrappedController, + JS::Handle reason); + +[[nodiscard]] extern bool WritableStreamControllerErrorSteps( + JSContext* cx, + JS::Handle unwrappedController); + +[[nodiscard]] extern bool WritableStreamControllerStartHandler(JSContext* cx, + unsigned argc, + JS::Value* vp); + +[[nodiscard]] extern bool WritableStreamControllerStartFailedHandler( + JSContext* cx, unsigned argc, JS::Value* vp); + +/** + * Characterizes the family of algorithms, (startAlgorithm, writeAlgorithm, + * closeAlgorithm, abortAlgorithm), associated with a writable stream. + * + * See the comment on SetUpWritableStreamDefaultController(). + */ +enum class SinkAlgorithms { + Script, + Transform, +}; + +[[nodiscard]] extern bool SetUpWritableStreamDefaultController( + JSContext* cx, JS::Handle stream, + SinkAlgorithms algorithms, JS::Handle underlyingSink, + JS::Handle writeMethod, JS::Handle closeMethod, + JS::Handle abortMethod, double highWaterMark, + JS::Handle size); + +[[nodiscard]] extern bool +SetUpWritableStreamDefaultControllerFromUnderlyingSink( + JSContext* cx, JS::Handle stream, + JS::Handle underlyingSink, double highWaterMark, + JS::Handle sizeAlgorithm); + +extern void WritableStreamDefaultControllerClearAlgorithms( + WritableStreamDefaultController* unwrappedController); + +[[nodiscard]] extern bool WritableStreamDefaultControllerClose( + JSContext* cx, + JS::Handle unwrappedController); + +[[nodiscard]] extern bool WritableStreamDefaultControllerGetChunkSize( + JSContext* cx, + JS::Handle unwrappedController, + JS::Handle chunk, JS::MutableHandle returnValue); + +extern double WritableStreamDefaultControllerGetDesiredSize( + const WritableStreamDefaultController* controller); + +[[nodiscard]] extern bool WritableStreamDefaultControllerWrite( + JSContext* cx, + JS::Handle unwrappedController, + JS::Handle chunk, JS::Handle chunkSize); + +[[nodiscard]] extern bool WritableStreamDefaultControllerErrorIfNeeded( + JSContext* cx, + JS::Handle unwrappedController, + JS::Handle error); + +[[nodiscard]] extern bool WritableStreamDefaultControllerProcessClose( + JSContext* cx, + JS::Handle unwrappedController); + +[[nodiscard]] extern bool WritableStreamDefaultControllerProcessWrite( + JSContext* cx, + JS::Handle unwrappedController, + JS::Handle chunk); + +extern bool WritableStreamDefaultControllerGetBackpressure( + const WritableStreamDefaultController* unwrappedController); + +[[nodiscard]] extern bool WritableStreamDefaultControllerError( + JSContext* cx, + JS::Handle unwrappedController, + JS::Handle error); + +} // namespace js + +#endif // builtin_streams_WritableStreamDefaultControllerOperations_h diff --git a/js/src/builtin/streams/WritableStreamDefaultWriter-inl.h b/js/src/builtin/streams/WritableStreamDefaultWriter-inl.h new file mode 100644 index 0000000000000..72dc8f27d2ece --- /dev/null +++ b/js/src/builtin/streams/WritableStreamDefaultWriter-inl.h @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Class WritableStreamDefaultWriter. */ + +#ifndef builtin_streams_WritableStreamDefaultWriter_inl_h +#define builtin_streams_WritableStreamDefaultWriter_inl_h + +#include "builtin/streams/WritableStreamDefaultWriter.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT + +#include "builtin/streams/WritableStream.h" // js::WritableStream +#include "js/RootingAPI.h" // JS::Handle +#include "js/Value.h" // JS::ObjectValue +#include "vm/NativeObject.h" // js::NativeObject + +#include "builtin/streams/Streams-inl.h" // js::UnwrapInternalSlot + +struct JS_PUBLIC_API JSContext; + +namespace js { + +/** + * Returns the stream associated with the given reader. + */ +[[nodiscard]] inline WritableStream* UnwrapStreamFromWriter( + JSContext* cx, JS::Handle unwrappedWriter) { + MOZ_ASSERT(unwrappedWriter->hasStream()); + return UnwrapInternalSlot( + cx, unwrappedWriter, WritableStreamDefaultWriter::Slot_Stream); +} + +} // namespace js + +#endif // builtin_streams_WritableStreamDefaultWriter_inl_h diff --git a/js/src/builtin/streams/WritableStreamDefaultWriter.cpp b/js/src/builtin/streams/WritableStreamDefaultWriter.cpp new file mode 100644 index 0000000000000..3577d89f86e93 --- /dev/null +++ b/js/src/builtin/streams/WritableStreamDefaultWriter.cpp @@ -0,0 +1,526 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Class WritableStreamDefaultWriter. */ + +#include "builtin/streams/WritableStreamDefaultWriter-inl.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT + +#include "builtin/streams/ClassSpecMacro.h" // JS_STREAMS_CLASS_SPEC +#include "builtin/streams/MiscellaneousOperations.h" // js::ReturnPromiseRejectedWithPendingError +#include "builtin/streams/WritableStream.h" // js::WritableStream +#include "builtin/streams/WritableStreamOperations.h" // js::WritableStreamCloseQueuedOrInFlight +#include "builtin/streams/WritableStreamWriterOperations.h" // js::WritableStreamDefaultWriter{Abort,GetDesiredSize,Release,Write} +#include "js/CallArgs.h" // JS::CallArgs{,FromVp} +#include "js/Class.h" // js::ClassSpec, JS_NULL_CLASS_OPS +#include "js/ErrorReport.h" // JS_ReportErrorNumberASCII +#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* +#include "js/PropertySpec.h" // JS{Function,Property}Spec, JS_{FS,PS}_END, JS_{FN,PSG} +#include "js/RootingAPI.h" // JS::Handle +#include "js/Value.h" // JS::Value +#include "vm/Compartment.h" // JS::Compartment +#include "vm/JSContext.h" // JSContext +#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined + +#include "builtin/Promise-inl.h" // js::SetSettledPromiseIsHandled +#include "vm/Compartment-inl.h" // JS::Compartment::wrap, js::UnwrapAndTypeCheck{Argument,This} +#include "vm/JSObject-inl.h" // js::NewObjectWithClassProto +#include "vm/NativeObject-inl.h" // js::ThrowIfNotConstructing +#include "vm/Realm-inl.h" // js::AutoRealm + +using JS::CallArgs; +using JS::CallArgsFromVp; +using JS::Handle; +using JS::Rooted; +using JS::Value; + +using js::ClassSpec; +using js::GetErrorMessage; +using js::PromiseObject; +using js::ReturnPromiseRejectedWithPendingError; +using js::UnwrapAndTypeCheckArgument; +using js::UnwrapAndTypeCheckThis; +using js::WritableStream; +using js::WritableStreamCloseQueuedOrInFlight; +using js::WritableStreamDefaultWriter; +using js::WritableStreamDefaultWriterGetDesiredSize; +using js::WritableStreamDefaultWriterRelease; +using js::WritableStreamDefaultWriterWrite; + +/*** 4.5. Class WritableStreamDefaultWriter *********************************/ + +/** + * Stream spec, 4.5.3. new WritableStreamDefaultWriter(stream) + * Steps 3-9. + */ +[[nodiscard]] WritableStreamDefaultWriter* +js::CreateWritableStreamDefaultWriter(JSContext* cx, + Handle unwrappedStream, + Handle proto /* = nullptr */) { + Rooted writer( + cx, NewObjectWithClassProto(cx, proto)); + if (!writer) { + return nullptr; + } + + // Step 3: Set this.[[ownerWritableStream]] to stream. + { + Rooted stream(cx, unwrappedStream); + if (!cx->compartment()->wrap(cx, &stream)) { + return nullptr; + } + writer->setStream(stream); + } + + // Step 4 is moved to the end. + + // Step 5: Let state be stream.[[state]]. + // Step 6: If state is "writable", + if (unwrappedStream->writable()) { + // Step 6.a: If ! WritableStreamCloseQueuedOrInFlight(stream) is false and + // stream.[[backpressure]] is true, set this.[[readyPromise]] to a + // new promise. + PromiseObject* promise; + if (!WritableStreamCloseQueuedOrInFlight(unwrappedStream) && + unwrappedStream->backpressure()) { + promise = PromiseObject::createSkippingExecutor(cx); + } + // Step 6.b: Otherwise, set this.[[readyPromise]] to a promise resolved with + // undefined. + else { + promise = PromiseResolvedWithUndefined(cx); + } + if (!promise) { + return nullptr; + } + writer->setReadyPromise(promise); + + // Step 6.c: Set this.[[closedPromise]] to a new promise. + promise = PromiseObject::createSkippingExecutor(cx); + if (!promise) { + return nullptr; + } + + writer->setClosedPromise(promise); + } + // Step 8: Otherwise, if state is "closed", + else if (unwrappedStream->closed()) { + // Step 8.a: Set this.[[readyPromise]] to a promise resolved with undefined. + PromiseObject* readyPromise = PromiseResolvedWithUndefined(cx); + if (!readyPromise) { + return nullptr; + } + + writer->setReadyPromise(readyPromise); + + // Step 8.b: Set this.[[closedPromise]] to a promise resolved with + // undefined. + PromiseObject* closedPromise = PromiseResolvedWithUndefined(cx); + if (!closedPromise) { + return nullptr; + } + + writer->setClosedPromise(closedPromise); + } else { + // Wrap stream.[[StoredError]] just once for either step 7 or step 9. + Rooted storedError(cx, unwrappedStream->storedError()); + if (!cx->compartment()->wrap(cx, &storedError)) { + return nullptr; + } + + // Step 7: Otherwise, if state is "erroring", + if (unwrappedStream->erroring()) { + // Step 7.a: Set this.[[readyPromise]] to a promise rejected with + // stream.[[storedError]]. + Rooted promise( + cx, PromiseObject::unforgeableReject(cx, storedError)); + if (!promise) { + return nullptr; + } + + writer->setReadyPromise(promise); + + // Step 7.b: Set this.[[readyPromise]].[[PromiseIsHandled]] to true. + js::SetSettledPromiseIsHandled(cx, promise.as()); + + // Step 7.c: Set this.[[closedPromise]] to a new promise. + JSObject* closedPromise = PromiseObject::createSkippingExecutor(cx); + if (!closedPromise) { + return nullptr; + } + + writer->setClosedPromise(closedPromise); + } + // Step 9: Otherwise, + else { + // Step 9.a: Assert: state is "errored". + MOZ_ASSERT(unwrappedStream->errored()); + + Rooted promise(cx); + + // Step 9.b: Let storedError be stream.[[storedError]]. + // Step 9.c: Set this.[[readyPromise]] to a promise rejected with + // storedError. + promise = PromiseObject::unforgeableReject(cx, storedError); + if (!promise) { + return nullptr; + } + + writer->setReadyPromise(promise); + + // Step 9.d: Set this.[[readyPromise]].[[PromiseIsHandled]] to true. + js::SetSettledPromiseIsHandled(cx, promise.as()); + + // Step 9.e: Set this.[[closedPromise]] to a promise rejected with + // storedError. + promise = PromiseObject::unforgeableReject(cx, storedError); + if (!promise) { + return nullptr; + } + + writer->setClosedPromise(promise); + + // Step 9.f: Set this.[[closedPromise]].[[PromiseIsHandled]] to true. + js::SetSettledPromiseIsHandled(cx, promise.as()); + } + } + + // Step 4 (reordered): Set stream.[[writer]] to this. + // Doing this last prevents a partially-initialized writer from being attached + // to the stream (and possibly left there on OOM). + { + AutoRealm ar(cx, unwrappedStream); + Rooted wrappedWriter(cx, writer); + if (!cx->compartment()->wrap(cx, &wrappedWriter)) { + return nullptr; + } + unwrappedStream->setWriter(wrappedWriter); + } + + return writer; +} + +/** + * Streams spec, 4.5.3. + * new WritableStreamDefaultWriter(stream) + */ +bool WritableStreamDefaultWriter::constructor(JSContext* cx, unsigned argc, + Value* vp) { + + CallArgs args = CallArgsFromVp(argc, vp); + + if (!ThrowIfNotConstructing(cx, args, "WritableStreamDefaultWriter")) { + return false; + } + + // Step 1: If ! IsWritableStream(stream) is false, throw a TypeError + // exception. + Rooted unwrappedStream( + cx, UnwrapAndTypeCheckArgument( + cx, args, "WritableStreamDefaultWriter constructor", 0)); + if (!unwrappedStream) { + return false; + } + + // Step 2: If ! IsWritableStreamLocked(stream) is true, throw a TypeError + // exception. + if (unwrappedStream->isLocked()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_WRITABLESTREAM_ALREADY_LOCKED); + return false; + } + + // Implicit in the spec: Find the prototype object to use. + Rooted proto(cx); + if (!GetPrototypeFromBuiltinConstructor(cx, args, JSProto_Null, &proto)) { + return false; + } + + // Steps 3-9. + Rooted writer( + cx, CreateWritableStreamDefaultWriter(cx, unwrappedStream, proto)); + if (!writer) { + return false; + } + + args.rval().setObject(*writer); + return true; +} + +/** + * Streams spec, 4.5.4.1. get closed + */ +[[nodiscard]] static bool WritableStreamDefaultWriter_closed(JSContext* cx, + unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsWritableStreamDefaultWriter(this) is false, return a promise + // rejected with a TypeError exception. + Rooted unwrappedWriter( + cx, UnwrapAndTypeCheckThis(cx, args, + "get closed")); + if (!unwrappedWriter) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 2: Return this.[[closedPromise]]. + Rooted closedPromise(cx, unwrappedWriter->closedPromise()); + if (!cx->compartment()->wrap(cx, &closedPromise)) { + return false; + } + + args.rval().setObject(*closedPromise); + return true; +} + +/** + * Streams spec, 4.5.4.2. get desiredSize + */ +[[nodiscard]] static bool WritableStreamDefaultWriter_desiredSize(JSContext* cx, + unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsWritableStreamDefaultWriter(this) is false, throw a + // TypeError exception. + Rooted unwrappedWriter( + cx, UnwrapAndTypeCheckThis( + cx, args, "get desiredSize")); + if (!unwrappedWriter) { + return false; + } + + // Step 2: If this.[[ownerWritableStream]] is undefined, throw a TypeError + // exception. + if (!unwrappedWriter->hasStream()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_WRITABLESTREAMWRITER_NOT_OWNED, + "get desiredSize"); + return false; + } + + // Step 3: Return ! WritableStreamDefaultWriterGetDesiredSize(this). + if (!WritableStreamDefaultWriterGetDesiredSize(cx, unwrappedWriter, + args.rval())) { + return false; + } + + MOZ_ASSERT(args.rval().isNull() || args.rval().isNumber(), + "expected a type that'll never require wrapping"); + return true; +} + +/** + * Streams spec, 4.5.4.3. get ready + */ +[[nodiscard]] static bool WritableStreamDefaultWriter_ready(JSContext* cx, + unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsWritableStreamDefaultWriter(this) is false, return a promise + // rejected with a TypeError exception. + Rooted unwrappedWriter( + cx, UnwrapAndTypeCheckThis(cx, args, + "get ready")); + if (!unwrappedWriter) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 2: Return this.[[readyPromise]]. + Rooted readyPromise(cx, unwrappedWriter->readyPromise()); + if (!cx->compartment()->wrap(cx, &readyPromise)) { + return false; + } + + args.rval().setObject(*readyPromise); + return true; +} + +/** + * Streams spec, 4.5.4.4. abort(reason) + */ +[[nodiscard]] static bool WritableStreamDefaultWriter_abort(JSContext* cx, + unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsWritableStreamDefaultWriter(this) is false, return a promise + // rejected with a TypeError exception. + Rooted unwrappedWriter( + cx, + UnwrapAndTypeCheckThis(cx, args, "abort")); + if (!unwrappedWriter) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 2: If this.[[ownerWritableStream]] is undefined, return a promise + // rejected with a TypeError exception. + if (!unwrappedWriter->hasStream()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_WRITABLESTREAMWRITER_NOT_OWNED, "abort"); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 3: Return ! WritableStreamDefaultWriterAbort(this, reason). + JSObject* promise = + WritableStreamDefaultWriterAbort(cx, unwrappedWriter, args.get(0)); + if (!promise) { + return false; + } + cx->check(promise); + + args.rval().setObject(*promise); + return true; +} + +/** + * Streams spec, 4.5.4.5. close() + */ +[[nodiscard]] static bool WritableStreamDefaultWriter_close(JSContext* cx, + unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsWritableStreamDefaultWriter(this) is false, return a promise + // rejected with a TypeError exception. + Rooted unwrappedWriter( + cx, + UnwrapAndTypeCheckThis(cx, args, "close")); + if (!unwrappedWriter) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 2: Let stream be this.[[ownerWritableStream]]. + // Step 3: If stream is undefined, return a promise rejected with a TypeError + // exception. + if (!unwrappedWriter->hasStream()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_WRITABLESTREAMWRITER_NOT_OWNED, "write"); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + WritableStream* unwrappedStream = UnwrapStreamFromWriter(cx, unwrappedWriter); + if (!unwrappedStream) { + return false; + } + + // Step 4: If ! WritableStreamCloseQueuedOrInFlight(stream) is true, return a + // promise rejected with a TypeError exception. + if (WritableStreamCloseQueuedOrInFlight(unwrappedStream)) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_WRITABLESTREAM_CLOSE_CLOSING_OR_CLOSED); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 5: Return ! WritableStreamDefaultWriterClose(this). + JSObject* promise = WritableStreamDefaultWriterClose(cx, unwrappedWriter); + if (!promise) { + return false; + } + cx->check(promise); + + args.rval().setObject(*promise); + return true; +} + +/** + * Streams spec, 4.5.4.6. releaseLock() + */ +[[nodiscard]] static bool WritableStreamDefaultWriter_releaseLock(JSContext* cx, + unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsWritableStreamDefaultWriter(this) is false, return a promise + // rejected with a TypeError exception. + Rooted unwrappedWriter( + cx, + UnwrapAndTypeCheckThis(cx, args, "close")); + if (!unwrappedWriter) { + return false; + } + + // Step 2: Let stream be this.[[ownerWritableStream]]. + // Step 3: If stream is undefined, return. + if (!unwrappedWriter->hasStream()) { + args.rval().setUndefined(); + return true; + } + + // Step 4: Assert: stream.[[writer]] is not undefined. +#ifdef DEBUG + { + WritableStream* unwrappedStream = + UnwrapStreamFromWriter(cx, unwrappedWriter); + if (!unwrappedStream) { + return false; + } + MOZ_ASSERT(unwrappedStream->hasWriter()); + } +#endif + + // Step 5: Perform ! WritableStreamDefaultWriterRelease(this). + if (!WritableStreamDefaultWriterRelease(cx, unwrappedWriter)) { + return false; + } + + args.rval().setUndefined(); + return true; +} + +/** + * Streams spec, 4.5.4.7. write(chunk) + */ +[[nodiscard]] static bool WritableStreamDefaultWriter_write(JSContext* cx, + unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 1: If ! IsWritableStreamDefaultWriter(this) is false, return a promise + // rejected with a TypeError exception. + Rooted unwrappedWriter( + cx, + UnwrapAndTypeCheckThis(cx, args, "write")); + if (!unwrappedWriter) { + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 2: If this.[[ownerWritableStream]] is undefined, return a promise + // rejected with a TypeError exception. + if (!unwrappedWriter->hasStream()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_WRITABLESTREAMWRITER_NOT_OWNED, "write"); + return ReturnPromiseRejectedWithPendingError(cx, args); + } + + // Step 3: Return this.[[readyPromise]]. + PromiseObject* promise = + WritableStreamDefaultWriterWrite(cx, unwrappedWriter, args.get(0)); + if (!promise) { + return false; + } + cx->check(promise); + + args.rval().setObject(*promise); + return true; +} + +static const JSPropertySpec WritableStreamDefaultWriter_properties[] = { + JS_PSG("closed", WritableStreamDefaultWriter_closed, 0), + JS_PSG("desiredSize", WritableStreamDefaultWriter_desiredSize, 0), + JS_PSG("ready", WritableStreamDefaultWriter_ready, 0), JS_PS_END}; + +static const JSFunctionSpec WritableStreamDefaultWriter_methods[] = { + JS_FN("abort", WritableStreamDefaultWriter_abort, 1, 0), + JS_FN("close", WritableStreamDefaultWriter_close, 0, 0), + JS_FN("releaseLock", WritableStreamDefaultWriter_releaseLock, 0, 0), + JS_FN("write", WritableStreamDefaultWriter_write, 1, 0), JS_FS_END}; + +JS_STREAMS_CLASS_SPEC(WritableStreamDefaultWriter, 1, SlotCount, + ClassSpec::DontDefineConstructor, 0, JS_NULL_CLASS_OPS); diff --git a/js/src/builtin/streams/WritableStreamDefaultWriter.h b/js/src/builtin/streams/WritableStreamDefaultWriter.h new file mode 100644 index 0000000000000..2050174e9b719 --- /dev/null +++ b/js/src/builtin/streams/WritableStreamDefaultWriter.h @@ -0,0 +1,111 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Class WritableStreamDefaultWriter. */ + +#ifndef builtin_streams_WritableStreamDefaultWriter_h +#define builtin_streams_WritableStreamDefaultWriter_h + +#include "jstypes.h" // JS_PUBLIC_API +#include "js/Class.h" // JSClass, js::ClassSpec +#include "js/Value.h" // JS::{,Object,Undefined}Value +#include "vm/NativeObject.h" // js::NativeObject + +struct JS_PUBLIC_API JSContext; +class JS_PUBLIC_API JSObject; + +namespace js { + +class PromiseObject; +class WritableStream; + +class WritableStreamDefaultWriter : public NativeObject { + public: + /** + * Memory layout of Stream Writer instances. + * + * See https://streams.spec.whatwg.org/#default-writer-internal-slots for + * details. + */ + enum Slots { + /** + * A promise that is resolved when the stream this writes to becomes closed. + * + * This promise is ordinarily created while this writer is being created; in + * this case this promise is not a wrapper and is same-compartment with + * this. However, if the writer is closed and then this writer releases its + * lock on the stream, this promise will be recreated within whatever realm + * is in force when the lock is released: + * + * var ws = new WritableStream({}); + * var w = ws.getWriter(); + * var c = w.closed; + * w.close().then(() => { + * w.releaseLock(); // changes this slot, and |w.closed| + * assertEq(c === w.closed, false); + * }); + * + * So this field *may* potentially contain a wrapper around a promise. + */ + Slot_ClosedPromise, + + /** + * The stream that this writer writes to. Because writers are created under + * |WritableStream.prototype.getWriter| which may not be same-compartment + * with the stream, this is potentially a wrapper. + */ + Slot_Stream, + + /** + * The promise returned by the |writer.ready| getter property, a promise + * signaling that the related stream is accepting writes. + * + * This value repeatedly changes as the related stream changes back and + * forth between being writable and temporarily filled (or, ultimately, + * errored or aborted). These changes are invoked by a number of user- + * visible functions, so this may be a wrapper around a promise in another + * realm. + */ + Slot_ReadyPromise, + + SlotCount, + }; + + JSObject* closedPromise() const { + return &getFixedSlot(Slot_ClosedPromise).toObject(); + } + void setClosedPromise(JSObject* wrappedPromise) { + setFixedSlot(Slot_ClosedPromise, JS::ObjectValue(*wrappedPromise)); + } + + bool hasStream() const { return !getFixedSlot(Slot_Stream).isUndefined(); } + void setStream(JSObject* stream) { + setFixedSlot(Slot_Stream, JS::ObjectValue(*stream)); + } + void clearStream() { setFixedSlot(Slot_Stream, JS::UndefinedValue()); } + + JSObject* readyPromise() const { + return &getFixedSlot(Slot_ReadyPromise).toObject(); + } + void setReadyPromise(JSObject* wrappedPromise) { + setFixedSlot(Slot_ReadyPromise, JS::ObjectValue(*wrappedPromise)); + } + + static bool constructor(JSContext* cx, unsigned argc, JS::Value* vp); + static const ClassSpec classSpec_; + static const JSClass class_; + static const ClassSpec protoClassSpec_; + static const JSClass protoClass_; +}; + +[[nodiscard]] extern WritableStreamDefaultWriter* +CreateWritableStreamDefaultWriter(JSContext* cx, + JS::Handle unwrappedStream, + JS::Handle proto = nullptr); + +} // namespace js + +#endif // builtin_streams_WritableStreamDefaultWriter_h diff --git a/js/src/builtin/streams/WritableStreamOperations.cpp b/js/src/builtin/streams/WritableStreamOperations.cpp new file mode 100644 index 0000000000000..fce029fde49fd --- /dev/null +++ b/js/src/builtin/streams/WritableStreamOperations.cpp @@ -0,0 +1,922 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Writable stream abstract operations. */ + +#include "builtin/streams/WritableStreamOperations.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT + +#include // uint32_t + +#include "builtin/streams/MiscellaneousOperations.h" // js::PromiseRejectedWithPendingError +#include "builtin/streams/WritableStream.h" // js::WritableStream +#include "builtin/streams/WritableStreamDefaultController.h" // js::WritableStreamDefaultController{,Close}, js::WritableStream::controller +#include "builtin/streams/WritableStreamDefaultControllerOperations.h" // js::WritableStreamControllerErrorSteps +#include "builtin/streams/WritableStreamWriterOperations.h" // js::WritableStreamDefaultWriterEnsureReadyPromiseRejected +#include "js/CallArgs.h" // JS::CallArgs{,FromVp} +#include "js/ErrorReport.h" // JS_ReportErrorNumberASCII +#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* +#include "js/Promise.h" // JS::{Reject,Resolve}Promise +#include "js/RootingAPI.h" // JS::Handle, JS::Rooted +#include "js/Value.h" // JS::Value, JS::ObjecValue, JS::UndefinedHandleValue +#include "vm/Compartment.h" // JS::Compartment +#include "vm/JSContext.h" // JSContext +#include "vm/List.h" // js::ListObject +#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined + +#include "builtin/HandlerFunction-inl.h" // js::NewHandler, js::TargetFromHandler +#include "builtin/Promise-inl.h" // js::SetSettledPromiseIsHandled +#include "builtin/streams/MiscellaneousOperations-inl.h" // js::ResolveUnwrappedPromiseWithUndefined, js::RejectUnwrappedPromiseWithError +#include "builtin/streams/WritableStream-inl.h" // js::UnwrapWriterFromStream +#include "builtin/streams/WritableStreamDefaultWriter-inl.h" // js::WritableStreamDefaultWriter::closedPromise +#include "vm/Compartment-inl.h" // JS::Compartment::wrap, js::UnwrapAndDowncastObject +#include "vm/JSContext-inl.h" // JSContext::check +#include "vm/JSObject-inl.h" // js::NewObjectWithClassProto +#include "vm/List-inl.h" // js::{AppendTo,StoreNew}ListInFixedSlot +#include "vm/Realm-inl.h" // js::AutoRealm + +using js::ExtraFromHandler; +using js::PromiseObject; +using js::TargetFromHandler; +using js::UnwrapAndDowncastObject; +using js::WritableStream; +using js::WritableStreamDefaultController; +using js::WritableStreamRejectCloseAndClosedPromiseIfNeeded; + +using JS::CallArgs; +using JS::CallArgsFromVp; +using JS::Handle; +using JS::ObjectValue; +using JS::RejectPromise; +using JS::ResolvePromise; +using JS::Rooted; +using JS::UndefinedHandleValue; +using JS::Value; + +/*** 4.3. General writable stream abstract operations. **********************/ + +/** + * Streams spec, 4.3.4. InitializeWritableStream ( stream ) + */ +/* static */ [[nodiscard]] WritableStream* WritableStream::create( + JSContext* cx, void* nsISupportsObject_alreadyAddreffed /* = nullptr */, + Handle proto /* = nullptr */) { + cx->check(proto); + + // In the spec, InitializeWritableStream is always passed a newly created + // WritableStream object. We instead create it here and return it below. + Rooted stream( + cx, NewObjectWithClassProto(cx, proto)); + if (!stream) { + return nullptr; + } + + static_assert(Slot_ISupports == 0, + "Must use right slot for JSCLASS_SLOT0_IS_NSISUPPORTS"); + JS::SetObjectISupports(stream, nsISupportsObject_alreadyAddreffed); + + stream->initWritableState(); + + // Step 1: Set stream.[[state]] to "writable". + MOZ_ASSERT(stream->writable()); + + // Step 2: Set stream.[[storedError]], stream.[[writer]], + // stream.[[writableStreamController]], + // stream.[[inFlightWriteRequest]], stream.[[closeRequest]], + // stream.[[inFlightCloseRequest]] and stream.[[pendingAbortRequest]] + // to undefined. + MOZ_ASSERT(stream->storedError().isUndefined()); + MOZ_ASSERT(!stream->hasWriter()); + MOZ_ASSERT(!stream->hasController()); + MOZ_ASSERT(!stream->haveInFlightWriteRequest()); + MOZ_ASSERT(stream->inFlightWriteRequest().isUndefined()); + MOZ_ASSERT(stream->closeRequest().isUndefined()); + MOZ_ASSERT(stream->inFlightCloseRequest().isUndefined()); + MOZ_ASSERT(!stream->hasPendingAbortRequest()); + + // Step 3: Set stream.[[writeRequests]] to a new empty List. + if (!StoreNewListInFixedSlot(cx, stream, + WritableStream::Slot_WriteRequests)) { + return nullptr; + } + + // Step 4: Set stream.[[backpressure]] to false. + MOZ_ASSERT(!stream->backpressure()); + + return stream; +} + +void WritableStream::clearInFlightWriteRequest(JSContext* cx) { + MOZ_ASSERT(stateIsInitialized()); + MOZ_ASSERT(haveInFlightWriteRequest()); + + writeRequests()->popFirst(cx); + setFlag(HaveInFlightWriteRequest, false); + + MOZ_ASSERT(!haveInFlightWriteRequest()); + MOZ_ASSERT(inFlightWriteRequest().isUndefined()); +} + +/** + * Streams spec, 4.3.6. + * WritableStreamAbort ( stream, reason ) + * + * Note: The object (a promise) returned by this function is in the current + * compartment and does not require special wrapping to be put to use. + */ +JSObject* js::WritableStreamAbort(JSContext* cx, + Handle unwrappedStream, + Handle reason) { + cx->check(reason); + + // Step 1: Let state be stream.[[state]]. + // Step 2: If state is "closed" or "errored", return a promise resolved with + // undefined. + if (unwrappedStream->closed() || unwrappedStream->errored()) { + return PromiseResolvedWithUndefined(cx); + } + + // Step 3: If stream.[[pendingAbortRequest]] is not undefined, return + // stream.[[pendingAbortRequest]].[[promise]]. + if (unwrappedStream->hasPendingAbortRequest()) { + Rooted pendingPromise( + cx, unwrappedStream->pendingAbortRequestPromise()); + if (!cx->compartment()->wrap(cx, &pendingPromise)) { + return nullptr; + } + return pendingPromise; + } + + // Step 4: Assert: state is "writable" or "erroring". + MOZ_ASSERT(unwrappedStream->writable() ^ unwrappedStream->erroring()); + + // Step 7: Let promise be a new promise (reordered). + Rooted promise(cx, PromiseObject::createSkippingExecutor(cx)); + if (!promise) { + return nullptr; + } + + // Step 5: Let wasAlreadyErroring be false. + // Step 6: If state is "erroring", + // Step 6.a: Set wasAlreadyErroring to true. + // Step 6.b: Set reason to undefined. + bool wasAlreadyErroring = unwrappedStream->erroring(); + Handle pendingReason = + wasAlreadyErroring ? UndefinedHandleValue : reason; + + // Step 8: Set stream.[[pendingAbortRequest]] to + // Record {[[promise]]: promise, [[reason]]: reason, + // [[wasAlreadyErroring]]: wasAlreadyErroring}. + { + AutoRealm ar(cx, unwrappedStream); + + Rooted wrappedPromise(cx, promise); + Rooted wrappedPendingReason(cx, pendingReason); + + JS::Compartment* comp = cx->compartment(); + if (!comp->wrap(cx, &wrappedPromise) || + !comp->wrap(cx, &wrappedPendingReason)) { + return nullptr; + } + + unwrappedStream->setPendingAbortRequest( + wrappedPromise, wrappedPendingReason, wasAlreadyErroring); + } + + // Step 9: If wasAlreadyErroring is false, perform + // ! WritableStreamStartErroring(stream, reason). + if (!wasAlreadyErroring) { + if (!WritableStreamStartErroring(cx, unwrappedStream, pendingReason)) { + return nullptr; + } + } + + // Step 10: Return promise. + return promise; +} + +/** + * Streams spec, 4.3.7. + * WritableStreamClose ( stream ) + * + * Note: The object (a promise) returned by this function is in the current + * compartment and does not require special wrapping to be put to use. + */ +JSObject* js::WritableStreamClose(JSContext* cx, + Handle unwrappedStream) { + // Step 1: Let state be stream.[[state]]. + // Step 2: If state is "closed" or "errored", return a promise rejected with a + // TypeError exception. + if (unwrappedStream->closed() || unwrappedStream->errored()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_WRITABLESTREAM_CLOSED_OR_ERRORED); + return PromiseRejectedWithPendingError(cx); + } + + // Step 3: Assert: state is "writable" or "erroring". + MOZ_ASSERT(unwrappedStream->writable() ^ unwrappedStream->erroring()); + + // Step 4: Assert: ! WritableStreamCloseQueuedOrInFlight(stream) is false. + MOZ_ASSERT(!WritableStreamCloseQueuedOrInFlight(unwrappedStream)); + + // Step 5: Let promise be a new promise. + Rooted promise(cx, PromiseObject::createSkippingExecutor(cx)); + if (!promise) { + return nullptr; + } + + // Step 6: Set stream.[[closeRequest]] to promise. + { + AutoRealm ar(cx, unwrappedStream); + Rooted wrappedPromise(cx, promise); + if (!cx->compartment()->wrap(cx, &wrappedPromise)) { + return nullptr; + } + + unwrappedStream->setCloseRequest(promise); + } + + // Step 7: Let writer be stream.[[writer]]. + // Step 8: If writer is not undefined, and stream.[[backpressure]] is true, + // and state is "writable", resolve writer.[[readyPromise]] with + // undefined. + if (unwrappedStream->hasWriter() && unwrappedStream->backpressure() && + unwrappedStream->writable()) { + Rooted unwrappedWriter( + cx, UnwrapWriterFromStream(cx, unwrappedStream)); + if (!unwrappedWriter) { + return nullptr; + } + + if (!ResolveUnwrappedPromiseWithUndefined( + cx, unwrappedWriter->readyPromise())) { + return nullptr; + } + } + + // Step 9: Perform + // ! WritableStreamDefaultControllerClose( + // stream.[[writableStreamController]]). + Rooted unwrappedController( + cx, unwrappedStream->controller()); + if (!WritableStreamDefaultControllerClose(cx, unwrappedController)) { + return nullptr; + } + + // Step 10: Return promise. + return promise; +} + +/*** 4.4. Writable stream abstract operations used by controllers ***********/ + +/** + * Streams spec, 4.4.1. + * WritableStreamAddWriteRequest ( stream ) + */ +[[nodiscard]] PromiseObject* js::WritableStreamAddWriteRequest( + JSContext* cx, Handle unwrappedStream) { + // Step 1: Assert: ! IsWritableStreamLocked(stream) is true. + MOZ_ASSERT(unwrappedStream->isLocked()); + + // Step 2: Assert: stream.[[state]] is "writable". + MOZ_ASSERT(unwrappedStream->writable()); + + // Step 3: Let promise be a new promise. + Rooted promise(cx, PromiseObject::createSkippingExecutor(cx)); + if (!promise) { + return nullptr; + } + + // Step 4: Append promise as the last element of stream.[[writeRequests]]. + if (!AppendToListInFixedSlot(cx, unwrappedStream, + WritableStream::Slot_WriteRequests, promise)) { + return nullptr; + } + + // Step 5: Return promise. + return promise; +} + +/** + * Streams spec, 4.4.2. + * WritableStreamDealWithRejection ( stream, error ) + */ +[[nodiscard]] bool js::WritableStreamDealWithRejection( + JSContext* cx, Handle unwrappedStream, + Handle error) { + cx->check(error); + + // Step 1: Let state be stream.[[state]]. + // Step 2: If state is "writable", + if (unwrappedStream->writable()) { + // Step 2a: Perform ! WritableStreamStartErroring(stream, error). + // Step 2b: Return. + return WritableStreamStartErroring(cx, unwrappedStream, error); + } + + // Step 3: Assert: state is "erroring". + MOZ_ASSERT(unwrappedStream->erroring()); + + // Step 4: Perform ! WritableStreamFinishErroring(stream). + return WritableStreamFinishErroring(cx, unwrappedStream); +} + +static bool WritableStreamHasOperationMarkedInFlight( + const WritableStream* unwrappedStream); + +/** + * Streams spec, 4.4.3. + * WritableStreamStartErroring ( stream, reason ) + */ +[[nodiscard]] bool js::WritableStreamStartErroring( + JSContext* cx, Handle unwrappedStream, + Handle reason) { + cx->check(reason); + + // Step 1: Assert: stream.[[storedError]] is undefined. + MOZ_ASSERT(unwrappedStream->storedError().isUndefined()); + + // Step 2: Assert: stream.[[state]] is "writable". + MOZ_ASSERT(unwrappedStream->writable()); + + // Step 3: Let controller be stream.[[writableStreamController]]. + // Step 4: Assert: controller is not undefined. + MOZ_ASSERT(unwrappedStream->hasController()); + Rooted unwrappedController( + cx, unwrappedStream->controller()); + + // Step 5: Set stream.[[state]] to "erroring". + unwrappedStream->setErroring(); + + // Step 6: Set stream.[[storedError]] to reason. + { + AutoRealm ar(cx, unwrappedStream); + Rooted wrappedReason(cx, reason); + if (!cx->compartment()->wrap(cx, &wrappedReason)) { + return false; + } + unwrappedStream->setStoredError(wrappedReason); + } + + // Step 7: Let writer be stream.[[writer]]. + // Step 8: If writer is not undefined, perform + // ! WritableStreamDefaultWriterEnsureReadyPromiseRejected( + // writer, reason). + if (unwrappedStream->hasWriter()) { + Rooted unwrappedWriter( + cx, UnwrapWriterFromStream(cx, unwrappedStream)); + if (!unwrappedWriter) { + return false; + } + + if (!WritableStreamDefaultWriterEnsureReadyPromiseRejected( + cx, unwrappedWriter, reason)) { + return false; + } + } + + // Step 9: If ! WritableStreamHasOperationMarkedInFlight(stream) is false and + // controller.[[started]] is true, perform + // ! WritableStreamFinishErroring(stream). + if (!WritableStreamHasOperationMarkedInFlight(unwrappedStream) && + unwrappedController->started()) { + if (!WritableStreamFinishErroring(cx, unwrappedStream)) { + return false; + } + } + + return true; +} + +/** + * Streams spec, 4.4.4 WritableStreamFinishErroring ( stream ) + * Step 13: Upon fulfillment of promise, [...] + */ +static bool AbortRequestPromiseFulfilledHandler(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 13.a: Resolve abortRequest.[[promise]] with undefined. + Rooted abortRequestPromise(cx, TargetFromHandler(args)); + if (!ResolvePromise(cx, abortRequestPromise, UndefinedHandleValue)) { + return false; + } + + // Step 13.b: Perform + // ! WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream). + Rooted unwrappedStream( + cx, UnwrapAndDowncastObject( + cx, ExtraFromHandler(args))); + if (!unwrappedStream) { + return false; + } + + if (!WritableStreamRejectCloseAndClosedPromiseIfNeeded(cx, unwrappedStream)) { + return false; + } + + args.rval().setUndefined(); + return false; +} + +/** + * Streams spec, 4.4.4 WritableStreamFinishErroring ( stream ) + * Step 14: Upon rejection of promise with reason reason, [...] + */ +static bool AbortRequestPromiseRejectedHandler(JSContext* cx, unsigned argc, + Value* vp) { + CallArgs args = CallArgsFromVp(argc, vp); + + // Step 14.a: Reject abortRequest.[[promise]] with reason. + Rooted abortRequestPromise(cx, TargetFromHandler(args)); + if (!RejectPromise(cx, abortRequestPromise, args.get(0))) { + return false; + } + + // Step 14.b: Perform + // ! WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream). + Rooted unwrappedStream( + cx, UnwrapAndDowncastObject( + cx, ExtraFromHandler(args))); + if (!unwrappedStream) { + return false; + } + + if (!WritableStreamRejectCloseAndClosedPromiseIfNeeded(cx, unwrappedStream)) { + return false; + } + + args.rval().setUndefined(); + return false; +} + +/** + * Streams spec, 4.4.4. + * WritableStreamFinishErroring ( stream ) + */ +[[nodiscard]] bool js::WritableStreamFinishErroring( + JSContext* cx, Handle unwrappedStream) { + // Step 1: Assert: stream.[[state]] is "erroring". + MOZ_ASSERT(unwrappedStream->erroring()); + + // Step 2: Assert: ! WritableStreamHasOperationMarkedInFlight(stream) is + // false. + MOZ_ASSERT(!WritableStreamHasOperationMarkedInFlight(unwrappedStream)); + + // Step 3: Set stream.[[state]] to "errored". + unwrappedStream->setErrored(); + + // Step 4: Perform ! stream.[[writableStreamController]].[[ErrorSteps]](). + { + Rooted unwrappedController( + cx, unwrappedStream->controller()); + if (!WritableStreamControllerErrorSteps(cx, unwrappedController)) { + return false; + } + } + + // Step 5: Let storedError be stream.[[storedError]]. + Rooted storedError(cx, unwrappedStream->storedError()); + if (!cx->compartment()->wrap(cx, &storedError)) { + return false; + } + + // Step 6: Repeat for each writeRequest that is an element of + // stream.[[writeRequests]], + { + Rooted unwrappedWriteRequests( + cx, unwrappedStream->writeRequests()); + Rooted writeRequest(cx); + uint32_t len = unwrappedWriteRequests->length(); + for (uint32_t i = 0; i < len; i++) { + // Step 6.a: Reject writeRequest with storedError. + writeRequest = &unwrappedWriteRequests->get(i).toObject(); + if (!RejectUnwrappedPromiseWithError(cx, &writeRequest, storedError)) { + return false; + } + } + } + + // Step 7: Set stream.[[writeRequests]] to an empty List. + // We optimize this to discard the list entirely. (A brief scan of the + // streams spec should verify that [[writeRequests]] is never accessed on a + // stream when |stream.[[state]] === "errored"|, set in step 3 above.) + unwrappedStream->clearWriteRequests(); + + // Step 8: If stream.[[pendingAbortRequest]] is undefined, + if (!unwrappedStream->hasPendingAbortRequest()) { + // Step 8.a: Perform + // ! WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream). + // Step 8.b: Return. + return WritableStreamRejectCloseAndClosedPromiseIfNeeded(cx, + unwrappedStream); + } + + // Step 9: Let abortRequest be stream.[[pendingAbortRequest]]. + // Step 10: Set stream.[[pendingAbortRequest]] to undefined. + Rooted abortRequestReason( + cx, unwrappedStream->pendingAbortRequestReason()); + if (!cx->compartment()->wrap(cx, &abortRequestReason)) { + return false; + } + Rooted abortRequestPromise( + cx, unwrappedStream->pendingAbortRequestPromise()); + bool wasAlreadyErroring = + unwrappedStream->pendingAbortRequestWasAlreadyErroring(); + unwrappedStream->clearPendingAbortRequest(); + + // Step 11: If abortRequest.[[wasAlreadyErroring]] is true, + if (wasAlreadyErroring) { + // Step 11.a: Reject abortRequest.[[promise]] with storedError. + if (!RejectUnwrappedPromiseWithError(cx, &abortRequestPromise, + storedError)) { + return false; + } + + // Step 11.b: Perform + // ! WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream). + // Step 11.c: Return. + return WritableStreamRejectCloseAndClosedPromiseIfNeeded(cx, + unwrappedStream); + } + + // Step 12: Let promise be + // ! stream.[[writableStreamController]].[[AbortSteps]]( + // abortRequest.[[reason]]). + Rooted unwrappedController( + cx, unwrappedStream->controller()); + Rooted promise( + cx, WritableStreamControllerAbortSteps(cx, unwrappedController, + abortRequestReason)); + if (!promise) { + return false; + } + cx->check(promise); + + if (!cx->compartment()->wrap(cx, &abortRequestPromise)) { + return false; + } + + Rooted stream(cx, unwrappedStream); + if (!cx->compartment()->wrap(cx, &stream)) { + return false; + } + + // Step 13: Upon fulfillment of promise, [...] + // Step 14: Upon rejection of promise with reason reason, [...] + Rooted onFulfilled( + cx, NewHandlerWithExtra(cx, AbortRequestPromiseFulfilledHandler, + abortRequestPromise, stream)); + if (!onFulfilled) { + return false; + } + Rooted onRejected( + cx, NewHandlerWithExtra(cx, AbortRequestPromiseRejectedHandler, + abortRequestPromise, stream)); + if (!onRejected) { + return false; + } + + return JS::AddPromiseReactions(cx, promise, onFulfilled, onRejected); +} + +/** + * Streams spec, 4.4.5. + * WritableStreamFinishInFlightWrite ( stream ) + */ +[[nodiscard]] bool js::WritableStreamFinishInFlightWrite( + JSContext* cx, Handle unwrappedStream) { + // Step 1: Assert: stream.[[inFlightWriteRequest]] is not undefined. + MOZ_ASSERT(unwrappedStream->haveInFlightWriteRequest()); + + // Step 2: Resolve stream.[[inFlightWriteRequest]] with undefined. + if (!ResolveUnwrappedPromiseWithUndefined( + cx, &unwrappedStream->inFlightWriteRequest().toObject())) { + return false; + } + + // Step 3: Set stream.[[inFlightWriteRequest]] to undefined. + unwrappedStream->clearInFlightWriteRequest(cx); + MOZ_ASSERT(!unwrappedStream->haveInFlightWriteRequest()); + + return true; +} + +/** + * Streams spec, 4.4.6. + * WritableStreamFinishInFlightWriteWithError ( stream, error ) + */ +[[nodiscard]] bool js::WritableStreamFinishInFlightWriteWithError( + JSContext* cx, Handle unwrappedStream, + Handle error) { + cx->check(error); + + // Step 1: Assert: stream.[[inFlightWriteRequest]] is not undefined. + MOZ_ASSERT(unwrappedStream->haveInFlightWriteRequest()); + + // Step 2: Reject stream.[[inFlightWriteRequest]] with error. + if (!RejectUnwrappedPromiseWithError( + cx, &unwrappedStream->inFlightWriteRequest().toObject(), error)) { + return false; + } + + // Step 3: Set stream.[[inFlightWriteRequest]] to undefined. + unwrappedStream->clearInFlightWriteRequest(cx); + + // Step 4: Assert: stream.[[state]] is "writable" or "erroring". + MOZ_ASSERT(unwrappedStream->writable() ^ unwrappedStream->erroring()); + + // Step 5: Perform ! WritableStreamDealWithRejection(stream, error). + return WritableStreamDealWithRejection(cx, unwrappedStream, error); +} + +/** + * Streams spec, 4.4.7. + * WritableStreamFinishInFlightClose ( stream ) + */ +[[nodiscard]] bool js::WritableStreamFinishInFlightClose( + JSContext* cx, Handle unwrappedStream) { + // Step 1: Assert: stream.[[inFlightCloseRequest]] is not undefined. + MOZ_ASSERT(unwrappedStream->haveInFlightCloseRequest()); + + // Step 2: Resolve stream.[[inFlightCloseRequest]] with undefined. + if (!ResolveUnwrappedPromiseWithUndefined( + cx, &unwrappedStream->inFlightCloseRequest().toObject())) { + return false; + } + + // Step 3: Set stream.[[inFlightCloseRequest]] to undefined. + unwrappedStream->clearInFlightCloseRequest(); + MOZ_ASSERT(unwrappedStream->inFlightCloseRequest().isUndefined()); + + // Step 4: Let state be stream.[[state]]. + // Step 5: Assert: stream.[[state]] is "writable" or "erroring". + MOZ_ASSERT(unwrappedStream->writable() ^ unwrappedStream->erroring()); + + // Step 6: If state is "erroring", + if (unwrappedStream->erroring()) { + // Step 6.a: Set stream.[[storedError]] to undefined. + unwrappedStream->clearStoredError(); + + // Step 6.b: If stream.[[pendingAbortRequest]] is not undefined, + if (unwrappedStream->hasPendingAbortRequest()) { + // Step 6.b.i: Resolve stream.[[pendingAbortRequest]].[[promise]] with + // undefined. + if (!ResolveUnwrappedPromiseWithUndefined( + cx, unwrappedStream->pendingAbortRequestPromise())) { + return false; + } + + // Step 6.b.ii: Set stream.[[pendingAbortRequest]] to undefined. + unwrappedStream->clearPendingAbortRequest(); + } + } + + // Step 7: Set stream.[[state]] to "closed". + unwrappedStream->setClosed(); + + // Step 8: Let writer be stream.[[writer]]. + // Step 9: If writer is not undefined, resolve writer.[[closedPromise]] with + // undefined. + if (unwrappedStream->hasWriter()) { + WritableStreamDefaultWriter* unwrappedWriter = + UnwrapWriterFromStream(cx, unwrappedStream); + if (!unwrappedWriter) { + return false; + } + + if (!ResolveUnwrappedPromiseWithUndefined( + cx, unwrappedWriter->closedPromise())) { + return false; + } + } + + // Step 10: Assert: stream.[[pendingAbortRequest]] is undefined. + MOZ_ASSERT(!unwrappedStream->hasPendingAbortRequest()); + + // Step 11: Assert: stream.[[storedError]] is undefined. + MOZ_ASSERT(unwrappedStream->storedError().isUndefined()); + + return true; +} + +/** + * Streams spec, 4.4.8. + * WritableStreamFinishInFlightCloseWithError ( stream, error ) + */ +[[nodiscard]] bool js::WritableStreamFinishInFlightCloseWithError( + JSContext* cx, Handle unwrappedStream, + Handle error) { + cx->check(error); + + // Step 1: Assert: stream.[[inFlightCloseRequest]] is not undefined. + MOZ_ASSERT(unwrappedStream->haveInFlightCloseRequest()); + MOZ_ASSERT(!unwrappedStream->inFlightCloseRequest().isUndefined()); + + // Step 2: Reject stream.[[inFlightCloseRequest]] with error. + if (!RejectUnwrappedPromiseWithError( + cx, &unwrappedStream->inFlightCloseRequest().toObject(), error)) { + return false; + } + + // Step 3: Set stream.[[inFlightCloseRequest]] to undefined. + unwrappedStream->clearInFlightCloseRequest(); + + // Step 4: Assert: stream.[[state]] is "writable" or "erroring". + MOZ_ASSERT(unwrappedStream->writable() ^ unwrappedStream->erroring()); + + // Step 5: If stream.[[pendingAbortRequest]] is not undefined, + if (unwrappedStream->hasPendingAbortRequest()) { + // Step 5.a: Reject stream.[[pendingAbortRequest]].[[promise]] with error. + if (!RejectUnwrappedPromiseWithError( + cx, unwrappedStream->pendingAbortRequestPromise(), error)) { + return false; + } + + // Step 5.b: Set stream.[[pendingAbortRequest]] to undefined. + unwrappedStream->clearPendingAbortRequest(); + } + + // Step 6: Perform ! WritableStreamDealWithRejection(stream, error). + return WritableStreamDealWithRejection(cx, unwrappedStream, error); +} + +/** + * Streams spec, 4.4.9. + * WritableStreamCloseQueuedOrInFlight ( stream ) + */ +bool js::WritableStreamCloseQueuedOrInFlight( + const WritableStream* unwrappedStream) { + // Step 1: If stream.[[closeRequest]] is undefined and + // stream.[[inFlightCloseRequest]] is undefined, return false. + // Step 2: Return true. + return unwrappedStream->haveCloseRequestOrInFlightCloseRequest(); +} + +/** + * Streams spec, 4.4.10. + * WritableStreamHasOperationMarkedInFlight ( stream ) + */ +bool WritableStreamHasOperationMarkedInFlight( + const WritableStream* unwrappedStream) { + // Step 1: If stream.[[inFlightWriteRequest]] is undefined and + // controller.[[inFlightCloseRequest]] is undefined, return false. + // Step 2: Return true. + return unwrappedStream->haveInFlightWriteRequest() || + unwrappedStream->haveInFlightCloseRequest(); +} + +/** + * Streams spec, 4.4.11. + * WritableStreamMarkCloseRequestInFlight ( stream ) + */ +void js::WritableStreamMarkCloseRequestInFlight( + WritableStream* unwrappedStream) { + // Step 1: Assert: stream.[[inFlightCloseRequest]] is undefined. + MOZ_ASSERT(!unwrappedStream->haveInFlightCloseRequest()); + + // Step 2: Assert: stream.[[closeRequest]] is not undefined. + MOZ_ASSERT(!unwrappedStream->closeRequest().isUndefined()); + + // Step 3: Set stream.[[inFlightCloseRequest]] to stream.[[closeRequest]]. + // Step 4: Set stream.[[closeRequest]] to undefined. + unwrappedStream->convertCloseRequestToInFlightCloseRequest(); +} + +/** + * Streams spec, 4.4.12. + * WritableStreamMarkFirstWriteRequestInFlight ( stream ) + */ +void js::WritableStreamMarkFirstWriteRequestInFlight( + WritableStream* unwrappedStream) { + // Step 1: Assert: stream.[[inFlightWriteRequest]] is undefined. + MOZ_ASSERT(!unwrappedStream->haveInFlightWriteRequest()); + + // Step 2: Assert: stream.[[writeRequests]] is not empty. + MOZ_ASSERT(unwrappedStream->writeRequests()->length() > 0); + + // Step 3: Let writeRequest be the first element of stream.[[writeRequests]]. + // Step 4: Remove writeRequest from stream.[[writeRequests]], shifting all + // other elements downward (so that the second becomes the first, and + // so on). + // Step 5: Set stream.[[inFlightWriteRequest]] to writeRequest. + // In our implementation, we model [[inFlightWriteRequest]] as merely the + // first element of [[writeRequests]], plus a flag indicating there's an + // in-flight request. Set the flag and be done with it. + unwrappedStream->setHaveInFlightWriteRequest(); +} + +/** + * Streams spec, 4.4.13. + * WritableStreamRejectCloseAndClosedPromiseIfNeeded ( stream ) + */ +[[nodiscard]] bool js::WritableStreamRejectCloseAndClosedPromiseIfNeeded( + JSContext* cx, Handle unwrappedStream) { + // Step 1: Assert: stream.[[state]] is "errored". + MOZ_ASSERT(unwrappedStream->errored()); + + Rooted storedError(cx, unwrappedStream->storedError()); + if (!cx->compartment()->wrap(cx, &storedError)) { + return false; + } + + // Step 2: If stream.[[closeRequest]] is not undefined, + if (!unwrappedStream->closeRequest().isUndefined()) { + // Step 2.a: Assert: stream.[[inFlightCloseRequest]] is undefined. + MOZ_ASSERT(unwrappedStream->inFlightCloseRequest().isUndefined()); + + // Step 2.b: Reject stream.[[closeRequest]] with stream.[[storedError]]. + if (!RejectUnwrappedPromiseWithError( + cx, &unwrappedStream->closeRequest().toObject(), storedError)) { + return false; + } + + // Step 2.c: Set stream.[[closeRequest]] to undefined. + unwrappedStream->clearCloseRequest(); + } + + // Step 3: Let writer be stream.[[writer]]. + // Step 4: If writer is not undefined, + if (unwrappedStream->hasWriter()) { + Rooted unwrappedWriter( + cx, UnwrapWriterFromStream(cx, unwrappedStream)); + if (!unwrappedWriter) { + return false; + } + + // Step 4.a: Reject writer.[[closedPromise]] with stream.[[storedError]]. + if (!RejectUnwrappedPromiseWithError(cx, unwrappedWriter->closedPromise(), + storedError)) { + return false; + } + + // Step 4.b: Set writer.[[closedPromise]].[[PromiseIsHandled]] to true. + Rooted unwrappedClosedPromise( + cx, UnwrapAndDowncastObject( + cx, unwrappedWriter->closedPromise())); + if (!unwrappedClosedPromise) { + return false; + } + + js::SetSettledPromiseIsHandled(cx, unwrappedClosedPromise); + } + + return true; +} + +/** + * Streams spec, 4.4.14. + * WritableStreamUpdateBackpressure ( stream, backpressure ) + */ +[[nodiscard]] bool js::WritableStreamUpdateBackpressure( + JSContext* cx, Handle unwrappedStream, bool backpressure) { + // Step 1: Assert: stream.[[state]] is "writable". + MOZ_ASSERT(unwrappedStream->writable()); + + // Step 2: Assert: ! WritableStreamCloseQueuedOrInFlight(stream) is false. + MOZ_ASSERT(!WritableStreamCloseQueuedOrInFlight(unwrappedStream)); + + // Step 3: Let writer be stream.[[writer]]. + // Step 4: If writer is not undefined and backpressure is not + // stream.[[backpressure]], + if (unwrappedStream->hasWriter() && + backpressure != unwrappedStream->backpressure()) { + Rooted unwrappedWriter( + cx, UnwrapWriterFromStream(cx, unwrappedStream)); + if (!unwrappedWriter) { + return false; + } + + // Step 4.a: If backpressure is true, set writer.[[readyPromise]] to a new + // promise. + if (backpressure) { + Rooted promise(cx, PromiseObject::createSkippingExecutor(cx)); + if (!promise) { + return false; + } + + AutoRealm ar(cx, unwrappedWriter); + if (!cx->compartment()->wrap(cx, &promise)) { + return false; + } + unwrappedWriter->setReadyPromise(promise); + } else { + // Step 4.b: Otherwise, + // Step 4.b.i: Assert: backpressure is false. (guaranteed by type) + // Step 4.b.ii: Resolve writer.[[readyPromise]] with undefined. + if (!ResolveUnwrappedPromiseWithUndefined( + cx, unwrappedWriter->readyPromise())) { + return false; + } + } + } + + // Step 5: Set stream.[[backpressure]] to backpressure. + unwrappedStream->setBackpressure(backpressure); + + return true; +} diff --git a/js/src/builtin/streams/WritableStreamOperations.h b/js/src/builtin/streams/WritableStreamOperations.h new file mode 100644 index 0000000000000..7bf701d9d7a8b --- /dev/null +++ b/js/src/builtin/streams/WritableStreamOperations.h @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Writable stream abstract operations. */ + +#ifndef builtin_streams_WritableStreamOperations_h +#define builtin_streams_WritableStreamOperations_h + +#include "jstypes.h" // JS_PUBLIC_API +#include "js/RootingAPI.h" // JS::Handle +#include "js/Value.h" // JS::Value + +struct JS_PUBLIC_API JSContext; + +namespace js { + +class PromiseObject; +class WritableStream; + +extern JSObject* WritableStreamAbort( + JSContext* cx, JS::Handle unwrappedStream, + JS::Handle reason); + +extern JSObject* WritableStreamClose( + JSContext* cx, JS::Handle unwrappedStream); + +[[nodiscard]] extern PromiseObject* WritableStreamAddWriteRequest( + JSContext* cx, JS::Handle unwrappedStream); + +[[nodiscard]] extern bool WritableStreamDealWithRejection( + JSContext* cx, JS::Handle unwrappedStream, + JS::Handle error); + +[[nodiscard]] extern bool WritableStreamStartErroring( + JSContext* cx, JS::Handle unwrappedStream, + JS::Handle reason); + +[[nodiscard]] extern bool WritableStreamFinishErroring( + JSContext* cx, JS::Handle unwrappedStream); + +[[nodiscard]] extern bool WritableStreamFinishInFlightWrite( + JSContext* cx, JS::Handle unwrappedStream); + +[[nodiscard]] extern bool WritableStreamFinishInFlightWriteWithError( + JSContext* cx, JS::Handle unwrappedStream, + JS::Handle error); + +[[nodiscard]] extern bool WritableStreamFinishInFlightClose( + JSContext* cx, JS::Handle unwrappedStream); + +[[nodiscard]] extern bool WritableStreamFinishInFlightCloseWithError( + JSContext* cx, JS::Handle unwrappedStream, + JS::Handle error); + +extern bool WritableStreamCloseQueuedOrInFlight( + const WritableStream* unwrappedStream); + +extern void WritableStreamMarkCloseRequestInFlight( + WritableStream* unwrappedStream); + +extern void WritableStreamMarkFirstWriteRequestInFlight( + WritableStream* unwrappedStream); + +[[nodiscard]] extern bool WritableStreamRejectCloseAndClosedPromiseIfNeeded( + JSContext* cx, JS::Handle unwrappedStream); + +[[nodiscard]] extern bool WritableStreamUpdateBackpressure( + JSContext* cx, JS::Handle unwrappedStream, + bool backpressure); + +} // namespace js + +#endif // builtin_streams_WritableStreamOperations_h diff --git a/js/src/builtin/streams/WritableStreamWriterOperations.cpp b/js/src/builtin/streams/WritableStreamWriterOperations.cpp new file mode 100644 index 0000000000000..d36b77522731b --- /dev/null +++ b/js/src/builtin/streams/WritableStreamWriterOperations.cpp @@ -0,0 +1,444 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Writable stream writer abstract operations. */ + +#include "builtin/streams/WritableStreamWriterOperations.h" + +#include "mozilla/Assertions.h" // MOZ_ASSERT + +#include "builtin/streams/MiscellaneousOperations.h" // js::PromiseRejectedWithPendingError +#include "builtin/streams/WritableStream.h" // js::WritableStream +#include "builtin/streams/WritableStreamDefaultController.h" // js::WritableStream::controller +#include "builtin/streams/WritableStreamDefaultControllerOperations.h" // js::WritableStreamDefaultController{Close,GetDesiredSize} +#include "builtin/streams/WritableStreamDefaultWriter.h" // js::WritableStreamDefaultWriter +#include "builtin/streams/WritableStreamOperations.h" // js::WritableStream{Abort,CloseQueuedOrInFlight} +#include "js/ErrorReport.h" // JS_ReportErrorNumberASCII +#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* +#include "js/Promise.h" // JS::PromiseState +#include "js/Value.h" // JS::Value, JS::{Int32,Null}Value +#include "vm/Compartment.h" // JS::Compartment +#include "vm/Interpreter.h" // js::GetAndClearException +#include "vm/JSContext.h" // JSContext +#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined + +#include "builtin/Promise-inl.h" // js::SetSettledPromiseIsHandled +#include "builtin/streams/MiscellaneousOperations-inl.h" // js::ResolveUnwrappedPromiseWithUndefined +#include "builtin/streams/WritableStream-inl.h" // js::WritableStream::setCloseRequest +#include "builtin/streams/WritableStreamDefaultWriter-inl.h" // js::UnwrapStreamFromWriter +#include "vm/Compartment-inl.h" // js::UnwrapAnd{DowncastObject,TypeCheckThis} +#include "vm/JSContext-inl.h" // JSContext::check +#include "vm/Realm-inl.h" // js::AutoRealm + +using JS::Handle; +using JS::Int32Value; +using JS::MutableHandle; +using JS::NullValue; +using JS::NumberValue; +using JS::Rooted; +using JS::Value; + +using js::AutoRealm; +using js::PromiseObject; +using js::UnwrapAndDowncastObject; +using js::WritableStreamDefaultWriter; + +/*** 4.6. Writable stream writer abstract operations ************************/ + +/** + * Streams spec, 4.6.2. + * WritableStreamDefaultWriterAbort ( writer, reason ) + */ +JSObject* js::WritableStreamDefaultWriterAbort( + JSContext* cx, Handle unwrappedWriter, + Handle reason) { + cx->check(reason); + + // Step 1: Let stream be writer.[[ownerWritableStream]]. + // Step 2: Assert: stream is not undefined. + MOZ_ASSERT(unwrappedWriter->hasStream()); + Rooted unwrappedStream( + cx, UnwrapStreamFromWriter(cx, unwrappedWriter)); + if (!unwrappedStream) { + return nullptr; + } + + // Step 3: Return ! WritableStreamAbort(stream, reason). + return js::WritableStreamAbort(cx, unwrappedStream, reason); +} + +/** + * Streams spec, 4.6.3. + * WritableStreamDefaultWriterClose ( writer ) + */ +PromiseObject* js::WritableStreamDefaultWriterClose( + JSContext* cx, Handle unwrappedWriter) { + // Step 1: Let stream be writer.[[ownerWritableStream]]. + // Step 2: Assert: stream is not undefined. + MOZ_ASSERT(unwrappedWriter->hasStream()); + Rooted unwrappedStream( + cx, UnwrapStreamFromWriter(cx, unwrappedWriter)); + if (!unwrappedStream) { + return PromiseRejectedWithPendingError(cx); + } + + // Step 3: Let state be stream.[[state]]. + // Step 4: If state is "closed" or "errored", return a promise rejected with a + // TypeError exception. + if (unwrappedStream->closed() || unwrappedStream->errored()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_WRITABLESTREAM_CLOSED_OR_ERRORED); + return PromiseRejectedWithPendingError(cx); + } + + // Step 5: Assert: state is "writable" or "erroring". + MOZ_ASSERT(unwrappedStream->writable() ^ unwrappedStream->erroring()); + + // Step 6: Assert: ! WritableStreamCloseQueuedOrInFlight(stream) is false. + MOZ_ASSERT(!WritableStreamCloseQueuedOrInFlight(unwrappedStream)); + + // Step 7: Let promise be a new promise. + Rooted promise(cx, PromiseObject::createSkippingExecutor(cx)); + if (!promise) { + return nullptr; + } + + // Step 8: Set stream.[[closeRequest]] to promise. + { + AutoRealm ar(cx, unwrappedStream); + Rooted closeRequest(cx, promise); + if (!cx->compartment()->wrap(cx, &closeRequest)) { + return nullptr; + } + + unwrappedStream->setCloseRequest(closeRequest); + } + + // Step 9: If stream.[[backpressure]] is true and state is "writable", resolve + // writer.[[readyPromise]] with undefined. + if (unwrappedStream->backpressure() && unwrappedStream->writable()) { + if (!ResolveUnwrappedPromiseWithUndefined( + cx, unwrappedWriter->readyPromise())) { + return nullptr; + } + } + + // Step 10: Perform + // ! WritableStreamDefaultControllerClose( + // stream.[[writableStreamController]]). + Rooted unwrappedController( + cx, unwrappedStream->controller()); + if (!WritableStreamDefaultControllerClose(cx, unwrappedController)) { + return nullptr; + } + + // Step 11: Return promise. + return promise; +} + +/** + * Streams spec. + * WritableStreamDefaultWriterCloseWithErrorPropagation ( writer ) + */ +PromiseObject* js::WritableStreamDefaultWriterCloseWithErrorPropagation( + JSContext* cx, Handle unwrappedWriter) { + // Step 1: Let stream be writer.[[ownerWritableStream]]. + // Step 2: Assert: stream is not undefined. + WritableStream* unwrappedStream = UnwrapStreamFromWriter(cx, unwrappedWriter); + if (!unwrappedStream) { + return nullptr; + } + + // Step 3: Let state be stream.[[state]]. + // Step 4: If ! WritableStreamCloseQueuedOrInFlight(stream) is true or state + // is "closed", return a promise resolved with undefined. + if (WritableStreamCloseQueuedOrInFlight(unwrappedStream) || + unwrappedStream->closed()) { + return PromiseResolvedWithUndefined(cx); + } + + // Step 5: If state is "errored", return a promise rejected with + // stream.[[storedError]]. + if (unwrappedStream->errored()) { + Rooted storedError(cx, unwrappedStream->storedError()); + if (!cx->compartment()->wrap(cx, &storedError)) { + return nullptr; + } + + return PromiseObject::unforgeableReject(cx, storedError); + } + + // Step 6: Assert: state is "writable" or "erroring". + MOZ_ASSERT(unwrappedStream->writable() ^ unwrappedStream->erroring()); + + // Step 7: Return ! WritableStreamDefaultWriterClose(writer). + return WritableStreamDefaultWriterClose(cx, unwrappedWriter); +} + +using GetField = JSObject* (WritableStreamDefaultWriter::*)() const; +using SetField = void (WritableStreamDefaultWriter::*)(JSObject*); + +static bool EnsurePromiseRejected( + JSContext* cx, Handle unwrappedWriter, + GetField getField, SetField setField, Handle error) { + cx->check(error); + + Rooted unwrappedPromise( + cx, UnwrapAndDowncastObject( + cx, (unwrappedWriter->*getField)())); + if (!unwrappedPromise) { + return false; + } + + // 4.6.{5,6} step 1: If writer.[[]].[[PromiseState]] is "pending", + // reject writer.[[]] with error. + if (unwrappedPromise->state() == JS::PromiseState::Pending) { + if (!RejectUnwrappedPromiseWithError(cx, unwrappedPromise, error)) { + return false; + } + } else { + // 4.6.{5,6} step 2: Otherwise, set writer.[[]] to a promise rejected + // with error. + Rooted rejectedWithError( + cx, PromiseObject::unforgeableReject(cx, error)); + if (!rejectedWithError) { + return false; + } + + { + AutoRealm ar(cx, unwrappedWriter); + if (!cx->compartment()->wrap(cx, &rejectedWithError)) { + return false; + } + (unwrappedWriter->*setField)(rejectedWithError); + } + + // Directly-unobservable rejected promises aren't collapsed like resolved + // promises, and this promise is created in the current realm, so it's + // always an actual Promise. + unwrappedPromise = &rejectedWithError->as(); + } + + // 4.6.{5,6} step 3: Set writer.[[]].[[PromiseIsHandled]] to true. + js::SetSettledPromiseIsHandled(cx, unwrappedPromise); + return true; +} + +/** + * Streams spec, 4.6.5. + * WritableStreamDefaultWriterEnsureClosedPromiseRejected( writer, error ) + */ +[[nodiscard]] bool js::WritableStreamDefaultWriterEnsureClosedPromiseRejected( + JSContext* cx, Handle unwrappedWriter, + Handle error) { + return EnsurePromiseRejected( + cx, unwrappedWriter, &WritableStreamDefaultWriter::closedPromise, + &WritableStreamDefaultWriter::setClosedPromise, error); +} + +/** + * Streams spec, 4.6.6. + * WritableStreamDefaultWriterEnsureReadyPromiseRejected( writer, error ) + */ +[[nodiscard]] bool js::WritableStreamDefaultWriterEnsureReadyPromiseRejected( + JSContext* cx, Handle unwrappedWriter, + Handle error) { + return EnsurePromiseRejected( + cx, unwrappedWriter, &WritableStreamDefaultWriter::readyPromise, + &WritableStreamDefaultWriter::setReadyPromise, error); +} + +/** + * Streams spec, 4.6.7. + * WritableStreamDefaultWriterGetDesiredSize ( writer ) + */ +bool js::WritableStreamDefaultWriterGetDesiredSize( + JSContext* cx, Handle unwrappedWriter, + MutableHandle size) { + // Step 1: Let stream be writer.[[ownerWritableStream]]. + const WritableStream* unwrappedStream = + UnwrapStreamFromWriter(cx, unwrappedWriter); + if (!unwrappedStream) { + return false; + } + + // Step 2: Let state be stream.[[state]]. + // Step 3: If state is "errored" or "erroring", return null. + if (unwrappedStream->errored() || unwrappedStream->erroring()) { + size.setNull(); + } + // Step 4: If state is "closed", return 0. + else if (unwrappedStream->closed()) { + size.setInt32(0); + } + // Step 5: Return + // ! WritableStreamDefaultControllerGetDesiredSize( + // stream.[[writableStreamController]]). + else { + size.setNumber(WritableStreamDefaultControllerGetDesiredSize( + unwrappedStream->controller())); + } + + return true; +} + +/** + * Streams spec, 4.6.8. + * WritableStreamDefaultWriterRelease ( writer ) + */ +bool js::WritableStreamDefaultWriterRelease( + JSContext* cx, Handle unwrappedWriter) { + // Step 1: Let stream be writer.[[ownerWritableStream]]. + // Step 2: Assert: stream is not undefined. + MOZ_ASSERT(unwrappedWriter->hasStream()); + Rooted unwrappedStream( + cx, UnwrapStreamFromWriter(cx, unwrappedWriter)); + if (!unwrappedStream) { + return false; + } + + // Step 3: Assert: stream.[[writer]] is writer. +#ifdef DEBUG + { + WritableStreamDefaultWriter* unwrappedStreamWriter = + UnwrapWriterFromStream(cx, unwrappedStream); + if (!unwrappedStreamWriter) { + return false; + } + + MOZ_ASSERT(unwrappedStreamWriter == unwrappedWriter); + } +#endif + + // Step 4: Let releasedError be a new TypeError. + Rooted releasedError(cx); + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_WRITABLESTREAM_CANT_RELEASE_ALREADY_CLOSED); + if (!cx->isExceptionPending() || !GetAndClearException(cx, &releasedError)) { + return false; + } + + // Step 5: Perform + // ! WritableStreamDefaultWriterEnsureReadyPromiseRejected( + // writer, releasedError). + if (!WritableStreamDefaultWriterEnsureReadyPromiseRejected( + cx, unwrappedWriter, releasedError)) { + return false; + } + + // Step 6: Perform + // ! WritableStreamDefaultWriterEnsureClosedPromiseRejected( + // writer, releasedError). + if (!WritableStreamDefaultWriterEnsureClosedPromiseRejected( + cx, unwrappedWriter, releasedError)) { + return false; + } + + // Step 7: Set stream.[[writer]] to undefined. + unwrappedStream->clearWriter(); + + // Step 8: Set writer.[[ownerWritableStream]] to undefined. + unwrappedWriter->clearStream(); + return true; +} + +/** + * Streams spec, 4.6.9. + * WritableStreamDefaultWriterWrite ( writer, chunk ) + */ +PromiseObject* js::WritableStreamDefaultWriterWrite( + JSContext* cx, Handle unwrappedWriter, + Handle chunk) { + cx->check(chunk); + + // Step 1: Let stream be writer.[[ownerWritableStream]]. + // Step 2: Assert: stream is not undefined. + MOZ_ASSERT(unwrappedWriter->hasStream()); + Rooted unwrappedStream( + cx, UnwrapStreamFromWriter(cx, unwrappedWriter)); + if (!unwrappedStream) { + return nullptr; + } + + // Step 3: Let controller be stream.[[writableStreamController]]. + Rooted unwrappedController( + cx, unwrappedStream->controller()); + + // Step 4: Let chunkSize be + // ! WritableStreamDefaultControllerGetChunkSize(controller, chunk). + Rooted chunkSize(cx); + if (!WritableStreamDefaultControllerGetChunkSize(cx, unwrappedController, + chunk, &chunkSize)) { + return nullptr; + } + cx->check(chunkSize); + + // Step 5: If stream is not equal to writer.[[ownerWritableStream]], return a + // promise rejected with a TypeError exception. + // (This is just an obscure way of saying "If step 4 caused writer's lock on + // stream to be released", or concretely, "If writer.[[ownerWritableStream]] + // is [now, newly] undefined".) + if (!unwrappedWriter->hasStream()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_WRITABLESTREAM_RELEASED_DURING_WRITE); + return PromiseRejectedWithPendingError(cx); + } + + auto RejectWithStoredError = + [](JSContext* cx, + Handle unwrappedStream) -> PromiseObject* { + Rooted storedError(cx, unwrappedStream->storedError()); + if (!cx->compartment()->wrap(cx, &storedError)) { + return nullptr; + } + + return PromiseObject::unforgeableReject(cx, storedError); + }; + + // Step 6: Let state be stream.[[state]]. + // Step 7: If state is "errored", return a promise rejected with + // stream.[[storedError]]. + if (unwrappedStream->errored()) { + return RejectWithStoredError(cx, unwrappedStream); + } + + // Step 8: If ! WritableStreamCloseQueuedOrInFlight(stream) is true or state + // is "closed", return a promise rejected with a TypeError exception + // indicating that the stream is closing or closed. + if (WritableStreamCloseQueuedOrInFlight(unwrappedStream) || + unwrappedStream->closed()) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, + JSMSG_WRITABLESTREAM_WRITE_CLOSING_OR_CLOSED); + return PromiseRejectedWithPendingError(cx); + } + + // Step 9: If state is "erroring", return a promise rejected with + // stream.[[storedError]]. + if (unwrappedStream->erroring()) { + return RejectWithStoredError(cx, unwrappedStream); + } + + // Step 10: Assert: state is "writable". + MOZ_ASSERT(unwrappedStream->writable()); + + // Step 11: Let promise be ! WritableStreamAddWriteRequest(stream). + Rooted promise( + cx, WritableStreamAddWriteRequest(cx, unwrappedStream)); + if (!promise) { + return nullptr; + } + + // Step 12: Perform + // ! WritableStreamDefaultControllerWrite(controller, chunk, + // chunkSize). + if (!WritableStreamDefaultControllerWrite(cx, unwrappedController, chunk, + chunkSize)) { + return nullptr; + } + + // Step 13: Return promise. + return promise; +} diff --git a/js/src/builtin/streams/WritableStreamWriterOperations.h b/js/src/builtin/streams/WritableStreamWriterOperations.h new file mode 100644 index 0000000000000..7027f5f864444 --- /dev/null +++ b/js/src/builtin/streams/WritableStreamWriterOperations.h @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Writable stream writer abstract operations. */ + +#ifndef builtin_streams_WritableStreamWriterOperations_h +#define builtin_streams_WritableStreamWriterOperations_h + +#include "js/RootingAPI.h" // JS::{,Mutable}Handle +#include "js/Value.h" // JS::Value + +struct JS_PUBLIC_API JSContext; +class JS_PUBLIC_API JSObject; + +namespace js { + +class PromiseObject; +class WritableStreamDefaultWriter; + +extern JSObject* WritableStreamDefaultWriterAbort( + JSContext* cx, JS::Handle unwrappedWriter, + JS::Handle reason); + +extern PromiseObject* WritableStreamDefaultWriterClose( + JSContext* cx, JS::Handle unwrappedWriter); + +extern PromiseObject* WritableStreamDefaultWriterCloseWithErrorPropagation( + JSContext* cx, JS::Handle unwrappedWriter); + +[[nodiscard]] extern bool +WritableStreamDefaultWriterEnsureClosedPromiseRejected( + JSContext* cx, JS::Handle unwrappedWriter, + JS::Handle error); + +[[nodiscard]] extern bool WritableStreamDefaultWriterEnsureReadyPromiseRejected( + JSContext* cx, JS::Handle unwrappedWriter, + JS::Handle error); + +[[nodiscard]] extern bool WritableStreamDefaultWriterGetDesiredSize( + JSContext* cx, JS::Handle unwrappedWriter, + JS::MutableHandle size); + +[[nodiscard]] extern bool WritableStreamDefaultWriterRelease( + JSContext* cx, JS::Handle unwrappedWriter); + +extern PromiseObject* WritableStreamDefaultWriterWrite( + JSContext* cx, JS::Handle unwrappedWriter, + JS::Handle chunk); + +} // namespace js + +#endif // builtin_streams_WritableStreamWriterOperations_h diff --git a/js/src/frontend/FrontendContext.cpp b/js/src/frontend/FrontendContext.cpp index 3066ce4ec6869..f12bea5029517 100644 --- a/js/src/frontend/FrontendContext.cpp +++ b/js/src/frontend/FrontendContext.cpp @@ -62,7 +62,7 @@ void FrontendContext::setStackQuota(JS::NativeStackSize stackSize) { } #endif // !__wasi__ -#ifdef DEBUG +#if defined(DEBUG) && !defined(__wasi__) setNativeStackLimitThread(); #endif } @@ -250,7 +250,9 @@ static size_t GetTid() { } void FrontendContext::setNativeStackLimitThread() { +#ifndef __wasi__ stackLimitThreadId_.emplace(GetTid()); +#endif } void FrontendContext::assertNativeStackLimitThread() { diff --git a/js/src/fuzz-tests/tests.cpp b/js/src/fuzz-tests/tests.cpp index b730db188eaf5..85ea0c3b6bbf9 100644 --- a/js/src/fuzz-tests/tests.cpp +++ b/js/src/fuzz-tests/tests.cpp @@ -38,7 +38,10 @@ static const JSClass* getGlobalClass() { static JSObject* jsfuzz_createGlobal(JSContext* cx, JSPrincipals* principals) { /* Create the global object. */ JS::RealmOptions options; - options.creationOptions().setSharedMemoryAndAtomicsEnabled(true); + options.creationOptions() + .setWeakRefsEnabled(JS::WeakRefSpecifier::EnabledWithCleanupSome) + .setStreamsEnabled(true) + .setSharedMemoryAndAtomicsEnabled(true); return JS_NewGlobalObject(cx, getGlobalClass(), principals, JS::FireOnNewGlobalHook, options); } diff --git a/js/src/jsapi-tests/moz.build b/js/src/jsapi-tests/moz.build index a76d1de554501..a6963f63d3720 100644 --- a/js/src/jsapi-tests/moz.build +++ b/js/src/jsapi-tests/moz.build @@ -182,6 +182,11 @@ if not CONFIG["JS_CODEGEN_NONE"]: "testsJit.cpp", ] +if CONFIG["MOZ_JS_STREAMS"]: + UNIFIED_SOURCES += [ + "testReadableStream.cpp", + ] + if CONFIG["NIGHTLY_BUILD"]: # The Error interceptor only exists on Nightly. UNIFIED_SOURCES += [ diff --git a/js/src/jsapi-tests/testReadableStream.cpp b/js/src/jsapi-tests/testReadableStream.cpp new file mode 100644 index 0000000000000..ea987915d3b9e --- /dev/null +++ b/js/src/jsapi-tests/testReadableStream.cpp @@ -0,0 +1,1195 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 "jsapi.h" +#include "jsfriendapi.h" +#include "js/experimental/TypedData.h" // JS_GetArrayBufferViewData, JS_IsUint8Array +#include "js/PropertyAndElement.h" // JS_GetProperty, JS_HasProperty, JS_SetProperty +#include "js/Stream.h" +#include "jsapi-tests/tests.h" + +using namespace JS; + +char testBufferData[] = + "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + +struct StubExternalUnderlyingSource + : public JS::ReadableStreamUnderlyingSource { + void* buffer = testBufferData; + bool dataRequestCBCalled = false; + bool writeIntoRequestBufferCBCalled = false; + bool cancelStreamCBCalled = false; + Value cancelStreamReason; + bool streamClosedCBCalled = false; + Value streamClosedReason; + bool streamErroredCBCalled = false; + Value streamErroredReason; + bool finalizeStreamCBCalled = false; + void* finalizedStreamUnderlyingSource; + + static StubExternalUnderlyingSource instance; + + void requestData(JSContext* cx, HandleObject stream, + size_t desiredSize) override { + js::AssertSameCompartment(cx, stream); + MOZ_RELEASE_ASSERT(!dataRequestCBCalled, "Invalid test setup"); + dataRequestCBCalled = true; + } + + void writeIntoReadRequestBuffer(JSContext* cx, HandleObject stream, + JS::HandleObject chunk, size_t length, + size_t* bytesWritten) override { + js::AssertSameCompartment(cx, stream); + MOZ_RELEASE_ASSERT(!writeIntoRequestBufferCBCalled, "Invalid test setup"); + writeIntoRequestBufferCBCalled = true; + + MOZ_RELEASE_ASSERT(this == &StubExternalUnderlyingSource::instance); + MOZ_RELEASE_ASSERT(StubExternalUnderlyingSource::instance.buffer == + testBufferData); + MOZ_RELEASE_ASSERT(length <= sizeof(testBufferData)); + + JS::AutoCheckCannotGC noGC; + bool isSharedMemory; + + void* buffer = JS_GetArrayBufferViewData(chunk, &isSharedMemory, noGC); + MOZ_ASSERT(!isSharedMemory); + + memcpy(buffer, testBufferData, length); + *bytesWritten = length; + } + + Value cancel(JSContext* cx, HandleObject stream, + HandleValue reason) override { + js::AssertSameCompartment(cx, stream); + js::AssertSameCompartment(cx, reason); + MOZ_RELEASE_ASSERT(!cancelStreamCBCalled, "Invalid test setup"); + cancelStreamCBCalled = true; + cancelStreamReason = reason; + return reason; + } + + void onClosed(JSContext* cx, HandleObject stream) override { + js::AssertSameCompartment(cx, stream); + MOZ_RELEASE_ASSERT(!streamClosedCBCalled, "Invalid test setup"); + streamClosedCBCalled = true; + } + + void onErrored(JSContext* cx, HandleObject stream, + HandleValue reason) override { + js::AssertSameCompartment(cx, stream); + js::AssertSameCompartment(cx, reason); + MOZ_RELEASE_ASSERT(!streamErroredCBCalled, "Invalid test setup"); + streamErroredCBCalled = true; + streamErroredReason = reason; + } + + void finalize() override { + MOZ_RELEASE_ASSERT(!finalizeStreamCBCalled, "Invalid test setup"); + finalizeStreamCBCalled = true; + finalizedStreamUnderlyingSource = this; + } + + void reset() { + dataRequestCBCalled = false; + writeIntoRequestBufferCBCalled = false; + cancelStreamReason = UndefinedValue(); + cancelStreamCBCalled = false; + streamClosedCBCalled = false; + streamErroredCBCalled = false; + finalizeStreamCBCalled = false; + } +}; + +StubExternalUnderlyingSource StubExternalUnderlyingSource::instance; + +static_assert(alignof(StubExternalUnderlyingSource) > 1, + "UnderlyingSource pointers must not have the low bit set"); + +static JSObject* NewDefaultStream(JSContext* cx, HandleObject source = nullptr, + HandleFunction size = nullptr, + double highWaterMark = 1, + HandleObject proto = nullptr) { + RootedObject stream(cx, NewReadableDefaultStreamObject(cx, source, size, + highWaterMark, proto)); + if (stream) { + MOZ_RELEASE_ASSERT(IsReadableStream(stream)); + } + return stream; +} + +static bool GetIterResult(JSContext* cx, HandleObject promise, + MutableHandleValue value, bool* done) { + RootedObject iterResult(cx, &GetPromiseResult(promise).toObject()); + + bool found; + if (!JS_HasProperty(cx, iterResult, "value", &found)) { + return false; + } + MOZ_RELEASE_ASSERT(found); + if (!JS_HasProperty(cx, iterResult, "done", &found)) { + return false; + } + MOZ_RELEASE_ASSERT(found); + + RootedValue doneVal(cx); + if (!JS_GetProperty(cx, iterResult, "value", value)) { + return false; + } + if (!JS_GetProperty(cx, iterResult, "done", &doneVal)) { + return false; + } + + *done = doneVal.toBoolean(); + if (*done) { + MOZ_RELEASE_ASSERT(value.isUndefined()); + } + + return true; +} + +static JSObject* GetReadChunk(JSContext* cx, HandleObject readRequest) { + MOZ_RELEASE_ASSERT(GetPromiseState(readRequest) == PromiseState::Fulfilled); + RootedValue resultVal(cx, GetPromiseResult(readRequest)); + MOZ_RELEASE_ASSERT(resultVal.isObject()); + RootedObject result(cx, &resultVal.toObject()); + RootedValue chunkVal(cx); + JS_GetProperty(cx, result, "value", &chunkVal); + return &chunkVal.toObject(); +} + +struct StreamTestFixture : public JSAPIRuntimeTest { + virtual ~StreamTestFixture() {} +}; + +BEGIN_FIXTURE_TEST(StreamTestFixture, testReadableStream_NewReadableStream) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + ReadableStreamMode mode; + CHECK(ReadableStreamGetMode(cx, stream, &mode)); + CHECK(mode == ReadableStreamMode::Default); + return true; +} +END_FIXTURE_TEST(StreamTestFixture, testReadableStream_NewReadableStream) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamGetReaderDefault) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + + RootedObject reader(cx, ReadableStreamGetReader( + cx, stream, ReadableStreamReaderMode::Default)); + CHECK(reader); + CHECK(IsReadableStreamDefaultReader(reader)); + bool locked; + CHECK(ReadableStreamIsLocked(cx, stream, &locked)); + CHECK(locked); + bool closed; + CHECK(ReadableStreamReaderIsClosed(cx, reader, &closed)); + CHECK(!closed); + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamGetReaderDefault) + +BEGIN_FIXTURE_TEST(StreamTestFixture, testReadableStream_ReadableStreamTee) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + + RootedObject leftStream(cx); + RootedObject rightStream(cx); + CHECK(ReadableStreamTee(cx, stream, &leftStream, &rightStream)); + bool locked; + CHECK(ReadableStreamIsLocked(cx, stream, &locked)); + CHECK(locked); + CHECK(leftStream); + CHECK(IsReadableStream(leftStream)); + CHECK(rightStream); + CHECK(IsReadableStream(rightStream)); + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, testReadableStream_ReadableStreamTee) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamEnqueue) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + + RootedObject chunk(cx, JS_NewPlainObject(cx)); + CHECK(chunk); + RootedValue chunkVal(cx, ObjectValue(*chunk)); + CHECK(ReadableStreamEnqueue(cx, stream, chunkVal)); + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, testReadableStream_ReadableStreamEnqueue) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamDefaultReaderRead) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + RootedObject reader(cx, ReadableStreamGetReader( + cx, stream, ReadableStreamReaderMode::Default)); + CHECK(reader); + + RootedObject request(cx, ReadableStreamDefaultReaderRead(cx, reader)); + CHECK(request); + CHECK(IsPromiseObject(request)); + CHECK(GetPromiseState(request) == PromiseState::Pending); + + RootedObject chunk(cx, JS_NewPlainObject(cx)); + CHECK(chunk); + RootedValue chunkVal(cx, ObjectValue(*chunk)); + CHECK(ReadableStreamEnqueue(cx, stream, chunkVal)); + + CHECK(GetReadChunk(cx, request) == chunk); + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamDefaultReaderRead) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamDefaultReaderClose) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + RootedObject reader(cx, ReadableStreamGetReader( + cx, stream, ReadableStreamReaderMode::Default)); + CHECK(reader); + + RootedObject request(cx, ReadableStreamDefaultReaderRead(cx, reader)); + CHECK(request); + CHECK(IsPromiseObject(request)); + CHECK(GetPromiseState(request) == PromiseState::Pending); + + CHECK(ReadableStreamClose(cx, stream)); + + bool done; + RootedValue value(cx); + CHECK(GetPromiseState(request) == PromiseState::Fulfilled); + CHECK(GetIterResult(cx, request, &value, &done)); + CHECK(value.isUndefined()); + CHECK(done); + + // The callbacks are only invoked for external streams. + CHECK(!StubExternalUnderlyingSource::instance.streamClosedCBCalled); + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamDefaultReaderClose) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamDefaultReaderError) { + StubExternalUnderlyingSource::instance.reset(); + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + RootedObject reader(cx, ReadableStreamGetReader( + cx, stream, ReadableStreamReaderMode::Default)); + CHECK(reader); + + RootedObject request(cx, ReadableStreamDefaultReaderRead(cx, reader)); + CHECK(request); + CHECK(IsPromiseObject(request)); + CHECK(GetPromiseState(request) == PromiseState::Pending); + + bool locked; + CHECK(ReadableStreamIsLocked(cx, stream, &locked)); + CHECK(locked); + bool readable; + CHECK(ReadableStreamIsReadable(cx, stream, &readable)); + CHECK(readable); + RootedValue error(cx, Int32Value(42)); + CHECK(ReadableStreamError(cx, stream, error)); + + CHECK(GetPromiseState(request) == PromiseState::Rejected); + RootedValue reason(cx, GetPromiseResult(request)); + CHECK(reason.isInt32()); + CHECK(reason.toInt32() == 42); + + // The callbacks are only invoked for external streams. + CHECK(!StubExternalUnderlyingSource::instance.streamErroredCBCalled); + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamDefaultReaderError) + +static JSObject* NewExternalSourceStream( + JSContext* cx, ReadableStreamUnderlyingSource* source) { + RootedObject stream(cx, NewReadableExternalSourceStreamObject(cx, source)); + if (stream) { + MOZ_RELEASE_ASSERT(IsReadableStream(stream)); + } + return stream; +} + +static JSObject* NewExternalSourceStream(JSContext* cx) { + return NewExternalSourceStream(cx, &StubExternalUnderlyingSource::instance); +} + +BEGIN_FIXTURE_TEST( + StreamTestFixture, + testReadableStream_CreateReadableByteStreamWithExternalSource) { + StubExternalUnderlyingSource::instance.reset(); + + RootedObject stream(cx, NewExternalSourceStream(cx)); + CHECK(stream); + ReadableStreamMode mode; + CHECK(ReadableStreamGetMode(cx, stream, &mode)); + CHECK(mode == ReadableStreamMode::ExternalSource); + ReadableStreamUnderlyingSource* underlyingSource; + CHECK( + ReadableStreamGetExternalUnderlyingSource(cx, stream, &underlyingSource)); + CHECK(underlyingSource == &StubExternalUnderlyingSource::instance); + bool locked; + CHECK(ReadableStreamIsLocked(cx, stream, &locked)); + CHECK(locked); + CHECK(ReadableStreamReleaseExternalUnderlyingSource(cx, stream)); + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, + testReadableStream_CreateReadableByteStreamWithExternalSource) + +BEGIN_FIXTURE_TEST(StreamTestFixture, testReadableStream_ExternalSourceCancel) { + StubExternalUnderlyingSource::instance.reset(); + + RootedObject stream(cx, NewExternalSourceStream(cx)); + CHECK(stream); + RootedValue reason(cx, Int32Value(42)); + CHECK(ReadableStreamCancel(cx, stream, reason)); + CHECK(StubExternalUnderlyingSource::instance.cancelStreamCBCalled); + CHECK(StubExternalUnderlyingSource::instance.cancelStreamReason == reason); + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, testReadableStream_ExternalSourceCancel) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ExternalSourceGetReader) { + StubExternalUnderlyingSource::instance.reset(); + + RootedObject stream(cx, NewExternalSourceStream(cx)); + CHECK(stream); + + RootedValue streamVal(cx, ObjectValue(*stream)); + CHECK(JS_SetProperty(cx, global, "stream", streamVal)); + RootedValue rval(cx); + EVAL("stream.getReader()", &rval); + CHECK(rval.isObject()); + RootedObject reader(cx, &rval.toObject()); + CHECK(IsReadableStreamDefaultReader(reader)); + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, testReadableStream_ExternalSourceGetReader) + +enum class CompartmentMode { + Same, + Cross, +}; + +struct ReadFromExternalSourceFixture : public StreamTestFixture { + virtual ~ReadFromExternalSourceFixture() {} + + // On success, streamGlobal is a global object (not a wrapper) + // and stream is in the same compartment as cx (it may be a CCW). + bool createExternalSourceStream(CompartmentMode compartmentMode, + MutableHandleObject streamGlobal, + MutableHandleObject stream) { + if (compartmentMode == CompartmentMode::Same) { + streamGlobal.set(global); + stream.set(NewExternalSourceStream(cx)); + if (!stream) { + return false; + } + } else { + RootedObject savedGlobal(cx, global); + streamGlobal.set(createGlobal()); + if (!streamGlobal) { + return false; + } + global = savedGlobal; + + { + JSAutoRealm ar(cx, streamGlobal); + stream.set(NewExternalSourceStream(cx)); + if (!stream) { + return false; + } + } + if (!JS_WrapObject(cx, stream)) { + return false; + } + } + return true; + } + + bool readWithoutDataAvailable(CompartmentMode compartmentMode, + const char* evalSrc, const char* evalSrc2, + uint32_t writtenLength) { + StubExternalUnderlyingSource::instance.reset(); + definePrint(); + + // Create the stream. + RootedObject streamGlobal(cx); + RootedObject stream(cx); // can be a wrapper + CHECK(createExternalSourceStream(compartmentMode, &streamGlobal, &stream)); + js::RunJobs(cx); + + // GetExternalUnderlyingSource locks the stream. + ReadableStreamUnderlyingSource* underlyingSource; + CHECK(ReadableStreamGetExternalUnderlyingSource(cx, stream, + &underlyingSource)); + CHECK(underlyingSource == &StubExternalUnderlyingSource::instance); + bool locked; + CHECK(ReadableStreamIsLocked(cx, stream, &locked)); + CHECK(locked); + CHECK(ReadableStreamReleaseExternalUnderlyingSource(cx, stream)); + + // Run caller-supplied JS code to read from the stream. + RootedValue streamVal(cx, ObjectValue(*stream)); + CHECK(JS_SetProperty(cx, global, "stream", streamVal)); + RootedValue rval(cx); + EVAL(evalSrc, &rval); + CHECK(StubExternalUnderlyingSource::instance.dataRequestCBCalled); + CHECK( + !StubExternalUnderlyingSource::instance.writeIntoRequestBufferCBCalled); + CHECK(rval.isObject()); + RootedObject unwrappedPromise(cx, + js::CheckedUnwrapStatic(&rval.toObject())); + CHECK(unwrappedPromise); + CHECK(IsPromiseObject(unwrappedPromise)); + CHECK(GetPromiseState(unwrappedPromise) == PromiseState::Pending); + + // Stream in some data; this resolves the read() result promise. + size_t length = sizeof(testBufferData); + CHECK(ReadableStreamUpdateDataAvailableFromSource(cx, stream, length)); + CHECK( + StubExternalUnderlyingSource::instance.writeIntoRequestBufferCBCalled); + CHECK(GetPromiseState(unwrappedPromise) == PromiseState::Fulfilled); + RootedObject chunk(cx); + { + JSAutoRealm ar(cx, unwrappedPromise); + RootedValue iterVal(cx); + bool done; + if (!GetIterResult(cx, unwrappedPromise, &iterVal, &done)) { + return false; + } + CHECK(!done); + chunk = &iterVal.toObject(); + } + CHECK(JS_WrapObject(cx, &chunk)); + CHECK(JS_IsUint8Array(chunk)); + + { + JS::AutoCheckCannotGC noGC(cx); + bool dummy; + void* buffer = JS_GetArrayBufferViewData(chunk, &dummy, noGC); + CHECK(!memcmp(buffer, testBufferData, writtenLength)); + } + + // Check the callbacks fired by calling read() again. + StubExternalUnderlyingSource::instance.dataRequestCBCalled = false; + StubExternalUnderlyingSource::instance.writeIntoRequestBufferCBCalled = + false; + EVAL(evalSrc2, &rval); + CHECK(StubExternalUnderlyingSource::instance.dataRequestCBCalled); + CHECK( + !StubExternalUnderlyingSource::instance.writeIntoRequestBufferCBCalled); + + return true; + } + + bool readWithDataAvailable(CompartmentMode compartmentMode, + const char* evalSrc, uint32_t writtenLength) { + StubExternalUnderlyingSource::instance.reset(); + definePrint(); + + // Create a stream. + RootedObject streamGlobal(cx); + RootedObject stream(cx); + CHECK(createExternalSourceStream(compartmentMode, &streamGlobal, &stream)); + + // Getting the underlying source locks the stream. + ReadableStreamUnderlyingSource* underlyingSource; + CHECK(ReadableStreamGetExternalUnderlyingSource(cx, stream, + &underlyingSource)); + CHECK(underlyingSource == &StubExternalUnderlyingSource::instance); + bool locked; + CHECK(ReadableStreamIsLocked(cx, stream, &locked)); + CHECK(locked); + CHECK(ReadableStreamReleaseExternalUnderlyingSource(cx, stream)); + + // Make some data available. + size_t length = sizeof(testBufferData); + CHECK(ReadableStreamUpdateDataAvailableFromSource(cx, stream, length)); + + // Read from the stream. + RootedValue streamVal(cx, ObjectValue(*stream)); + CHECK(JS_SetProperty(cx, global, "stream", streamVal)); + RootedValue rval(cx); + EVAL(evalSrc, &rval); + CHECK( + StubExternalUnderlyingSource::instance.writeIntoRequestBufferCBCalled); + CHECK(rval.isObject()); + RootedObject unwrappedPromise(cx, + js::CheckedUnwrapStatic(&rval.toObject())); + CHECK(unwrappedPromise); + CHECK(IsPromiseObject(unwrappedPromise)); + CHECK(GetPromiseState(unwrappedPromise) == PromiseState::Fulfilled); + RootedObject chunk(cx); + { + JSAutoRealm ar(cx, unwrappedPromise); + RootedValue iterVal(cx); + bool done; + if (!GetIterResult(cx, unwrappedPromise, &iterVal, &done)) { + return false; + } + CHECK(!done); + chunk = &iterVal.toObject(); + } + CHECK(JS_WrapObject(cx, &chunk)); + CHECK(JS_IsUint8Array(chunk)); + + { + JS::AutoCheckCannotGC noGC(cx); + bool dummy; + void* buffer = JS_GetArrayBufferViewData(chunk, &dummy, noGC); + CHECK(!memcmp(buffer, testBufferData, writtenLength)); + } + + return true; + } +}; + +BEGIN_FIXTURE_TEST( + ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceReadDefaultWithoutDataAvailable) { + return readWithoutDataAvailable(CompartmentMode::Same, + "r = stream.getReader(); r.read()", + "r.read()", sizeof(testBufferData)); +} +END_FIXTURE_TEST( + ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceReadDefaultWithoutDataAvailable) + +BEGIN_FIXTURE_TEST( + ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceReadDefaultWithoutDataAvailable_CrossCompartment1) { + // Scenario 1: The stream and reader are both in the same compartment, but + // ReadableStreamUpdateDataAvailableFromSource is applied to a wrapper. + return readWithoutDataAvailable(CompartmentMode::Cross, + "r = stream.getReader(); r.read()", + "r.read()", sizeof(testBufferData)); +} +END_FIXTURE_TEST( + ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceReadDefaultWithoutDataAvailable_CrossCompartment1) + +BEGIN_FIXTURE_TEST( + ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceReadDefaultWithoutDataAvailable_CrossCompartment2) { + // Scenario 2: The stream and reader are in the same compartment, but a + // `read` method from another compartment is used on the reader. + return readWithoutDataAvailable( + CompartmentMode::Cross, + "r = stream.getReader(); read = new " + "ReadableStream({start(){}}).getReader().read; read.call(r)", + "read.call(r)", sizeof(testBufferData)); +} +END_FIXTURE_TEST( + ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceReadDefaultWithoutDataAvailable_CrossCompartment2) + +BEGIN_FIXTURE_TEST( + ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceReadDefaultWithoutDataAvailable_CrossCompartment3) { + // Scenario 3: The stream and reader are in different compartments. + return readWithoutDataAvailable( + CompartmentMode::Cross, + "r = ReadableStream.prototype.getReader.call(stream); r.read()", + "r.read()", sizeof(testBufferData)); +} +END_FIXTURE_TEST( + ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceReadDefaultWithoutDataAvailable_CrossCompartment3) + +BEGIN_FIXTURE_TEST(ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceCloseWithPendingRead) { + CHECK(readWithoutDataAvailable(CompartmentMode::Same, + "r = stream.getReader(); request0 = r.read(); " + "request1 = r.read(); request0", + "r.read()", sizeof(testBufferData))); + + RootedValue val(cx); + CHECK(JS_GetProperty(cx, global, "request1", &val)); + CHECK(val.isObject()); + RootedObject request(cx, &val.toObject()); + CHECK(IsPromiseObject(request)); + CHECK(GetPromiseState(request) == PromiseState::Pending); + + CHECK(JS_GetProperty(cx, global, "stream", &val)); + RootedObject stream(cx, &val.toObject()); + ReadableStreamClose(cx, stream); + + val = GetPromiseResult(request); + CHECK(val.isObject()); + RootedObject result(cx, &val.toObject()); + + JS_GetProperty(cx, result, "done", &val); + CHECK(val.isBoolean()); + CHECK(val.toBoolean() == true); + + JS_GetProperty(cx, result, "value", &val); + CHECK(val.isUndefined()); + return true; +} +END_FIXTURE_TEST(ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceCloseWithPendingRead) + +BEGIN_FIXTURE_TEST( + ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceReadDefaultWithDataAvailable) { + return readWithDataAvailable(CompartmentMode::Same, + "r = stream.getReader(); r.read()", + sizeof(testBufferData)); +} +END_FIXTURE_TEST(ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceReadDefaultWithDataAvailable) + +BEGIN_FIXTURE_TEST( + ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceReadDefaultWithDataAvailable_CrossCompartment1) { + // Scenario 1: The stream and reader are both in the same compartment, but + // ReadableStreamUpdateDataAvailableFromSource is applied to a wrapper. + return readWithDataAvailable(CompartmentMode::Cross, + "r = stream.getReader(); r.read()", + sizeof(testBufferData)); +} +END_FIXTURE_TEST( + ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceReadDefaultWithDataAvailable_CrossCompartment1) + +BEGIN_FIXTURE_TEST( + ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceReadDefaultWithDataAvailable_CrossCompartment2) { + // Scenario 2: The stream and reader are in the same compartment, but a + // `read` method from another compartment is used on the reader. + return readWithDataAvailable( + CompartmentMode::Cross, + "r = stream.getReader(); read = new " + "ReadableStream({start(){}}).getReader().read; read.call(r)", + sizeof(testBufferData)); +} +END_FIXTURE_TEST( + ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceReadDefaultWithDataAvailable_CrossCompartment2) + +BEGIN_FIXTURE_TEST( + ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceReadDefaultWithDataAvailable_CrossCompartment3) { + // Scenario 3: The stream and reader are in different compartments. + return readWithDataAvailable( + CompartmentMode::Cross, + "r = ReadableStream.prototype.getReader.call(stream); r.read()", + sizeof(testBufferData)); +} +END_FIXTURE_TEST( + ReadFromExternalSourceFixture, + testReadableStream_ExternalSourceReadDefaultWithDataAvailable_CrossCompartment3) + +// Cross-global tests: +BEGIN_FIXTURE_TEST( + StreamTestFixture, + testReadableStream_ReadableStreamOtherGlobalDefaultReaderRead) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &stream)); + RootedObject reader(cx, ReadableStreamGetReader( + cx, stream, ReadableStreamReaderMode::Default)); + CHECK(reader); + + RootedObject request(cx, ReadableStreamDefaultReaderRead(cx, reader)); + CHECK(request); + CHECK(IsPromiseObject(request)); + CHECK(!js::IsWrapper(request)); + CHECK(GetPromiseState(request) == PromiseState::Pending); + + RootedObject chunk(cx, JS_NewPlainObject(cx)); + CHECK(chunk); + RootedValue chunkVal(cx, ObjectValue(*chunk)); + CHECK(ReadableStreamEnqueue(cx, stream, chunkVal)); + + CHECK(GetReadChunk(cx, request) == chunk); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamOtherGlobalDefaultReaderRead) + +BEGIN_FIXTURE_TEST( + StreamTestFixture, + testReadableStream_ReadableStreamGetExternalUnderlyingSource) { + StubExternalUnderlyingSource::instance.reset(); + + RootedObject stream(cx, NewExternalSourceStream(cx)); + CHECK(stream); + ReadableStreamUnderlyingSource* source; + CHECK(ReadableStreamGetExternalUnderlyingSource(cx, stream, &source)); + CHECK(source == &StubExternalUnderlyingSource::instance); + CHECK(ReadableStreamReleaseExternalUnderlyingSource(cx, stream)); + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &stream)); + ReadableStreamUnderlyingSource* source; + CHECK(ReadableStreamGetExternalUnderlyingSource(cx, stream, &source)); + CHECK(source == &StubExternalUnderlyingSource::instance); + CHECK(ReadableStreamReleaseExternalUnderlyingSource(cx, stream)); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamGetExternalUnderlyingSource) + +BEGIN_FIXTURE_TEST( + StreamTestFixture, + testReadableStream_ReadableStreamUpdateDataAvailableFromSource) { + RootedObject stream(cx, NewExternalSourceStream(cx)); + CHECK(stream); + CHECK(ReadableStreamUpdateDataAvailableFromSource(cx, stream, 0)); + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &stream)); + CHECK(ReadableStreamUpdateDataAvailableFromSource(cx, stream, 1)); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamUpdateDataAvailableFromSource) + +BEGIN_FIXTURE_TEST(StreamTestFixture, testReadableStream_IsReadableStream) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + CHECK(IsReadableStream(stream)); + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &stream)); + CHECK(IsReadableStream(stream)); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, testReadableStream_IsReadableStream) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamGetMode) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + ReadableStreamMode mode; + CHECK(ReadableStreamGetMode(cx, stream, &mode)); + CHECK(mode == ReadableStreamMode::Default); + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &stream)); + CHECK(ReadableStreamGetMode(cx, stream, &mode)); + CHECK(mode == ReadableStreamMode::Default); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, testReadableStream_ReadableStreamGetMode) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamIsReadable) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + bool result; + CHECK(ReadableStreamIsReadable(cx, stream, &result)); + CHECK(result); + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &stream)); + CHECK(ReadableStreamIsReadable(cx, stream, &result)); + CHECK(result); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, testReadableStream_ReadableStreamIsReadable) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamIsLocked) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + bool result; + CHECK(ReadableStreamIsLocked(cx, stream, &result)); + CHECK_EQUAL(result, false); + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &stream)); + CHECK(ReadableStreamIsLocked(cx, stream, &result)); + CHECK_EQUAL(result, false); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, testReadableStream_ReadableStreamIsLocked) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamIsDisturbed) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + bool result; + CHECK(ReadableStreamIsDisturbed(cx, stream, &result)); + CHECK_EQUAL(result, false); + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &stream)); + CHECK(ReadableStreamIsDisturbed(cx, stream, &result)); + CHECK_EQUAL(result, false); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamIsDisturbed) + +BEGIN_FIXTURE_TEST(StreamTestFixture, testReadableStream_ReadableStreamCancel) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + + RootedValue reason(cx); + JSObject* callResult = ReadableStreamCancel(cx, stream, reason); + CHECK(callResult); + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &stream)); + RootedValue reason(cx); + JSObject* callResult = ReadableStreamCancel(cx, stream, reason); + CHECK(callResult); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, testReadableStream_ReadableStreamCancel) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamGetReader) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + + RootedObject reader(cx); + reader = + ReadableStreamGetReader(cx, stream, ReadableStreamReaderMode::Default); + CHECK(reader); + CHECK(IsReadableStreamDefaultReader(reader)); + CHECK(ReadableStreamReaderReleaseLock(cx, reader)); + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &stream)); + JSObject* callResult = + ReadableStreamGetReader(cx, stream, ReadableStreamReaderMode::Default); + CHECK(callResult); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, testReadableStream_ReadableStreamGetReader) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamTee_CrossCompartment) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + + RootedObject branch1Stream(cx); + RootedObject branch2Stream(cx); + CHECK(ReadableStreamTee(cx, stream, &branch1Stream, &branch2Stream)); + CHECK(IsReadableStream(branch1Stream)); + CHECK(IsReadableStream(branch2Stream)); + stream = branch1Stream; + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &stream)); + CHECK(ReadableStreamTee(cx, stream, &branch1Stream, &branch2Stream)); + CHECK(IsReadableStream(branch1Stream)); + CHECK(IsReadableStream(branch2Stream)); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamTee_CrossCompartment) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamGetDesiredSize) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + bool hasValue; + double value; + CHECK(ReadableStreamGetDesiredSize(cx, stream, &hasValue, &value)); + CHECK_EQUAL(hasValue, true); + CHECK_EQUAL(value, 1.0); + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &stream)); + hasValue = false; + value = 0; + CHECK(ReadableStreamGetDesiredSize(cx, stream, &hasValue, &value)); + CHECK_EQUAL(hasValue, true); + CHECK_EQUAL(value, 1.0); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamGetDesiredSize) + +BEGIN_FIXTURE_TEST(StreamTestFixture, testReadableStream_ReadableStreamClose) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + CHECK(ReadableStreamClose(cx, stream)); + + stream = NewDefaultStream(cx); + CHECK(stream); + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &stream)); + CHECK(ReadableStreamClose(cx, stream)); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, testReadableStream_ReadableStreamClose) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamEnqueue_CrossCompartment) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + RootedValue chunk(cx); + CHECK(ReadableStreamEnqueue(cx, stream, chunk)); + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &stream)); + RootedValue chunk(cx); + CHECK(ReadableStreamEnqueue(cx, stream, chunk)); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamEnqueue_CrossCompartment) + +BEGIN_FIXTURE_TEST(StreamTestFixture, testReadableStream_ReadableStreamError) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + RootedValue error(cx); + CHECK(ReadableStreamError(cx, stream, error)); + + stream = NewDefaultStream(cx); + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &stream)); + RootedValue error(cx); + CHECK(ReadableStreamError(cx, stream, error)); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, testReadableStream_ReadableStreamError) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_IsReadableStreamReader) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + RootedObject reader(cx, ReadableStreamGetReader( + cx, stream, ReadableStreamReaderMode::Default)); + CHECK(reader); + CHECK(IsReadableStreamReader(reader)); + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &reader)); + CHECK(IsReadableStreamReader(reader)); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, testReadableStream_IsReadableStreamReader) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_IsReadableStreamDefaultReader) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + RootedObject reader(cx, ReadableStreamGetReader( + cx, stream, ReadableStreamReaderMode::Default)); + CHECK(IsReadableStreamDefaultReader(reader)); + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &reader)); + CHECK(IsReadableStreamDefaultReader(reader)); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, + testReadableStream_IsReadableStreamDefaultReader) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamReaderIsClosed) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + + RootedObject reader(cx, ReadableStreamGetReader( + cx, stream, ReadableStreamReaderMode::Default)); + bool result; + CHECK(ReadableStreamReaderIsClosed(cx, reader, &result)); + CHECK_EQUAL(result, false); + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &reader)); + bool result; + CHECK(ReadableStreamReaderIsClosed(cx, reader, &result)); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamReaderIsClosed) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamReaderCancel) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + RootedObject reader(cx, ReadableStreamGetReader( + cx, stream, ReadableStreamReaderMode::Default)); + RootedValue reason(cx); + CHECK(ReadableStreamReaderCancel(cx, reader, reason)); + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &reader)); + RootedValue reason(cx); + CHECK(ReadableStreamReaderCancel(cx, reader, reason)); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamReaderCancel) + +BEGIN_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamReaderReleaseLock) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + RootedObject reader(cx, ReadableStreamGetReader( + cx, stream, ReadableStreamReaderMode::Default)); + CHECK(reader); + CHECK(ReadableStreamReaderReleaseLock(cx, reader)); + + // Repeat the test cross-compartment. This creates a new reader, since + // releasing the lock above deactivated the first reader. + reader = + ReadableStreamGetReader(cx, stream, ReadableStreamReaderMode::Default); + CHECK(reader); + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &reader)); + CHECK(ReadableStreamReaderReleaseLock(cx, reader)); + } + + return true; +} +END_FIXTURE_TEST(StreamTestFixture, + testReadableStream_ReadableStreamReaderReleaseLock) + +BEGIN_FIXTURE_TEST( + StreamTestFixture, + testReadableStream_ReadableStreamDefaultReaderRead_CrossCompartment) { + RootedObject stream(cx, NewDefaultStream(cx)); + CHECK(stream); + RootedObject reader(cx, ReadableStreamGetReader( + cx, stream, ReadableStreamReaderMode::Default)); + JSObject* callResult = ReadableStreamDefaultReaderRead(cx, reader); + CHECK(callResult); + + RootedObject otherGlobal(cx, createGlobal()); + CHECK(otherGlobal); + { + JSAutoRealm ar(cx, otherGlobal); + CHECK(JS_WrapObject(cx, &reader)); + JSObject* callResult = ReadableStreamDefaultReaderRead(cx, reader); + CHECK(callResult); + } + + return true; +} +END_FIXTURE_TEST( + StreamTestFixture, + testReadableStream_ReadableStreamDefaultReaderRead_CrossCompartment) diff --git a/js/src/jsapi-tests/tests.cpp b/js/src/jsapi-tests/tests.cpp index d515791104b60..21a86ed43dd9f 100644 --- a/js/src/jsapi-tests/tests.cpp +++ b/js/src/jsapi-tests/tests.cpp @@ -118,7 +118,9 @@ JSObject* JSAPIRuntimeTest::createGlobal(JSPrincipals* principals) { /* Create the global object. */ JS::RootedObject newGlobal(cx); JS::RealmOptions options; - options.creationOptions().setSharedMemoryAndAtomicsEnabled(true); + options.creationOptions() + .setStreamsEnabled(true) + .setSharedMemoryAndAtomicsEnabled(true); newGlobal = JS_NewGlobalObject(cx, getGlobalClass(), principals, JS::FireOnNewGlobalHook, options); if (!newGlobal) { diff --git a/js/src/moz.build b/js/src/moz.build index 121dfd9c76e95..a000e4a42dda2 100644 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -201,6 +201,7 @@ EXPORTS.js += [ "../public/SourceText.h", "../public/StableStringChars.h", "../public/Stack.h", + "../public/Stream.h", "../public/StreamConsumer.h", "../public/String.h", "../public/StructuredClone.h", @@ -451,6 +452,34 @@ UNIFIED_SOURCES += [ "vm/Xdr.cpp", ] +if CONFIG["MOZ_JS_STREAMS"]: + UNIFIED_SOURCES += [ + "builtin/streams/MiscellaneousOperations.cpp", + "builtin/streams/PipeToState.cpp", + "builtin/streams/PullIntoDescriptor.cpp", + "builtin/streams/QueueingStrategies.cpp", + "builtin/streams/QueueWithSizes.cpp", + "builtin/streams/ReadableByteStreamController.cpp", + "builtin/streams/ReadableByteStreamControllerOperations.cpp", + "builtin/streams/ReadableStream.cpp", + "builtin/streams/ReadableStreamBYOBReader.cpp", + "builtin/streams/ReadableStreamBYOBRequest.cpp", + "builtin/streams/ReadableStreamDefaultController.cpp", + "builtin/streams/ReadableStreamDefaultControllerOperations.cpp", + "builtin/streams/ReadableStreamDefaultReader.cpp", + "builtin/streams/ReadableStreamInternals.cpp", + "builtin/streams/ReadableStreamOperations.cpp", + "builtin/streams/ReadableStreamReader.cpp", + "builtin/streams/StreamAPI.cpp", + "builtin/streams/TeeState.cpp", + "builtin/streams/WritableStream.cpp", + "builtin/streams/WritableStreamDefaultController.cpp", + "builtin/streams/WritableStreamDefaultControllerOperations.cpp", + "builtin/streams/WritableStreamDefaultWriter.cpp", + "builtin/streams/WritableStreamOperations.cpp", + "builtin/streams/WritableStreamWriterOperations.cpp", + ] + # builtin/RegExp.cpp cannot be built in unified mode because it causes huge # win32 test slowdowns # jsmath.cpp cannot be built in unified mode because it needs to re-#define the diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index bb2b2e0a4328d..bcaba8febee8f 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -847,6 +847,12 @@ bool shell::enableTestWasmAwaitTier2 = false; bool shell::enableSourcePragmas = true; bool shell::enableAsyncStacks = false; bool shell::enableAsyncStackCaptureDebuggeeOnly = false; +bool shell::enableStreams = false; +bool shell::enableReadableByteStreams = false; +bool shell::enableBYOBStreamReaders = false; +bool shell::enableWritableStreams = false; +bool shell::enableReadableStreamPipeTo = false; +bool shell::enableWeakRefs = false; bool shell::enableToSource = false; #ifdef JS_GC_ZEAL uint32_t shell::gZealBits = 0; @@ -4552,6 +4558,7 @@ static void SetStandardRealmOptions(JS::RealmOptions& options) { options.creationOptions() .setSharedMemoryAndAtomicsEnabled(enableSharedMemory) .setCoopAndCoepEnabled(false) + .setStreamsEnabled(enableStreams) .setToSourceEnabled(enableToSource); } @@ -12944,6 +12951,20 @@ bool InitOptionParser(OptionParser& op) { !op.addBoolOption('\0', "less-debug-code", "Emit less machine code for " "checking assertions under DEBUG.") || + !op.addBoolOption('\0', "enable-streams", + "Enable WHATWG Streams (default)") || + !op.addBoolOption('\0', "no-streams", "Disable WHATWG Streams") || + !op.addBoolOption('\0', "enable-readable-byte-streams", + "Enable support for WHATWG ReadableStreams of type " + "'bytes'") || + !op.addBoolOption('\0', "enable-byob-stream-readers", + "Enable support for getting BYOB readers for WHATWG " + "ReadableStreams of type \"bytes\"") || + !op.addBoolOption('\0', "enable-writable-streams", + "Enable support for WHATWG WritableStreams") || + !op.addBoolOption('\0', "enable-readablestream-pipeto", + "Enable support for " + "WHATWG ReadableStream.prototype.pipeTo") || !op.addBoolOption('\0', "disable-tosource", "Disable toSource/uneval") || !op.addBoolOption('\0', "disable-property-error-message-fix", "Disable fix for the error message when accessing " @@ -13737,6 +13758,11 @@ bool SetContextWasmOptions(JSContext* cx, const OptionParser& op) { } enableTestWasmAwaitTier2 = op.getBoolOption("test-wasm-await-tier2"); + enableStreams = !op.getBoolOption("no-streams"); + enableReadableByteStreams = op.getBoolOption("enable-readable-byte-streams"); + enableBYOBStreamReaders = op.getBoolOption("enable-byob-stream-readers"); + enableWritableStreams = op.getBoolOption("enable-writable-streams"); + enableReadableStreamPipeTo = op.getBoolOption("enable-readablestream-pipeto"); JS::ContextOptionsRef(cx) .setAsmJS(enableAsmJS) diff --git a/js/src/shell/jsshell.h b/js/src/shell/jsshell.h index 6c615a704acbb..85174e25a9d12 100644 --- a/js/src/shell/jsshell.h +++ b/js/src/shell/jsshell.h @@ -117,6 +117,11 @@ extern bool enableTestWasmAwaitTier2; extern bool enableSourcePragmas; extern bool enableAsyncStacks; extern bool enableAsyncStackCaptureDebuggeeOnly; +extern bool enableStreams; +extern bool enableReadableByteStreams; +extern bool enableBYOBStreamReaders; +extern bool enableWritableStreams; +extern bool enableReadableStreamPipeTo; extern bool enableWeakRefs; extern bool enableToSource; extern bool enablePropertyErrorMessageFix; diff --git a/js/src/tests/non262/ReadableStream/readable-stream-globals.js b/js/src/tests/non262/ReadableStream/readable-stream-globals.js new file mode 100644 index 0000000000000..bafd2214bec29 --- /dev/null +++ b/js/src/tests/non262/ReadableStream/readable-stream-globals.js @@ -0,0 +1,367 @@ +// |reftest| skip-if(!this.hasOwnProperty("ReadableStream")) + +if ("ignoreUnhandledRejections" in this) { + ignoreUnhandledRejections(); +} + +async function test() { + if (typeof newGlobal !== 'undefined') { + otherGlobal = newGlobal(); + } + + OtherReadableStream = otherGlobal.ReadableStream; + + ReadableStreamReader = new ReadableStream().getReader().constructor; + OtherReadableStreamReader = new otherGlobal.ReadableStream().getReader().constructor; + + let byteStreamsSupported = false; + try { + let controller; + let reader = new ReadableStream({ + start(c) { + ByteStreamController = c.constructor; + controller = c; + }, + type: "bytes" + }).getReader({ mode: "byob" }) + ReadableStreamBYOBReader = reader.constructor; + reader.read(new Uint8Array(10)); + BYOBRequest = controller.byobRequest.constructor; + reader = new otherGlobal.ReadableStream({ + start(c) { + OtherByteStreamController = c.constructor; + controller = c; + }, + type: "bytes" + }).getReader({ mode: "byob" }); + OtherReadableStreamBYOBReader = reader.constructor; + reader.read(new Uint8Array(10)); + OtherBYOBRequest = controller.byobRequest.constructor; + + BYOBRequestGetter = Object.getOwnPropertyDescriptor(ByteStreamController.prototype, + "byobRequest").get; + OtherBYOBRequestGetter = Object.getOwnPropertyDescriptor(OtherByteStreamController.prototype, + "byobRequest").get; + + byteStreamsSupported = true; + } catch (e) { + } + + let chunk = { name: "chunk" }; + let enqueuedError = { name: "enqueuedError" }; + + let controller; + let stream; + let otherStream; + let otherController; + let reader; + let otherReader; + + function getFreshInstances(type, otherType = type) { + stream = new ReadableStream({ start(c) { controller = c; }, type }); + + otherStream = new OtherReadableStream({ start(c) { otherController = c; }, type: otherType }); + } + + getFreshInstances(); + + Controller = controller.constructor; + OtherController = otherController.constructor; + + + otherReader = OtherReadableStream.prototype.getReader.call(stream); + assertEq(otherReader instanceof ReadableStreamReader, false); + assertEq(otherReader instanceof OtherReadableStreamReader, true); + assertEq(otherController instanceof Controller, false); + + assertEq(stream.locked, true); + Object.defineProperty(stream, "locked", + Object.getOwnPropertyDescriptor(OtherReadableStream.prototype, "locked")); + assertEq(stream.locked, true); + + + request = otherReader.read(); + assertEq(request instanceof otherGlobal.Promise, true); + controller.close(); + assertEq(await request instanceof Object, true); + + getFreshInstances(); + otherReader = new OtherReadableStreamReader(stream); + + getFreshInstances(); + otherReader = new OtherReadableStreamReader(stream); + let cancelSucceeded = false; + let cancelPromise = ReadableStreamReader.prototype.cancel.call(otherReader); + assertEq(cancelPromise instanceof Promise, true); + assertEq(await cancelPromise, undefined); + + getFreshInstances(); + otherReader = new OtherReadableStreamReader(stream); + let closeSucceeded = false; + Object.defineProperty(otherReader, "closed", + Object.getOwnPropertyDescriptor(ReadableStreamReader.prototype, "closed")); + let closedPromise = otherReader.closed; + assertEq(closedPromise instanceof otherGlobal.Promise, true); + controller.close(); + assertEq(await closedPromise, undefined); + + getFreshInstances(); + + otherReader = OtherReadableStream.prototype.getReader.call(stream); + request = otherReader.read(); + assertEq(request instanceof otherGlobal.Promise, true); + otherController.close.call(controller); + assertEq(await request instanceof otherGlobal.Object, true); + + getFreshInstances(); + + assertEq(controller.desiredSize, 1); + Object.defineProperty(controller, "desiredSize", + Object.getOwnPropertyDescriptor(OtherController.prototype, "desiredSize")); + assertEq(controller.desiredSize, 1); + + + request = otherReader.read(); + + controller.error(enqueuedError); + + expectException(() => controller.close(), TypeError); + expectException(() => otherController.close.call(controller), otherGlobal.TypeError); + + otherReader.releaseLock(); + + reader = stream.getReader(); + assertEq(await expectAsyncException(async () => reader.read(), enqueuedError.constructor), + enqueuedError); + + otherReader.releaseLock.call(reader); + assertEq(reader.closed instanceof otherGlobal.Promise, true); + + getFreshInstances(); + + reader = stream.getReader(); + request = otherReader.read.call(reader); + assertEq(request instanceof otherGlobal.Promise, true); + controller.enqueue(chunk); + assertEq((await request).value, chunk); + + reader.releaseLock(); + + getFreshInstances(); + + reader = stream.getReader(); + request = otherReader.read.call(reader); + otherController.enqueue.call(controller, chunk); + otherController.enqueue.call(controller, new otherGlobal.Uint8Array(10)); + controller.enqueue(new otherGlobal.Uint8Array(10)); + request = otherReader.read.call(reader); + + getFreshInstances(); + + stream = new ReadableStream({ start(c) { controller = c; } }, { size() {return 1} }); + otherController.enqueue.call(controller, chunk); + otherController.enqueue.call(controller, new otherGlobal.Uint8Array(10)); + controller.enqueue(new otherGlobal.Uint8Array(10)); + + getFreshInstances(); + + controller.close(); + expectException(() => controller.enqueue(new otherGlobal.Uint8Array(10)), TypeError); + expectException(() => otherController.enqueue.call(controller, chunk), otherGlobal.TypeError); + expectException(() => otherController.enqueue.call(controller, new otherGlobal.Uint8Array(10)), + otherGlobal.TypeError); + + getFreshInstances(); + + let [branch1, branch2] = otherGlobal.ReadableStream.prototype.tee.call(stream); + assertEq(branch1 instanceof otherGlobal.ReadableStream, true); + assertEq(branch2 instanceof otherGlobal.ReadableStream, true); + + controller.enqueue(chunk); + reader = branch1.getReader(); + result = await reader.read(); + reader.releaseLock(); + let subPromiseCreated = false; + let speciesInvoked = false; + class SubPromise extends Promise { + constructor(executor) { + super(executor); + subPromiseCreated = true; + } + } + Object.defineProperty(Promise, Symbol.species, {get: function() { + speciesInvoked = true; + return SubPromise; + } + }); + + otherGlobal.eval(` + subPromiseCreated = false; + speciesInvoked = false; + class OtherSubPromise extends Promise { + constructor(executor) { + super(executor); + subPromiseCreated = true; + } + } + Object.defineProperty(Promise, Symbol.species, {get: function() { + speciesInvoked = true; + return OtherSubPromise; + } + });`); + + controller.error(enqueuedError); + subPromiseCreated = false; + speciesInvoked = false; + otherGlobal.subPromiseCreated = false; + otherGlobal.speciesInvoked = false; + let cancelPromise1 = branch1.cancel({ name: "cancel 1" }); + assertEq(cancelPromise1 instanceof otherGlobal.Promise, true); + assertEq(subPromiseCreated, false); + assertEq(speciesInvoked, false); + assertEq(otherGlobal.subPromiseCreated, false); + assertEq(otherGlobal.speciesInvoked, false); + subPromiseCreated = false; + speciesInvoked = false; + otherGlobal.subPromiseCreated = false; + otherGlobal.speciesInvoked = false; + let cancelPromise2 = branch2.cancel({ name: "cancel 2" }); + assertEq(cancelPromise2 instanceof otherGlobal.Promise, true); + assertEq(subPromiseCreated, false); + assertEq(speciesInvoked, false); + assertEq(otherGlobal.subPromiseCreated, false); + assertEq(otherGlobal.speciesInvoked, false); + await 1; + + + getFreshInstances(); + + [branch1, branch2] = otherGlobal.ReadableStream.prototype.tee.call(stream); + assertEq(branch1 instanceof otherGlobal.ReadableStream, true); + assertEq(branch2 instanceof otherGlobal.ReadableStream, true); + + controller.enqueue(chunk); + reader = branch1.getReader(); + result = await reader.read(); + reader.releaseLock(); + + + assertEq(result.value, chunk); + + controller.error(enqueuedError); + subPromiseCreated = false; + speciesInvoked = false; + otherGlobal.subPromiseCreated = false; + otherGlobal.speciesInvoked = false; + cancelPromise1 = ReadableStream.prototype.cancel.call(branch1, { name: "cancel 1" }); + assertEq(cancelPromise1 instanceof Promise, true); + assertEq(subPromiseCreated, false); + assertEq(speciesInvoked, false); + assertEq(otherGlobal.subPromiseCreated, false); + assertEq(otherGlobal.speciesInvoked, false); + subPromiseCreated = false; + speciesInvoked = false; + otherGlobal.subPromiseCreated = false; + otherGlobal.speciesInvoked = false; + cancelPromise2 = ReadableStream.prototype.cancel.call(branch2, { name: "cancel 2" }); + assertEq(cancelPromise2 instanceof Promise, true); + assertEq(subPromiseCreated, false); + assertEq(speciesInvoked, false); + assertEq(otherGlobal.subPromiseCreated, false); + assertEq(otherGlobal.speciesInvoked, false); + + if (!byteStreamsSupported) { + return; + } + + // if (typeof nukeCCW === 'function') { + // getFreshInstances("bytes"); + // assertEq(otherController instanceof OtherByteStreamController, true); + // reader = ReadableStream.prototype.getReader.call(otherStream); + // otherGlobal.reader = reader; + // otherGlobal.nukeCCW(otherGlobal.reader); + // let chunk = new Uint8Array(10); + // expectException(() => otherController.enqueue(chunk), otherGlobal.TypeError); + // // otherController.error(); + // expectException(() => reader.read(), TypeError); + // } + + function testBYOBRequest(controller, view) { + const request = new BYOBRequest(controller, view); + let storedView = request.view; + assertEq(storedView, view); + storedView = Object.getOwnPropertyDescriptor(OtherBYOBRequest.prototype, "view").get.call(request); + assertEq(storedView, view); + request.respond(10); + OtherBYOBRequest.prototype.respond.call(request, 10); + request.respondWithNewView(new view.constructor(10)); + OtherBYOBRequest.prototype.respondWithNewView.call(request, new view.constructor(10)); + } + + expectException(() => new BYOBRequest(), TypeError); + getFreshInstances("bytes"); + expectException(() => new BYOBRequest(controller, new Uint8Array(10)), TypeError); + expectException(() => new BYOBRequest(otherController, new Uint8Array(10)), TypeError); + expectException(() => new BYOBRequest(otherController, new Uint8Array(10)), TypeError); + expectException(() => new BYOBRequest(otherController, new otherGlobal.Uint8Array(10)), TypeError); + + getFreshInstances("bytes"); + + reader = stream.getReader({ mode: "byob" }); + request = OtherReadableStreamBYOBReader.prototype.read.call(reader, new Uint8Array(10)); + assertEq(request instanceof otherGlobal.Promise, true); + controller.enqueue(new Uint8Array([1, 2, 3, 4])); + result = await request; + + getFreshInstances("bytes"); + + reader = stream.getReader({ mode: "byob" }); + request = OtherReadableStreamBYOBReader.prototype.read.call(reader, new Uint8Array(10)); + assertEq(request instanceof otherGlobal.Promise, true); + try { + let byobRequest = OtherBYOBRequestGetter.call(controller); + } catch (e) { + print(e, '\n', e.stack); + } + controller.enqueue(new Uint8Array([1, 2, 3, 4])); + result = await request; + + await 1; +} + +function expectException(closure, errorType) { + let error; + try { + closure(); + } catch (e) { + error = e; + } + assertEq(error !== undefined, true); + assertEq(error.constructor, errorType); + return error; +} + +async function expectAsyncException(closure, errorType) { + let error; + try { + await closure(); + } catch (e) { + error = e; + } + assertEq(error !== undefined, true); + assertEq(error.constructor, errorType); + return error; +} + +async function runTest() { + try { + await test(); + } catch (e) { + assertEq(false, true, `Unexpected exception ${e}\n${e.stack}`); + } + console.log("done"); + if (typeof reportCompare === "function") + reportCompare(true, true); +} + +runTest(); diff --git a/js/src/vm/CommonPropertyNames.h b/js/src/vm/CommonPropertyNames.h index 81794dced35ba..bce1ddfe35e38 100644 --- a/js/src/vm/CommonPropertyNames.h +++ b/js/src/vm/CommonPropertyNames.h @@ -55,12 +55,14 @@ MACRO_(AsyncGeneratorReturn, "AsyncGeneratorReturn") \ MACRO_(AsyncGeneratorThrow, "AsyncGeneratorThrow") \ MACRO2(at, "at") \ + MACRO_(autoAllocateChunkSize, "autoAllocateChunkSize") \ MACRO_(await, "await") \ MACRO_(bound, "bound") \ MACRO_(boundWithSpace_, "bound ") \ MACRO_(break_, "break") \ MACRO_(breakdown, "breakdown") \ MACRO2(by, "by") \ + MACRO_(byob, "byob") \ MACRO_(byteLength, "byteLength") \ MACRO_(byteOffset, "byteOffset") \ MACRO_(bytes, "bytes") \ @@ -71,6 +73,7 @@ MACRO_(callee, "callee") \ MACRO_(callFunction, "callFunction") \ MACRO_(captureStackTrace, "captureStackTrace") \ + MACRO_(cancel, "cancel") \ MACRO_(case_, "case") \ MACRO_(caseFirst, "caseFirst") \ MACRO_(catch_, "catch") \ @@ -78,6 +81,7 @@ MACRO_(chunks, "chunks") \ MACRO_(class_, "class") \ MACRO_(cleanupSome, "cleanupSome") \ + MACRO_(close, "close") \ MACRO_(collation, "collation") \ MACRO_(collections, "collections") \ MACRO_(column, "column") \ @@ -228,6 +232,7 @@ MACRO_(hash_constructor_, "#constructor") \ MACRO_(hasIndices, "hasIndices") \ MACRO_(hasOwn, "hasOwn") \ + MACRO_(highWaterMark, "highWaterMark") \ IF_EXPLICIT_RESOURCE_MANAGEMENT(MACRO_(hint, "hint")) \ MACRO_(hour, "hour") \ MACRO_(hour12, "hour12") \ @@ -338,6 +343,7 @@ MACRO_(minutesDisplay, "minutesDisplay") \ MACRO_(minutesStyle, "minutesStyle") \ MACRO_(missingArguments, "missingArguments") \ + MACRO_(mode, "mode") \ MACRO_(module, "module") \ MACRO_(Module, "Module") \ MACRO_(month, "month") \ @@ -407,8 +413,12 @@ MACRO_(pause, "pause") \ MACRO_(pending, "pending") \ MACRO_(percentSign, "percentSign") \ + MACRO_(pipeTo, "pipeTo") \ MACRO_(plainTime, "plainTime") \ MACRO_(plusSign, "plusSign") \ + MACRO_(preventAbort, "preventAbort") \ + MACRO_(preventCancel, "preventCancel") \ + MACRO_(preventClose, "preventClose") \ MACRO_(preventExtensions, "preventExtensions") \ MACRO_(private_, "private") \ MACRO_(promise, "promise") \ @@ -417,6 +427,7 @@ MACRO_(prototype, "prototype") \ MACRO_(proxy, "proxy") \ MACRO_(public_, "public") \ + MACRO_(pull, "pull") \ MACRO_(quarter, "quarter") \ MACRO_(range, "range") \ MACRO_(raw, "raw") \ @@ -464,6 +475,7 @@ MACRO_(setFromHex, "setFromHex") \ MACRO_(setPrototypeOf, "setPrototypeOf") \ MACRO_(shared, "shared") \ + MACRO_(signal, "signal") \ MACRO_(signDisplay, "signDisplay") \ MACRO_(size, "size") \ MACRO_(sliceToImmutable, "sliceToImmutable") \ diff --git a/js/src/vm/GlobalObject.cpp b/js/src/vm/GlobalObject.cpp index 34f30e7495a74..2ba62411ffbf7 100644 --- a/js/src/vm/GlobalObject.cpp +++ b/js/src/vm/GlobalObject.cpp @@ -33,6 +33,14 @@ #include "builtin/FinalizationRegistryObject.h" #include "builtin/MapObject.h" #include "builtin/ShadowRealm.h" +#include "builtin/streams/QueueingStrategies.h" // js::{ByteLength,Count}QueueingStrategy +#include "builtin/streams/ReadableStream.h" // js::ReadableStream +#include "builtin/streams/ReadableStreamBYOBRequest.h" // js::ReadableStreamBYOBRequest +#include "builtin/streams/ReadableStreamController.h" // js::Readable{StreamDefault,ByteStream}Controller +#include "builtin/streams/ReadableStreamReader.h" // js::ReadableStreamDefaultReader +#include "builtin/streams/WritableStream.h" // js::WritableStream +#include "builtin/streams/WritableStreamDefaultController.h" // js::WritableStreamDefaultController +#include "builtin/streams/WritableStreamDefaultWriter.h" // js::WritableStreamDefaultWriter #include "builtin/Symbol.h" #ifdef JS_HAS_INTL_API # include "builtin/temporal/Duration.h" @@ -219,6 +227,21 @@ bool GlobalObject::skipDeselectedConstructor(JSContext* cx, JSProtoKey key) { return !JS::Prefs::experimental_temporal(); #endif +#ifdef MOZ_JS_STREAMS + case JSProto_ReadableStream: + case JSProto_ReadableStreamDefaultReader: + case JSProto_ReadableStreamDefaultController: + case JSProto_ByteLengthQueuingStrategy: + case JSProto_CountQueuingStrategy: + case JSProto_ReadableStreamBYOBReader: + case JSProto_ReadableStreamBYOBRequest: + case JSProto_ReadableByteStreamController: + case JSProto_WritableStream: + case JSProto_WritableStreamDefaultController: + case JSProto_WritableStreamDefaultWriter: + return !cx->realm()->creationOptions().getStreamsEnabled(); +#endif + // Return true if the given constructor has been disabled at run-time. case JSProto_Atomics: case JSProto_SharedArrayBuffer: diff --git a/js/src/vm/List-inl.h b/js/src/vm/List-inl.h index 50f7c1caf24ca..52b1969958926 100644 --- a/js/src/vm/List-inl.h +++ b/js/src/vm/List-inl.h @@ -13,12 +13,15 @@ #include // uint32_t -#include "js/Value.h" // JS::Value +#include "js/RootingAPI.h" // JS::Handle, JS::Rooted +#include "js/Value.h" // JS::Value, JS::ObjectValue #include "vm/JSContext.h" // JSContext #include "vm/NativeObject.h" // js::NativeObject +#include "vm/Compartment-inl.h" // JS::Compartment::wrap #include "vm/JSObject-inl.h" // js::NewObjectWithGivenProto #include "vm/NativeObject-inl.h" // js::NativeObject::* +#include "vm/Realm-inl.h" // js::AutoRealm inline /* static */ js::ListObject* js::ListObject::create(JSContext* cx) { return NewObjectWithGivenProto(cx, nullptr); @@ -36,6 +39,21 @@ inline bool js::ListObject::append(JSContext* cx, Value value) { return true; } +inline bool js::ListObject::appendValueAndSize(JSContext* cx, + JS::Handle value, + double size) { + uint32_t len = length(); + + if (!ensureElements(cx, len + 2)) { + return false; + } + + ensureDenseInitializedLength(len, 2); + setDenseElement(len, value); + setDenseElement(len + 1, JS::DoubleValue(size)); + return true; +} + inline JS::Value js::ListObject::popFirst(JSContext* cx) { uint32_t len = length(); MOZ_ASSERT(len > 0); @@ -51,9 +69,54 @@ inline JS::Value js::ListObject::popFirst(JSContext* cx) { return entry; } +inline void js::ListObject::popFirstPair(JSContext* cx) { + uint32_t len = length(); + MOZ_ASSERT(len > 0); + MOZ_ASSERT((len % 2) == 0); + + if (!tryShiftDenseElements(2)) { + moveDenseElements(0, 2, len - 2); + setDenseInitializedLength(len - 2); + shrinkElements(cx, len - 2); + } + + MOZ_ASSERT(length() == len - 2); +} + template inline T& js::ListObject::popFirstAs(JSContext* cx) { return popFirst(cx).toObject().as(); } +namespace js { + +[[nodiscard]] inline bool StoreNewListInFixedSlot(JSContext* cx, + JS::Handle obj, + uint32_t slot) { + AutoRealm ar(cx, obj); + ListObject* list = ListObject::create(cx); + if (!list) { + return false; + } + + obj->setFixedSlot(slot, JS::ObjectValue(*list)); + return true; +} + +[[nodiscard]] inline bool AppendToListInFixedSlot( + JSContext* cx, JS::Handle obj, uint32_t slot, + JS::Handle toAppend) { + JS::Rooted list( + cx, &obj->getFixedSlot(slot).toObject().as()); + + AutoRealm ar(cx, list); + JS::Rooted val(cx, JS::ObjectValue(*toAppend)); + if (!cx->compartment()->wrap(cx, &val)) { + return false; + } + return list->append(cx, val); +} + +} // namespace js + #endif // vm_List_inl_h diff --git a/js/src/vm/List.h b/js/src/vm/List.h index cb8699d7030c6..42c79dc406aad 100644 --- a/js/src/vm/List.h +++ b/js/src/vm/List.h @@ -51,6 +51,13 @@ class ListObject : public NativeObject { */ [[nodiscard]] inline bool append(JSContext* cx, Value value); + /** + * Adds |value| and |size| elements to a list consisting of (value, size) + * pairs stored in successive elements. + */ + [[nodiscard]] inline bool appendValueAndSize(JSContext* cx, HandleValue value, + double size); + /** * Remove and return the first element of the list. * @@ -58,6 +65,12 @@ class ListObject : public NativeObject { */ inline JS::Value popFirst(JSContext* cx); + /** + * Remove the first two elements from a nonempty list of (value, size) pairs + * of elements. + */ + inline void popFirstPair(JSContext* cx); + /** * Remove and return the first element of the list. * diff --git a/js/src/vm/NativeObject.h b/js/src/vm/NativeObject.h index d88b717bf652e..74eb0d0daa9bf 100644 --- a/js/src/vm/NativeObject.h +++ b/js/src/vm/NativeObject.h @@ -1485,6 +1485,8 @@ class NativeObject : public JSObject { inline void ensureDenseInitializedLength(uint32_t index, uint32_t extra); void setDenseElement(uint32_t index, const Value& val) { + // Note: Streams code can call this for the internal ListObject type with + // MagicValue(JS_WRITABLESTREAM_CLOSE_RECORD). MOZ_ASSERT_IF(val.isMagic(), val.whyMagic() != JS_ELEMENTS_HOLE); setDenseElementUnchecked(index, val); } diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h index d9614160b0e74..e7d9e55422e0c 100644 --- a/js/src/vm/Runtime.h +++ b/js/src/vm/Runtime.h @@ -41,6 +41,7 @@ #include "js/shadow/Zone.h" #include "js/ShadowRealmCallbacks.h" #include "js/Stack.h" +#include "js/Stream.h" // JS::AbortSignalIsAborted #include "js/StreamConsumer.h" #include "js/Symbol.h" #include "js/UniquePtr.h" @@ -591,6 +592,30 @@ struct JSRuntime { const JSClass* maybeWindowProxyClass() const { return windowProxyClass_; } void setWindowProxyClass(const JSClass* clasp) { windowProxyClass_ = clasp; } + private: + js::WriteOnceData abortSignalClass_; + js::WriteOnceData abortSignalIsAborted_; + + public: + void initPipeToHandling(const JSClass* abortSignalClass, + JS::AbortSignalIsAborted isAborted) { + MOZ_ASSERT(abortSignalClass != nullptr, + "doesn't make sense for an embedder to provide a null class " + "when specifying pipeTo handling"); + MOZ_ASSERT(isAborted != nullptr, "must pass a valid function pointer"); + + abortSignalClass_ = abortSignalClass; + abortSignalIsAborted_ = isAborted; + } + + const JSClass* maybeAbortSignalClass() const { return abortSignalClass_; } + + bool abortSignalIsAborted(JSObject* obj) { + MOZ_ASSERT(abortSignalIsAborted_ != nullptr, + "must call initPipeToHandling first"); + return abortSignalIsAborted_(obj); + } + private: // List of non-ephemeron weak containers to sweep during // beginSweepingSweepGroup. diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index 80e04d9a87f28..43986f7c556a9 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -52,6 +52,7 @@ #include "js/MemoryMetrics.h" #include "js/Object.h" // JS::GetClass #include "js/RealmIterators.h" +#include "js/Stream.h" // JS::AbortSignalIsAborted, JS::InitPipeToHandling #include "js/SliceBudget.h" #include "js/UbiNode.h" #include "js/UbiNodeUtils.h" diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 0986e53121fdb..6055579739005 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -9171,6 +9171,22 @@ mirror: always # LoadStartupJSPrefs do_not_use_directly: true +# Streams API. This only applies to JS Streams +- name: javascript.options.streams + type: RelaxedAtomicBool + value: true + mirror: always + +# Writable Streams API. (The pref above must also be set to expose this.) +# +# Writable streams are still EXTRAORDINARILY BETA and it is well-known that +# things are likely pretty broken if you poke much at all, so if you flip this +# preference, don't report bugs against it just yet. +- name: javascript.options.writable_streams + type: RelaxedAtomicBool + value: false + mirror: always + - name: javascript.options.main_thread_stack_quota_cap type: uint32_t #if defined(MOZ_ASAN) diff --git a/testing/web-platform/meta/fetch/api/abort/__dir__.ini b/testing/web-platform/meta/fetch/api/abort/__dir__.ini index b9f5886878e11..12fa96f08bfba 100644 --- a/testing/web-platform/meta/fetch/api/abort/__dir__.ini +++ b/testing/web-platform/meta/fetch/api/abort/__dir__.ini @@ -1,2 +1,3 @@ +prefs: [javascript.options.streams:true] lsan-disabled: true leak-threshold: [default:51200] diff --git a/testing/web-platform/meta/fetch/api/basic/__dir__.ini b/testing/web-platform/meta/fetch/api/basic/__dir__.ini index d1ce8a0ed7cff..ae26c15a3b955 100644 --- a/testing/web-platform/meta/fetch/api/basic/__dir__.ini +++ b/testing/web-platform/meta/fetch/api/basic/__dir__.ini @@ -1,2 +1,3 @@ +prefs: [javascript.options.streams:true] lsan-disabled: true leak-threshold: [default:3020800] diff --git a/testing/web-platform/meta/fetch/api/response/__dir__.ini b/testing/web-platform/meta/fetch/api/response/__dir__.ini index 83d49dd735bfd..23fe89a2b56d7 100644 --- a/testing/web-platform/meta/fetch/api/response/__dir__.ini +++ b/testing/web-platform/meta/fetch/api/response/__dir__.ini @@ -1 +1,2 @@ +prefs: [javascript.options.streams:true] lsan-allowed: [Alloc, NS_NewCStringInputStream, PR_NewMonitor, maybe_pod_malloc, mozilla::NonBlockingAsyncInputStream::AsyncWait, mozilla::NonBlockingAsyncInputStream::Create, mozilla::dom::BodyStream::Create, mozilla::dom::WorkerPrivate::WorkerPrivate, unknown stack] diff --git a/testing/web-platform/meta/fetch/api/response/response-stream-disturbed-by-pipe.any.js.ini b/testing/web-platform/meta/fetch/api/response/response-stream-disturbed-by-pipe.any.js.ini index 6293b735513e6..f45d073ff344b 100644 --- a/testing/web-platform/meta/fetch/api/response/response-stream-disturbed-by-pipe.any.js.ini +++ b/testing/web-platform/meta/fetch/api/response/response-stream-disturbed-by-pipe.any.js.ini @@ -1,3 +1,4 @@ +prefs: [dom.streams.transform_streams.enabled:true] [response-stream-disturbed-by-pipe.any.worker.html] [response-stream-disturbed-by-pipe.any.serviceworker.html] diff --git a/testing/web-platform/meta/html/infrastructure/safe-passing-of-structured-data/__dir__.ini b/testing/web-platform/meta/html/infrastructure/safe-passing-of-structured-data/__dir__.ini new file mode 100644 index 0000000000000..102bdfdc22a65 --- /dev/null +++ b/testing/web-platform/meta/html/infrastructure/safe-passing-of-structured-data/__dir__.ini @@ -0,0 +1 @@ +prefs: [dom.streams.transferable.enabled:true] diff --git a/testing/web-platform/meta/html/webappapis/structured-clone/__dir__.ini b/testing/web-platform/meta/html/webappapis/structured-clone/__dir__.ini new file mode 100644 index 0000000000000..102bdfdc22a65 --- /dev/null +++ b/testing/web-platform/meta/html/webappapis/structured-clone/__dir__.ini @@ -0,0 +1 @@ +prefs: [dom.streams.transferable.enabled:true] diff --git a/testing/web-platform/meta/service-workers/__dir__.ini b/testing/web-platform/meta/service-workers/__dir__.ini index 51084011f38e2..5eeb391f9f5bb 100644 --- a/testing/web-platform/meta/service-workers/__dir__.ini +++ b/testing/web-platform/meta/service-workers/__dir__.ini @@ -1,3 +1,3 @@ -prefs: [dom.serviceWorkers.mitigations.bypass_on_fault:false] +prefs: [javascript.options.streams:true, dom.serviceWorkers.mitigations.bypass_on_fault:false] lsan-allowed: [Alloc, MakeUnique, Malloc, mozilla::detail::UniqueSelector, mozilla::dom::ClientManager::CreateSourceInternal, mozilla::dom::ClientManager::GetOrCreateForCurrentThread, mozilla::dom::Performance::CreateForWorker, mozilla::dom::PerformanceStorageWorker::AddEntryOnWorker, mozilla::dom::ServiceWorkerGlobalScope::GetClients, mozilla::dom::ServiceWorkerRegistration::CreateForWorker, mozilla::dom::WorkerLocation::Create, mozilla::dom::WorkerNavigator::Create, mozilla::dom::WorkerPrivate::GetOrCreateGlobalScope, mozilla::dom::cache::CacheStorage::CreateOnWorker, nsDynamicAtom::Create] leak-threshold: [tab:51200] diff --git a/testing/web-platform/meta/streams/__dir__.ini b/testing/web-platform/meta/streams/__dir__.ini new file mode 100644 index 0000000000000..af09f6a1e38b3 --- /dev/null +++ b/testing/web-platform/meta/streams/__dir__.ini @@ -0,0 +1 @@ +prefs: [javascript.options.streams:true, dom.streams.transform_streams.enabled:true, dom.streams.pipeTo.enabled:true] diff --git a/testing/web-platform/meta/streams/transferable/__dir__.ini b/testing/web-platform/meta/streams/transferable/__dir__.ini index 4652b4d3fe7cd..df5716805835b 100644 --- a/testing/web-platform/meta/streams/transferable/__dir__.ini +++ b/testing/web-platform/meta/streams/transferable/__dir__.ini @@ -1 +1,2 @@ +prefs: [dom.streams.transferable.enabled:true] lsan-allowed: [NS_NewRunnableFunction, detail::ProxyRelease, mozilla::SupportsThreadSafeWeakPtr, mozilla::ipc::BackgroundChildImpl::AllocPRemoteWorkerChild] diff --git a/testing/web-platform/meta/workers/semantics/interface-objects/__dir__.ini b/testing/web-platform/meta/workers/semantics/interface-objects/__dir__.ini new file mode 100644 index 0000000000000..a794c9d111671 --- /dev/null +++ b/testing/web-platform/meta/workers/semantics/interface-objects/__dir__.ini @@ -0,0 +1 @@ +prefs: [javascript.options.streams:true] diff --git a/testing/web-platform/meta/workers/semantics/structured-clone/__dir__.ini b/testing/web-platform/meta/workers/semantics/structured-clone/__dir__.ini new file mode 100644 index 0000000000000..102bdfdc22a65 --- /dev/null +++ b/testing/web-platform/meta/workers/semantics/structured-clone/__dir__.ini @@ -0,0 +1 @@ +prefs: [dom.streams.transferable.enabled:true] diff --git a/testing/web-platform/meta/xhr/__dir__.ini b/testing/web-platform/meta/xhr/__dir__.ini index 6328d798b6a51..75ac31ade42c8 100644 --- a/testing/web-platform/meta/xhr/__dir__.ini +++ b/testing/web-platform/meta/xhr/__dir__.ini @@ -1,2 +1,3 @@ +prefs: [javascript.options.streams:true] lsan-allowed: [Alloc, mozilla::net::nsServerSocket::CreateClientTransport] leak-threshold: [default:51200] From e4571c20758604d2db288767254c2a34746541cb Mon Sep 17 00:00:00 2001 From: Jake Champion Date: Mon, 18 Mar 2024 17:03:26 +0000 Subject: [PATCH 02/10] Within a GitHub Workflow, build SpiderMonkey and run jstests and jit-tests --- .github/workflows/main.yml | 25 +++++++++++++++++++++++++ .github/workflows/mozconfig-debug | 8 ++++++++ .github/workflows/mozconfig-release | 8 ++++++++ 3 files changed, 41 insertions(+) create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/mozconfig-debug create mode 100644 .github/workflows/mozconfig-release diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000000..e7616d430e55f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,25 @@ +name: CI +concurrency: + group: ${{ github.head_ref }}-${{ github.workflow}} + cancel-in-progress: true +on: + pull_request: +defaults: + run: + shell: bash + +jobs: + test: + strategy: + fail-fast: false + matrix: + test: [jstests, jit-test] + mozconfig: [ debug, release ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - run: ./mach --no-interactive bootstrap --application-choice=js + - run: MOZCONFIG=.github/workflows/mozconfig-${{ matrix.mozconfig }} ./mach build + - run: MOZCONFIG=.github/workflows/mozconfig-${{ matrix.mozconfig }} ./mach ${{ matrix.test }} diff --git a/.github/workflows/mozconfig-debug b/.github/workflows/mozconfig-debug new file mode 100644 index 0000000000000..3b730a2a7ca4c --- /dev/null +++ b/.github/workflows/mozconfig-debug @@ -0,0 +1,8 @@ +ac_add_options --enable-project=js +ac_add_options --enable-application=js +ac_add_options --enable-jitspew +ac_add_options --enable-optimize=-O3 +ac_add_options --enable-js-streams +ac_add_options --disable-stdcxx-compat + +ac_add_options --enable-debug diff --git a/.github/workflows/mozconfig-release b/.github/workflows/mozconfig-release new file mode 100644 index 0000000000000..8de7ee60243cc --- /dev/null +++ b/.github/workflows/mozconfig-release @@ -0,0 +1,8 @@ +ac_add_options --enable-project=js +ac_add_options --enable-application=js +ac_add_options --enable-jitspew +ac_add_options --enable-optimize=-O3 +ac_add_options --enable-js-streams +ac_add_options --disable-stdcxx-compat + +ac_add_options --disable-debug From 737de343a9be1e6318b9bb1ef6c4e937d8216ba8 Mon Sep 17 00:00:00 2001 From: Till Schneidereit Date: Mon, 26 Jul 2021 11:28:40 +0200 Subject: [PATCH 03/10] JSAPI support for resetting the seed for Math.random() In long-running environments, it's desirable for the embedding to reset the random seed at controlled points in time. In particular, when running in WASI, a situation can occur where a VM snapshot is taken at build time using [Wizer](https://github.com/bytecodealliance/wizer), which is then loaded and used as the basis for running separate workloads many times over. If `Math.random()` was called during the initialization phase, this would cause all workloads to get the same results for all consecutive calls to `Math.random()`. --- js/src/jsfriendapi.h | 10 ++++++++++ js/src/jsmath.cpp | 6 ++++++ js/src/vm/JSContext.cpp | 5 +++++ js/src/vm/Realm.h | 4 ++++ 4 files changed, 25 insertions(+) diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index ae31440a08778..f4ccd258338de 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -226,6 +226,16 @@ extern JS_PUBLIC_API void RestartDrainingJobQueue(JSContext* cx); extern JS_PUBLIC_API void RunJobs(JSContext* cx); +extern JS_PUBLIC_API bool HasJobsPending(JSContext* cx); + +/** + * Reset the seed for Math.random(). + * + * Enables embedders to reset the seed at controlled points, e.g. after + * resuming execution from an instance snapshot of SpiderMonkey's VM. + */ +extern JS_PUBLIC_API void ResetMathRandomSeed(JSContext* cx); + extern JS_PUBLIC_API JS::Zone* GetRealmZone(JS::Realm* realm); using PreserveWrapperCallback = bool (*)(JSContext*, JS::HandleObject); diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp index 70aa4dbab83c0..25ff66b9fef90 100644 --- a/js/src/jsmath.cpp +++ b/js/src/jsmath.cpp @@ -566,6 +566,12 @@ Realm::getOrCreateRandomNumberGenerator() { return randomNumberGenerator_.ref(); } +void Realm::resetRandomNumberGenerator() { + if (randomNumberGenerator_.isSome()) { + randomNumberGenerator_.reset(); + } +} + double js::math_random_impl(JSContext* cx) { return cx->realm()->getOrCreateRandomNumberGenerator().nextDouble(); } diff --git a/js/src/vm/JSContext.cpp b/js/src/vm/JSContext.cpp index 4f64086696b00..08ffc9a02e320 100644 --- a/js/src/vm/JSContext.cpp +++ b/js/src/vm/JSContext.cpp @@ -859,6 +859,11 @@ bool InternalJobQueue::getHostDefinedData( return true; } +JS_PUBLIC_API void js::ResetMathRandomSeed(JSContext* cx) { + MOZ_ASSERT(cx->realm()); + cx->realm()->resetRandomNumberGenerator(); +} + bool InternalJobQueue::enqueuePromiseJob(JSContext* cx, JS::HandleObject promise, JS::HandleObject job, diff --git a/js/src/vm/Realm.h b/js/src/vm/Realm.h index d4229a952ffa0..342be128f26d3 100644 --- a/js/src/vm/Realm.h +++ b/js/src/vm/Realm.h @@ -828,6 +828,10 @@ class JS::Realm : public JS::shadow::Realm { // Initializes randomNumberGenerator if needed. mozilla::non_crypto::XorShift128PlusRNG& getOrCreateRandomNumberGenerator(); + // Resets randomNumberGenerator to null, so it'll be reinitialized on next + // use. + void resetRandomNumberGenerator(); + const mozilla::non_crypto::XorShift128PlusRNG* addressOfRandomNumberGenerator() const { return randomNumberGenerator_.ptr(); From 51f29d2cfcf61cb03760aca90116c4585dac23e0 Mon Sep 17 00:00:00 2001 From: Till Schneidereit Date: Sun, 21 Feb 2021 12:08:19 +0100 Subject: [PATCH 04/10] Add JS::HasJobsPending as a way to query the status of the internal Jobs queue --- js/src/vm/JSContext.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/src/vm/JSContext.cpp b/js/src/vm/JSContext.cpp index 08ffc9a02e320..9e8eadd801043 100644 --- a/js/src/vm/JSContext.cpp +++ b/js/src/vm/JSContext.cpp @@ -841,6 +841,11 @@ JS_PUBLIC_API void js::RestartDrainingJobQueue(JSContext* cx) { cx->internalJobQueue->uninterrupt(); } +JS_PUBLIC_API bool js::HasJobsPending(JSContext* cx) { + MOZ_ASSERT(cx->jobQueue); + return !cx->jobQueue->empty(); +} + JS_PUBLIC_API void js::RunJobs(JSContext* cx) { MOZ_ASSERT(cx->jobQueue); MOZ_ASSERT(cx->isEvaluatingModule == 0); From 6a87a98c8aadc7b960dfd9e3753adaf316a96dcd Mon Sep 17 00:00:00 2001 From: Jake Champion Date: Mon, 8 Apr 2024 17:42:49 +0100 Subject: [PATCH 05/10] remove the close-pr workflow --- .github/workflows/close-pr.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/workflows/close-pr.yml diff --git a/.github/workflows/close-pr.yml b/.github/workflows/close-pr.yml deleted file mode 100644 index 85b6eb8b1dec0..0000000000000 --- a/.github/workflows/close-pr.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Close Pull Request -on: - pull_request_target: - types: [opened, reopened] - -jobs: - close-pr: - runs-on: ubuntu-latest - steps: - - name: Close PR - env: - GH_TOKEN: ${{ github.token }} - GH_REPO: ${{ github.repository }} - PR: ${{ github.event.pull_request.number }} - run: | - gh pr close ${{ env.PR }} --comment "(Automated Close) Please do not file pull requests here, see https://firefox-source-docs.mozilla.org/contributing/how_to_submit_a_patch.html" - gh pr lock ${{ env.PR }} From 1e77c0d2599e85337879c5148bcd9172b2177563 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Tue, 22 Aug 2023 10:55:18 -0700 Subject: [PATCH 06/10] JS shell on WASI: add basic Wizer integration for standalone testing. This patch allows the use of a JS shell binary, compiled to `wasm32-wasi` (WASI ABI on WebAssembly), to make use of the Wizer snapshotting tool to embed JavaScript source with SpiderMonkey to run in a standalone Wasm module. If enabled with `--enable-js-shell-wizer`, the shell no longer provides an interactive REPL; instead, when invoked during the "initialization" phase of Wizer, it reads JS source on standard input, then saves JS state (the global, the context, etc) for later. When the execution is snapshotted and the snapshot is later executed as an ordinary WASI command, the resume entry-point invokes a JS function named `main` in the global scope, if any. An example of how to use this follows: ``` $ echo "function main() { print('hello world'); }" | \ wizer --allow-wasi -r _start=wizer.resume obj-release/dist/bin/js \ -o snapshotted.wasm $ wasmtime snapshotted.wasm hello world $ ``` Note that embedders of SpiderMonkey on Wasm can and do add their own Wizer integration; the purpose of this PR is to add a standalone mode that does not require building SpiderMonkey within another context in order to evaluate features (such as AOT compilation) that require snapshotting as a prerequisite. Followup PRs will include test results derived with this simple Wizer integration. --- js/moz.configure | 16 +++ js/src/shell/js.cpp | 81 +++++++++----- js/src/shell/jsshell.h | 15 +++ js/src/shell/moz.build | 2 + js/src/shell/wizer.cpp | 59 ++++++++++ third_party/wizer/LICENSE | 220 ++++++++++++++++++++++++++++++++++++++ third_party/wizer/wizer.h | 128 ++++++++++++++++++++++ 7 files changed, 496 insertions(+), 25 deletions(-) create mode 100644 js/src/shell/wizer.cpp create mode 100644 third_party/wizer/LICENSE create mode 100644 third_party/wizer/wizer.h diff --git a/js/moz.configure b/js/moz.configure index a363235983aba..1c92f37e74f6b 100644 --- a/js/moz.configure +++ b/js/moz.configure @@ -57,6 +57,22 @@ def js_disable_shell(value): set_config("JS_DISABLE_SHELL", js_disable_shell) +option( + "--enable-js-shell-wizer", + default=False, + when=js_standalone, + help="{Support|Do not support} wizening of the JS shell", +) + + +@depends("--enable-js-shell-wizer", when=js_standalone) +def js_shell_wizer(value): + if value: + return True + + +set_define("JS_SHELL_WIZER", js_shell_wizer) + set_define("JS_64BIT", depends(target)(lambda t: t.bitness == 64 or None)) set_define("JS_PUNBOX64", depends(target)(lambda t: t.bitness == 64 or None)) diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index bcaba8febee8f..b4193feef5f3b 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -44,6 +44,7 @@ #endif #include #include +#include #ifndef __wasi__ # include #endif @@ -12361,7 +12362,8 @@ ShellContext::~ShellContext() { MOZ_ASSERT(offThreadJobs.empty()); } -static int Shell(JSContext* cx, OptionParser* op) { +static int Shell(JSContext* cx, OptionParser* op, + MutableHandleObject lastGlobal) { #ifdef JS_STRUCTURED_SPEW cx->spewer().enableSpewing(); #endif @@ -12413,6 +12415,7 @@ static int Shell(JSContext* cx, OptionParser* op) { if (!glob) { return 1; } + lastGlobal.set(glob.get()); JSAutoRealm ar(cx, glob); @@ -12660,7 +12663,13 @@ static bool SetGCParameterFromArg(JSContext* cx, char* arg) { return true; } -int main(int argc, char** argv) { +// Special-case stdout and stderr. We bump their refcounts to prevent them +// from getting closed and then having some printf fail somewhere. +RCFile rcStdout(stdout); +RCFile rcStderr(stderr); + +Variant js::shell::ShellMain(int argc, char** argv, + bool retainContext) { PreInit(); sArgc = argc; @@ -12670,13 +12679,8 @@ int main(int argc, char** argv) { setlocale(LC_ALL, ""); - // Special-case stdout and stderr. We bump their refcounts to prevent them - // from getting closed and then having some printf fail somewhere. - RCFile rcStdout(stdout); rcStdout.acquire(); - RCFile rcStderr(stderr); rcStderr.acquire(); - SetOutputFile("JS_STDOUT", &rcStdout, &gOutFile); SetOutputFile("JS_STDERR", &rcStderr, &gErrFile); @@ -12688,27 +12692,27 @@ int main(int argc, char** argv) { OptionParser op("Usage: {progname} [options] [[script] scriptArgs*]"); if (!InitOptionParser(op)) { - return EXIT_FAILURE; + return AsVariant(EXIT_FAILURE); } switch (op.parseArgs(argc, argv)) { case OptionParser::EarlyExit: - return EXIT_SUCCESS; + return AsVariant(EXIT_SUCCESS); case OptionParser::ParseError: op.printHelp(argv[0]); - return EXIT_FAILURE; + return AsVariant(EXIT_FAILURE); case OptionParser::Fail: - return EXIT_FAILURE; + return AsVariant(EXIT_FAILURE); case OptionParser::Okay: break; } if (op.getHelpOption()) { - return EXIT_SUCCESS; + return AsVariant(EXIT_SUCCESS); } if (!SetGlobalOptionsPreJSInit(op)) { - return EXIT_FAILURE; + return AsVariant(EXIT_FAILURE); } if (!JS::SetLoggingInterface(shellLoggingInterface)) { @@ -12719,7 +12723,7 @@ int main(int argc, char** argv) { // Start the engine. if (const char* message = JS_InitWithFailureDiagnostic()) { fprintf(gErrFile->fp, "JS_Init failed: %s\n", message); - return 1; + return AsVariant(1); } // `selfHostedXDRBuffer` contains XDR buffer of the self-hosted JS. @@ -12731,11 +12735,11 @@ int main(int argc, char** argv) { auto shutdownEngine = MakeScopeExit([] { JS_ShutDown(); }); if (!SetGlobalOptionsPostJSInit(op)) { - return EXIT_FAILURE; + return AsVariant(EXIT_FAILURE); } if (!InitSharedObjectMailbox()) { - return EXIT_FAILURE; + return AsVariant(EXIT_FAILURE); } JS::SetProcessBuildIdOp(ShellBuildId); @@ -12743,7 +12747,7 @@ int main(int argc, char** argv) { /* Use the same parameters as the browser in xpcjsruntime.cpp. */ JSContext* const cx = JS_NewContext(JS::DefaultHeapMaxBytes); if (!cx) { - return 1; + return AsVariant(1); } // Register telemetry callbacks. @@ -12755,11 +12759,11 @@ int main(int argc, char** argv) { UniquePtr sc = MakeUnique(cx, ShellContext::MainThread); if (!sc || !sc->registerWithCx(cx)) { - return 1; + return AsVariant(1); } if (!SetContextOptions(cx, op)) { - return 1; + return AsVariant(1); } JS_SetTrustedPrincipals(cx, &ShellPrincipals::fullyTrusted); @@ -12772,7 +12776,7 @@ int main(int argc, char** argv) { bufferStreamState = js_new>( mutexid::BufferStreamState); if (!bufferStreamState) { - return 1; + return AsVariant(1); } auto shutdownBufferStreams = MakeScopeExit([] { ShutdownBufferStreams(); @@ -12814,7 +12818,7 @@ int main(int argc, char** argv) { } if (!JS::InitSelfHostedCode(cx, xdrSpan, xdrWriter)) { - return 1; + return AsVariant(1); } EnvironmentPreparer environmentPreparer(cx); @@ -12828,13 +12832,14 @@ int main(int argc, char** argv) { if (!WasmCompileAndSerialize(cx)) { // Errors have been printed directly to stderr. MOZ_ASSERT(!cx->isExceptionPending()); - return EXIT_FAILURE; + return AsVariant(EXIT_FAILURE); } #endif - return EXIT_SUCCESS; + return AsVariant(EXIT_SUCCESS); } - result = Shell(cx, &op); + RootedObject lastGlobal(cx); + result = Shell(cx, &op, &lastGlobal); #ifdef DEBUG if (OOM_printAllocationCount) { @@ -12842,9 +12847,29 @@ int main(int argc, char** argv) { } #endif - return result; + if (retainContext) { + shutdownEngine.release(); + destroyCx.release(); + shutdownBufferStreams.release(); + shutdownShellThreads.release(); + + JSAndShellContext ret{cx, lastGlobal.get(), std::move(sc), + std::move(selfHostedXDRBuffer)}; + return AsVariant(std::move(ret)); + } else { + return AsVariant(result); + } } +// N.B.: When Wizer support is enabled, a separate main() is used. +#ifndef JS_SHELL_WIZER + +int main(int argc, char** argv) { + return ShellMain(argc, argv, /* returnContext = */ false).as(); +} + +#endif // !JS_SHELL_WIZER + bool InitOptionParser(OptionParser& op) { op.setDescription( "The SpiderMonkey shell provides a command line interface to the " @@ -13620,6 +13645,12 @@ bool SetGlobalOptionsPostJSInit(const OptionParser& op) { JS::DelazificationOption::ParseEverythingEagerly; } + // Likewise, if we have Wizer support built into the shell, we + // unconditionally parse everything eagerly. +#ifdef JS_SHELL_WIZER + defaultDelazificationMode = JS::DelazificationOption::ParseEverythingEagerly; +#endif + if (const char* xdr = op.getStringOption("selfhosted-xdr-path")) { shell::selfHostedXDRPath = xdr; } diff --git a/js/src/shell/jsshell.h b/js/src/shell/jsshell.h index 85174e25a9d12..35e04fae1a8dc 100644 --- a/js/src/shell/jsshell.h +++ b/js/src/shell/jsshell.h @@ -19,6 +19,7 @@ #include "threading/LockGuard.h" #include "threading/Mutex.h" #include "threading/Thread.h" +#include "util/CompleteFile.h" // js::FileContents #include "vm/GeckoProfiler.h" #include "vm/Monitor.h" @@ -259,11 +260,25 @@ struct ShellContext { JS::PersistentRooted taskCallbacks; }; +// A JSContext, the associated global object, the ShellContext, and +// other miscellaneous bits that need to live as long as the +// shell. This is used to wrap up the shell state when it needs to be +// persisted (e.g., in a Wizer snapshot). +struct JSAndShellContext { + JSContext* cx; + JSObject* glob; + UniquePtr shellCx; + mozilla::Maybe selfHostedXDRBuffer; +}; + extern ShellContext* GetShellContext(JSContext* cx); [[nodiscard]] extern bool PrintStackTrace(JSContext* cx, JS::Handle stackObj); +mozilla::Variant ShellMain(int argc, char** argv, + bool retainContext); + } /* namespace shell */ } /* namespace js */ diff --git a/js/src/shell/moz.build b/js/src/shell/moz.build index d7fa408fc38f5..e8ca9e67a1e2d 100644 --- a/js/src/shell/moz.build +++ b/js/src/shell/moz.build @@ -22,6 +22,7 @@ UNIFIED_SOURCES += [ "OSObject.cpp", "ShellModuleObjectWrapper.cpp", "WasmTesting.cpp", + "wizer.cpp", ] if CONFIG["FUZZING_INTERFACES"]: @@ -39,6 +40,7 @@ DEFINES["EXPORT_JS_API"] = True LOCAL_INCLUDES += [ "!..", "..", + "/third_party/wizer", ] OS_LIBS += CONFIG["EDITLINE_LIBS"] diff --git a/js/src/shell/wizer.cpp b/js/src/shell/wizer.cpp new file mode 100644 index 0000000000000..3e0a3fa91a11e --- /dev/null +++ b/js/src/shell/wizer.cpp @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +/* Support for Wizer-based snapshotting of the JS shell, when built + * for a Wasm target (i.e., running inside a Wasm module). */ + +#include "js/CallAndConstruct.h" // JS_CallFunctionName +#include "shell/jsshell.h" + +using namespace js; +using namespace js::shell; + +#ifdef JS_SHELL_WIZER + +# include + +static std::optional wizenedContext; + +static void WizerInit() { + const int argc = 1; + char* argv[2] = {strdup("js"), NULL}; + + auto ret = ShellMain(argc, argv, /* retainContext = */ true); + if (!ret.is()) { + fprintf(stderr, "Could not execute shell main during Wizening!\n"); + abort(); + } + + wizenedContext = std::move(ret.as()); +} + +WIZER_INIT(WizerInit); + +int main(int argc, char** argv) { + (void)argc; + (void)argv; + + if (wizenedContext) { + JSContext* cx = wizenedContext.value().cx; + RootedObject glob(cx, wizenedContext.value().glob); + + JSAutoRealm ar(cx, glob); + + // Look up a function called "main" in the global. + JS::Rooted ret(cx); + if (!JS_CallFunctionName(cx, cx->global(), "main", + JS::HandleValueArray::empty(), &ret)) { + fprintf(stderr, "Failed to call main() in Wizened JS source!\n"); + abort(); + } + } else { + return ShellMain(argc, argv, /* returnContext = */ false).as(); + } +} + +#endif // JS_SHELL_WIZER diff --git a/third_party/wizer/LICENSE b/third_party/wizer/LICENSE new file mode 100644 index 0000000000000..f9d81955f4bcb --- /dev/null +++ b/third_party/wizer/LICENSE @@ -0,0 +1,220 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +--- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + diff --git a/third_party/wizer/wizer.h b/third_party/wizer/wizer.h new file mode 100644 index 0000000000000..e374a5c96062c --- /dev/null +++ b/third_party/wizer/wizer.h @@ -0,0 +1,128 @@ +/* + * Wizer interface for Wasm module to be initialized. + * + * This header provides several macros that allow a Wasm module written in C/C++ + * to declare an initializer function, and ensure that global constructors (in + * C++'s case) are run at initialization time rather than on startup of the + * pre-initialized module. + */ +#ifndef _WIZER_H_ +#define _WIZER_H_ + +#ifdef __cplusplus +#define __WIZER_EXTERN_C extern "C" +#else +#define __WIZER_EXTERN_C extern +#endif + +#ifdef __clang_major__ +// wasi-sdk-16 was the first wasi-sdk version that shipped with a version of +// wasi-libc that did not include __original_main. However, wasi-sdk-15 shipped +// with clang-14.0.0. To correctly identify the boundary where __original_main +// no longer exists, we check for either clang-15+ or specifically clang-14.0.4. +// +// wasi-sdk-17 ships with clang-15.0.6 +// wasi-sdk-16 ships with clang-14.0.4 +#if __clang_major__ >= 15 || (__clang_major__ == 14 && __clang_patchlevel__ == 4) +#define WIZER_MAIN_VOID __main_void +#else +#define WIZER_MAIN_VOID __original_main +#endif +#endif + +// We default to assuming that the compiler is new enough to provide +// __main_void. +#ifndef WIZER_MAIN_VOID +#define WIZER_MAIN_VOID __main_void +#endif + +/* + * This macro inserts the exported functions necessary to allow Wizer to + * pre-initialize a Wasm module. + * + * To use, simply invoke the macro in exactly one compilation unit (C/C++ file) + * that is compiled into the Wasm module to be pre-initialized: + * + * static void my_init_function() { ... } + * + * WIZER_INIT(my_init_function); + * + * (The macro refers to the provided init function, so it must have been defined + * or must have a forward declaration at the point the macro is used.) + * + * The resulting module should be processed by Wizer as follows: + * + * $ wizer -r _start=wizer.resume -o out.wasm in.wasm + * + * The result of this will be the following behavior: + * + * - If the `in.wasm` (the direct compilation output of a program including this + * macro invocation) is run directly according to the WASI ABI (i.e., by + * invoking `_start`), then nothing changes: global constructors are run, + * `main()` is invoked, then global destructors are run. The initialization + * function is *not* run in this case. + * + * - During pre-initialization (i.e., during this `wizer` invocation), global + * constructors will run, and then the provided initialization function will + * run. The module's memory and global-variable state is then snapshotted and + * saved into `out.wasm`. + * + * All other Wizer restrictions apply (see Wizer documentation for details): + * for example, WASI hostcalls may be blocked, depending on options, and + * invoking any other imported function will result in an immediate trap + * and failure of the Wizer run. + * + * - If the resulting `out.wasm` is then run using the WASI ABI, the program's + * global constructors are *not* re-run. Instead, execution starts directly at + * `main()`, using the heap and global-variable state left by the global + * constructor and initialization function execution during the Wizer + * invocation. + * + * If no initialization function is needed (i.e., only C++ global constructors + * should be run), use `WIZER_DEFAULT_INIT()` instead. + */ +#define WIZER_INIT(init_func) \ + __WIZER_EXTERN_C void __wasm_call_ctors(); \ + __WIZER_EXTERN_C void __wasm_call_dtors(); \ + __WIZER_EXTERN_C int WIZER_MAIN_VOID(); \ + /* This function's export name `wizer.initialize` is specially */ \ + /* recognized by Wizer. It is the direct entry point for pre-init. */ \ + __attribute__((export_name("wizer.initialize"))) void \ + __wizer_initialize() { \ + /* `__wasm_call_ctors()` is generated by `wasm-ld` and invokes all */ \ + /* of the global constructors. It is safe (and in fact necessary) */ \ + /* to manually invoke it here because `wizer.initialize` is the */ \ + /* direct entry point, and no libc startup (crt1.o or equivalent) */ \ + /* is executed before this code does. */ \ + __wasm_call_ctors(); \ + /* We now invoke the provided init function before returning. */ \ + init_func(); \ + } \ + /* This function replaces `_start` (the WASI-specified entry point) in */ \ + /* the pre-initialized Wasm module. */ \ + __attribute__((export_name("wizer.resume"))) void __wizer_resume() { \ + /* `__main_void()` is defined by the WASI SDK toolchain due to */ \ + /* special semantics in C/C++ for the `main()` function, i.e., ito */ \ + /* can either take argc/argv or not. It collects arguments using */ \ + /* the appropriate WASI calls and then invokes the user program's */ \ + /* `main()`. This may change in the future; when it does, we will */ \ + /* coordinate with the WASI-SDK toolchain to implement this entry */ \ + /* point in an alternate way. */ \ + WIZER_MAIN_VOID(); \ + /* Because we are replacing `_start()`, we need to manually invoke */ \ + /* destructors as well. */ \ + __wasm_call_dtors(); \ + } + +/* + * This macro is like `WIZER_INIT()`, but takes no initialization function. + * Instead, the pre-initialization phase only executes C++ global constructors + * before snapshotting the module state. + * + * See documentation for `WIZER_INIT()` for more details and usage instructions. + */ +#define WIZER_DEFAULT_INIT() \ + static void __empty_init() {} \ + WIZER_INIT(__empty_init) + +#endif // _WIZER_H_ From 27c3537e91cf1c5c37dbd5e60e9f603da7cefea5 Mon Sep 17 00:00:00 2001 From: Till Schneidereit Date: Wed, 30 Jul 2025 13:37:00 +0200 Subject: [PATCH 07/10] Bugfix in handling abort requests in WritableStream Not sure why this didn't bite us before, but it does now. --- js/src/builtin/streams/WritableStreamOperations.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/builtin/streams/WritableStreamOperations.cpp b/js/src/builtin/streams/WritableStreamOperations.cpp index fce029fde49fd..6789cbbc71df7 100644 --- a/js/src/builtin/streams/WritableStreamOperations.cpp +++ b/js/src/builtin/streams/WritableStreamOperations.cpp @@ -420,7 +420,7 @@ static bool AbortRequestPromiseFulfilledHandler(JSContext* cx, unsigned argc, } args.rval().setUndefined(); - return false; + return true; } /** @@ -451,7 +451,7 @@ static bool AbortRequestPromiseRejectedHandler(JSContext* cx, unsigned argc, } args.rval().setUndefined(); - return false; + return true; } /** From 18566eacce391c84f2cb8702769dc52e19e137be Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Thu, 19 Feb 2026 10:40:59 +0100 Subject: [PATCH 08/10] PBL: add weval annotations --- js/moz.configure | 15 + js/src/gc/GC.cpp | 10 + js/src/ics/README.md | 66 ++ js/src/ics/remove-platform-dependent-ics.py | 15 + js/src/jit-test/tests/gc/bug-1791975.js | 7 + js/src/jit-test/tests/strings/concat.js | 15 + js/src/jit/BaselineCacheIRCompiler.cpp | 13 + js/src/jit/CacheIR.cpp | 4 + js/src/jit/CacheIRCompiler.cpp | 24 + js/src/jit/CacheIRCompiler.h | 25 +- js/src/jit/CacheIRSpewer.cpp | 2 + js/src/jit/CacheIRWriter.h | 3 + js/src/jit/CompactBuffer.h | 8 +- js/src/jit/moz.build | 5 + js/src/moz.build | 5 + js/src/shell/js.cpp | 2 +- js/src/vm/JSScript.cpp | 11 + js/src/vm/JSScript.h | 20 + js/src/vm/PortableBaselineInterpret-defs.h | 85 +++ .../vm/PortableBaselineInterpret-weval-defs.h | 142 ++++ js/src/vm/PortableBaselineInterpret.cpp | 658 ++++++++++++------ js/src/vm/PortableBaselineInterpret.h | 18 +- js/src/vm/Weval.h | 35 + third_party/weval/LICENSE | 220 ++++++ third_party/weval/weval.h | 489 +++++++++++++ 25 files changed, 1650 insertions(+), 247 deletions(-) create mode 100644 js/src/ics/README.md create mode 100755 js/src/ics/remove-platform-dependent-ics.py create mode 100644 js/src/jit-test/tests/strings/concat.js create mode 100644 js/src/vm/PortableBaselineInterpret-defs.h create mode 100644 js/src/vm/PortableBaselineInterpret-weval-defs.h create mode 100644 js/src/vm/Weval.h create mode 100644 third_party/weval/LICENSE create mode 100644 third_party/weval/weval.h diff --git a/js/moz.configure b/js/moz.configure index 1c92f37e74f6b..e6944cda3fb9a 100644 --- a/js/moz.configure +++ b/js/moz.configure @@ -200,6 +200,21 @@ set_config( depends_if("--enable-portable-baseline-interp-force")(lambda _: True), ) +# weval support (ahead-of-time interpreter compilation in Wasm) for PBL. +option( + "--enable-pbl-weval", + default=False, + help="{Support|Do not support} wevaling the PBL interpreter", +) + +@depends("--enable-portable-baseline-interp", "--enable-pbl-weval") +def js_pbl_weval(pbl, weval): + if pbl and weval: + return True + +set_define("ENABLE_JS_PBL_WEVAL", js_pbl_weval) +set_config("ENABLE_JS_PBL_WEVAL", js_pbl_weval) + # Enable ahead-of-time-known preloaded IC bodies. option( "--enable-aot-ics", diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp index 4948db68d3bd7..3749e07c31e45 100644 --- a/js/src/gc/GC.cpp +++ b/js/src/gc/GC.cpp @@ -5261,6 +5261,16 @@ Realm* js::NewRealm(JSContext* cx, JSPrincipals* principals, zone->compartments().infallibleAppend(compHolder.release()); } +#ifdef ENABLE_JS_AOT_ICS + if (zone) { + // This is where the AOT IC corpus is loaded. If we do not eagerly force + // this, it may not be created when initializing then snapshotting the + // engine, because its creation is only otherwise triggered lazily by + // execution. + zone->ensureJitZoneExists(cx); + } +#endif + if (zoneHolder) { rt->gc.zones().infallibleAppend(zoneHolder.release()); diff --git a/js/src/ics/README.md b/js/src/ics/README.md new file mode 100644 index 0000000000000..ca47af477da3d --- /dev/null +++ b/js/src/ics/README.md @@ -0,0 +1,66 @@ +# IC corpus + +This directory is available to include a pre-collected IC corpus which will be +used if `--enable-aot-ics` is configured. + +## (Re-)collecting a corpus + +The corpus is not checked into upstream because it would change too frequently. +To build a corpus, perform the following steps: + +1. Build a PBL-only native SpiderMonkey shell with the following configuration: + +```plain +# file mozconfig.pbl.native.release.ics +ac_add_options --enable-project=js +ac_add_options --enable-application=js +ac_add_options --enable-optimize=-O3 +ac_add_options --enable-portable-baseline-interp +ac_add_options --enable-portable-baseline-interp-force +ac_add_options --enable-aot-ics +ac_add_options --enable-aot-ics-force +ac_add_options --enable-aot-ics-enforce +ac_add_options --prefix=obj-release/dist +mk_add_options MOZ_OBJDIR=obj-release-ics +``` + +```shell +MOZCONFIG=mozconfig.pbl.native.release.ics ./mach build +``` + +2. Run the jit-tests with this shell, collecting IC files: + +```shell +AOT_ICS_KEEP_GOING=1 js/src/jit-test/jit_test.py -f obj-release-ics/dist/bin/js +``` + +3. Remove the existing corpus and move these files into the directory (use + `find` to avoid "command line too long" errors): + +```shell +find js/src/ics/ -name 'IC-*' -exec rm {} \; +find . -maxdepth 1 -name 'IC-*' -exec mv {} js/src/ics/ \; +``` + +4. Remove duplicates and remove ICs that depend on platform-dependent CacheIR + opcodes (e.g. those that are disabled on 32-bit targets): + +```shell +cd js/src/ics/ +./remove-duplicates.py +./remove-platform-dependent-ics.py +``` + +5. Build a new PBL-based SpiderMonkey with AOT ICs: + +```plain +# file mozconfig.pbl.native.release +ac_add_options --enable-project=js +ac_add_options --enable-application=js +ac_add_options --enable-optimize=-O3 +ac_add_options --enable-portable-baseline-interp +ac_add_options --enable-portable-baseline-interp-force +ac_add_options --enable-aot-ics +ac_add_options --prefix=obj-release/dist +mk_add_options MOZ_OBJDIR=obj-release +``` diff --git a/js/src/ics/remove-platform-dependent-ics.py b/js/src/ics/remove-platform-dependent-ics.py new file mode 100755 index 0000000000000..0669c72fd2a1f --- /dev/null +++ b/js/src/ics/remove-platform-dependent-ics.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +# This Source Code Form is subject to the terms of the Mozilla Public +# 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/. + +import glob +import os + +for file in glob.glob("IC-*"): + with open(file, "rb") as f: + content = f.read() + if b'CallScriptedProxy' in content: + print("Removing: %s" % file) + os.unlink(file) diff --git a/js/src/jit-test/tests/gc/bug-1791975.js b/js/src/jit-test/tests/gc/bug-1791975.js index f56f723db766d..50cd4a56cd16f 100644 --- a/js/src/jit-test/tests/gc/bug-1791975.js +++ b/js/src/jit-test/tests/gc/bug-1791975.js @@ -1,3 +1,10 @@ +// |jit-test| skip-if: !('oomAtAllocation' in this) || getBuildConfiguration('pbl') +// +// We skip this test under PBL-debug builds because it seems to have a +// nondeterministic OOM failure that we can't reproduce locally. Other tests +// provide coverage of OOM handling generally so we don't lose too much +// (hopefully!) by skipping this one. + gczeal(10, 10); try { throw 0; diff --git a/js/src/jit-test/tests/strings/concat.js b/js/src/jit-test/tests/strings/concat.js new file mode 100644 index 0000000000000..cfc7bc5db63e2 --- /dev/null +++ b/js/src/jit-test/tests/strings/concat.js @@ -0,0 +1,15 @@ + +function do_concat(val) { + for (let i = 0; i < 100; i++) { + val += "X"; + } + + return val; +} + +function test() { + for (let i = 0; i < 100; i++) { + let result = do_concat("X"); + } +} +test(); diff --git a/js/src/jit/BaselineCacheIRCompiler.cpp b/js/src/jit/BaselineCacheIRCompiler.cpp index 16b53e572d231..1370374422f90 100644 --- a/js/src/jit/BaselineCacheIRCompiler.cpp +++ b/js/src/jit/BaselineCacheIRCompiler.cpp @@ -29,6 +29,7 @@ #include "util/Unicode.h" #include "vm/PortableBaselineInterpret.h" #include "vm/StaticStrings.h" +#include "vm/Weval.h" #include "jit/JitScript-inl.h" #include "jit/MacroAssembler-inl.h" @@ -2142,6 +2143,11 @@ static bool LookupOrCompileStub(JSContext* cx, CacheKind kind, /* stubCode = */ nullptr)) { return false; } + +#ifdef ENABLE_JS_PBL_WEVAL + // Register for weval specialization, if enabled. + js::pbl::EnqueueICStubSpecialization(stubInfo); +#endif } MOZ_ASSERT_IF(IsBaselineInterpreterEnabled(), code); MOZ_ASSERT(stubInfo); @@ -2314,7 +2320,14 @@ ICAttachResult js::jit::AttachBaselineCacheIRStub( newStub->setTypeData(writer.typeData()); #ifdef ENABLE_PORTABLE_BASELINE_INTERP +# ifdef ENABLE_JS_PBL_WEVAL + newStub->updateRawJitCode( + (stubInfo->hasWeval() && stubInfo->weval().func) + ? reinterpret_cast(stubInfo->weval().func) + : pbl::GetICInterpreter()); +# else newStub->updateRawJitCode(pbl::GetICInterpreter()); +#endif #endif stub->addNewStub(icEntry, newStub); diff --git a/js/src/jit/CacheIR.cpp b/js/src/jit/CacheIR.cpp index c0f7cac6ae367..0b81276753995 100644 --- a/js/src/jit/CacheIR.cpp +++ b/js/src/jit/CacheIR.cpp @@ -15998,12 +15998,16 @@ AttachDecision BinaryArithIRGenerator::tryAttachStringConcat() { return AttachDecision::NoAction; } +#ifdef ENABLE_PORTABLE_BASELINE_INTERP + JitCode* code = nullptr; +#else JitCode* code = cx_->zone()->jitZone()->ensureStubExists( cx_, JitZone::StubKind::StringConcat); if (!code) { cx_->recoverFromOutOfMemory(); return AttachDecision::NoAction; } +#endif ValOperandId lhsId(writer.setInputOperandId(0)); ValOperandId rhsId(writer.setInputOperandId(1)); diff --git a/js/src/jit/CacheIRCompiler.cpp b/js/src/jit/CacheIRCompiler.cpp index c5754dc3927f6..cf614e4998324 100644 --- a/js/src/jit/CacheIRCompiler.cpp +++ b/js/src/jit/CacheIRCompiler.cpp @@ -49,6 +49,7 @@ #include "vm/TypedArrayObject.h" #include "vm/TypeofEqOperand.h" // TypeofEqOperand #include "vm/Uint8Clamped.h" +#include "vm/Weval.h" #include "builtin/Boolean-inl.h" #include "jit/MacroAssembler-inl.h" @@ -1032,6 +1033,20 @@ void CacheRegisterAllocator::restoreInputState(MacroAssembler& masm, } } +CacheIRStubInfo::CacheIRStubInfo(CacheKind kind, ICStubEngine engine, + bool makesGCCalls, uint32_t stubDataOffset, + uint32_t codeLength) + : codeLength_(codeLength), + kind_(kind), + engine_(engine), + stubDataOffset_(stubDataOffset), + makesGCCalls_(makesGCCalls) { + MOZ_ASSERT(kind_ == kind, "Kind must fit in bitfield"); + MOZ_ASSERT(engine_ == engine, "Engine must fit in bitfield"); + MOZ_ASSERT(stubDataOffset_ == stubDataOffset, + "stubDataOffset must fit in uint8_t"); +} + size_t CacheIRStubInfo::stubDataSize() const { size_t field = 0; size_t size = 0; @@ -1264,6 +1279,15 @@ ICCacheIRStub* ICCacheIRStub::clone(JSRuntime* rt, ICStubSpace& newSpace) { return newStub; } +#ifdef ENABLE_JS_PBL_WEVAL +Weval& CacheIRStubInfo::weval() { + if (!weval_) { + weval_ = MakeUnique(); + } + return *weval_; +} +#endif + template static inline bool ShouldTraceWeakEdgeInStub(JSTracer* trc) { if constexpr (std::is_same_v) { diff --git a/js/src/jit/CacheIRCompiler.h b/js/src/jit/CacheIRCompiler.h index 62d2f8f0d4cf8..582e92f0394e9 100644 --- a/js/src/jit/CacheIRCompiler.h +++ b/js/src/jit/CacheIRCompiler.h @@ -28,6 +28,10 @@ namespace js { class TypedArrayObject; enum class UnaryMathFunction : uint8_t; +#ifdef ENABLE_JS_PBL_WEVAL +struct Weval; +#endif + namespace jit { class BaselineCacheIRCompiler; @@ -1347,18 +1351,12 @@ class CacheIRStubInfo { uint8_t stubDataOffset_; bool makesGCCalls_; +#ifdef ENABLE_JS_PBL_WEVAL + UniquePtr weval_ = {}; +#endif + CacheIRStubInfo(CacheKind kind, ICStubEngine engine, bool makesGCCalls, - uint32_t stubDataOffset, uint32_t codeLength) - : codeLength_(codeLength), - kind_(kind), - engine_(engine), - stubDataOffset_(stubDataOffset), - makesGCCalls_(makesGCCalls) { - MOZ_ASSERT(kind_ == kind, "Kind must fit in bitfield"); - MOZ_ASSERT(engine_ == engine, "Engine must fit in bitfield"); - MOZ_ASSERT(stubDataOffset_ == stubDataOffset, - "stubDataOffset must fit in uint8_t"); - } + uint32_t stubDataOffset, uint32_t codeLength); CacheIRStubInfo(const CacheIRStubInfo&) = delete; CacheIRStubInfo& operator=(const CacheIRStubInfo&) = delete; @@ -1434,6 +1432,11 @@ class CacheIRStubInfo { void replaceStubRawValueBits(uint8_t* stubData, uint32_t offset, uint64_t oldBits, uint64_t newBits) const; + +#ifdef ENABLE_JS_PBL_WEVAL + bool hasWeval() const { return weval_.get() != nullptr; } + Weval& weval(); +#endif }; template diff --git a/js/src/jit/CacheIRSpewer.cpp b/js/src/jit/CacheIRSpewer.cpp index 52e2782266f6d..4d5764c6f3485 100644 --- a/js/src/jit/CacheIRSpewer.cpp +++ b/js/src/jit/CacheIRSpewer.cpp @@ -525,6 +525,8 @@ static const char* ArrayBufferViewKindName(ArrayBufferViewKind kind) { switch (kind) { case ArrayBufferViewKind::FixedLength: return "FixedLength"; + case ArrayBufferViewKind::Immutable: + return "Immutable"; case ArrayBufferViewKind::Resizable: return "Resizable"; } diff --git a/js/src/jit/CacheIRWriter.h b/js/src/jit/CacheIRWriter.h index 7f7325b9ee077..147b31ceb05a6 100644 --- a/js/src/jit/CacheIRWriter.h +++ b/js/src/jit/CacheIRWriter.h @@ -379,6 +379,9 @@ class MOZ_RAII CacheIRWriter : public JS::CustomAutoRooter { MOZ_ASSERT(op == nextOperandId_); nextOperandId_++; numInputOperands_++; + if (op >= operandLastUsed_.length()) { + buffer_.propagateOOM(operandLastUsed_.resize(op + 1)); + } return op; } diff --git a/js/src/jit/CompactBuffer.h b/js/src/jit/CompactBuffer.h index d21f5e579e625..db7b14be85bbe 100644 --- a/js/src/jit/CompactBuffer.h +++ b/js/src/jit/CompactBuffer.h @@ -68,7 +68,7 @@ class CompactBufferReader { : buffer_(start), end_(end) {} inline explicit CompactBufferReader(const CompactBufferWriter& writer); uint8_t readByte() { - MOZ_ASSERT(buffer_ < end_); + MOZ_ASSERT_IF(end_, buffer_ < end_); return *buffer_++; } uint32_t readFixedUint32_t() { @@ -117,14 +117,14 @@ class CompactBufferReader { } bool more() const { - MOZ_ASSERT(buffer_ <= end_); + MOZ_ASSERT_IF(end_, buffer_ <= end_); return buffer_ < end_; } void seek(const uint8_t* start, uint32_t offset) { buffer_ = start + offset; - MOZ_ASSERT(start < end_); - MOZ_ASSERT(buffer_ <= end_); + MOZ_ASSERT_IF(end_, start < end_); + MOZ_ASSERT_IF(end_, buffer_ <= end_); } const uint8_t* currentPosition() const { return buffer_; } diff --git a/js/src/jit/moz.build b/js/src/jit/moz.build index 39d5d48c3edf4..caf81c8e6d4dc 100644 --- a/js/src/jit/moz.build +++ b/js/src/jit/moz.build @@ -307,3 +307,8 @@ if CONFIG["ENABLE_JS_AOT_ICS"]: if CONFIG["FUZZING_INTERFACES"] or CONFIG["FUZZING_JS_FUZZILLI"]: include("/tools/fuzzing/libfuzzer-config.mozbuild") + +if CONFIG["ENABLE_JS_PBL_WEVAL"]: + LOCAL_INCLUDES += [ + "../../../third_party/weval" + ] diff --git a/js/src/moz.build b/js/src/moz.build index a000e4a42dda2..ae5af29eda3fc 100644 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -703,3 +703,8 @@ if CONFIG["JS_HAS_INTL_API"]: if CONFIG["USE_LIBZ_RS"]: DEFINES["USE_LIBZ_RS"] = True + +if CONFIG["ENABLE_JS_PBL_WEVAL"]: + LOCAL_INCLUDES += [ + "../../third_party/weval" + ] diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index b4193feef5f3b..c09a9a4c9c5c1 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -12716,7 +12716,7 @@ Variant js::shell::ShellMain(int argc, char** argv, } if (!JS::SetLoggingInterface(shellLoggingInterface)) { - return 1; + return AsVariant(1); } ParseLoggerOptions(); diff --git a/js/src/vm/JSScript.cpp b/js/src/vm/JSScript.cpp index f64ed893ca194..9a5f260cbf621 100644 --- a/js/src/vm/JSScript.cpp +++ b/js/src/vm/JSScript.cpp @@ -75,6 +75,7 @@ #include "vm/StringType.h" // JSString, JSAtom #include "vm/Time.h" // AutoIncrementalTimer #include "vm/ToSource.h" // JS::ValueToSource +#include "vm/Weval.h" #ifdef MOZ_VTUNE # include "vtune/VTuneWrapper.h" #endif @@ -2663,6 +2664,10 @@ bool JSScript::fullyInitFromStencil( } } +#ifdef ENABLE_JS_PBL_WEVAL + pbl::EnqueueScriptSpecialization(script); +#endif + return true; } @@ -3891,3 +3896,9 @@ JS::ubi::Base::Size JS::ubi::Concrete::size( const char* JS::ubi::Concrete::scriptFilename() const { return get().filename(); } + +#ifdef ENABLE_JS_PBL_WEVAL +void BaseScript::allocWeval() { + weval_ = MakeUnique(); +} +#endif diff --git a/js/src/vm/JSScript.h b/js/src/vm/JSScript.h index 3a6c1ffc7aa03..bed6c7d01f055 100644 --- a/js/src/vm/JSScript.h +++ b/js/src/vm/JSScript.h @@ -91,6 +91,8 @@ struct CompilationStencilMerger; class StencilXDR; } // namespace frontend +struct Weval; + class ScriptCounts { public: using PCCountsVector = mozilla::Vector; @@ -1567,6 +1569,13 @@ class BaseScript : public gc::TenuredCellWithNonGCPointer { // will be nullptr. RefPtr sharedData_ = {}; +#ifdef ENABLE_JS_PBL_WEVAL + // Specialized function generated by partial-evaluation tool + // `weval`, if any. Indirected via a `UniquePtr` to keep a stable + // address across GCs. + UniquePtr weval_ = {}; +#endif + // End of fields. BaseScript(uint8_t* stubEntry, JSFunction* function, @@ -1746,6 +1755,17 @@ class BaseScript : public gc::TenuredCellWithNonGCPointer { #if defined(DEBUG) || defined(JS_JITSPEW) void dumpStringContent(js::GenericPrinter& out) const; #endif + +#ifdef ENABLE_JS_PBL_WEVAL + bool hasWeval() const { return weval_.get() != nullptr; } + Weval& weval() { + if (!weval_) { + allocWeval(); + } + return *weval_; + } + void allocWeval(); +#endif }; extern void SweepScriptData(JSRuntime* rt); diff --git a/js/src/vm/PortableBaselineInterpret-defs.h b/js/src/vm/PortableBaselineInterpret-defs.h new file mode 100644 index 0000000000000..20d95c9ceb990 --- /dev/null +++ b/js/src/vm/PortableBaselineInterpret-defs.h @@ -0,0 +1,85 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +#ifndef PortableBaselineInerpret_defs_h +#define PortableBaselineInerpret_defs_h + +/* Basic definitions for PBL's internals that can be swapped out as + * needed to handle interpreter details differently. + * + * Meant to be included only from PortableBaselineInterpret.cpp. */ + +#define PBL_HYBRID_ICS_DEFAULT true + +#define PBL_CALL_IC(jitcode, ctx, stubvalue, result, arg0, arg1, arg2value, \ + hasarg2) \ + do { \ + ctx.arg2 = arg2value; \ + if (stubvalue->isFallback()) { \ + ICStubFunc func = reinterpret_cast(jitcode); \ + result = func(arg0, arg1, stubvalue, ctx); \ + } else { \ + result = ICInterpretOps(arg0, arg1, stubvalue, ctx); \ + } \ + } while (0) + +#define PBL_CALL_INTERP(result, script, interp, ...) \ + result = interp(__VA_ARGS__); + +#define PBL_ESTABLISH_STUBINFO_CODE(Specialized, stubInfo, code) \ + stubInfo = cstub->stubInfo(); \ + code = stubInfo->code(); + +#define READ_REG(reg) \ + ({ \ + TRACE_PRINTF("READ_REG(%d): %" PRIx64 "\n", int((reg)), \ + ctx.icregs.icVals[(reg)]); \ + ctx.icregs.icVals[(reg)]; \ + }) +#define WRITE_REG(reg, value, tagtype) \ + do { \ + uint64_t write_value = (value); \ + TRACE_PRINTF("WRITE_REG(%d, " #tagtype "): %" PRIx64 "\n", (reg), \ + write_value); \ + ctx.icregs.icVals[(reg)] = write_value; \ + ctx.icregs.icTags[(reg)] = uint64_t(JSVAL_TAG_##tagtype) \ + << JSVAL_TAG_SHIFT; \ + } while (0) +#define READ_VALUE_REG(reg) \ + ({ \ + uint64_t bits = ctx.icregs.icVals[(reg)] | ctx.icregs.icTags[(reg)]; \ + TRACE_PRINTF("READ_VALUE_REG(%d): %" PRIx64 "\n", (reg), bits); \ + Value::fromRawBits(bits); \ + }) +#define WRITE_VALUE_REG(reg, value) \ + do { \ + uint64_t write_value = (value).asRawBits(); \ + TRACE_PRINTF("WRITE_VALUE_REG(%d): %" PRIx64 "\n", (reg), write_value); \ + ctx.icregs.icVals[(reg)] = write_value; \ + ctx.icregs.icTags[(reg)] = 0; \ + } while (0) + +#define PBL_PUSH_CTX(ctx) ; +#define PBL_UPDATE_CTX(ctx) ; +#define PBL_POP_CTX() ; + +#define VIRTPUSH(value) PUSH(value) +#define VIRTPOP() POP() +#define VIRTSP(index) sp[(index)] +#define VIRTSPWRITE(index, value) sp[(index)] = (value) +#define SYNCSP() +#define SETLOCAL(i, value) frame->unaliasedLocal(i) = value +#define GETLOCAL(i) frame->unaliasedLocal(i) + +#define PBL_SETUP_INTERP_INPUTS(argsObjAliasesFormals, nfixed) \ + argsObjAliasesFormals = frame->script()->argsObjAliasesFormals(); \ + nfixed = frame->script()->nfixed(); + +#define PBL_SPECIALIZE_VALUE(i, low, high) i + +#define PBL_SCRIPT_HAS_SPECIALIZATION(script) false + +#endif /* PortableBaselineInerpret_defs_h */ diff --git a/js/src/vm/PortableBaselineInterpret-weval-defs.h b/js/src/vm/PortableBaselineInterpret-weval-defs.h new file mode 100644 index 0000000000000..61aaa7e7907b7 --- /dev/null +++ b/js/src/vm/PortableBaselineInterpret-weval-defs.h @@ -0,0 +1,142 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +#ifndef PortableBaselineInerpret_weval_defs_h +#define PortableBaselineInerpret_weval_defs_h + +#ifdef DEBUG +// weval has to constant-propagate interpreter state well enough to unroll the +// interpreter loops, and this is not possible in a debug build because the +// interpreter state is spilled and reloaded to memory (which cannot be tracked +// in a fine-grained way by cprop). We need C++ locals to live in Wasm locals +// for weval to work. +#error PBL weval support only works in optimized (non-debug) builds. +#endif + +/* Basic definitions for PBL's internals that can be swapped out as + * needed to handle interpreter details differently. + * + * Meant to be included only from PortableBaselineInterpret.cpp. */ + +#define PBL_HYBRID_ICS_DEFAULT false + +#define PBL_CALL_IC(jitcode, ctx, stubvalue, result, arg0, arg1, arg2value, \ + hasarg2) \ + do { \ + if (hasarg2) { \ + ctx.arg2 = arg2value; \ + } \ + ICStubFunc func = reinterpret_cast(jitcode); \ + result = func(arg0, arg1, stubvalue, ctx); \ + } while (0) + +#define PBL_CALL_INTERP(result, script, interp, ...) \ + if (script->hasWeval() && script->weval().func) { \ + result = (reinterpret_cast(script->weval().func))(__VA_ARGS__); \ + } else { \ + result = interp(__VA_ARGS__); \ + } + +#define PBL_ESTABLISH_STUBINFO_CODE(Specialized, stubInfo, code) \ + if (!Specialized) { \ + stubInfo = cstub->stubInfo(); \ + code = stubInfo->code(); \ + } else { \ + stubInfo = reinterpret_cast( \ + weval_read_specialization_global(0)); \ + code = reinterpret_cast(weval_read_specialization_global(1)); \ + } + +#define READ_REG(reg) \ + (Specialized ? weval_read_reg((reg)) : ctx.icregs.icVals[(reg)]) +#define WRITE_REG(reg, value, tagtype) \ + if (Specialized) { \ + weval_write_reg((reg), (value)); \ + weval_write_reg((reg) + ICRegs::kMaxICVals, uint64_t(JSVAL_TAG_##tagtype) \ + << JSVAL_TAG_SHIFT); \ + } else { \ + ctx.icregs.icVals[(reg)] = (value); \ + ctx.icregs.icTags[(reg)] = uint64_t(JSVAL_TAG_##tagtype) \ + << JSVAL_TAG_SHIFT; \ + } + +#define READ_VALUE_REG(reg) \ + Value::fromRawBits( \ + Specialized ? (weval_read_reg((reg) + ICRegs::kMaxICVals) | \ + weval_read_reg((reg))) \ + : (ctx.icregs.icTags[(reg)] | ctx.icregs.icVals[(reg)])) +#define WRITE_VALUE_REG(reg, value) \ + if (Specialized) { \ + weval_write_reg((reg), (value).asRawBits()); \ + weval_write_reg((reg) + ICRegs::kMaxICVals, 0); \ + } else { \ + ctx.icregs.icVals[(reg)] = (value).asRawBits(); \ + ctx.icregs.icTags[(reg)] = 0; \ + } + +#define PBL_PUSH_CTX(ctx) weval::push_context(reinterpret_cast(ctx)); + +#define PBL_UPDATE_CTX(ctx) \ + weval::update_context(reinterpret_cast(ctx)); + +#define PBL_POP_CTX() \ + weval::pop_context(); + +#define VIRTPUSH(value) \ + if (Specialized) { \ + --sp; \ + weval_push_stack(reinterpret_cast(sp), (value).asUInt64()); \ + } else { \ + *--sp = (value); \ + } +#define VIRTPOP() \ + (Specialized ? ({ \ + uint64_t* ptr = reinterpret_cast(sp++); \ + StackVal(weval_pop_stack(ptr)); \ + }) \ + : *sp++) +#define VIRTSP(index) \ + (Specialized ? StackVal(weval_read_stack( \ + reinterpret_cast(&sp[(index)]), (index))) \ + : sp[(index)]) +#define VIRTSPWRITE(index, value) \ + if (Specialized) { \ + weval_write_stack(reinterpret_cast(&sp[(index)]), (index), \ + (value).asUInt64()); \ + } else { \ + sp[(index)] = (value); \ + } +#define SYNCSP() \ + if (Specialized) { \ + weval_sync_stack(); \ + } +#define SETLOCAL(i, value) \ + if (Specialized) { \ + weval_write_local(reinterpret_cast(&frame->unaliasedLocal(i)), \ + i, (value).asRawBits()); \ + } else { \ + frame->unaliasedLocal(i) = value; \ + } +#define GETLOCAL(i) \ + (Specialized \ + ? Value::fromRawBits(weval_read_local( \ + reinterpret_cast(&frame->unaliasedLocal(i)), i)) \ + : frame->unaliasedLocal(i)) + +#define PBL_SETUP_INTERP_INPUTS(argsObjAliasesFormals, nfixed) \ + argsObjAliasesFormals = Specialized \ + ? (weval_read_specialization_global(0) != 0) \ + : frame->script()->argsObjAliasesFormals(); \ + nfixed = Specialized ? weval_read_specialization_global(1) \ + : frame->script()->nfixed(); + +#define PBL_SPECIALIZE_VALUE(i, low, high) \ + int32_t(weval_specialize_value(uint32_t(i), 0, uint32_t(high - low + 1))); + +#define PBL_SCRIPT_HAS_SPECIALIZATION(script) \ + (script->hasWeval() && script->weval().func) + +#endif /* PortableBaselineInerpret_defs_h */ diff --git a/js/src/vm/PortableBaselineInterpret.cpp b/js/src/vm/PortableBaselineInterpret.cpp index 696115476b831..25a9a1a9f2108 100644 --- a/js/src/vm/PortableBaselineInterpret.cpp +++ b/js/src/vm/PortableBaselineInterpret.cpp @@ -57,6 +57,7 @@ #include "vm/PlainObject.h" #include "vm/Shape.h" #include "vm/TypeofEqOperand.h" // TypeofEqOperand +#include "vm/Weval.h" #include "vm/WrapperObject.h" #include "debugger/DebugAPI-inl.h" @@ -67,6 +68,13 @@ #include "vm/JSScript-inl.h" #include "vm/PlainObject-inl.h" +#ifdef ENABLE_JS_PBL_WEVAL +WEVAL_DEFINE_GLOBALS() +# include "vm/PortableBaselineInterpret-weval-defs.h" +#else +# include "vm/PortableBaselineInterpret-defs.h" +#endif + namespace js { namespace pbl { @@ -91,8 +99,6 @@ using namespace js::jit; } while (0) #endif -#define PBL_HYBRID_ICS_DEFAULT true - // Whether we are using the "hybrid" strategy for ICs (see the [SMDOC] // in PortableBaselineInterpret.h for more). This is currently a // constant, but may become configurable in the future. @@ -439,24 +445,24 @@ class VMFrame { bool success() const { return exitFP != nullptr; } }; -#define PUSH_EXIT_FRAME_OR_RET(value, init_sp) \ +#define PUSH_EXIT_FRAME_OR_RET(ret_stmt, init_sp) \ VMFrame cx(ctx.frameMgr, ctx.stack, init_sp); \ if (!cx.success()) { \ - return value; \ + ret_stmt; \ } \ StackVal* sp = cx.spBelowFrame(); /* shadow the definition */ \ (void)sp; /* avoid unused-variable warnings */ #define PUSH_IC_FRAME() \ ctx.error = PBIResult::Error; \ - PUSH_EXIT_FRAME_OR_RET(IC_ERROR_SENTINEL(), ctx.sp()) + PUSH_EXIT_FRAME_OR_RET(RETURN_IC(IC_ERROR_SENTINEL()), ctx.sp()) #define PUSH_FALLBACK_IC_FRAME() \ ctx.error = PBIResult::Error; \ - PUSH_EXIT_FRAME_OR_RET(IC_ERROR_SENTINEL(), sp) + PUSH_EXIT_FRAME_OR_RET(return IC_ERROR_SENTINEL(), sp) #define PUSH_EXIT_FRAME() \ frame->interpreterPC() = pc; \ SYNCSP(); \ - PUSH_EXIT_FRAME_OR_RET(PBIResult::Error, sp) + PUSH_EXIT_FRAME_OR_RET(return PBIResult::Error, sp) /* * ----------------------------------------------- @@ -469,26 +475,55 @@ class VMFrame { // platforms, e.g. Wasm on Wasmtime on x86-64, we have as few as four // register arguments available before args go through the stack.) struct ICCtx { - BaselineFrame* frame; VMFrameManager frameMgr; State& state; ICRegs icregs; Stack& stack; - StackVal* sp_; + + // Values we keep in ICCtx rather than separate locals in the main + // interpreter body in order to reduce register pressure. + JSObject* envChain; + ImmutableScriptData* isd; + Value* ret; + StackVal* entryFrame; + jsbytecode* entryPC; + + // Values that we pass as auxiliary arguments to ICs; they either + // change infrequently (`frame`) or we want to minimize argument + // count to fit into registers on more limited architectures + // (e.g. wasm32 on Wasmtime, with only 4 integer argument + // registers). + BaselineFrame* frame; + StackVal* spbase; + // We pass `sp` as two parts, `spbase` and `spoffset`, so that IC + // sites in specialized function bodies can constant-propagate + // `spoffset` and compile down to a single store of a constant to + // `spoffset` (while `spbase` never changes). + uintptr_t spoffset; // negative offset from spbase + jsbytecode* pcbase; PBIResult error; uint64_t arg2; ICCtx(JSContext* cx, BaselineFrame* frame_, State& state_, Stack& stack_) - : frame(frame_), - frameMgr(cx, frame_), + : frameMgr(cx, frame_), state(state_), icregs(), stack(stack_), - sp_(nullptr), + envChain(nullptr), + isd(nullptr), + ret(nullptr), + entryFrame(nullptr), + entryPC(nullptr), + frame(frame_), + spbase(nullptr), + spoffset(0), error(PBIResult::Ok), arg2(0) {} - StackVal* sp() { return sp_; } + StackVal* sp() { + return reinterpret_cast(reinterpret_cast(spbase) - + spoffset); + } }; #define IC_ERROR_SENTINEL() (JS::MagicValue(JS_GENERIC_MAGIC).asRawBits()) @@ -497,17 +532,10 @@ struct ICCtx { typedef uint64_t (*ICStubFunc)(uint64_t arg0, uint64_t arg1, ICStub* stub, ICCtx& ctx); -#define PBL_CALL_IC(jitcode, ctx, stubvalue, result, arg0, arg1, arg2value, \ - hasarg2) \ - do { \ - ctx.arg2 = arg2value; \ - ICStubFunc func = reinterpret_cast(jitcode); \ - result = func(arg0, arg1, stubvalue, ctx); \ - } while (0) - typedef PBIResult (*PBIFunc)(JSContext* cx_, State& state, Stack& stack, StackVal* sp, JSObject* envChain, Value* ret, - jsbytecode* pc, ImmutableScriptData* isd, + jsbytecode* pcbase, uint32_t pcoffset, + ImmutableScriptData* isd, jsbytecode* restartEntryPC, BaselineFrame* restartFrame, StackVal* restartEntryFrame, @@ -533,6 +561,7 @@ static double DoubleMinMax(bool isMax, double first, double second) { } // Interpreter for CacheIR. +template uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, ICCtx& ctx) { { @@ -549,33 +578,30 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, #else // ENABLE_COMPUTED_GOTO_DISPATCH -# define CACHEOP_CASE(name) \ - case CacheOp::name: \ - cacheop_##name : CACHEOP_TRACE(name) +# ifdef ENABLE_JS_PBL_WEVAL +# define CACHEOP_CASE(name) \ + case CacheOp::name: \ + weval_trace_line(__LINE__); \ + weval_assert_const32( \ + reinterpret_cast(cacheIRReader.currentPosition()), \ + __LINE__); \ + cacheop_##name : CACHEOP_TRACE(name) +# else +# define CACHEOP_CASE(name) \ + case CacheOp::name: \ + cacheop_##name : CACHEOP_TRACE(name) +# endif # define CACHEOP_CASE_FALLTHROUGH(name) \ [[fallthrough]]; \ CACHEOP_CASE(name) -# define DISPATCH_CACHEOP() \ - cacheop = cacheIRReader.readOp(); \ +# define DISPATCH_CACHEOP() \ + cacheop = cacheIRReader.readOp(); \ + PBL_UPDATE_CTX(cacheIRReader.currentPosition()); \ goto dispatch; #endif // !ENABLE_COMPUTED_GOTO_DISPATCH -#define READ_REG(index) ctx.icregs.icVals[(index)] -#define READ_VALUE_REG(index) \ - Value::fromRawBits(ctx.icregs.icVals[(index)] | ctx.icregs.icTags[(index)]) -#define WRITE_REG(index, value, tag) \ - do { \ - ctx.icregs.icVals[(index)] = (value); \ - ctx.icregs.icTags[(index)] = uint64_t(JSVAL_TAG_##tag) << JSVAL_TAG_SHIFT; \ - } while (0) -#define WRITE_VALUE_REG(index, value) \ - do { \ - ctx.icregs.icVals[(index)] = (value).asRawBits(); \ - ctx.icregs.icTags[(index)] = 0; \ - } while (0) - DECLARE_CACHEOP_CASE(ReturnFromIC); DECLARE_CACHEOP_CASE(GuardToObject); DECLARE_CACHEOP_CASE(GuardIsNullOrUndefined); @@ -857,7 +883,17 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, #define CACHEOP_TRACE(name) \ TRACE_PRINTF("cacheop (frame %p stub %p): " #name "\n", ctx.frame, cstub); -#define FAIL_IC() goto next_ic; +#define FAIL_IC() \ + do { \ + PBL_PUSH_CTX(uint32_t(1)); \ + goto next_ic; \ + } while (0) + +#define RETURN_IC(value) \ + do { \ + PBL_PUSH_CTX(uint32_t(2)); \ + return (value); \ + } while (0) // We set a fixed bound on the number of icVals which is smaller than what IC // generators may use. As a result we can't evaluate an IC if it defines too @@ -868,22 +904,24 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, #define BOUNDSCHECK(resultId) \ if (resultId.id() >= ICRegs::kMaxICVals) FAIL_IC(); -#define PREDICT_NEXT(name) \ - if (cacheIRReader.peekOp() == CacheOp::name) { \ - cacheIRReader.readOp(); \ - cacheop = CacheOp::name; \ - goto cacheop_##name; \ +#define PREDICT_NEXT(name) \ + if (!Specialized && cacheIRReader.peekOp() == CacheOp::name) { \ + cacheIRReader.readOp(); \ + cacheop = CacheOp::name; \ + goto cacheop_##name; \ } -#define PREDICT_RETURN() \ - if (cacheIRReader.peekOp() == CacheOp::ReturnFromIC) { \ - TRACE_PRINTF("stub successful, predicted return\n"); \ - return retValue; \ +#define PREDICT_RETURN() \ + if (!Specialized && cacheIRReader.peekOp() == CacheOp::ReturnFromIC) { \ + TRACE_PRINTF("stub successful, predicted return\n"); \ + RETURN_IC(retValue); \ } ICCacheIRStub* cstub = stub->toCacheIRStub(); - const CacheIRStubInfo* stubInfo = cstub->stubInfo(); - CacheIRReader cacheIRReader(stubInfo); + const CacheIRStubInfo* stubInfo; + const uint8_t* code; + PBL_ESTABLISH_STUBINFO_CODE(Specialized, stubInfo, code); + CacheIRReader cacheIRReader(code, nullptr); uint64_t retValue = 0; CacheOp cacheop; @@ -891,6 +929,8 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, WRITE_VALUE_REG(1, Value::fromRawBits(arg1)); WRITE_VALUE_REG(2, Value::fromRawBits(ctx.arg2)); + PBL_PUSH_CTX(cacheIRReader.currentPosition()); + DISPATCH_CACHEOP(); #ifndef ENABLE_COMPUTED_GOTO_DISPATCH @@ -901,7 +941,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, CACHEOP_CASE(ReturnFromIC) { TRACE_PRINTF("stub successful!\n"); - return retValue; + RETURN_IC(retValue); } CACHEOP_CASE(GuardToObject) { @@ -1901,7 +1941,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, if (!SetElementMegamorphic(cx, obj0, value0, value1, args.strict)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } } DISPATCH_CACHEOP(); @@ -2306,7 +2346,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, if (!ctx.stack.check(sp, sizeof(StackVal) * (totalArgs + 6))) { ReportOverRecursed(ctx.frameMgr.cxForLocalUseOnly()); ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } // Create `this` if we are constructing and this is a @@ -2329,7 +2369,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, ReservedRooted result(&ctx.state.value0); if (!CreateThisFromIC(cx, calleeObj, newTargetRooted, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } thisVal = result; // `callee` may have moved. @@ -2398,7 +2438,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, if (!success) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = args[0].asRawBits(); } else { @@ -2414,13 +2454,15 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, ImmutableScriptData* isd = script->immutableScriptData(); PBIResult result; Value ret; - result = PortableBaselineInterpret( - cx, ctx.state, ctx.stack, sp, - /* envChain = */ nullptr, &ret, pc, isd, nullptr, nullptr, + PBL_CALL_INTERP( + result, script, + (PortableBaselineInterpret), cx, + ctx.state, ctx.stack, sp, /* envChain = */ nullptr, + reinterpret_cast(&ret), pc, 0, isd, nullptr, nullptr, nullptr, PBIResult::Ok); if (result != PBIResult::Ok) { ctx.error = result; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } if (flags.isConstructing() && !ret.isObject()) { ret = args[0]; @@ -2475,7 +2517,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, if (!ctx.stack.check(sp, sizeof(StackVal) * 8)) { ReportOverRecursed(ctx.frameMgr.cxForLocalUseOnly()); ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } // This will not be an Exit frame but a BaselineStub frame, so @@ -2503,12 +2545,15 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, ImmutableScriptData* isd = script->immutableScriptData(); PBIResult result; Value ret; - result = PortableBaselineInterpret( - cx, ctx.state, ctx.stack, sp, /* envChain = */ nullptr, &ret, pc, - isd, nullptr, nullptr, nullptr, PBIResult::Ok); + PBL_CALL_INTERP( + result, script, + (PortableBaselineInterpret), cx, + ctx.state, ctx.stack, sp, /* envChain = */ nullptr, + reinterpret_cast(&ret), pc, 0, isd, nullptr, nullptr, + nullptr, PBIResult::Ok); if (result != PBIResult::Ok) { ctx.error = result; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = ret.asRawBits(); } @@ -2566,7 +2611,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, if (!ctx.stack.check(sp, sizeof(StackVal) * (totalArgs + 6))) { ReportOverRecursed(ctx.frameMgr.cxForLocalUseOnly()); ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } // This will not be an Exit frame but a BaselineStub frame, so @@ -2597,12 +2642,15 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, ImmutableScriptData* isd = script->immutableScriptData(); PBIResult result; Value ret; - result = PortableBaselineInterpret( - cx, ctx.state, ctx.stack, sp, /* envChain = */ nullptr, &ret, pc, - isd, nullptr, nullptr, nullptr, PBIResult::Ok); + PBL_CALL_INTERP( + result, script, + (PortableBaselineInterpret), cx, + ctx.state, ctx.stack, sp, /* envChain = */ nullptr, + reinterpret_cast(&ret), pc, 0, isd, nullptr, nullptr, + nullptr, PBIResult::Ok); if (result != PBIResult::Ok) { ctx.error = result; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = ret.asRawBits(); } @@ -2860,7 +2908,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, JSLinearString* result = LinearizeForCharAccess(cx, str); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } WRITE_REG(resultId.id(), reinterpret_cast(result), STRING); } @@ -2882,7 +2930,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, JSLinearString* result = LinearizeForCharAccess(cx, str); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } WRITE_REG(resultId.id(), reinterpret_cast(result), STRING); } @@ -2927,7 +2975,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, result = StringFromCharCode(cx, c); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } } retValue = StringValue(result).asRawBits(); @@ -3356,7 +3404,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, retValue = StringValue(result).asRawBits(); } else { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } } PREDICT_RETURN(); @@ -3395,7 +3443,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, } if (!StringsEqual(cx, lhs, rhs, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } break; case JSOp::Ne: @@ -3411,35 +3459,35 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, if (!StringsEqual(cx, lhs, rhs, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } break; case JSOp::Lt: if (!StringsCompare(cx, lhs, rhs, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } break; case JSOp::Ge: if (!StringsCompare( cx, lhs, rhs, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } break; case JSOp::Le: if (!StringsCompare( cx, /* N.B. swapped order */ rhs, lhs, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } break; case JSOp::Gt: if (!StringsCompare( cx, /* N.B. swapped order */ rhs, lhs, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } break; default: @@ -3955,7 +4003,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, ReservedRooted result(&ctx.state.value0); if (!NumberParseInt(cx, str0, radix, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = result.asRawBits(); } @@ -4168,7 +4216,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, auto* iter = GetIterator(cx, rootedObj); if (!iter) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = ObjectValue(*iter).asRawBits(); } @@ -4230,7 +4278,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, args.allocKind, site); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = ObjectValue(*result).asRawBits(); } @@ -4255,7 +4303,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, NewArrayObjectBaselineFallback(cx, arrayLength, allocKind, site); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = ObjectValue(*result).asRawBits(); } @@ -4279,7 +4327,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, ArrayConstructorOneArg(cx, templateObjectRooted, length, site); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = ObjectValue(*result).asRawBits(); } @@ -4301,7 +4349,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, cx, templateObjectRooted, length); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = ObjectValue(*result).asRawBits(); } @@ -4331,7 +4379,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, lengthRooted); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = ObjectValue(*result).asRawBits(); } @@ -4354,7 +4402,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, cx, templateObjectRooted, arrayRooted); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = ObjectValue(*result).asRawBits(); } @@ -4395,7 +4443,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, if (!CallNativeGetter(cx, getterRooted, receiverRooted, &resultRooted)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = resultRooted.asRawBits(); } @@ -4423,7 +4471,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, ReservedRooted rhsRooted(&ctx.state.value1, rhs); if (!CallNativeSetter(cx, setterRooted, receiverRooted, rhsRooted)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } } PREDICT_RETURN(); @@ -4517,7 +4565,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, bool result = false; if (!StringIncludes(cx, str0, str1, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = BooleanValue(result).asRawBits(); } @@ -4538,7 +4586,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, int32_t result = 0; if (!StringIndexOf(cx, str0, str1, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = Int32Value(result).asRawBits(); } @@ -4559,7 +4607,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, int32_t result = 0; if (!StringLastIndexOf(cx, str0, str1, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = Int32Value(result).asRawBits(); } @@ -4580,7 +4628,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, bool result = false; if (!StringStartsWith(cx, str0, str1, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = BooleanValue(result).asRawBits(); } @@ -4601,7 +4649,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, bool result = false; if (!StringEndsWith(cx, str0, str1, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = BooleanValue(result).asRawBits(); } @@ -4617,7 +4665,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, auto* result = StringToLowerCase(cx, str); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = StringValue(result).asRawBits(); } @@ -4633,7 +4681,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, auto* result = StringToUpperCase(cx, str); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = StringValue(result).asRawBits(); } @@ -4650,7 +4698,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, auto* result = StringTrim(cx, str0); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = StringValue(result).asRawBits(); } @@ -4667,7 +4715,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, auto* result = StringTrimStart(cx, str0); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = StringValue(result).asRawBits(); } @@ -4684,7 +4732,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, auto* result = StringTrimEnd(cx, str0); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = StringValue(result).asRawBits(); } @@ -4705,7 +4753,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, auto* result = SubstringKernel(cx, str0, begin, length); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = StringValue(result).asRawBits(); } @@ -4730,7 +4778,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, auto* result = StringReplace(cx, str0, str1, str2); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = StringValue(result).asRawBits(); } @@ -4751,7 +4799,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, auto* result = StringSplitString(cx, str0, str1, INT32_MAX); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = ObjectValue(*result).asRawBits(); } @@ -4789,7 +4837,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, auto* result = Int32ToStringPure(cx, idInt); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } WRITE_VALUE_REG(resultId.id(), StringValue(result)); } @@ -4807,7 +4855,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, auto* result = NewStringIterator(cx); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = ObjectValue(*result).asRawBits(); } @@ -4882,7 +4930,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, bool result; if (!IsPossiblyWrappedTypedArray(cx, obj, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = BooleanValue(result).asRawBits(); } else { @@ -4975,7 +5023,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, if (!SetPropertyMegamorphic(cx, objRooted, idRooted, valRooted, strict)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } } @@ -5019,7 +5067,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, auto* result = ArrayJoin(cx, obj0, str0); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = StringValue(result).asRawBits(); } @@ -5039,7 +5087,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, ReservedRooted value0(&ctx.state.value0, rhs); if (!SetArrayLength(cx, obj0, value0, strict)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } } PREDICT_RETURN(); @@ -5055,7 +5103,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, auto* result = ObjectKeys(cx, obj0); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = ObjectValue(*result).asRawBits(); } @@ -5073,7 +5121,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, auto* result = ObjectCreateWithTemplate(cx, templateRooted); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = ObjectValue(*result).asRawBits(); } @@ -5111,7 +5159,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, auto* result = Int32ToStringWithBase(cx, input, base, true); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = StringValue(result).asRawBits(); } @@ -5146,7 +5194,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, PUSH_IC_FRAME(); if (!GetFirstDollarIndexRaw(cx, str, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = Int32Value(result).asRawBits(); } @@ -5210,7 +5258,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, } if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = ObjectValue(*result).asRawBits(); @@ -5241,7 +5289,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, if (!RegExpMatcherRaw(cx, regexpRooted, inputRooted, lastIndex, nullptr, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = result.asRawBits(); } else { @@ -5249,7 +5297,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, if (!RegExpSearcherRaw(cx, regexpRooted, inputRooted, lastIndex, nullptr, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = Int32Value(result).asRawBits(); } @@ -5279,7 +5327,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, bool result = false; if (!RegExpHasCaptureGroups(cx, regexpRooted, inputRooted, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = BooleanValue(result).asRawBits(); } @@ -5305,7 +5353,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, if (!RegExpBuiltinExecMatchFromJit(cx, regexpRooted, inputRooted, nullptr, &output)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = output.asRawBits(); } @@ -5331,7 +5379,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, if (!RegExpBuiltinExecTestFromJit(cx, regexpRooted, inputRooted, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = BooleanValue(result).asRawBits(); } @@ -5359,7 +5407,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, auto* result = NewRegExpStringIterator(cx); if (!result) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = ObjectValue(*result).asRawBits(); } @@ -5379,7 +5427,7 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, ReservedRooted result(&ctx.state.value0, UndefinedValue()); if (!GetSparseElementHelper(cx, nobjRooted, index, &result)) { ctx.error = PBIResult::Error; - return IC_ERROR_SENTINEL(); + RETURN_IC(IC_ERROR_SENTINEL()); } retValue = result.asRawBits(); } @@ -5405,6 +5453,8 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub, #undef CACHEOP_UNIMPL next_ic: + PBL_POP_CTX(); + PBL_POP_CTX(); TRACE_PRINTF("IC failed; next IC\n"); return CallNextIC(arg0, arg1, stub, ctx); } @@ -5759,7 +5809,7 @@ uint8_t* GetPortableFallbackStub(BaselineICFallbackKind kind) { } uint8_t* GetICInterpreter() { - return reinterpret_cast(&ICInterpretOps); + return reinterpret_cast(&ICInterpretOps); } /* @@ -5768,34 +5818,34 @@ uint8_t* GetICInterpreter() { * ----------------------------------------------- */ -static EnvironmentObject& getEnvironmentFromCoordinate( +template +static MOZ_ALWAYS_INLINE EnvironmentObject& getEnvironmentFromCoordinate( BaselineFrame* frame, EnvironmentCoordinate ec) { JSObject* env = frame->environmentChain(); + PBL_PUSH_CTX(0U); for (unsigned i = ec.hops(); i; i--) { - if (env->is()) { + if (Specialized || env->is()) { env = &env->as().enclosingEnvironment(); } else { MOZ_ASSERT(env->is()); env = &env->as().enclosingEnvironment(); } + PBL_UPDATE_CTX(i); } + PBL_POP_CTX(); return env->is() ? env->as() : env->as().environment(); } -#ifndef __wasi__ -# define DEBUG_CHECK() \ - if (frame->isDebuggee()) { \ - TRACE_PRINTF( \ - "Debug check: frame is debuggee, checking for debug script\n"); \ - if (frame->script()->hasDebugScript()) { \ - goto debug; \ - } \ - } -#else -# define DEBUG_CHECK() -#endif +#define DEBUG_CHECK() \ + if (!Specialized && frame->isDebuggee()) { \ + TRACE_PRINTF( \ + "Debug check: frame is debuggee, checking for debug script\n"); \ + if (frame->script()->hasDebugScript()) { \ + goto debug; \ + } \ + } #define LABEL(op) (&&label_##op) #ifdef ENABLE_COMPUTED_GOTO_DISPATCH @@ -5805,29 +5855,24 @@ static EnvironmentObject& getEnvironmentFromCoordinate( goto* addresses[*pc] #else # define CASE(op) label_##op : case JSOp::op: -# define DISPATCH() \ - DEBUG_CHECK(); \ +# define DISPATCH() \ + DEBUG_CHECK(); \ + PBL_UPDATE_CTX(pc); \ goto dispatch #endif -#define ADVANCE(delta) pc += (delta); +#define ADVANCE(delta) \ + pc += (delta); \ + PBL_UPDATE_CTX(pc); #define ADVANCE_AND_DISPATCH(delta) \ ADVANCE(delta); \ DISPATCH(); #define END_OP(op) ADVANCE_AND_DISPATCH(JSOpLength_##op); -#define VIRTPUSH(value) PUSH(value) -#define VIRTPOP() POP() -#define VIRTSP(index) sp[(index)] -#define VIRTSPWRITE(index, value) sp[(index)] = (value) -#define SYNCSP() -#define SETLOCAL(i, value) frame->unaliasedLocal(i) = value -#define GETLOCAL(i) frame->unaliasedLocal(i) - #define IC_SET_ARG_FROM_STACK(index, stack_index) \ - ic_arg##index = sp[(stack_index)].asUInt64(); -#define IC_POP_ARG(index) ic_arg##index = (*sp++).asUInt64(); + ic_arg##index = VIRTSP(stack_index).asUInt64(); +#define IC_POP_ARG(index) ic_arg##index = VIRTPOP().asUInt64(); #define IC_SET_VAL_ARG(index, expr) ic_arg##index = (expr).asRawBits(); #define IC_SET_OBJ_ARG(index, expr) \ ic_arg##index = reinterpret_cast(expr); @@ -5835,10 +5880,10 @@ static EnvironmentObject& getEnvironmentFromCoordinate( #define IC_PUSH_RESULT() VIRTPUSH(StackVal(ic_ret)); #if !defined(TRACE_INTERP) -# define PREDICT_NEXT(op) \ - if (JSOp(*pc) == JSOp::op) { \ - DEBUG_CHECK(); \ - goto label_##op; \ +# define PREDICT_NEXT(op) \ + if (!Specialized && JSOp(*pc) == JSOp::op) { \ + DEBUG_CHECK(); \ + goto label_##op; \ } #else # define PREDICT_NEXT(op) @@ -5863,14 +5908,19 @@ static EnvironmentObject& getEnvironmentFromCoordinate( #define NEXT_IC() icEntry++ +#define UPDATE_SPOFF() \ + ctx.spoffset = \ + reinterpret_cast(spbase) - reinterpret_cast(sp); + #define INVOKE_IC(kind, hasarg2) \ - ctx.sp_ = sp; \ frame->interpreterPC() = pc; \ - frame->interpreterICEntry() = icEntry; \ SYNCSP(); \ + UPDATE_SPOFF(); \ PBL_CALL_IC(icEntry->firstStub()->rawJitCode(), ctx, icEntry->firstStub(), \ ic_ret, ic_arg0, ic_arg1, ic_arg2, hasarg2); \ if (ic_ret == IC_ERROR_SENTINEL()) { \ + PBL_PUSH_CTX(uint32_t(1)); \ + pcoffset = pc - pcbase; \ ic_result = ctx.error; \ goto ic_fail; \ } \ @@ -5895,12 +5945,15 @@ static EnvironmentObject& getEnvironmentFromCoordinate( Stack::handleMut(&sp[(index)]); \ }) -template -PBIResult PortableBaselineInterpret( - JSContext* cx_, State& state, Stack& stack, StackVal* sp, - JSObject* envChain, Value* ret, jsbytecode* pc, ImmutableScriptData* isd, - jsbytecode* restartEntryPC, BaselineFrame* restartFrame, - StackVal* restartEntryFrame, PBIResult restartCode) { +template +PBIResult PortableBaselineInterpret(JSContext* cx_, State& state, Stack& stack, + StackVal* sp, JSObject* envChain, + Value* ret, jsbytecode* pcbase, + uint32_t pcoffset, ImmutableScriptData* isd, + jsbytecode* restartEntryPC, + BaselineFrame* restartFrame, + StackVal* restartEntryFrame, + PBIResult restartCode) { #define RESTART(code) \ if (!IsRestart) { \ TRACE_PRINTF("Restarting (code %d sp %p fp %p)\n", int(code), sp, \ @@ -5913,14 +5966,26 @@ PBIResult PortableBaselineInterpret( #define GOTO_ERROR() \ do { \ SYNCSP(); \ + UPDATE_SPOFF(); \ + pcoffset = pc - pcbase; \ RESTART(PBIResult::Error); \ goto error; \ } while (0) +#define RESET_SP(new_sp) \ + sp = new_sp; \ + spbase = sp; \ + ctx.spbase = spbase; \ + ctx.spoffset = 0; + // Update local state when we switch to a new script with a new PC. #define RESET_PC(new_pc, new_script) \ pc = new_pc; \ + pcbase = new_script->code(); \ + ctx.pcbase = pcbase; \ + pcoffset = pc - pcbase; \ entryPC = new_script->code(); \ + ctx.entryPC = entryPC; \ isd = new_script->immutableScriptData(); \ icEntries = frame->icScript()->icEntries(); \ icEntry = frame->interpreterICEntry(); \ @@ -5940,6 +6005,7 @@ PBIResult PortableBaselineInterpret( BaselineFrame* frame = restartFrame; StackVal* entryFrame = restartEntryFrame; jsbytecode* entryPC = restartEntryPC; + jsbytecode* pc = pcbase + pcoffset; if (!IsRestart) { PUSHNATIVE(StackValNative(nullptr)); // Fake return address. @@ -5953,18 +6019,54 @@ PBIResult PortableBaselineInterpret( entryPC = pc; } + /* + * Local state: PC, IC entry pointer, stack pointer, frame pointer, + * and tracking of entry state when multiple frames are handled in + * this one interpreter call. + * + * Note that we store a lot of state in `ctx`; this is for + * register-pressure reasons. We do not want the restart tails to + * keep locals alive; rather we are fine with loads from memory on + * those cold paths. + * + * Despite that in-memory state, we *also* keep cached copies in + * locals of various state. This is so that partial-evaluation + * specialization and other compiler optimizations can see through + * this dataflow. We are careful to use the cached-in-local copies + * only in ways that can be elided after + * specialization/optimization, and to rely on the in-memory copies + * when dynamic copies will be loaded. + * + * Finally, we split PC and SP into "base" and "offset" portions + * carefully so that the "offsets" are fixed for a given program + * point in the bytecode. This allows specialization to + * constant-propagate the offsets rather than generate a chain of + * adds/subtracts from the dynamic base. + */ + bool from_unwind = false; - uint32_t nfixed = frame->script()->nfixed(); - bool argsObjAliasesFormals = frame->script()->argsObjAliasesFormals(); + StackVal* spbase; + ICCtx ctx(cx_, frame, state, stack); - PBIResult ic_result = PBIResult::Ok; - uint64_t ic_arg0 = 0, ic_arg1 = 0, ic_arg2 = 0, ic_ret = 0; + RESET_SP(sp); + ctx.envChain = envChain; + ctx.isd = isd; + ctx.ret = ret; + ctx.entryFrame = entryFrame; + ctx.entryPC = entryPC; + ctx.pcbase = pcbase; + + bool argsObjAliasesFormals; + uint32_t nfixed; + PBL_SETUP_INTERP_INPUTS(argsObjAliasesFormals, nfixed); - ICCtx ctx(cx_, frame, state, stack); auto* icEntries = frame->icScript()->icEntries(); auto* icEntry = icEntries; const uint32_t* resumeOffsets = isd->resumeOffsets().data(); + PBIResult ic_result = PBIResult::Ok; + uint64_t ic_arg0 = 0, ic_arg1 = 0, ic_arg2 = 0, ic_ret = 0; + if (IsRestart) { ic_result = restartCode; TRACE_PRINTF( @@ -5996,11 +6098,13 @@ PBIResult PortableBaselineInterpret( } ret->setUndefined(); - // Check if we are being debugged, and set a flag in the frame if so. This - // flag must be set before calling InitFunctionEnvironmentObjects. - if (frame->script()->isDebuggee()) { - TRACE_PRINTF("Script is debuggee\n"); - frame->setIsDebuggee(); + if (!Specialized) { + // Check if we are being debugged, and set a flag in the frame if so. This + // flag must be set before calling InitFunctionEnvironmentObjects. + if (frame->script()->isDebuggee()) { + TRACE_PRINTF("Script is debuggee\n"); + frame->setIsDebuggee(); + } } if (CalleeTokenIsFunction(frame->calleeToken())) { @@ -6017,37 +6121,43 @@ PBIResult PortableBaselineInterpret( } // The debug prologue can't run until the function environment is set up. - if (frame->script()->isDebuggee()) { - PUSH_EXIT_FRAME(); - if (!DebugPrologue(cx, frame)) { - GOTO_ERROR(); - } - } - - if (!frame->script()->hasScriptCounts()) { - if (ctx.frameMgr.cxForLocalUseOnly()->realm()->collectCoverageForDebug()) { + if (!Specialized) { + if (frame->script()->isDebuggee()) { PUSH_EXIT_FRAME(); - if (!frame->script()->initScriptCounts(cx)) { + if (!DebugPrologue(cx, frame)) { GOTO_ERROR(); } } - } - COUNT_COVERAGE_MAIN(); + + if (!frame->script()->hasScriptCounts()) { + if (ctx.frameMgr.cxForLocalUseOnly() + ->realm() + ->collectCoverageForDebug()) { + PUSH_EXIT_FRAME(); + if (!frame->script()->initScriptCounts(cx)) { + GOTO_ERROR(); + } + } + } + COUNT_COVERAGE_MAIN(); #ifdef ENABLE_INTERRUPT_CHECKS - if (ctx.frameMgr.cxForLocalUseOnly()->hasAnyPendingInterrupt()) { - PUSH_EXIT_FRAME(); - if (!InterruptCheck(cx)) { - GOTO_ERROR(); + if (ctx.frameMgr.cxForLocalUseOnly()->hasAnyPendingInterrupt()) { + PUSH_EXIT_FRAME(); + if (!InterruptCheck(cx)) { + GOTO_ERROR(); + } } - } #endif + } TRACE_PRINTF("Entering: sp = %p fp = %p frame = %p, script = %p, pc = %p\n", sp, ctx.stack.fp, frame, frame->script(), pc); TRACE_PRINTF("nslots = %d nfixed = %d\n", int(frame->script()->nslots()), int(frame->script()->nfixed())); + PBL_PUSH_CTX(pc); + while (true) { DEBUG_CHECK(); @@ -6322,7 +6432,8 @@ PBIResult PortableBaselineInterpret( result = Value::fromRawBits(ic_ret).toBoolean(); } int32_t jumpOffset = GET_JUMP_OFFSET(pc); - if (!result) { + int choice = PBL_SPECIALIZE_VALUE(uint32_t(result), 0, 1); + if (!choice) { ADVANCE(jumpOffset); PREDICT_NEXT(JumpTarget); PREDICT_NEXT(LoopHead); @@ -6348,7 +6459,8 @@ PBIResult PortableBaselineInterpret( result = Value::fromRawBits(ic_ret).toBoolean(); } int32_t jumpOffset = GET_JUMP_OFFSET(pc); - if (result) { + int choice = PBL_SPECIALIZE_VALUE(uint32_t(result), 0, 1); + if (choice) { ADVANCE(jumpOffset); PREDICT_NEXT(JumpTarget); PREDICT_NEXT(LoopHead); @@ -6376,7 +6488,8 @@ PBIResult PortableBaselineInterpret( result = Value::fromRawBits(ic_ret).toBoolean(); } int32_t jumpOffset = GET_JUMP_OFFSET(pc); - if (result) { + int choice = PBL_SPECIALIZE_VALUE(uint32_t(result), 0, 1); + if (choice) { ADVANCE(jumpOffset); PREDICT_NEXT(JumpTarget); PREDICT_NEXT(LoopHead); @@ -6404,7 +6517,8 @@ PBIResult PortableBaselineInterpret( result = Value::fromRawBits(ic_ret).toBoolean(); } int32_t jumpOffset = GET_JUMP_OFFSET(pc); - if (!result) { + int choice = PBL_SPECIALIZE_VALUE(uint32_t(result), 0, 1); + if (!choice) { ADVANCE(jumpOffset); PREDICT_NEXT(JumpTarget); PREDICT_NEXT(LoopHead); @@ -7737,6 +7851,10 @@ PBIResult PortableBaselineInterpret( uint32_t argc = GET_ARGC(pc); do { { + if (Specialized) { + break; + } + // CallArgsFromSp would be called with // - numValues = argc + 2 + constructing // - stackSlots = argc + constructing @@ -7796,6 +7914,10 @@ PBIResult PortableBaselineInterpret( TRACE_PRINTF("missed fastpath: not enough arguments\n"); break; } + if (PBL_SCRIPT_HAS_SPECIALIZATION(calleeScript)) { + TRACE_PRINTF("missed fastpath: specialized function exists\n"); + break; + } // Fast-path: function, interpreted, has JitScript, same realm, no // argument underflow. @@ -7873,10 +7995,11 @@ PBIResult PortableBaselineInterpret( ctx.frameMgr.switchToFrame(frame); ctx.frame = frame; // 6. Set up PC and SP for callee. - sp = reinterpret_cast(frame); + RESET_SP(reinterpret_cast(frame)); RESET_PC(calleeScript->code(), calleeScript); // 7. Check callee stack space for max stack depth. - if (!stack.check(sp, sizeof(StackVal) * calleeScript->nslots())) { + if (!ctx.stack.check(sp, + sizeof(StackVal) * calleeScript->nslots())) { PUSH_EXIT_FRAME(); ReportOverRecursed(ctx.frameMgr.cxForLocalUseOnly()); GOTO_ERROR(); @@ -7934,6 +8057,8 @@ PBIResult PortableBaselineInterpret( // Slow path: use the IC! ic_arg0 = argc; + IC_ZERO_ARG(1); + IC_ZERO_ARG(2); ctx.icregs.extraArgs = 2 + constructing; INVOKE_IC(Call, false); VIRTPOPN(argc + 2 + constructing); @@ -7960,6 +8085,8 @@ PBIResult PortableBaselineInterpret( CASE(SpreadNew) { static_assert(JSOpLength_SpreadSuperCall == JSOpLength_SpreadNew); ic_arg0 = 1; + IC_ZERO_ARG(1); + IC_ZERO_ARG(2); ctx.icregs.extraArgs = 3; INVOKE_IC(SpreadCall, false); VIRTPOPN(4); @@ -8288,7 +8415,9 @@ PBIResult PortableBaselineInterpret( } CASE(Coalesce) { - if (!VIRTSP(0).asValue().isNullOrUndefined()) { + bool cond = !VIRTSP(0).asValue().isNullOrUndefined(); + int choice = PBL_SPECIALIZE_VALUE(int(cond), 0, 1); + if (choice) { ADVANCE(GET_JUMP_OFFSET(pc)); DISPATCH(); } else { @@ -8298,7 +8427,8 @@ PBIResult PortableBaselineInterpret( CASE(Case) { bool cond = VIRTPOP().asValue().toBoolean(); - if (cond) { + int choice = PBL_SPECIALIZE_VALUE(int(cond), 0, 1); + if (choice) { VIRTPOP(); ADVANCE(GET_JUMP_OFFSET(pc)); DISPATCH(); @@ -8328,7 +8458,8 @@ PBIResult PortableBaselineInterpret( } if (i >= low && i <= high) { - uint32_t idx = uint32_t(i) - uint32_t(low); + uint32_t idx = PBL_SPECIALIZE_VALUE(uint32_t(i) - uint32_t(low), 0, + uint32_t(high - low + 1)); uint32_t firstResumeIndex = GET_RESUMEINDEX(pc + 3 * JUMP_OFFSET_LEN); pc = entryPC + resumeOffsets[firstResumeIndex + idx]; DISPATCH(); @@ -8363,28 +8494,29 @@ PBIResult PortableBaselineInterpret( } from_unwind = false; - uint32_t argc = frame->numActualArgs(); - sp = ctx.stack.popFrame(); + RESET_SP(ctx.stack.popFrame()); // If FP is higher than the entry frame now, return; otherwise, // do an inline state update. - if (stack.fp > entryFrame) { - *ret = frame->returnValue(); + if (Specialized || stack.fp > entryFrame) { + *ctx.ret = frame->returnValue(); TRACE_PRINTF("ret = %" PRIx64 "\n", ret->asRawBits()); return ok ? PBIResult::Ok : PBIResult::Error; } else { TRACE_PRINTF("Return fastpath\n"); + uint32_t argc = frame->numActualArgs(); Value ret = frame->returnValue(); TRACE_PRINTF("ret = %" PRIx64 "\n", ret.asRawBits()); // Pop exit frame as well. - sp = ctx.stack.popFrame(); + RESET_SP(ctx.stack.popFrame()); // Pop fake return address and descriptor. POPNNATIVE(2); // Set PC, frame, and current script. frame = reinterpret_cast( - reinterpret_cast(stack.fp) - BaselineFrame::Size()); + reinterpret_cast(ctx.stack.fp) - + BaselineFrame::Size()); TRACE_PRINTF(" sp -> %p, fp -> %p, frame -> %p\n", sp, ctx.stack.fp, frame); ctx.frameMgr.switchToFrame(frame); @@ -8539,13 +8671,14 @@ PBIResult PortableBaselineInterpret( } CASE(InitLexical) { uint32_t i = GET_LOCALNO(pc); - frame->unaliasedLocal(i) = VIRTSP(0).asValue(); + SETLOCAL(i, VIRTSP(0).asValue()); END_OP(InitLexical); } CASE(InitAliasedLexical) { EnvironmentCoordinate ec = EnvironmentCoordinate(pc); - EnvironmentObject& obj = getEnvironmentFromCoordinate(frame, ec); + EnvironmentObject& obj = + getEnvironmentFromCoordinate(frame, ec); obj.setAliasedBinding(ec, VIRTSP(0).asValue()); END_OP(InitAliasedLexical); } @@ -8650,7 +8783,8 @@ PBIResult PortableBaselineInterpret( static_assert(JSOpLength_GetAliasedVar == JSOpLength_GetAliasedDebugVar); EnvironmentCoordinate ec = EnvironmentCoordinate(pc); - EnvironmentObject& obj = getEnvironmentFromCoordinate(frame, ec); + EnvironmentObject& obj = + getEnvironmentFromCoordinate(frame, ec); VIRTPUSH(StackVal(obj.aliasedBinding(ec))); END_OP(GetAliasedVar); } @@ -8745,7 +8879,8 @@ PBIResult PortableBaselineInterpret( CASE(SetAliasedVar) { EnvironmentCoordinate ec = EnvironmentCoordinate(pc); - EnvironmentObject& obj = getEnvironmentFromCoordinate(frame, ec); + EnvironmentObject& obj = + getEnvironmentFromCoordinate(frame, ec); MOZ_ASSERT(!IsUninitializedLexical(obj.aliasedBinding(ec))); obj.setAliasedBinding(ec, VIRTSP(0).asValue()); END_OP(SetAliasedVar); @@ -9053,11 +9188,13 @@ PBIResult PortableBaselineInterpret( END_OP(Unpick); } CASE(DebugCheckSelfHosted) { - HandleValue val = SPHANDLE(0); - { - PUSH_EXIT_FRAME(); - if (!Debug_CheckSelfHosted(cx, val)) { - GOTO_ERROR(); + if (!Specialized) { + HandleValue val = SPHANDLE(0); + { + PUSH_EXIT_FRAME(); + if (!Debug_CheckSelfHosted(cx, val)) { + GOTO_ERROR(); + } } } END_OP(DebugCheckSelfHosted); @@ -9086,9 +9223,15 @@ PBIResult PortableBaselineInterpret( restart: // This is a `goto` target so that we exit any on-stack exit frames // before restarting, to match previous behavior. - return PortableBaselineInterpret( - ctx.frameMgr.cxForLocalUseOnly(), ctx.state, ctx.stack, sp, envChain, ret, - pc, isd, entryPC, frame, entryFrame, restartCode); + // + // Note carefully that every arg here is loaded from `ctx` except + // for `pcoffset`, which can be computed as a constant when this + // code is specialized. This is intentional: it reduces register + // pressure across the main function body. + return PortableBaselineInterpret( + ctx.frameMgr.cxForLocalUseOnly(), ctx.state, ctx.stack, ctx.sp(), + ctx.envChain, ctx.ret, ctx.pcbase, pcoffset, ctx.isd, ctx.entryPC, + ctx.frame, ctx.entryFrame, restartCode); error: TRACE_PRINTF("HandleException: frame %p\n", frame); @@ -9117,7 +9260,7 @@ PBIResult PortableBaselineInterpret( case ExceptionResumeKind::Finally: RESET_PC(frame->interpreterPC(), frame->script()); ctx.stack.fp = reinterpret_cast(rfe.framePointer); - sp = reinterpret_cast(rfe.stackPointer); + RESET_SP(reinterpret_cast(rfe.stackPointer)); TRACE_PRINTF(" -> finally to pc %p\n", pc); VIRTPUSH(StackVal(rfe.exception)); VIRTPUSH(StackVal(rfe.exceptionStack)); @@ -9153,6 +9296,8 @@ PBIResult PortableBaselineInterpret( DISPATCH(); ic_fail: + PBL_POP_CTX(); // inner "slow path" context + PBL_POP_CTX(); // PC context RESTART(ic_result); switch (ic_result) { case PBIResult::Ok: @@ -9174,7 +9319,7 @@ PBIResult PortableBaselineInterpret( TRACE_PRINTF(" -> returning\n"); return PBIResult::Unwind; } - sp = ctx.stack.unwindingSP; + RESET_SP(ctx.stack.unwindingSP); ctx.stack.fp = ctx.stack.unwindingFP; frame = reinterpret_cast( reinterpret_cast(ctx.stack.fp) - BaselineFrame::Size()); @@ -9194,7 +9339,7 @@ PBIResult PortableBaselineInterpret( reinterpret_cast(entryFrame) + BaselineFrame::Size()) { return PBIResult::Error; } - sp = ctx.stack.unwindingSP; + RESET_SP(ctx.stack.unwindingSP); ctx.stack.fp = ctx.stack.unwindingFP; frame = reinterpret_cast( reinterpret_cast(ctx.stack.fp) - BaselineFrame::Size()); @@ -9212,10 +9357,10 @@ PBIResult PortableBaselineInterpret( } if (reinterpret_cast(ctx.stack.unwindingFP) == reinterpret_cast(entryFrame) + BaselineFrame::Size()) { - *ret = frame->returnValue(); + *ctx.ret = frame->returnValue(); return PBIResult::Ok; } - sp = ctx.stack.unwindingSP; + RESET_SP(ctx.stack.unwindingSP); ctx.stack.fp = ctx.stack.unwindingFP; frame = reinterpret_cast( reinterpret_cast(ctx.stack.fp) - BaselineFrame::Size()); @@ -9226,7 +9371,6 @@ PBIResult PortableBaselineInterpret( from_unwind = true; goto do_return; -#ifndef __wasi__ debug:; { TRACE_PRINTF("hit debug point\n"); @@ -9239,7 +9383,6 @@ debug:; TRACE_PRINTF("HandleDebugTrap done\n"); } goto dispatch; -#endif } /* @@ -9306,9 +9449,10 @@ bool PortableBaselineTrampoline(JSContext* cx, size_t argc, Value* argv, jsbytecode* pc = script->code(); ImmutableScriptData* isd = script->immutableScriptData(); PBIResult ret; - ret = PortableBaselineInterpret( - cx, state, stack, sp, envChain, result, pc, isd, nullptr, nullptr, - nullptr, PBIResult::Ok); + PBL_CALL_INTERP(ret, script, + (PortableBaselineInterpret), + cx, state, stack, sp, envChain, result, pc, 0, isd, nullptr, + nullptr, nullptr, PBIResult::Ok); switch (ret) { case PBIResult::Ok: case PBIResult::UnwindRet: @@ -9380,5 +9524,65 @@ bool PortablebaselineInterpreterStackCheck(JSContext* cx, RunState& state, return (top - base) >= needed; } +#ifdef ENABLE_JS_PBL_WEVAL + +// IDs for interpreter bodies that we weval, so that we can stably +// associate collected request bodies with interpreters even when +// SpiderMonkey is relinked and actual function pointer values may +// change. +static const uint32_t WEVAL_JSOP_ID = 1; +static const uint32_t WEVAL_IC_ID = 2; + +WEVAL_DEFINE_TARGET(1, (PortableBaselineInterpret)); +WEVAL_DEFINE_TARGET(2, (ICInterpretOps)); + +void EnqueueScriptSpecialization(JSScript* script) { + Weval& weval = script->weval(); + if (!weval.req) { + using weval::Runtime; + using weval::Specialize; + using weval::SpecializeMemory; + + jsbytecode* pc = script->code(); + uint32_t pc_len = script->length(); + ImmutableScriptData* isd = script->immutableScriptData(); + uint32_t isd_len = isd->immutableData().Length(); + + weval.req = weval::weval( + reinterpret_cast(&weval.func), + &PortableBaselineInterpret, WEVAL_JSOP_ID, + /* num_globals = */ 2, + Specialize(script->argsObjAliasesFormals() ? 1 : 0), + Specialize(script->nfixed()), Runtime(), + Runtime(), Runtime(), Runtime(), + Runtime(), Runtime(), + SpecializeMemory(pc, pc_len), Specialize(0), + SpecializeMemory(isd, isd_len), + Runtime(), Runtime(), Runtime(), + Runtime()); + } +} + +void EnqueueICStubSpecialization(CacheIRStubInfo* stubInfo) { + Weval& weval = stubInfo->weval(); + if (!weval.req) { + using weval::Runtime; + using weval::SpecializeMemory; + + // StubInfo length: do not include the `Weval` object pointer, as + // it is nondeterministic. + uint32_t len = sizeof(CacheIRStubInfo) - sizeof(void*); + + weval.req = + weval::weval(reinterpret_cast(&weval.func), + &ICInterpretOps, WEVAL_IC_ID, /* num_globals = */ 2, + SpecializeMemory(stubInfo, len), + SpecializeMemory(stubInfo->code(), + stubInfo->codeLength())); + } +} + +#endif // ENABLE_JS_PBL_WEVAL + } // namespace pbl } // namespace js diff --git a/js/src/vm/PortableBaselineInterpret.h b/js/src/vm/PortableBaselineInterpret.h index 7bc49e309e6ef..46f80d1ae5858 100644 --- a/js/src/vm/PortableBaselineInterpret.h +++ b/js/src/vm/PortableBaselineInterpret.h @@ -329,16 +329,26 @@ enum class PBIResult { UnwindRet, }; -template +template PBIResult PortableBaselineInterpret( JSContext* cx_, State& state, Stack& stack, StackVal* sp, - JSObject* envChain, Value* ret, jsbytecode* pc, ImmutableScriptData* isd, - jsbytecode* restartEntryPC, jit::BaselineFrame* restartFrame, - StackVal* restartEntryFrame, PBIResult restartCode); + JSObject* envChain, Value* ret, jsbytecode* pcbase, uint32_t pcoffset, + ImmutableScriptData* isd, jsbytecode* restartEntryPC, + jit::BaselineFrame* restartFrame, StackVal* restartEntryFrame, + PBIResult restartCode); uint8_t* GetPortableFallbackStub(jit::BaselineICFallbackKind kind); uint8_t* GetICInterpreter(); +#ifdef ENABLE_JS_PBL_WEVAL +// Register the existence of a JSScript, in case PBL may have a way to +// accelerate it (e.g., register a weval specialization request). +void EnqueueScriptSpecialization(JSScript* script); +// Register the existence of an ICScript, in case PBL may have a way +// to accelerate it (e.g., register a weval specialization request). +void EnqueueICStubSpecialization(jit::CacheIRStubInfo* stub); +#endif + } /* namespace pbl */ } /* namespace js */ diff --git a/js/src/vm/Weval.h b/js/src/vm/Weval.h new file mode 100644 index 0000000000000..fd805e3f943cf --- /dev/null +++ b/js/src/vm/Weval.h @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +#ifndef vm_Weval_h +#define vm_Weval_h + +#ifdef ENABLE_JS_PBL_WEVAL +# include +#endif + +namespace js { + +#ifdef ENABLE_JS_PBL_WEVAL + +struct Weval { + weval_func_t func; + weval_req_t* req; + + public: + Weval() : func(nullptr), req(nullptr) {} + ~Weval() { + if (req) { + weval_free(req); + req = nullptr; + } + } +}; + +#endif +} // namespace js + +#endif /* vm_Weval_h */ diff --git a/third_party/weval/LICENSE b/third_party/weval/LICENSE new file mode 100644 index 0000000000000..f9d81955f4bcb --- /dev/null +++ b/third_party/weval/LICENSE @@ -0,0 +1,220 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +--- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + diff --git a/third_party/weval/weval.h b/third_party/weval/weval.h new file mode 100644 index 0000000000000..3648d5d0012a3 --- /dev/null +++ b/third_party/weval/weval.h @@ -0,0 +1,489 @@ +#pragma once + +#include +#include +#include + +/* ------------------------------------------------------------------------- */ +/* partial-evaluation async requests and queues */ +/* ------------------------------------------------------------------------- */ + +typedef void (*weval_func_t)(); + +typedef struct weval_req_t weval_req_t; +typedef struct weval_req_arg_t weval_req_arg_t; +typedef struct weval_lookup_entry_t weval_lookup_entry_t; +typedef struct weval_lookup_t weval_lookup_t; + +struct weval_req_t { + weval_req_t* next; + weval_req_t* prev; + /* A user-provided ID of the weval'd function, for stability of + * collected request bodies across relinkings: */ + uint32_t func_id; + uint32_t + num_globals; /* how many globals to specialize (prepended to arg list)? */ + weval_func_t func; + uint8_t* argbuf; + uint32_t arglen; + weval_func_t* specialized; +}; + +typedef enum { + weval_req_arg_i32 = 0, + weval_req_arg_i64 = 1, + weval_req_arg_f32 = 2, + weval_req_arg_f64 = 3, + weval_req_arg_buffer = 4, + weval_req_arg_none = 255, +} weval_req_arg_type; + +struct weval_req_arg_t { + uint32_t specialize; /* is this argument specialized? */ + uint32_t + ty; /* type of specialization value (`weval_req_arg_type` enum value). */ + /* The value to specialize on: */ + union { + uint64_t raw; + uint32_t i32; + uint64_t i64; + float f32; + double f64; + struct { + /* A pointer to arbitrary memory with constant contents of the + * given length; data follows. */ + uint32_t len; + /* Size of buffer in data stream; next arg follows inline data. */ + uint32_t padded_len; + } buffer; + } u; +}; + +/* Lookup table created by weval for pre-inserted wevaled function bodies */ +struct weval_lookup_t { + weval_lookup_entry_t* entries; + uint32_t nentries; +}; + +struct weval_lookup_entry_t { + uint32_t func_id; + const uint8_t* argbuf; + uint32_t arglen; + weval_func_t specialized; +}; + +extern weval_req_t* weval_req_pending_head; +extern bool weval_is_wevaled; +extern weval_lookup_t weval_lookup_table; + +#define WEVAL_DEFINE_GLOBALS() \ + weval_req_t* weval_req_pending_head; \ + __attribute__((export_name("weval.pending.head"))) weval_req_t** \ + __weval_pending_head() { \ + return &weval_req_pending_head; \ + } \ + \ + bool weval_is_wevaled; \ + __attribute__((export_name("weval.is.wevaled"))) bool* \ + __weval_is_wevaled() { \ + return &weval_is_wevaled; \ + } + +// #define WEVAL_DEFINE_TARGET(index, func) \ +// __attribute__((export_name("weval.func." #index))) \ +// weval_func_t __weval_func_##index() { \ +// return (weval_func_t) & (func); \ +// } +#define WEVAL_DEFINE_TARGET(index, func) \ + __attribute__((export_name("weval.func." #index))) \ + __attribute__((used)) \ + void* __weval_func_##index() { \ + volatile weval_func_t ptr = (weval_func_t)(func); \ + return (void*)ptr; \ + } + +static inline void weval_request(weval_req_t* req) { + if (weval_is_wevaled) { + /* nothing! */ + } else { + req->next = weval_req_pending_head; + req->prev = NULL; + if (weval_req_pending_head) { + weval_req_pending_head->prev = req; + } + weval_req_pending_head = req; + } +} + +static inline void weval_free(weval_req_t* req) { + if (req->prev) { + req->prev->next = req->next; + } else if (weval_req_pending_head == req) { + weval_req_pending_head = req->next; + } + if (req->next) { + req->next->prev = req->prev; + } + if (req->argbuf) { + free(req->argbuf); + } + free(req); +} + +/* ------------------------------------------------------------------------- */ +/* intrinsics */ +/* ------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +#define WEVAL_WASM_IMPORT(name) \ + __attribute__((__import_module__("weval"), __import_name__(name))) + +/* Core intrinsics for interpreter loops: contexts, registers, value + * specialization */ + +void weval_push_context(uint32_t pc) WEVAL_WASM_IMPORT("push.context"); +void weval_pop_context() WEVAL_WASM_IMPORT("pop.context"); +void weval_update_context(uint32_t pc) WEVAL_WASM_IMPORT("update.context"); +uint64_t weval_read_reg(uint64_t idx) WEVAL_WASM_IMPORT("read.reg"); +void weval_write_reg(uint64_t idx, uint64_t value) + WEVAL_WASM_IMPORT("write.reg"); +uint32_t weval_specialize_value(uint32_t value, uint32_t lo, uint32_t hi) + WEVAL_WASM_IMPORT("specialize.value"); +uint64_t weval_read_specialization_global(uint32_t index) + WEVAL_WASM_IMPORT("read.specialization.global"); + +/* Operand-stack virtualization */ + +/* + * The stack is tracked abstractly as part of block specialization + * context, and has entries of the form: + * + * /// Some value pushed onto stack. Not actually stored until + * /// state is synced. + * struct StackEntry { + * /// The address at which the value is stored. + * stackptr: Value, + * /// The value to store (and return from pops/stack-reads). + * value: Value, + * } + */ + +/* Push a value on the abstract stack; does not yet actually store + * memory until sync'd. */ +void weval_push_stack(uint64_t* ptr, uint64_t value) + WEVAL_WASM_IMPORT("push.stack"); +/* Synchronize all stack entries to the actual stack. */ +void weval_sync_stack() WEVAL_WASM_IMPORT("sync.stack"); +/* Read an entry from the virtual stack if available (index 0 is + * just-pushed, 1 is one push before that, etc.) Loads from the + * pointer if that index is not available. */ +uint64_t weval_read_stack(uint64_t* ptr, uint32_t index) + WEVAL_WASM_IMPORT("read.stack"); +/* Write an entry at an existing stack index */ +void weval_write_stack(uint64_t* ptr, uint32_t index, uint64_t value) + WEVAL_WASM_IMPORT("write.stack"); +/* Pops an entry from the stack, canceling its store if any (the + * effect never occurs). */ +uint64_t weval_pop_stack(uint64_t* ptr) WEVAL_WASM_IMPORT("pop.stack"); + +/* Locals virtualization; locals are also flushed when the stack is + * flushed */ + +uint64_t weval_read_local(uint64_t* ptr, uint32_t index) + WEVAL_WASM_IMPORT("read.local"); +void weval_write_local(uint64_t* ptr, uint32_t index, uint64_t value) + WEVAL_WASM_IMPORT("write.local"); + +/* Debugging and stats intrinsics */ + +void weval_trace_line(uint32_t line_number) WEVAL_WASM_IMPORT("trace.line"); +void weval_abort_specialization(uint32_t line_number, uint32_t fatal) + WEVAL_WASM_IMPORT("abort.specialization"); +void weval_assert_const32(uint32_t value, uint32_t line_no) + WEVAL_WASM_IMPORT("assert.const32"); +void weval_print(const char* message, uint32_t line, uint32_t val) + WEVAL_WASM_IMPORT("print"); +void weval_context_bucket(uint32_t bucket) WEVAL_WASM_IMPORT("context.bucket"); + +#undef WEVAL_WASM_IMPORT + +#ifdef __cplusplus +} // extern "C" +#endif + +#ifdef __cplusplus +namespace weval { +static inline void push_context(uint32_t pc) { weval_push_context(pc); } +static inline void pop_context() { weval_pop_context(); } +static inline void update_context(uint32_t pc) { weval_update_context(pc); } +} // namespace weval +#endif // __cplusplus + +/* ------------------------------------------------------------------------- */ +/* C++ type-safe wrapper for partial evaluation of functions */ +/* ------------------------------------------------------------------------- */ + +#ifdef __cplusplus +namespace weval { + +struct ArgWriter { + static const size_t MAX = 1024 * 1024; + + uint8_t* buffer; + size_t len; + size_t cap; + + ArgWriter() : buffer(nullptr), len(0), cap(0) {} + + uint8_t* alloc(size_t bytes) { + if (bytes + len > MAX) { + return nullptr; + } + if (bytes + len > cap) { + size_t desired_cap = (cap == 0) ? 1024 : cap; + while (desired_cap < (len + bytes)) { + desired_cap *= 2; + } + buffer = reinterpret_cast(realloc(buffer, desired_cap)); + if (!buffer) { + return nullptr; + } + cap = desired_cap; + } + uint8_t* ret = buffer + len; + len += bytes; + return ret; + } + + template + bool write(T t) { + uint8_t* mem = alloc(sizeof(T)); + if (!mem) { + return false; + } + memcpy(mem, reinterpret_cast(&t), sizeof(T)); + return true; + } + + uint8_t* take() { + uint8_t* ret = buffer; + buffer = nullptr; + len = 0; + cap = 0; + return ret; + } +}; + +template +struct ArgSpec {}; + +template +struct RuntimeArg : ArgSpec {}; + +template +RuntimeArg Runtime() { + return RuntimeArg{}; +} + +template +struct Specialize : ArgSpec { + T value; + explicit Specialize(T value_) : value(value_) {} +}; + +template +struct SpecializeMemory : ArgSpec { + T ptr; + uint32_t len; + SpecializeMemory(T ptr_, uint32_t len_) : ptr(ptr_), len(len_) {} + SpecializeMemory(const SpecializeMemory& other) = default; +}; + +namespace impl { +template +using FuncPtr = Ret (*)(Args...); + +template +struct StoreArg; + +template <> +struct StoreArg { + bool operator()(ArgWriter& args, uint32_t value) { + weval_req_arg_t arg; + arg.specialize = 1; + arg.ty = weval_req_arg_i32; + arg.u.raw = 0; + arg.u.i32 = value; + return args.write(arg); + } +}; +template <> +struct StoreArg { + bool operator()(ArgWriter& args, bool value) { + weval_req_arg_t arg; + arg.specialize = 1; + arg.ty = weval_req_arg_i32; + arg.u.raw = 0; + arg.u.i32 = value ? 1 : 0; + return args.write(arg); + } +}; +template <> +struct StoreArg { + bool operator()(ArgWriter& args, uint64_t value) { + weval_req_arg_t arg; + arg.specialize = 1; + arg.ty = weval_req_arg_i64; + arg.u.raw = 0; + arg.u.i64 = value; + return args.write(arg); + } +}; +template <> +struct StoreArg { + bool operator()(ArgWriter& args, float value) { + weval_req_arg_t arg; + arg.specialize = 1; + arg.ty = weval_req_arg_f32; + arg.u.raw = 0; + arg.u.f32 = value; + return args.write(arg); + } +}; +template <> +struct StoreArg { + bool operator()(ArgWriter& args, double value) { + weval_req_arg_t arg; + arg.specialize = 1; + arg.ty = weval_req_arg_f64; + arg.u.raw = 0; + arg.u.f64 = value; + return args.write(arg); + } +}; +template +struct StoreArg { + bool operator()(ArgWriter& args, T* value) { + static_assert(sizeof(T*) == 4, "Only 32-bit Wasm supported"); + weval_req_arg_t arg; + arg.specialize = 1; + arg.ty = weval_req_arg_i32; + arg.u.raw = 0; + arg.u.i32 = reinterpret_cast(value); + return args.write(arg); + } +}; +template +struct StoreArg { + bool operator()(ArgWriter& args, T& value) { + return StoreArg(args, &value); + } +}; +template +struct StoreArg { + bool operator()(ArgWriter& args, const T* value) { + static_assert(sizeof(const T*) == 4, "Only 32-bit Wasm supported"); + weval_req_arg_t arg; + arg.specialize = 1; + arg.ty = weval_req_arg_i32; + arg.u.raw = 0; + arg.u.i32 = reinterpret_cast(value); + return args.write(arg); + } +}; + +template +struct StoreArgs {}; + +template <> +struct StoreArgs<> { + bool operator()(ArgWriter& args) { return true; } +}; + +template +struct StoreArgs, Rest...> { + bool operator()(ArgWriter& args, Specialize arg0, Rest... rest) { + if (!StoreArg()(args, arg0.value)) { + return false; + } + return StoreArgs()(args, rest...); + } +}; + +template +struct StoreArgs, Rest...> { + bool operator()(ArgWriter& args, SpecializeMemory arg0, Rest... rest) { + weval_req_arg_t arg; + arg.specialize = 1; + arg.ty = weval_req_arg_buffer; + arg.u.raw = 0; + arg.u.buffer.len = arg0.len; + arg.u.buffer.padded_len = (arg0.len + 7) & ~7; // Align to 8-byte boundary. + if (!args.write(arg)) { + return false; + } + const uint8_t* src = reinterpret_cast(arg0.ptr); + uint8_t* dst = args.alloc(arg.u.buffer.padded_len); + if (!dst) { + return false; + } + memcpy(dst, src, arg0.len); + if (arg.u.buffer.padded_len > arg.u.buffer.len) { + // Ensure deterministic (zeroed) padding bytes. + memset(dst + arg.u.buffer.len, 0, + arg.u.buffer.padded_len - arg.u.buffer.len); + } + return StoreArgs()(args, rest...); + } +}; + +template +struct StoreArgs, Rest...> { + bool operator()(ArgWriter& args, RuntimeArg arg0, Rest... rest) { + weval_req_arg_t arg; + arg.specialize = 0; + arg.ty = weval_req_arg_none; + arg.u.raw = 0; + if (!args.write(arg)) { + return false; + } + return StoreArgs()(args, rest...); + } +}; + +} // namespace impl + +template +weval_req_t* weval(impl::FuncPtr* dest, + impl::FuncPtr generic, uint32_t func_id, + uint32_t num_globals, + WrappedArgs... args) { + weval_req_t* req = (weval_req_t*)malloc(sizeof(weval_req_t)); + if (!req) { + return nullptr; + } + ArgWriter writer; + if (!impl::StoreArgs()(writer, args...)) { + return nullptr; + } + + req->func_id = func_id; + req->num_globals = num_globals; + req->func = (weval_func_t)generic; + req->arglen = writer.len; + req->argbuf = writer.take(); + req->specialized = (weval_func_t*)dest; + + weval_request(req); + + return req; +} + +inline void free(weval_req_t* req) { weval_free(req); } + +} // namespace weval + +#endif // __cplusplus From f8ac5833b9fff2c41f86e51a2cc287b0acf4cb8c Mon Sep 17 00:00:00 2001 From: Tomasz Andrzejak Date: Tue, 24 Feb 2026 19:12:26 +0100 Subject: [PATCH 09/10] Add IC corpus for PBL ahead-of-time ICs --- js/src/ics/IC-10012932722129304576 | 1 + js/src/ics/IC-10017063470928229984 | 1 + js/src/ics/IC-10024653209997799430 | 1 + js/src/ics/IC-10027192055534650466 | 1 + js/src/ics/IC-10047658442846226757 | 1 + js/src/ics/IC-10071222831863122338 | 1 + js/src/ics/IC-10085408470993969915 | 1 + js/src/ics/IC-10112295838932053588 | 1 + js/src/ics/IC-10120036528695626238 | 1 + js/src/ics/IC-10133658182771939722 | 1 + js/src/ics/IC-10146627587987531577 | 1 + js/src/ics/IC-10174150775558148628 | 1 + js/src/ics/IC-10183979387394653126 | 1 + js/src/ics/IC-10190184921897590573 | 1 + js/src/ics/IC-10206623616188944477 | 1 + js/src/ics/IC-1021055887912932210 | 1 + js/src/ics/IC-10229792663333787841 | 1 + js/src/ics/IC-10285160584534782478 | 1 + js/src/ics/IC-10287899934032377038 | 1 + js/src/ics/IC-10296630081760163552 | 1 + js/src/ics/IC-10323304896754139606 | 1 + js/src/ics/IC-10337334507454623397 | 1 + js/src/ics/IC-10354653151230292671 | 1 + js/src/ics/IC-10387960712561871230 | 1 + js/src/ics/IC-10390855945778908237 | 1 + js/src/ics/IC-10398018477319480099 | 1 + js/src/ics/IC-10419927781334253497 | 1 + js/src/ics/IC-10467058652674703426 | 1 + js/src/ics/IC-10493323457472461123 | 1 + js/src/ics/IC-10504739238754050285 | 1 + js/src/ics/IC-10508634394369394069 | 1 + js/src/ics/IC-10517045791805761861 | 1 + js/src/ics/IC-10539062004584484050 | 1 + js/src/ics/IC-10552508641524210829 | 1 + js/src/ics/IC-10557077917219503953 | 1 + js/src/ics/IC-10557234435714705037 | 1 + js/src/ics/IC-1057791614928279724 | 1 + js/src/ics/IC-10594532515162574745 | 1 + js/src/ics/IC-1059520217747093635 | 1 + js/src/ics/IC-10624605180333492108 | 1 + js/src/ics/IC-10631882817250290341 | 1 + js/src/ics/IC-10632368867850150164 | 1 + js/src/ics/IC-1065699860197787893 | 1 + js/src/ics/IC-10666528917422509453 | 1 + js/src/ics/IC-10705031122100274016 | 1 + js/src/ics/IC-10705525611129912618 | 1 + js/src/ics/IC-10713018433347600908 | 1 + js/src/ics/IC-10714232282968382548 | 1 + js/src/ics/IC-10722218364273034881 | 1 + js/src/ics/IC-10728486856959292234 | 1 + js/src/ics/IC-10739734239018832127 | 1 + js/src/ics/IC-10783119225808419178 | 1 + js/src/ics/IC-10785410580519018791 | 1 + js/src/ics/IC-10785774754033130732 | 1 + js/src/ics/IC-10799558662845372007 | 1 + js/src/ics/IC-108091804264432729 | 1 + js/src/ics/IC-10835907626368138623 | 1 + js/src/ics/IC-10844197858476861698 | 1 + js/src/ics/IC-10845060487352600691 | 1 + js/src/ics/IC-10864341715849999487 | 1 + js/src/ics/IC-10889474852253441039 | 1 + js/src/ics/IC-10891149831505669090 | 1 + js/src/ics/IC-10892791689614926029 | 1 + js/src/ics/IC-10918584040860798834 | 1 + js/src/ics/IC-10923317551992982900 | 1 + js/src/ics/IC-10926954779920259261 | 1 + js/src/ics/IC-10979775141347768108 | 1 + js/src/ics/IC-10990951273432093646 | 1 + js/src/ics/IC-11012461244502181753 | 1 + js/src/ics/IC-11017584780111727090 | 1 + js/src/ics/IC-11018256844882494789 | 1 + js/src/ics/IC-11038123939989769693 | 1 + js/src/ics/IC-11042919346822061224 | 1 + js/src/ics/IC-11049174715014180988 | 1 + js/src/ics/IC-11060220060333108715 | 1 + js/src/ics/IC-11082178700814934535 | 1 + js/src/ics/IC-11088247450335219404 | 1 + js/src/ics/IC-11099301388699508111 | 1 + js/src/ics/IC-11108365595478169871 | 1 + js/src/ics/IC-11108560576299426297 | 1 + js/src/ics/IC-11125824584033702639 | 1 + js/src/ics/IC-11126707063016432122 | 1 + js/src/ics/IC-11155126938465675967 | 1 + js/src/ics/IC-11159457153374891709 | 1 + js/src/ics/IC-11178347053423973510 | 1 + js/src/ics/IC-11211612145964873406 | 1 + js/src/ics/IC-11243479038559379129 | 1 + js/src/ics/IC-11250125306565772198 | 1 + js/src/ics/IC-11252846724706279705 | 1 + js/src/ics/IC-11263448588881622669 | 1 + js/src/ics/IC-11293654638617896162 | 1 + js/src/ics/IC-11297337085505550617 | 1 + js/src/ics/IC-1130563304257587708 | 1 + js/src/ics/IC-11320172572546773151 | 1 + js/src/ics/IC-11321571101584858952 | 1 + js/src/ics/IC-11326524844255251184 | 1 + js/src/ics/IC-11329216527069876807 | 1 + js/src/ics/IC-11342028399540104729 | 1 + js/src/ics/IC-11342449414654468824 | 1 + js/src/ics/IC-11366109308614220038 | 1 + js/src/ics/IC-11376266815919996863 | 1 + js/src/ics/IC-11417613263274110541 | 1 + js/src/ics/IC-11454413586868258316 | 1 + js/src/ics/IC-11458870435822720219 | 1 + js/src/ics/IC-11474570303586391308 | 1 + js/src/ics/IC-11480314688100767565 | 1 + js/src/ics/IC-11480950816980033955 | 1 + js/src/ics/IC-1149008753018867496 | 1 + js/src/ics/IC-11497767217347158124 | 1 + js/src/ics/IC-11508998258759747115 | 1 + js/src/ics/IC-11532719234975304443 | 1 + js/src/ics/IC-1154511991230356778 | 1 + js/src/ics/IC-11549215406510528747 | 1 + js/src/ics/IC-11574571414559288473 | 1 + js/src/ics/IC-11575965914216701705 | 1 + js/src/ics/IC-11584630481534884288 | 1 + js/src/ics/IC-115956099603421614 | 1 + js/src/ics/IC-11600883776069615550 | 1 + js/src/ics/IC-1160638201342710981 | 1 + js/src/ics/IC-1163104847051405417 | 1 + js/src/ics/IC-11654432696377733861 | 1 + js/src/ics/IC-11672428136127135434 | 1 + js/src/ics/IC-11717237524687619883 | 1 + js/src/ics/IC-11720463879807711297 | 1 + js/src/ics/IC-11728749527861571239 | 1 + js/src/ics/IC-11739825854642521065 | 1 + js/src/ics/IC-11751293708003933641 | 1 + js/src/ics/IC-11753442557781561422 | 1 + js/src/ics/IC-11797152210899251011 | 1 + js/src/ics/IC-11837681195604493712 | 1 + js/src/ics/IC-11845180153158895363 | 1 + js/src/ics/IC-11863523924152214302 | 1 + js/src/ics/IC-11894253971728676207 | 1 + js/src/ics/IC-11895890575808877920 | 1 + js/src/ics/IC-11897578746080597689 | 1 + js/src/ics/IC-11900209573568550991 | 1 + js/src/ics/IC-11915705574977581913 | 1 + js/src/ics/IC-11917784147139259625 | 1 + js/src/ics/IC-11920954854556069503 | 1 + js/src/ics/IC-11922998074703375584 | 1 + js/src/ics/IC-11926030484686920413 | 1 + js/src/ics/IC-11929523768962332961 | 1 + js/src/ics/IC-11966432795011431208 | 1 + js/src/ics/IC-11971878972146791849 | 1 + js/src/ics/IC-11973731599994297577 | 1 + js/src/ics/IC-11974869848038048031 | 1 + js/src/ics/IC-1197555389676146502 | 1 + js/src/ics/IC-11992046825318127452 | 1 + js/src/ics/IC-1199785264712320331 | 1 + js/src/ics/IC-12007963213199633266 | 1 + js/src/ics/IC-12041464180932850200 | 1 + js/src/ics/IC-12065190136681622706 | 1 + js/src/ics/IC-12078685233027911076 | 1 + js/src/ics/IC-12125345230025462642 | 1 + js/src/ics/IC-12128525700402149420 | 1 + js/src/ics/IC-12140967404139583523 | 1 + js/src/ics/IC-12145809946683612898 | 1 + js/src/ics/IC-12169621141189477120 | 1 + js/src/ics/IC-12171152205929690452 | 1 + js/src/ics/IC-12196014049427297313 | 1 + js/src/ics/IC-12201504879653295403 | 1 + js/src/ics/IC-12202322731571668158 | 1 + js/src/ics/IC-12203565973789721200 | 1 + js/src/ics/IC-1220410939266165701 | 1 + js/src/ics/IC-12209746183633700082 | 1 + js/src/ics/IC-12223037103699642874 | 1 + js/src/ics/IC-12229925625792126666 | 1 + js/src/ics/IC-12233302930724022918 | 1 + js/src/ics/IC-12245285497735887338 | 1 + js/src/ics/IC-12249314329615632638 | 1 + js/src/ics/IC-12256373031424411132 | 1 + js/src/ics/IC-12258217476841598370 | 1 + js/src/ics/IC-12289877284398697974 | 1 + js/src/ics/IC-12307589128357386290 | 1 + js/src/ics/IC-12331206339995042354 | 1 + js/src/ics/IC-1233965829917535966 | 1 + js/src/ics/IC-12345710976435458483 | 1 + js/src/ics/IC-12352350110830558107 | 1 + js/src/ics/IC-12371675856128831185 | 1 + js/src/ics/IC-12385358395433347552 | 1 + js/src/ics/IC-1239752390732558512 | 1 + js/src/ics/IC-12407352839699051567 | 1 + js/src/ics/IC-12443551273558633822 | 1 + js/src/ics/IC-12487802332971824960 | 1 + js/src/ics/IC-12496184382435453157 | 1 + js/src/ics/IC-1249757521006731908 | 1 + js/src/ics/IC-12498738451478602664 | 1 + js/src/ics/IC-12516077265661064965 | 1 + js/src/ics/IC-12548582455891075725 | 1 + js/src/ics/IC-12550843294731269611 | 1 + js/src/ics/IC-12551184882861653836 | 1 + js/src/ics/IC-12563077197556992774 | 1 + js/src/ics/IC-12581823821343441875 | 1 + js/src/ics/IC-12587110550698455113 | 1 + js/src/ics/IC-12595348712287346529 | 1 + js/src/ics/IC-12598398037025850460 | 1 + js/src/ics/IC-12607204059847499564 | 1 + js/src/ics/IC-12631430526166016177 | 1 + js/src/ics/IC-12635275125499063241 | 1 + js/src/ics/IC-12650195333268884682 | 1 + js/src/ics/IC-1266649421690466245 | 1 + js/src/ics/IC-12670139211231267888 | 1 + js/src/ics/IC-12672156301222351563 | 1 + js/src/ics/IC-12683654241500161406 | 1 + js/src/ics/IC-12699136477779093932 | 1 + js/src/ics/IC-12726821881891537036 | 1 + js/src/ics/IC-12729550702382520945 | 1 + js/src/ics/IC-12735248903735755888 | 1 + js/src/ics/IC-12778322974528517410 | 1 + js/src/ics/IC-12787153739956192081 | 1 + js/src/ics/IC-12817398985788194896 | 1 + js/src/ics/IC-12824617670150603619 | 1 + js/src/ics/IC-1286034681513999872 | 1 + js/src/ics/IC-1289055945440076065 | 1 + js/src/ics/IC-12898163203561858565 | 1 + js/src/ics/IC-12943703669575335204 | 1 + js/src/ics/IC-12978522289822245675 | 1 + js/src/ics/IC-12981357691094245271 | 1 + js/src/ics/IC-12981527137183523177 | 1 + js/src/ics/IC-12997906975415912917 | 1 + js/src/ics/IC-13002166095676503091 | 1 + js/src/ics/IC-13003696480971919932 | 1 + js/src/ics/IC-13011662256902718091 | 1 + js/src/ics/IC-13033903474341569707 | 1 + js/src/ics/IC-13043784027947946539 | 1 + js/src/ics/IC-13051015350853341929 | 1 + js/src/ics/IC-13081187640352631583 | 1 + js/src/ics/IC-13083324281158730695 | 1 + js/src/ics/IC-13085205972210035871 | 1 + js/src/ics/IC-13105678602020066221 | 1 + js/src/ics/IC-13108599658801043492 | 1 + js/src/ics/IC-13110895715554840408 | 1 + js/src/ics/IC-13116667660014893331 | 1 + js/src/ics/IC-1314572759126981884 | 1 + js/src/ics/IC-13174815646869447150 | 1 + js/src/ics/IC-13177021243244537568 | 1 + js/src/ics/IC-13191825944594179624 | 1 + js/src/ics/IC-13193174032408027607 | 1 + js/src/ics/IC-13202553063534550925 | 1 + js/src/ics/IC-13213951643209372357 | 1 + js/src/ics/IC-13215801888775527267 | 1 + js/src/ics/IC-13219400405226357578 | 1 + js/src/ics/IC-13222916196804984928 | 1 + js/src/ics/IC-132325594514648605 | 1 + js/src/ics/IC-13257172125999579457 | 1 + js/src/ics/IC-13266905752506190131 | 1 + js/src/ics/IC-13267965840024089330 | 1 + js/src/ics/IC-13271239178108435093 | 1 + js/src/ics/IC-13376562380096345472 | 1 + js/src/ics/IC-13384588600075681597 | 1 + js/src/ics/IC-13414121263549175469 | 1 + js/src/ics/IC-13417568664826714804 | 1 + js/src/ics/IC-13427353002263075219 | 1 + js/src/ics/IC-13433654559768403866 | 1 + js/src/ics/IC-13453167643054042561 | 1 + js/src/ics/IC-134685456544051856 | 1 + js/src/ics/IC-13471159476725365323 | 1 + js/src/ics/IC-13471620504449912811 | 1 + js/src/ics/IC-13473257844410089377 | 1 + js/src/ics/IC-13501956760510915436 | 1 + js/src/ics/IC-1351863608263831257 | 1 + js/src/ics/IC-13533339276683470532 | 1 + js/src/ics/IC-13536195992539915258 | 1 + js/src/ics/IC-13555736913312993277 | 1 + js/src/ics/IC-13556009625476393953 | 1 + js/src/ics/IC-13559342151354789534 | 1 + js/src/ics/IC-13578765989722205494 | 1 + js/src/ics/IC-13590805774714694855 | 1 + js/src/ics/IC-13598851409407123945 | 1 + js/src/ics/IC-13612588813206562818 | 1 + js/src/ics/IC-13625293738303124290 | 1 + js/src/ics/IC-13642100787672430064 | 1 + js/src/ics/IC-13648456409911318231 | 1 + js/src/ics/IC-13650715547761725318 | 1 + js/src/ics/IC-13698406506563248093 | 1 + js/src/ics/IC-13713553301365407662 | 1 + js/src/ics/IC-13721563172958389941 | 1 + js/src/ics/IC-13726068251736320735 | 1 + js/src/ics/IC-1373711190724684948 | 1 + js/src/ics/IC-1378554472176792638 | 1 + js/src/ics/IC-13812622730687272193 | 1 + js/src/ics/IC-13832093419347002950 | 1 + js/src/ics/IC-13834587576954467767 | 1 + js/src/ics/IC-13841379517215814936 | 1 + js/src/ics/IC-1386704165739255941 | 1 + js/src/ics/IC-13876270104054221329 | 1 + js/src/ics/IC-13880620641127642606 | 1 + js/src/ics/IC-13897273724036325999 | 1 + js/src/ics/IC-13921079828401338443 | 1 + js/src/ics/IC-13956483640505359679 | 1 + js/src/ics/IC-1396220819944324854 | 1 + js/src/ics/IC-13968336765600219575 | 1 + js/src/ics/IC-13970198218191718150 | 1 + js/src/ics/IC-13973523225442191237 | 1 + js/src/ics/IC-13976813150224281378 | 1 + js/src/ics/IC-13998294700404197465 | 1 + js/src/ics/IC-14052287005514388927 | 1 + js/src/ics/IC-14117263075278951151 | 1 + js/src/ics/IC-14123896615027276117 | 1 + js/src/ics/IC-14130460441626628276 | 1 + js/src/ics/IC-14144766053941653023 | 1 + js/src/ics/IC-1414880105904709695 | 1 + js/src/ics/IC-14150618541272524050 | 1 + js/src/ics/IC-14162189632336807272 | 1 + js/src/ics/IC-14187676263726922411 | 1 + js/src/ics/IC-14195953354760445669 | 1 + js/src/ics/IC-14200755824617605140 | 1 + js/src/ics/IC-14204410074732422434 | 1 + js/src/ics/IC-14220090459296499202 | 1 + js/src/ics/IC-1422276730860130965 | 1 + js/src/ics/IC-14223030849999757218 | 1 + js/src/ics/IC-14224859134046417490 | 1 + js/src/ics/IC-14229624103423851641 | 1 + js/src/ics/IC-14246505469395708684 | 1 + js/src/ics/IC-14281653422476756083 | 1 + js/src/ics/IC-14283904817563706615 | 1 + js/src/ics/IC-14288027680938726747 | 1 + js/src/ics/IC-14298534756209246351 | 1 + js/src/ics/IC-14311069532179393026 | 1 + js/src/ics/IC-14331161007341784256 | 1 + js/src/ics/IC-14339088406296197105 | 1 + js/src/ics/IC-14354680038107022059 | 1 + js/src/ics/IC-14362161806700298319 | 1 + js/src/ics/IC-14413012798209215909 | 1 + js/src/ics/IC-14461154631329666657 | 1 + js/src/ics/IC-14467883914263481337 | 1 + js/src/ics/IC-14489346579519751547 | 1 + js/src/ics/IC-14496628861062968371 | 1 + js/src/ics/IC-14527407928280247926 | 1 + js/src/ics/IC-14554493060237194384 | 1 + js/src/ics/IC-14563408594424938637 | 1 + js/src/ics/IC-14567866124878772554 | 1 + js/src/ics/IC-14626558405453506165 | 1 + js/src/ics/IC-14628011205963112067 | 1 + js/src/ics/IC-1468766867779691211 | 1 + js/src/ics/IC-14704840864205952478 | 1 + js/src/ics/IC-14712683113271789853 | 1 + js/src/ics/IC-14729315179854293649 | 1 + js/src/ics/IC-14737756895956693 | 1 + js/src/ics/IC-14752691146145831027 | 1 + js/src/ics/IC-1475711424344730393 | 1 + js/src/ics/IC-14778912386275267097 | 1 + js/src/ics/IC-14807800099883036295 | 1 + js/src/ics/IC-14809712869255117667 | 1 + js/src/ics/IC-14810953188900809801 | 1 + js/src/ics/IC-14814903859502936283 | 1 + js/src/ics/IC-14824099102875933291 | 1 + js/src/ics/IC-1482567358729930735 | 1 + js/src/ics/IC-14830994789469329991 | 1 + js/src/ics/IC-14868959734744316604 | 1 + js/src/ics/IC-14915757337629635975 | 1 + js/src/ics/IC-14954089963405707637 | 1 + js/src/ics/IC-14989789579183259278 | 1 + js/src/ics/IC-14998253286370425907 | 1 + js/src/ics/IC-15021385070842040776 | 1 + js/src/ics/IC-15035644798634038466 | 1 + js/src/ics/IC-15059931753717096427 | 1 + js/src/ics/IC-15066543668900739549 | 1 + js/src/ics/IC-1506858868501291641 | 1 + js/src/ics/IC-15091287448359619416 | 1 + js/src/ics/IC-15095481451536776188 | 1 + js/src/ics/IC-15101574030554362130 | 1 + js/src/ics/IC-15110406232392833946 | 1 + js/src/ics/IC-15122227476588696652 | 1 + js/src/ics/IC-1513045088330615991 | 1 + js/src/ics/IC-15130802706756202910 | 1 + js/src/ics/IC-15132418029182055989 | 1 + js/src/ics/IC-15147177876626450886 | 1 + js/src/ics/IC-15156872336781672293 | 1 + js/src/ics/IC-15178909475978467084 | 1 + js/src/ics/IC-15200613056540070697 | 1 + js/src/ics/IC-15206564085425805792 | 1 + js/src/ics/IC-15218842393645411021 | 1 + js/src/ics/IC-15237843965976528717 | 1 + js/src/ics/IC-15245480520633794906 | 1 + js/src/ics/IC-15247978184118655068 | 1 + js/src/ics/IC-15256063064043402161 | 1 + js/src/ics/IC-15256845708303439675 | 1 + js/src/ics/IC-15256894484672306899 | 1 + js/src/ics/IC-15261488265697596324 | 1 + js/src/ics/IC-15270022190426507533 | 1 + js/src/ics/IC-15276382482033055864 | 1 + js/src/ics/IC-15281522977235745903 | 1 + js/src/ics/IC-15291494922982619894 | 1 + js/src/ics/IC-15299409602153111814 | 1 + js/src/ics/IC-15310789324411277655 | 1 + js/src/ics/IC-15324427682562725367 | 1 + js/src/ics/IC-15326146453845061467 | 1 + js/src/ics/IC-15352591983625765146 | 1 + js/src/ics/IC-15380481758331451160 | 1 + js/src/ics/IC-15434203544764041676 | 1 + js/src/ics/IC-15434732477982591583 | 1 + js/src/ics/IC-1543617745482107482 | 1 + js/src/ics/IC-1544352321194837078 | 1 + js/src/ics/IC-15445061814796593256 | 1 + js/src/ics/IC-15471644747976782201 | 1 + js/src/ics/IC-15482899218233437130 | 1 + js/src/ics/IC-1548481327602403487 | 1 + js/src/ics/IC-15503679691755473313 | 1 + js/src/ics/IC-1551596676474711944 | 1 + js/src/ics/IC-1553317233990934446 | 1 + js/src/ics/IC-15575561699811901548 | 1 + js/src/ics/IC-15578522933277279246 | 1 + js/src/ics/IC-15594862229984184183 | 1 + js/src/ics/IC-156017073758642248 | 1 + js/src/ics/IC-15607155572177135408 | 1 + js/src/ics/IC-1561934718361445124 | 1 + js/src/ics/IC-15641157417691695382 | 1 + js/src/ics/IC-15647871084071096245 | 1 + js/src/ics/IC-15664021278566613298 | 1 + js/src/ics/IC-15665475069516480819 | 1 + js/src/ics/IC-15665533781681879826 | 1 + js/src/ics/IC-156666557929437089 | 1 + js/src/ics/IC-15670054774371412494 | 1 + js/src/ics/IC-15690989141793533292 | 1 + js/src/ics/IC-15701153857556437688 | 1 + js/src/ics/IC-15703166559612210896 | 1 + js/src/ics/IC-15734495085669042066 | 1 + js/src/ics/IC-15744850445352658239 | 1 + js/src/ics/IC-15761189120968104974 | 1 + js/src/ics/IC-15764820530268627074 | 1 + js/src/ics/IC-15772659658134430490 | 1 + js/src/ics/IC-15783749619028334769 | 1 + js/src/ics/IC-15784845121327496478 | 1 + js/src/ics/IC-1578690047484083694 | 1 + js/src/ics/IC-15805593711153201813 | 1 + js/src/ics/IC-15821008227049644203 | 1 + js/src/ics/IC-15851642846257800120 | 1 + js/src/ics/IC-15980272252901078068 | 1 + js/src/ics/IC-1598824005327988934 | 1 + js/src/ics/IC-15995853631243213777 | 1 + js/src/ics/IC-16001020454003752679 | 1 + js/src/ics/IC-16021804920950381964 | 1 + js/src/ics/IC-16026809682949283923 | 1 + js/src/ics/IC-1606030695044352806 | 1 + js/src/ics/IC-16061132850755538181 | 1 + js/src/ics/IC-16063664025510308365 | 1 + js/src/ics/IC-16070776591766294213 | 1 + js/src/ics/IC-16076808003286742872 | 1 + js/src/ics/IC-1608112832159864779 | 1 + js/src/ics/IC-16083582160266340449 | 1 + js/src/ics/IC-16083659671668501989 | 1 + js/src/ics/IC-16094422463908910611 | 1 + js/src/ics/IC-16102950291961954136 | 1 + js/src/ics/IC-16121396575455359152 | 1 + js/src/ics/IC-16124720736972446092 | 1 + js/src/ics/IC-16136230262803458414 | 1 + js/src/ics/IC-16150605594131551637 | 1 + js/src/ics/IC-16154473313194127728 | 1 + js/src/ics/IC-16166239202911500667 | 1 + js/src/ics/IC-16174291589317550903 | 1 + js/src/ics/IC-16180687653006196821 | 1 + js/src/ics/IC-1618600175832804022 | 1 + js/src/ics/IC-16195997200473740336 | 1 + js/src/ics/IC-161974646781488000 | 1 + js/src/ics/IC-16227756009333563992 | 1 + js/src/ics/IC-1627400993137997584 | 1 + js/src/ics/IC-16280462555922375898 | 1 + js/src/ics/IC-16294827684364476198 | 1 + js/src/ics/IC-16296220530659520538 | 1 + js/src/ics/IC-16302938893583030197 | 1 + js/src/ics/IC-16316788967681582913 | 1 + js/src/ics/IC-16317548204222040719 | 1 + js/src/ics/IC-16324777759269612328 | 1 + js/src/ics/IC-1634739098904739531 | 1 + js/src/ics/IC-1635501914358270870 | 1 + js/src/ics/IC-16369833480082781658 | 1 + js/src/ics/IC-16374656114163620899 | 1 + js/src/ics/IC-1638383586556121771 | 1 + js/src/ics/IC-16396647195197475809 | 1 + js/src/ics/IC-16398001397064690244 | 1 + js/src/ics/IC-16412785163782828143 | 1 + js/src/ics/IC-16441932411964214517 | 1 + js/src/ics/IC-16444569505671344216 | 1 + js/src/ics/IC-16447784970019255691 | 1 + js/src/ics/IC-16456037603459887409 | 1 + js/src/ics/IC-16473305132307886320 | 1 + js/src/ics/IC-16492928734702167289 | 1 + js/src/ics/IC-16536605270292443508 | 1 + js/src/ics/IC-16546279636009970594 | 1 + js/src/ics/IC-16546794286948420345 | 1 + js/src/ics/IC-16557056797325753112 | 1 + js/src/ics/IC-16581406946776729085 | 1 + js/src/ics/IC-16585010222894519915 | 1 + js/src/ics/IC-16606329988385761398 | 1 + js/src/ics/IC-16622623138591522525 | 1 + js/src/ics/IC-16625574802904276802 | 1 + js/src/ics/IC-16625967148908603541 | 1 + js/src/ics/IC-16628473567969918110 | 1 + js/src/ics/IC-16662032354709854999 | 1 + js/src/ics/IC-16665929507764626742 | 1 + js/src/ics/IC-16682031519227121100 | 1 + js/src/ics/IC-16691336148681222157 | 1 + js/src/ics/IC-16702403310026065928 | 1 + js/src/ics/IC-16706212125424985810 | 1 + js/src/ics/IC-16739666423033416984 | 1 + js/src/ics/IC-16744391240382581557 | 1 + js/src/ics/IC-16750844397036450523 | 1 + js/src/ics/IC-1675953501727852675 | 1 + js/src/ics/IC-16761661378458221911 | 1 + js/src/ics/IC-1677144798147218081 | 1 + js/src/ics/IC-16810720249147781773 | 1 + js/src/ics/IC-16843569621895605781 | 1 + js/src/ics/IC-16894807033258179497 | 1 + js/src/ics/IC-16896933975358668103 | 1 + js/src/ics/IC-16929910075128602681 | 1 + js/src/ics/IC-16962286447891923863 | 1 + js/src/ics/IC-1697596976209236913 | 1 + js/src/ics/IC-16977823490136600386 | 1 + js/src/ics/IC-16997233238971559737 | 1 + js/src/ics/IC-17001888958166851542 | 1 + js/src/ics/IC-17008048015808328062 | 1 + js/src/ics/IC-17030656571181434301 | 1 + js/src/ics/IC-17034129802980087269 | 1 + js/src/ics/IC-17049830041849044806 | 1 + js/src/ics/IC-17054177827044753950 | 1 + js/src/ics/IC-17072361331064894952 | 1 + js/src/ics/IC-1707959048926965928 | 1 + js/src/ics/IC-17094936275664989501 | 1 + js/src/ics/IC-1710672456797280749 | 1 + js/src/ics/IC-17124708235541468188 | 1 + js/src/ics/IC-17133745156678627147 | 1 + js/src/ics/IC-17137945674274924239 | 1 + js/src/ics/IC-17139371222773197350 | 1 + js/src/ics/IC-17140783973773984614 | 1 + js/src/ics/IC-17143168296190575955 | 1 + js/src/ics/IC-17143656987586251558 | 1 + js/src/ics/IC-17157214466461301985 | 1 + js/src/ics/IC-1718347208533669718 | 1 + js/src/ics/IC-17194952183924216031 | 1 + js/src/ics/IC-17200512045638306662 | 1 + js/src/ics/IC-17202574952621097581 | 1 + js/src/ics/IC-17206702365849189612 | 1 + js/src/ics/IC-17218157902369351333 | 1 + js/src/ics/IC-17219233629473999621 | 1 + js/src/ics/IC-17223794167792224979 | 1 + js/src/ics/IC-17243291150669084667 | 1 + js/src/ics/IC-17245147196178324728 | 1 + js/src/ics/IC-17250028833087076103 | 1 + js/src/ics/IC-17283064744871819413 | 1 + js/src/ics/IC-17287232743506522707 | 1 + js/src/ics/IC-17303372224456508774 | 1 + js/src/ics/IC-17311424909765776333 | 1 + js/src/ics/IC-1731653344172329244 | 1 + js/src/ics/IC-17341274183022673861 | 1 + js/src/ics/IC-17369591371278226621 | 1 + js/src/ics/IC-17377678630321335324 | 1 + js/src/ics/IC-17402807312835872528 | 1 + js/src/ics/IC-17404785894496485648 | 1 + js/src/ics/IC-17409096388200987766 | 1 + js/src/ics/IC-17421839695520615129 | 1 + js/src/ics/IC-1742917343698058941 | 1 + js/src/ics/IC-17431225583265888174 | 1 + js/src/ics/IC-17433811116324676658 | 1 + js/src/ics/IC-17435886047030795391 | 1 + js/src/ics/IC-17461554138527416107 | 1 + js/src/ics/IC-17465787569802424915 | 1 + js/src/ics/IC-17478019032397489303 | 1 + js/src/ics/IC-17500653588999119138 | 1 + js/src/ics/IC-17523830714429615508 | 1 + js/src/ics/IC-17538293816173927979 | 1 + js/src/ics/IC-17553867699806252475 | 1 + js/src/ics/IC-17565183669852008737 | 1 + js/src/ics/IC-1757527689596980995 | 1 + js/src/ics/IC-17604194641356900798 | 1 + js/src/ics/IC-17609203402393407740 | 1 + js/src/ics/IC-17619171276207721564 | 1 + js/src/ics/IC-17619594449876844546 | 1 + js/src/ics/IC-17647621666440692093 | 1 + js/src/ics/IC-1765703006862995331 | 1 + js/src/ics/IC-17694320777855220627 | 1 + js/src/ics/IC-17700930231562942520 | 1 + js/src/ics/IC-17708013622254109918 | 1 + js/src/ics/IC-17728547256082126010 | 1 + js/src/ics/IC-17740269958270359325 | 1 + js/src/ics/IC-17757130859605688788 | 1 + js/src/ics/IC-17772381250193455234 | 1 + js/src/ics/IC-17809225714392331196 | 1 + js/src/ics/IC-17829093428407408025 | 1 + js/src/ics/IC-17836645186823502871 | 1 + js/src/ics/IC-17872027683831176768 | 1 + js/src/ics/IC-17882229252473860350 | 1 + js/src/ics/IC-17904590481600338695 | 1 + js/src/ics/IC-17915188919478386689 | 1 + js/src/ics/IC-17916278593513441896 | 1 + js/src/ics/IC-17919747057367750288 | 1 + js/src/ics/IC-17921446924779061187 | 1 + js/src/ics/IC-17977958804376690512 | 1 + js/src/ics/IC-17991001654696064903 | 1 + js/src/ics/IC-17996793111526515057 | 1 + js/src/ics/IC-18024960594532879479 | 1 + js/src/ics/IC-18026600390025347800 | 1 + js/src/ics/IC-18027735950718257946 | 1 + js/src/ics/IC-18045588146049567594 | 1 + js/src/ics/IC-18061435983453055086 | 1 + js/src/ics/IC-18063391690975188185 | 1 + js/src/ics/IC-18082601175560036483 | 1 + js/src/ics/IC-18083887163005789614 | 1 + js/src/ics/IC-1812428509537670571 | 1 + js/src/ics/IC-18138572930094200708 | 1 + js/src/ics/IC-18150499382853049364 | 1 + js/src/ics/IC-18163004627835258171 | 1 + js/src/ics/IC-18163352791804677298 | 1 + js/src/ics/IC-18168596951306988086 | 1 + js/src/ics/IC-18177577239575973132 | 1 + js/src/ics/IC-18203033874725942972 | 1 + js/src/ics/IC-18205290136643812152 | 1 + js/src/ics/IC-18215232378759789035 | 1 + js/src/ics/IC-18230162535045614918 | 1 + js/src/ics/IC-18233255133612278157 | 1 + js/src/ics/IC-18247437866360058214 | 1 + js/src/ics/IC-18247511447866385793 | 1 + js/src/ics/IC-18255000213765161667 | 1 + js/src/ics/IC-18260918275196662745 | 1 + js/src/ics/IC-18269332780259816901 | 1 + js/src/ics/IC-18273421188824580010 | 1 + js/src/ics/IC-1829882015200888732 | 1 + js/src/ics/IC-18300707677101983051 | 1 + js/src/ics/IC-18364728046067680159 | 1 + js/src/ics/IC-18383069888075440090 | 1 + js/src/ics/IC-18406681373742992801 | 1 + js/src/ics/IC-18417415188337939512 | 1 + js/src/ics/IC-1874721558703988683 | 1 + js/src/ics/IC-187764657074712339 | 1 + js/src/ics/IC-188624896502903694 | 1 + js/src/ics/IC-1899740917641139130 | 1 + js/src/ics/IC-191092073745633310 | 1 + js/src/ics/IC-1911222769264596611 | 1 + js/src/ics/IC-1914090163038826176 | 1 + js/src/ics/IC-1922088450768176119 | 1 + js/src/ics/IC-1922379877290903206 | 1 + js/src/ics/IC-1930651877465110134 | 1 + js/src/ics/IC-1958498882277703804 | 1 + js/src/ics/IC-1978813921514302351 | 1 + js/src/ics/IC-1984731683141195983 | 1 + js/src/ics/IC-2011520596613052330 | 1 + js/src/ics/IC-2062548415379116244 | 1 + js/src/ics/IC-2069761895861418575 | 1 + js/src/ics/IC-2071781605961187052 | 1 + js/src/ics/IC-2074656138179039797 | 1 + js/src/ics/IC-2081802683341159475 | 1 + js/src/ics/IC-2086723106745968256 | 1 + js/src/ics/IC-2086905995182716458 | 1 + js/src/ics/IC-210144046857212322 | 1 + js/src/ics/IC-2137848763953584890 | 1 + js/src/ics/IC-2143448554454499349 | 1 + js/src/ics/IC-2151648659228270655 | 1 + js/src/ics/IC-216425788329978311 | 1 + js/src/ics/IC-2169251083567393299 | 1 + js/src/ics/IC-2171431250058728502 | 1 + js/src/ics/IC-2184863063398148428 | 1 + js/src/ics/IC-2230606841539842551 | 1 + js/src/ics/IC-2273202721796384800 | 1 + js/src/ics/IC-2313082164892530755 | 1 + js/src/ics/IC-2339634224401801487 | 1 + js/src/ics/IC-2351162846336746035 | 1 + js/src/ics/IC-2371990067430049343 | 1 + js/src/ics/IC-2377599860335463454 | 1 + js/src/ics/IC-2380892506045607779 | 1 + js/src/ics/IC-2398402272777244131 | 1 + js/src/ics/IC-2417302517823498608 | 1 + js/src/ics/IC-2418707696100325399 | 1 + js/src/ics/IC-2454948850716611951 | 1 + js/src/ics/IC-2456834969277128085 | 1 + js/src/ics/IC-2462731431393133002 | 1 + js/src/ics/IC-2515826279634114248 | 1 + js/src/ics/IC-2518253502660787428 | 1 + js/src/ics/IC-2521244443826978133 | 1 + js/src/ics/IC-2531978278637808078 | 1 + js/src/ics/IC-2535451704436036055 | 1 + js/src/ics/IC-2542825496446283237 | 1 + js/src/ics/IC-2584985458187775789 | 1 + js/src/ics/IC-2618512630462482380 | 1 + js/src/ics/IC-2624898344269778408 | 1 + js/src/ics/IC-2644556544581678306 | 1 + js/src/ics/IC-2645532145448443217 | 1 + js/src/ics/IC-2661083574516437070 | 1 + js/src/ics/IC-2669068402497370744 | 1 + js/src/ics/IC-2686711967840485705 | 1 + js/src/ics/IC-2691121023243741501 | 1 + js/src/ics/IC-2702772690004335189 | 1 + js/src/ics/IC-2708659804234438728 | 1 + js/src/ics/IC-2737678301559937239 | 1 + js/src/ics/IC-2765459467037608334 | 1 + js/src/ics/IC-2767613240500855107 | 1 + js/src/ics/IC-2773590376861193527 | 1 + js/src/ics/IC-2782409437992023769 | 1 + js/src/ics/IC-280026093892213862 | 1 + js/src/ics/IC-2801956725434653136 | 1 + js/src/ics/IC-2802425936511893854 | 1 + js/src/ics/IC-2827143466525184837 | 1 + js/src/ics/IC-2855688269616687597 | 1 + js/src/ics/IC-2873965502031799334 | 1 + js/src/ics/IC-287542670551658275 | 1 + js/src/ics/IC-2895026259980035856 | 1 + js/src/ics/IC-2912402446003854960 | 1 + js/src/ics/IC-2913871485666489552 | 1 + js/src/ics/IC-291878540700978050 | 1 + js/src/ics/IC-292082082355467009 | 1 + js/src/ics/IC-2928815103741675983 | 1 + js/src/ics/IC-2958411735556139423 | 1 + js/src/ics/IC-2966024549592476080 | 1 + js/src/ics/IC-2983342025737404834 | 1 + js/src/ics/IC-2990975653483082955 | 1 + js/src/ics/IC-2992382339529556418 | 1 + js/src/ics/IC-3016091860216907838 | 1 + js/src/ics/IC-3024635330905737690 | 1 + js/src/ics/IC-3050564922038072872 | 1 + js/src/ics/IC-3058041403847434208 | 1 + js/src/ics/IC-3058288795472298567 | 1 + js/src/ics/IC-3063208630223808341 | 1 + js/src/ics/IC-3063897698311975033 | 1 + js/src/ics/IC-3065981700777779924 | 1 + js/src/ics/IC-3070543937284829139 | 1 + js/src/ics/IC-3107997055811569125 | 1 + js/src/ics/IC-3108375503482564051 | 1 + js/src/ics/IC-3126533402459306811 | 1 + js/src/ics/IC-3129554586835639708 | 1 + js/src/ics/IC-3130944617629361877 | 1 + js/src/ics/IC-3141748223018335851 | 1 + js/src/ics/IC-3149342849615121298 | 1 + js/src/ics/IC-315159741714676948 | 1 + js/src/ics/IC-3151621465039598092 | 1 + js/src/ics/IC-3159826668269198227 | 1 + js/src/ics/IC-3180778674546850643 | 1 + js/src/ics/IC-3183032258049838025 | 1 + js/src/ics/IC-3184817209321377926 | 1 + js/src/ics/IC-3188547504096831872 | 1 + js/src/ics/IC-3209469901421149634 | 1 + js/src/ics/IC-3210025847986191306 | 1 + js/src/ics/IC-3215707204901826833 | 1 + js/src/ics/IC-3221536603393431694 | 1 + js/src/ics/IC-3242710856889481812 | 1 + js/src/ics/IC-3254310163569751649 | 1 + js/src/ics/IC-3260469094742591393 | 1 + js/src/ics/IC-3270125778517387953 | 1 + js/src/ics/IC-3285495661201347501 | 1 + js/src/ics/IC-3291639657746952837 | 1 + js/src/ics/IC-3303567693918747615 | 1 + js/src/ics/IC-3313907665922919113 | 1 + js/src/ics/IC-3316780861999244382 | 1 + js/src/ics/IC-3365998306684347245 | 1 + js/src/ics/IC-337983161629110517 | 1 + js/src/ics/IC-3388123219511355535 | 1 + js/src/ics/IC-3430589870118667057 | 1 + js/src/ics/IC-3451635243707423569 | 1 + js/src/ics/IC-3456421405836740213 | 1 + js/src/ics/IC-3463540458717575441 | 1 + js/src/ics/IC-3481031266271930715 | 1 + js/src/ics/IC-3512058922300613252 | 1 + js/src/ics/IC-3528013366198793326 | 1 + js/src/ics/IC-3528179051561271653 | 1 + js/src/ics/IC-3530211928626575094 | 1 + js/src/ics/IC-3551621975038476869 | 1 + js/src/ics/IC-3559333848528880282 | 1 + js/src/ics/IC-3568082001678279740 | 1 + js/src/ics/IC-3569882059995853558 | 1 + js/src/ics/IC-3589849304579682331 | 1 + js/src/ics/IC-3597138435105657726 | 1 + js/src/ics/IC-3609972302888278654 | 1 + js/src/ics/IC-3612832018387859729 | 1 + js/src/ics/IC-3634148346840572296 | 1 + js/src/ics/IC-3656206024072327113 | 1 + js/src/ics/IC-3657932750771746404 | 1 + js/src/ics/IC-3661072867427592162 | 1 + js/src/ics/IC-3661695729403573203 | 1 + js/src/ics/IC-3672696817653550044 | 1 + js/src/ics/IC-3679450300823375305 | 1 + js/src/ics/IC-3682576107139758084 | 1 + js/src/ics/IC-3734812142467418625 | 1 + js/src/ics/IC-3755018854119379339 | 1 + js/src/ics/IC-3773285914794781769 | 1 + js/src/ics/IC-3777372779978486243 | 1 + js/src/ics/IC-3783993352614114791 | 1 + js/src/ics/IC-3797926286349396013 | 1 + js/src/ics/IC-3808918365377850068 | 1 + js/src/ics/IC-3865431538426642194 | 1 + js/src/ics/IC-3867479862096930136 | 1 + js/src/ics/IC-3870915099258776426 | 1 + js/src/ics/IC-389003273598954999 | 1 + js/src/ics/IC-3917163428349655949 | 1 + js/src/ics/IC-3949900529100100863 | 1 + js/src/ics/IC-3964603549364967584 | 1 + js/src/ics/IC-39690460880282582 | 1 + js/src/ics/IC-3978516112237392526 | 1 + js/src/ics/IC-3980529659776200209 | 1 + js/src/ics/IC-3990626075643434207 | 1 + js/src/ics/IC-3995686981063035752 | 1 + js/src/ics/IC-4000443357665273090 | 1 + js/src/ics/IC-4028281825672479567 | 1 + js/src/ics/IC-4030969467382293263 | 1 + js/src/ics/IC-4047821176947237630 | 1 + js/src/ics/IC-406074042512431995 | 1 + js/src/ics/IC-4063194770314682956 | 1 + js/src/ics/IC-4069361993612748503 | 1 + js/src/ics/IC-4070939822708021300 | 1 + js/src/ics/IC-4078436961597644502 | 1 + js/src/ics/IC-4106844363038176762 | 1 + js/src/ics/IC-4116168477963531058 | 1 + js/src/ics/IC-41191806326866852 | 1 + js/src/ics/IC-4127463736148707198 | 1 + js/src/ics/IC-4137503656080954450 | 1 + js/src/ics/IC-414410497084563379 | 1 + js/src/ics/IC-4159338440671789798 | 1 + js/src/ics/IC-4183842994047523642 | 1 + js/src/ics/IC-419206947237103119 | 1 + js/src/ics/IC-4201435969598747070 | 1 + js/src/ics/IC-4213864849714302958 | 1 + js/src/ics/IC-4253798086806600477 | 1 + js/src/ics/IC-4257898183961413318 | 1 + js/src/ics/IC-428929725231831370 | 1 + js/src/ics/IC-4290628426590161433 | 1 + js/src/ics/IC-4314897430777610180 | 1 + js/src/ics/IC-4331034240427156470 | 1 + js/src/ics/IC-4349140574576985106 | 1 + js/src/ics/IC-4356010842119990164 | 1 + js/src/ics/IC-4401115047547016029 | 1 + js/src/ics/IC-4469743735075377828 | 1 + js/src/ics/IC-4529465499681039560 | 1 + js/src/ics/IC-4531364307335516741 | 1 + js/src/ics/IC-4540536284992510594 | 1 + js/src/ics/IC-455359788701706473 | 1 + js/src/ics/IC-4564453466100177384 | 1 + js/src/ics/IC-4570824905465268802 | 1 + js/src/ics/IC-4586879335310093030 | 1 + js/src/ics/IC-4615780852236812813 | 1 + js/src/ics/IC-4633639322269444908 | 1 + js/src/ics/IC-463435529406221163 | 1 + js/src/ics/IC-4667474526973057585 | 1 + js/src/ics/IC-4668691876088627929 | 1 + js/src/ics/IC-4681946795141297256 | 1 + js/src/ics/IC-4701671027380290987 | 1 + js/src/ics/IC-4731098206248976372 | 1 + js/src/ics/IC-4734497559573485904 | 1 + js/src/ics/IC-4735590702341055761 | 1 + js/src/ics/IC-4736397757847713077 | 1 + js/src/ics/IC-4739648521757046986 | 1 + js/src/ics/IC-4744040428186374519 | 1 + js/src/ics/IC-4764951245913829783 | 1 + js/src/ics/IC-4807651754683386837 | 1 + js/src/ics/IC-4837639617296355283 | 1 + js/src/ics/IC-4845452116642991738 | 1 + js/src/ics/IC-4891342749109966432 | 1 + js/src/ics/IC-4900135455193282383 | 1 + js/src/ics/IC-4922149867090114317 | 1 + js/src/ics/IC-4963669926436995651 | 1 + js/src/ics/IC-4980379635059490652 | 1 + js/src/ics/IC-4982387211093858531 | 1 + js/src/ics/IC-4983691950823390195 | 1 + js/src/ics/IC-4990566579533878012 | 1 + js/src/ics/IC-5023487226246351503 | 1 + js/src/ics/IC-5031122507432221980 | 1 + js/src/ics/IC-5045618420272476443 | 1 + js/src/ics/IC-5069792978291141863 | 1 + js/src/ics/IC-5074177821418432695 | 1 + js/src/ics/IC-5087120774109976541 | 1 + js/src/ics/IC-5093742640529975629 | 1 + js/src/ics/IC-5107105040617672305 | 1 + js/src/ics/IC-5151588910615654670 | 1 + js/src/ics/IC-51552858227663770 | 1 + js/src/ics/IC-5159868623055647136 | 1 + js/src/ics/IC-5170848910968615373 | 1 + js/src/ics/IC-5173344172117297366 | 1 + js/src/ics/IC-5200828597209498575 | 1 + js/src/ics/IC-5203330381890490451 | 1 + js/src/ics/IC-5214159996564928378 | 1 + js/src/ics/IC-5229682133416320795 | 1 + js/src/ics/IC-5292473895363177205 | 1 + js/src/ics/IC-5298416090638667837 | 1 + js/src/ics/IC-5314653691660087053 | 1 + js/src/ics/IC-5316601505449798967 | 1 + js/src/ics/IC-5325110385863222471 | 1 + js/src/ics/IC-5325479602864963535 | 1 + js/src/ics/IC-5356911276060368919 | 1 + js/src/ics/IC-5360274303237669571 | 1 + js/src/ics/IC-5366859542488836052 | 1 + js/src/ics/IC-537262894942906764 | 1 + js/src/ics/IC-5414419622920062469 | 1 + js/src/ics/IC-5430422129922568042 | 1 + js/src/ics/IC-5431138521638409901 | 1 + js/src/ics/IC-5440563467445612687 | 1 + js/src/ics/IC-5451562074139472869 | 1 + js/src/ics/IC-5453413639121254243 | 1 + js/src/ics/IC-5453706424808110088 | 1 + js/src/ics/IC-5475933309292952269 | 1 + js/src/ics/IC-548882788670680882 | 1 + js/src/ics/IC-5498468084005282890 | 1 + js/src/ics/IC-5503857666127213563 | 1 + js/src/ics/IC-551759920627692530 | 1 + js/src/ics/IC-5532241740121324706 | 1 + js/src/ics/IC-5535867792675904524 | 1 + js/src/ics/IC-5557600775286138031 | 1 + js/src/ics/IC-5577207826876614659 | 1 + js/src/ics/IC-5621344425638133163 | 1 + js/src/ics/IC-5622365618808743691 | 1 + js/src/ics/IC-5626904542189522402 | 1 + js/src/ics/IC-5641070235743673050 | 1 + js/src/ics/IC-5655558484629346613 | 1 + js/src/ics/IC-5666456393611175420 | 1 + js/src/ics/IC-5671110871170019000 | 1 + js/src/ics/IC-5678260749392815029 | 1 + js/src/ics/IC-5718826192652598978 | 1 + js/src/ics/IC-5727692861382456992 | 1 + js/src/ics/IC-5733502973680379365 | 1 + js/src/ics/IC-5756273448623453072 | 1 + js/src/ics/IC-5775164289335658528 | 1 + js/src/ics/IC-5786249113263803994 | 1 + js/src/ics/IC-579257625803382067 | 1 + js/src/ics/IC-5813034366357900449 | 1 + js/src/ics/IC-5819847375259697467 | 1 + js/src/ics/IC-5835529469182302568 | 1 + js/src/ics/IC-5846323929830966129 | 1 + js/src/ics/IC-5849615840270306761 | 1 + js/src/ics/IC-5855891115550373556 | 1 + js/src/ics/IC-5869987350935109062 | 1 + js/src/ics/IC-5872242747911214759 | 1 + js/src/ics/IC-5874239926455863724 | 1 + js/src/ics/IC-587714778299262616 | 1 + js/src/ics/IC-588384615805920198 | 1 + js/src/ics/IC-5912250539169622605 | 1 + js/src/ics/IC-5912323616554975669 | 1 + js/src/ics/IC-5913967622441221915 | 1 + js/src/ics/IC-5920990077679333046 | 1 + js/src/ics/IC-5979933657154175813 | 1 + js/src/ics/IC-5981087199954198415 | 1 + js/src/ics/IC-5981532190828677479 | 1 + js/src/ics/IC-5982182292180846915 | 1 + js/src/ics/IC-5991742124680723496 | 1 + js/src/ics/IC-5999742380082135166 | 1 + js/src/ics/IC-600504079898778130 | 1 + js/src/ics/IC-6009444823097086357 | 1 + js/src/ics/IC-6019576791496131862 | 1 + js/src/ics/IC-6061207598748454306 | 1 + js/src/ics/IC-6082115889906159497 | 1 + js/src/ics/IC-6087499400459459326 | 1 + js/src/ics/IC-6098254129790034277 | 1 + js/src/ics/IC-6101894920461306288 | 1 + js/src/ics/IC-610213485237308342 | 1 + js/src/ics/IC-6105652248863429548 | 1 + js/src/ics/IC-6127367941508481067 | 1 + js/src/ics/IC-6135345967831715705 | 1 + js/src/ics/IC-6143375524470104030 | 1 + js/src/ics/IC-6146020855536251424 | 1 + js/src/ics/IC-6146325095462273887 | 1 + js/src/ics/IC-615433728494893218 | 1 + js/src/ics/IC-6158212624399616553 | 1 + js/src/ics/IC-6159868938875897971 | 1 + js/src/ics/IC-6183110164745970583 | 1 + js/src/ics/IC-6210440649435489795 | 1 + js/src/ics/IC-6212775784017808964 | 1 + js/src/ics/IC-6235677804899620724 | 1 + js/src/ics/IC-6240639567071266349 | 1 + js/src/ics/IC-6245643355357745767 | 1 + js/src/ics/IC-625074041988396194 | 1 + js/src/ics/IC-6261712165203039516 | 1 + js/src/ics/IC-6292702835226523330 | 1 + js/src/ics/IC-6327522087412591704 | 1 + js/src/ics/IC-6330274544238710646 | 1 + js/src/ics/IC-6340399081515649191 | 1 + js/src/ics/IC-6341944345095833427 | 1 + js/src/ics/IC-6360555972558397887 | 1 + js/src/ics/IC-636392079608777021 | 1 + js/src/ics/IC-6400233992713918968 | 1 + js/src/ics/IC-6449820065704212551 | 1 + js/src/ics/IC-647091038417072018 | 1 + js/src/ics/IC-6472000057917485609 | 1 + js/src/ics/IC-6514508776943165331 | 1 + js/src/ics/IC-6515912138002560906 | 1 + js/src/ics/IC-6516656865559158023 | 1 + js/src/ics/IC-6519158448193854731 | 1 + js/src/ics/IC-6536480825513853421 | 1 + js/src/ics/IC-654735065054311339 | 1 + js/src/ics/IC-6596086071328775033 | 1 + js/src/ics/IC-6632537767881657296 | 1 + js/src/ics/IC-6634032363341560936 | 1 + js/src/ics/IC-6648431281659226653 | 1 + js/src/ics/IC-6655497693124912829 | 1 + js/src/ics/IC-6673320317353405836 | 1 + js/src/ics/IC-6676114981265147186 | 1 + js/src/ics/IC-6705368495046246180 | 1 + js/src/ics/IC-6715353510766004631 | 1 + js/src/ics/IC-6721597167480484729 | 1 + js/src/ics/IC-6721693850971571311 | 1 + js/src/ics/IC-6721824873076198479 | 1 + js/src/ics/IC-6752409692062461485 | 1 + js/src/ics/IC-677106290285116179 | 1 + js/src/ics/IC-6797217433273716714 | 1 + js/src/ics/IC-6816786854972243760 | 1 + js/src/ics/IC-6818829038527474643 | 1 + js/src/ics/IC-6824775793783396742 | 1 + js/src/ics/IC-6827892447804868454 | 1 + js/src/ics/IC-6831699885929882581 | 1 + js/src/ics/IC-6845756836940205003 | 1 + js/src/ics/IC-684607117327143518 | 1 + js/src/ics/IC-6855513314369875080 | 1 + js/src/ics/IC-6858616511397494805 | 1 + js/src/ics/IC-6859461870347346752 | 1 + js/src/ics/IC-6865598851008758714 | 1 + js/src/ics/IC-6868447145767669823 | 1 + js/src/ics/IC-6870789570020117766 | 1 + js/src/ics/IC-6887264002064944094 | 1 + js/src/ics/IC-6938079888860718492 | 1 + js/src/ics/IC-6978157832134484043 | 1 + js/src/ics/IC-6980487891696488724 | 1 + js/src/ics/IC-6982304726945942578 | 1 + js/src/ics/IC-698368224462398174 | 1 + js/src/ics/IC-6985684912028731373 | 1 + js/src/ics/IC-699245192487902193 | 1 + js/src/ics/IC-6998649725787362515 | 1 + js/src/ics/IC-6999334146529986366 | 1 + js/src/ics/IC-7005290164786924814 | 1 + js/src/ics/IC-7006336842200308514 | 1 + js/src/ics/IC-700786831797247594 | 1 + js/src/ics/IC-7024210860932854393 | 1 + js/src/ics/IC-7026816496132132923 | 1 + js/src/ics/IC-70272839060919129 | 1 + js/src/ics/IC-7061950734640137756 | 1 + js/src/ics/IC-7084355145539501606 | 1 + js/src/ics/IC-7110280990772449778 | 1 + js/src/ics/IC-7117088071630770506 | 1 + js/src/ics/IC-7133664460836359581 | 1 + js/src/ics/IC-7167465578550532482 | 1 + js/src/ics/IC-7173802388303836688 | 1 + js/src/ics/IC-7202736064201176555 | 1 + js/src/ics/IC-7220026805480361100 | 1 + js/src/ics/IC-7235661149420205537 | 1 + js/src/ics/IC-7250684370862830639 | 1 + js/src/ics/IC-726275027529054686 | 1 + js/src/ics/IC-7267775787848262760 | 1 + js/src/ics/IC-7276738268032779131 | 1 + js/src/ics/IC-731101809626422680 | 1 + js/src/ics/IC-7314986533314100677 | 1 + js/src/ics/IC-7324892400700704689 | 1 + js/src/ics/IC-7324956736683671941 | 1 + js/src/ics/IC-7339472814877822799 | 1 + js/src/ics/IC-7350554386930401733 | 1 + js/src/ics/IC-7360746468769580882 | 1 + js/src/ics/IC-7362853432073309735 | 1 + js/src/ics/IC-736676615944560765 | 1 + js/src/ics/IC-7404248840167653361 | 1 + js/src/ics/IC-7408088356929918646 | 1 + js/src/ics/IC-7409538886074621816 | 1 + js/src/ics/IC-7425475827528203933 | 1 + js/src/ics/IC-7434900830251242148 | 1 + js/src/ics/IC-745904529816712807 | 1 + js/src/ics/IC-7486529677653082600 | 1 + js/src/ics/IC-749116032814679234 | 1 + js/src/ics/IC-7492639846094803244 | 1 + js/src/ics/IC-7499173717495355685 | 1 + js/src/ics/IC-7503353916431455277 | 1 + js/src/ics/IC-751687832949406719 | 1 + js/src/ics/IC-7558157803468401724 | 1 + js/src/ics/IC-7564196606949402877 | 1 + js/src/ics/IC-7567606418741977363 | 1 + js/src/ics/IC-7568466058094061231 | 1 + js/src/ics/IC-7581138345160930295 | 1 + js/src/ics/IC-7584402331764181517 | 1 + js/src/ics/IC-758837353040836026 | 1 + js/src/ics/IC-7626298430772506162 | 1 + js/src/ics/IC-7639062178051447962 | 1 + js/src/ics/IC-7645375823311335156 | 1 + js/src/ics/IC-7649343913925262713 | 1 + js/src/ics/IC-7684497546958413653 | 1 + js/src/ics/IC-769874876471461951 | 1 + js/src/ics/IC-7708211997325567179 | 1 + js/src/ics/IC-7719784825117209774 | 1 + js/src/ics/IC-7757860598185740927 | 1 + js/src/ics/IC-7768433527213643412 | 1 + js/src/ics/IC-7791800684512152753 | 1 + js/src/ics/IC-7804041312612862365 | 1 + js/src/ics/IC-7866166923509172853 | 1 + js/src/ics/IC-7869157210104551129 | 1 + js/src/ics/IC-7870884289306445919 | 1 + js/src/ics/IC-7895134038915974605 | 1 + js/src/ics/IC-7909848207463708484 | 1 + js/src/ics/IC-7917106339670149229 | 1 + js/src/ics/IC-7930724512359688784 | 1 + js/src/ics/IC-7940724580282964946 | 1 + js/src/ics/IC-7948263610858036054 | 1 + js/src/ics/IC-7951837257564624315 | 1 + js/src/ics/IC-7952192849644477208 | 1 + js/src/ics/IC-7972057111904247804 | 1 + js/src/ics/IC-8001703547456055322 | 1 + js/src/ics/IC-8009553409671560982 | 1 + js/src/ics/IC-802216659212149853 | 1 + js/src/ics/IC-8068678896796315186 | 1 + js/src/ics/IC-807303826890643662 | 1 + js/src/ics/IC-8075975975025262858 | 1 + js/src/ics/IC-8085671503585936599 | 1 + js/src/ics/IC-8101078221050368849 | 1 + js/src/ics/IC-8108183892012730001 | 1 + js/src/ics/IC-8111883778987399440 | 1 + js/src/ics/IC-8131647849764614667 | 1 + js/src/ics/IC-8137744976260600065 | 1 + js/src/ics/IC-8142046115317896438 | 1 + js/src/ics/IC-8142965712298942684 | 1 + js/src/ics/IC-8155132706777070304 | 1 + js/src/ics/IC-8180528644816477753 | 1 + js/src/ics/IC-8182823701706162214 | 1 + js/src/ics/IC-8193213348312547492 | 1 + js/src/ics/IC-8199823677791083428 | 1 + js/src/ics/IC-8215484261361241131 | 1 + js/src/ics/IC-8216349263939615631 | 1 + js/src/ics/IC-8230559266677649540 | 1 + js/src/ics/IC-8233321740058095794 | 1 + js/src/ics/IC-8236049176462706622 | 1 + js/src/ics/IC-8244482935373369685 | 1 + js/src/ics/IC-8244631324132828388 | 1 + js/src/ics/IC-8254164986441511102 | 1 + js/src/ics/IC-8254418371745474891 | 1 + js/src/ics/IC-8295071825394113903 | 1 + js/src/ics/IC-8304559682286002846 | 1 + js/src/ics/IC-8315217340573356278 | 1 + js/src/ics/IC-8317733766362443569 | 1 + js/src/ics/IC-8322473950258781440 | 1 + js/src/ics/IC-832278648520639690 | 1 + js/src/ics/IC-8326071184532710890 | 1 + js/src/ics/IC-8355419085300232965 | 1 + js/src/ics/IC-8360592877849122155 | 1 + js/src/ics/IC-8363578138225385166 | 1 + js/src/ics/IC-8403239149345319813 | 1 + js/src/ics/IC-8413322494742765965 | 1 + js/src/ics/IC-8420671501376903345 | 1 + js/src/ics/IC-8429088277321985112 | 1 + js/src/ics/IC-8441206218065884468 | 1 + js/src/ics/IC-8442127857693820938 | 1 + js/src/ics/IC-8442598027497994034 | 1 + js/src/ics/IC-8443741239559716080 | 1 + js/src/ics/IC-8445141178915289773 | 1 + js/src/ics/IC-847530939114946120 | 1 + js/src/ics/IC-8476731158983138059 | 1 + js/src/ics/IC-8481490251351291794 | 1 + js/src/ics/IC-8501101688775670023 | 1 + js/src/ics/IC-850629062811003910 | 1 + js/src/ics/IC-8518561424476582843 | 1 + js/src/ics/IC-852149399956264048 | 1 + js/src/ics/IC-8534257520509712648 | 1 + js/src/ics/IC-8540470795437792712 | 1 + js/src/ics/IC-8558874767732896280 | 1 + js/src/ics/IC-8559109891190089019 | 1 + js/src/ics/IC-8585837622815890575 | 1 + js/src/ics/IC-8601040439805555324 | 1 + js/src/ics/IC-8605376481005836786 | 1 + js/src/ics/IC-8610836031911855894 | 1 + js/src/ics/IC-8616612317712480790 | 1 + js/src/ics/IC-8618671683994336078 | 1 + js/src/ics/IC-8622514010011455349 | 1 + js/src/ics/IC-8630183055865625216 | 1 + js/src/ics/IC-8648689368816333021 | 1 + js/src/ics/IC-8674212790026628899 | 1 + js/src/ics/IC-8708623109992990057 | 1 + js/src/ics/IC-8714373314762342458 | 1 + js/src/ics/IC-8717527894172818884 | 1 + js/src/ics/IC-8720531975905999486 | 1 + js/src/ics/IC-8722343896312957455 | 1 + js/src/ics/IC-8726193584855817371 | 1 + js/src/ics/IC-8726371440541008632 | 1 + js/src/ics/IC-8736858826767240875 | 1 + js/src/ics/IC-8743022270375700073 | 1 + js/src/ics/IC-8784848970440649925 | 1 + js/src/ics/IC-8792325727821224946 | 1 + js/src/ics/IC-8798666721954004916 | 1 + js/src/ics/IC-8823236652876382714 | 1 + js/src/ics/IC-8823597251267430225 | 1 + js/src/ics/IC-884268059723707606 | 1 + js/src/ics/IC-8849974549760789440 | 1 + js/src/ics/IC-8850589965328179479 | 1 + js/src/ics/IC-8851692584952403385 | 1 + js/src/ics/IC-8853423124788182920 | 1 + js/src/ics/IC-8854506138512858772 | 1 + js/src/ics/IC-8875849149003083422 | 1 + js/src/ics/IC-8877294232782861220 | 1 + js/src/ics/IC-8883504650163102320 | 1 + js/src/ics/IC-8885076315408518481 | 1 + js/src/ics/IC-8906228050932337182 | 1 + js/src/ics/IC-8948583931810245738 | 1 + js/src/ics/IC-89948756699479799 | 1 + js/src/ics/IC-9001279303262868808 | 1 + js/src/ics/IC-9016572976303657578 | 1 + js/src/ics/IC-9024129248431175636 | 1 + js/src/ics/IC-9024603486414797067 | 1 + js/src/ics/IC-9068370305687006223 | 1 + js/src/ics/IC-907219630550004812 | 1 + js/src/ics/IC-908139079542668886 | 1 + js/src/ics/IC-9101669341400883942 | 1 + js/src/ics/IC-9131463022250286799 | 1 + js/src/ics/IC-914618578567048327 | 1 + js/src/ics/IC-9150792826415987483 | 1 + js/src/ics/IC-9151989501444644471 | 1 + js/src/ics/IC-9174168230444628686 | 1 + js/src/ics/IC-9204215648363835601 | 1 + js/src/ics/IC-9207945744466625582 | 1 + js/src/ics/IC-9227137605983198345 | 1 + js/src/ics/IC-9232985867061065700 | 1 + js/src/ics/IC-9237484516049187040 | 1 + js/src/ics/IC-9237928901674183252 | 1 + js/src/ics/IC-9241680487677976030 | 1 + js/src/ics/IC-9259202069011985421 | 1 + js/src/ics/IC-9269862329904473956 | 1 + js/src/ics/IC-9277230435407334463 | 1 + js/src/ics/IC-9277645843586731829 | 1 + js/src/ics/IC-9286654478851807920 | 1 + js/src/ics/IC-9288392477050382459 | 1 + js/src/ics/IC-9292709240371023995 | 1 + js/src/ics/IC-9295154719658582522 | 1 + js/src/ics/IC-9295303214710262444 | 1 + js/src/ics/IC-9315883869159875436 | 1 + js/src/ics/IC-9342121970605574416 | 1 + js/src/ics/IC-9345518466920727586 | 1 + js/src/ics/IC-9346103948563292422 | 1 + js/src/ics/IC-9362119496493489065 | 1 + js/src/ics/IC-9367473185132767844 | 1 + js/src/ics/IC-9389242458480391583 | 1 + js/src/ics/IC-9392012973422799465 | 1 + js/src/ics/IC-9393358715217716730 | 1 + js/src/ics/IC-9398310652853512136 | 1 + js/src/ics/IC-942975193168022395 | 1 + js/src/ics/IC-9452175063057999653 | 1 + js/src/ics/IC-9491230334521679912 | 1 + js/src/ics/IC-9533267757058197559 | 1 + js/src/ics/IC-9573953316357395344 | 1 + js/src/ics/IC-9585383870753227774 | 1 + js/src/ics/IC-9587117297918663607 | 1 + js/src/ics/IC-959124955268769284 | 1 + js/src/ics/IC-9603353749932629576 | 1 + js/src/ics/IC-9658388761974449119 | 1 + js/src/ics/IC-9671460492835606492 | 1 + js/src/ics/IC-9683159600389630575 | 1 + js/src/ics/IC-9729795167523645589 | 1 + js/src/ics/IC-973618382294854402 | 1 + js/src/ics/IC-9778741650967686308 | 1 + js/src/ics/IC-9841770053655394962 | 1 + js/src/ics/IC-9843527680704020017 | 1 + js/src/ics/IC-9861241337687476640 | 1 + js/src/ics/IC-9864679896375120796 | 1 + js/src/ics/IC-9884033488871678626 | 1 + js/src/ics/IC-9945672477509952136 | 1 + js/src/ics/IC-9958937109052491671 | 1 + js/src/ics/IC-9973119692938145424 | 1 + js/src/ics/IC-9978339837634607339 | 1 + js/src/ics/IC-9980784582763935427 | 1 + js/src/ics/IC-9988742469133872172 | 1 + js/src/ics/IC-999481620998529653 | 1 + 1243 files changed, 1243 insertions(+) create mode 100644 js/src/ics/IC-10012932722129304576 create mode 100644 js/src/ics/IC-10017063470928229984 create mode 100644 js/src/ics/IC-10024653209997799430 create mode 100644 js/src/ics/IC-10027192055534650466 create mode 100644 js/src/ics/IC-10047658442846226757 create mode 100644 js/src/ics/IC-10071222831863122338 create mode 100644 js/src/ics/IC-10085408470993969915 create mode 100644 js/src/ics/IC-10112295838932053588 create mode 100644 js/src/ics/IC-10120036528695626238 create mode 100644 js/src/ics/IC-10133658182771939722 create mode 100644 js/src/ics/IC-10146627587987531577 create mode 100644 js/src/ics/IC-10174150775558148628 create mode 100644 js/src/ics/IC-10183979387394653126 create mode 100644 js/src/ics/IC-10190184921897590573 create mode 100644 js/src/ics/IC-10206623616188944477 create mode 100644 js/src/ics/IC-1021055887912932210 create mode 100644 js/src/ics/IC-10229792663333787841 create mode 100644 js/src/ics/IC-10285160584534782478 create mode 100644 js/src/ics/IC-10287899934032377038 create mode 100644 js/src/ics/IC-10296630081760163552 create mode 100644 js/src/ics/IC-10323304896754139606 create mode 100644 js/src/ics/IC-10337334507454623397 create mode 100644 js/src/ics/IC-10354653151230292671 create mode 100644 js/src/ics/IC-10387960712561871230 create mode 100644 js/src/ics/IC-10390855945778908237 create mode 100644 js/src/ics/IC-10398018477319480099 create mode 100644 js/src/ics/IC-10419927781334253497 create mode 100644 js/src/ics/IC-10467058652674703426 create mode 100644 js/src/ics/IC-10493323457472461123 create mode 100644 js/src/ics/IC-10504739238754050285 create mode 100644 js/src/ics/IC-10508634394369394069 create mode 100644 js/src/ics/IC-10517045791805761861 create mode 100644 js/src/ics/IC-10539062004584484050 create mode 100644 js/src/ics/IC-10552508641524210829 create mode 100644 js/src/ics/IC-10557077917219503953 create mode 100644 js/src/ics/IC-10557234435714705037 create mode 100644 js/src/ics/IC-1057791614928279724 create mode 100644 js/src/ics/IC-10594532515162574745 create mode 100644 js/src/ics/IC-1059520217747093635 create mode 100644 js/src/ics/IC-10624605180333492108 create mode 100644 js/src/ics/IC-10631882817250290341 create mode 100644 js/src/ics/IC-10632368867850150164 create mode 100644 js/src/ics/IC-1065699860197787893 create mode 100644 js/src/ics/IC-10666528917422509453 create mode 100644 js/src/ics/IC-10705031122100274016 create mode 100644 js/src/ics/IC-10705525611129912618 create mode 100644 js/src/ics/IC-10713018433347600908 create mode 100644 js/src/ics/IC-10714232282968382548 create mode 100644 js/src/ics/IC-10722218364273034881 create mode 100644 js/src/ics/IC-10728486856959292234 create mode 100644 js/src/ics/IC-10739734239018832127 create mode 100644 js/src/ics/IC-10783119225808419178 create mode 100644 js/src/ics/IC-10785410580519018791 create mode 100644 js/src/ics/IC-10785774754033130732 create mode 100644 js/src/ics/IC-10799558662845372007 create mode 100644 js/src/ics/IC-108091804264432729 create mode 100644 js/src/ics/IC-10835907626368138623 create mode 100644 js/src/ics/IC-10844197858476861698 create mode 100644 js/src/ics/IC-10845060487352600691 create mode 100644 js/src/ics/IC-10864341715849999487 create mode 100644 js/src/ics/IC-10889474852253441039 create mode 100644 js/src/ics/IC-10891149831505669090 create mode 100644 js/src/ics/IC-10892791689614926029 create mode 100644 js/src/ics/IC-10918584040860798834 create mode 100644 js/src/ics/IC-10923317551992982900 create mode 100644 js/src/ics/IC-10926954779920259261 create mode 100644 js/src/ics/IC-10979775141347768108 create mode 100644 js/src/ics/IC-10990951273432093646 create mode 100644 js/src/ics/IC-11012461244502181753 create mode 100644 js/src/ics/IC-11017584780111727090 create mode 100644 js/src/ics/IC-11018256844882494789 create mode 100644 js/src/ics/IC-11038123939989769693 create mode 100644 js/src/ics/IC-11042919346822061224 create mode 100644 js/src/ics/IC-11049174715014180988 create mode 100644 js/src/ics/IC-11060220060333108715 create mode 100644 js/src/ics/IC-11082178700814934535 create mode 100644 js/src/ics/IC-11088247450335219404 create mode 100644 js/src/ics/IC-11099301388699508111 create mode 100644 js/src/ics/IC-11108365595478169871 create mode 100644 js/src/ics/IC-11108560576299426297 create mode 100644 js/src/ics/IC-11125824584033702639 create mode 100644 js/src/ics/IC-11126707063016432122 create mode 100644 js/src/ics/IC-11155126938465675967 create mode 100644 js/src/ics/IC-11159457153374891709 create mode 100644 js/src/ics/IC-11178347053423973510 create mode 100644 js/src/ics/IC-11211612145964873406 create mode 100644 js/src/ics/IC-11243479038559379129 create mode 100644 js/src/ics/IC-11250125306565772198 create mode 100644 js/src/ics/IC-11252846724706279705 create mode 100644 js/src/ics/IC-11263448588881622669 create mode 100644 js/src/ics/IC-11293654638617896162 create mode 100644 js/src/ics/IC-11297337085505550617 create mode 100644 js/src/ics/IC-1130563304257587708 create mode 100644 js/src/ics/IC-11320172572546773151 create mode 100644 js/src/ics/IC-11321571101584858952 create mode 100644 js/src/ics/IC-11326524844255251184 create mode 100644 js/src/ics/IC-11329216527069876807 create mode 100644 js/src/ics/IC-11342028399540104729 create mode 100644 js/src/ics/IC-11342449414654468824 create mode 100644 js/src/ics/IC-11366109308614220038 create mode 100644 js/src/ics/IC-11376266815919996863 create mode 100644 js/src/ics/IC-11417613263274110541 create mode 100644 js/src/ics/IC-11454413586868258316 create mode 100644 js/src/ics/IC-11458870435822720219 create mode 100644 js/src/ics/IC-11474570303586391308 create mode 100644 js/src/ics/IC-11480314688100767565 create mode 100644 js/src/ics/IC-11480950816980033955 create mode 100644 js/src/ics/IC-1149008753018867496 create mode 100644 js/src/ics/IC-11497767217347158124 create mode 100644 js/src/ics/IC-11508998258759747115 create mode 100644 js/src/ics/IC-11532719234975304443 create mode 100644 js/src/ics/IC-1154511991230356778 create mode 100644 js/src/ics/IC-11549215406510528747 create mode 100644 js/src/ics/IC-11574571414559288473 create mode 100644 js/src/ics/IC-11575965914216701705 create mode 100644 js/src/ics/IC-11584630481534884288 create mode 100644 js/src/ics/IC-115956099603421614 create mode 100644 js/src/ics/IC-11600883776069615550 create mode 100644 js/src/ics/IC-1160638201342710981 create mode 100644 js/src/ics/IC-1163104847051405417 create mode 100644 js/src/ics/IC-11654432696377733861 create mode 100644 js/src/ics/IC-11672428136127135434 create mode 100644 js/src/ics/IC-11717237524687619883 create mode 100644 js/src/ics/IC-11720463879807711297 create mode 100644 js/src/ics/IC-11728749527861571239 create mode 100644 js/src/ics/IC-11739825854642521065 create mode 100644 js/src/ics/IC-11751293708003933641 create mode 100644 js/src/ics/IC-11753442557781561422 create mode 100644 js/src/ics/IC-11797152210899251011 create mode 100644 js/src/ics/IC-11837681195604493712 create mode 100644 js/src/ics/IC-11845180153158895363 create mode 100644 js/src/ics/IC-11863523924152214302 create mode 100644 js/src/ics/IC-11894253971728676207 create mode 100644 js/src/ics/IC-11895890575808877920 create mode 100644 js/src/ics/IC-11897578746080597689 create mode 100644 js/src/ics/IC-11900209573568550991 create mode 100644 js/src/ics/IC-11915705574977581913 create mode 100644 js/src/ics/IC-11917784147139259625 create mode 100644 js/src/ics/IC-11920954854556069503 create mode 100644 js/src/ics/IC-11922998074703375584 create mode 100644 js/src/ics/IC-11926030484686920413 create mode 100644 js/src/ics/IC-11929523768962332961 create mode 100644 js/src/ics/IC-11966432795011431208 create mode 100644 js/src/ics/IC-11971878972146791849 create mode 100644 js/src/ics/IC-11973731599994297577 create mode 100644 js/src/ics/IC-11974869848038048031 create mode 100644 js/src/ics/IC-1197555389676146502 create mode 100644 js/src/ics/IC-11992046825318127452 create mode 100644 js/src/ics/IC-1199785264712320331 create mode 100644 js/src/ics/IC-12007963213199633266 create mode 100644 js/src/ics/IC-12041464180932850200 create mode 100644 js/src/ics/IC-12065190136681622706 create mode 100644 js/src/ics/IC-12078685233027911076 create mode 100644 js/src/ics/IC-12125345230025462642 create mode 100644 js/src/ics/IC-12128525700402149420 create mode 100644 js/src/ics/IC-12140967404139583523 create mode 100644 js/src/ics/IC-12145809946683612898 create mode 100644 js/src/ics/IC-12169621141189477120 create mode 100644 js/src/ics/IC-12171152205929690452 create mode 100644 js/src/ics/IC-12196014049427297313 create mode 100644 js/src/ics/IC-12201504879653295403 create mode 100644 js/src/ics/IC-12202322731571668158 create mode 100644 js/src/ics/IC-12203565973789721200 create mode 100644 js/src/ics/IC-1220410939266165701 create mode 100644 js/src/ics/IC-12209746183633700082 create mode 100644 js/src/ics/IC-12223037103699642874 create mode 100644 js/src/ics/IC-12229925625792126666 create mode 100644 js/src/ics/IC-12233302930724022918 create mode 100644 js/src/ics/IC-12245285497735887338 create mode 100644 js/src/ics/IC-12249314329615632638 create mode 100644 js/src/ics/IC-12256373031424411132 create mode 100644 js/src/ics/IC-12258217476841598370 create mode 100644 js/src/ics/IC-12289877284398697974 create mode 100644 js/src/ics/IC-12307589128357386290 create mode 100644 js/src/ics/IC-12331206339995042354 create mode 100644 js/src/ics/IC-1233965829917535966 create mode 100644 js/src/ics/IC-12345710976435458483 create mode 100644 js/src/ics/IC-12352350110830558107 create mode 100644 js/src/ics/IC-12371675856128831185 create mode 100644 js/src/ics/IC-12385358395433347552 create mode 100644 js/src/ics/IC-1239752390732558512 create mode 100644 js/src/ics/IC-12407352839699051567 create mode 100644 js/src/ics/IC-12443551273558633822 create mode 100644 js/src/ics/IC-12487802332971824960 create mode 100644 js/src/ics/IC-12496184382435453157 create mode 100644 js/src/ics/IC-1249757521006731908 create mode 100644 js/src/ics/IC-12498738451478602664 create mode 100644 js/src/ics/IC-12516077265661064965 create mode 100644 js/src/ics/IC-12548582455891075725 create mode 100644 js/src/ics/IC-12550843294731269611 create mode 100644 js/src/ics/IC-12551184882861653836 create mode 100644 js/src/ics/IC-12563077197556992774 create mode 100644 js/src/ics/IC-12581823821343441875 create mode 100644 js/src/ics/IC-12587110550698455113 create mode 100644 js/src/ics/IC-12595348712287346529 create mode 100644 js/src/ics/IC-12598398037025850460 create mode 100644 js/src/ics/IC-12607204059847499564 create mode 100644 js/src/ics/IC-12631430526166016177 create mode 100644 js/src/ics/IC-12635275125499063241 create mode 100644 js/src/ics/IC-12650195333268884682 create mode 100644 js/src/ics/IC-1266649421690466245 create mode 100644 js/src/ics/IC-12670139211231267888 create mode 100644 js/src/ics/IC-12672156301222351563 create mode 100644 js/src/ics/IC-12683654241500161406 create mode 100644 js/src/ics/IC-12699136477779093932 create mode 100644 js/src/ics/IC-12726821881891537036 create mode 100644 js/src/ics/IC-12729550702382520945 create mode 100644 js/src/ics/IC-12735248903735755888 create mode 100644 js/src/ics/IC-12778322974528517410 create mode 100644 js/src/ics/IC-12787153739956192081 create mode 100644 js/src/ics/IC-12817398985788194896 create mode 100644 js/src/ics/IC-12824617670150603619 create mode 100644 js/src/ics/IC-1286034681513999872 create mode 100644 js/src/ics/IC-1289055945440076065 create mode 100644 js/src/ics/IC-12898163203561858565 create mode 100644 js/src/ics/IC-12943703669575335204 create mode 100644 js/src/ics/IC-12978522289822245675 create mode 100644 js/src/ics/IC-12981357691094245271 create mode 100644 js/src/ics/IC-12981527137183523177 create mode 100644 js/src/ics/IC-12997906975415912917 create mode 100644 js/src/ics/IC-13002166095676503091 create mode 100644 js/src/ics/IC-13003696480971919932 create mode 100644 js/src/ics/IC-13011662256902718091 create mode 100644 js/src/ics/IC-13033903474341569707 create mode 100644 js/src/ics/IC-13043784027947946539 create mode 100644 js/src/ics/IC-13051015350853341929 create mode 100644 js/src/ics/IC-13081187640352631583 create mode 100644 js/src/ics/IC-13083324281158730695 create mode 100644 js/src/ics/IC-13085205972210035871 create mode 100644 js/src/ics/IC-13105678602020066221 create mode 100644 js/src/ics/IC-13108599658801043492 create mode 100644 js/src/ics/IC-13110895715554840408 create mode 100644 js/src/ics/IC-13116667660014893331 create mode 100644 js/src/ics/IC-1314572759126981884 create mode 100644 js/src/ics/IC-13174815646869447150 create mode 100644 js/src/ics/IC-13177021243244537568 create mode 100644 js/src/ics/IC-13191825944594179624 create mode 100644 js/src/ics/IC-13193174032408027607 create mode 100644 js/src/ics/IC-13202553063534550925 create mode 100644 js/src/ics/IC-13213951643209372357 create mode 100644 js/src/ics/IC-13215801888775527267 create mode 100644 js/src/ics/IC-13219400405226357578 create mode 100644 js/src/ics/IC-13222916196804984928 create mode 100644 js/src/ics/IC-132325594514648605 create mode 100644 js/src/ics/IC-13257172125999579457 create mode 100644 js/src/ics/IC-13266905752506190131 create mode 100644 js/src/ics/IC-13267965840024089330 create mode 100644 js/src/ics/IC-13271239178108435093 create mode 100644 js/src/ics/IC-13376562380096345472 create mode 100644 js/src/ics/IC-13384588600075681597 create mode 100644 js/src/ics/IC-13414121263549175469 create mode 100644 js/src/ics/IC-13417568664826714804 create mode 100644 js/src/ics/IC-13427353002263075219 create mode 100644 js/src/ics/IC-13433654559768403866 create mode 100644 js/src/ics/IC-13453167643054042561 create mode 100644 js/src/ics/IC-134685456544051856 create mode 100644 js/src/ics/IC-13471159476725365323 create mode 100644 js/src/ics/IC-13471620504449912811 create mode 100644 js/src/ics/IC-13473257844410089377 create mode 100644 js/src/ics/IC-13501956760510915436 create mode 100644 js/src/ics/IC-1351863608263831257 create mode 100644 js/src/ics/IC-13533339276683470532 create mode 100644 js/src/ics/IC-13536195992539915258 create mode 100644 js/src/ics/IC-13555736913312993277 create mode 100644 js/src/ics/IC-13556009625476393953 create mode 100644 js/src/ics/IC-13559342151354789534 create mode 100644 js/src/ics/IC-13578765989722205494 create mode 100644 js/src/ics/IC-13590805774714694855 create mode 100644 js/src/ics/IC-13598851409407123945 create mode 100644 js/src/ics/IC-13612588813206562818 create mode 100644 js/src/ics/IC-13625293738303124290 create mode 100644 js/src/ics/IC-13642100787672430064 create mode 100644 js/src/ics/IC-13648456409911318231 create mode 100644 js/src/ics/IC-13650715547761725318 create mode 100644 js/src/ics/IC-13698406506563248093 create mode 100644 js/src/ics/IC-13713553301365407662 create mode 100644 js/src/ics/IC-13721563172958389941 create mode 100644 js/src/ics/IC-13726068251736320735 create mode 100644 js/src/ics/IC-1373711190724684948 create mode 100644 js/src/ics/IC-1378554472176792638 create mode 100644 js/src/ics/IC-13812622730687272193 create mode 100644 js/src/ics/IC-13832093419347002950 create mode 100644 js/src/ics/IC-13834587576954467767 create mode 100644 js/src/ics/IC-13841379517215814936 create mode 100644 js/src/ics/IC-1386704165739255941 create mode 100644 js/src/ics/IC-13876270104054221329 create mode 100644 js/src/ics/IC-13880620641127642606 create mode 100644 js/src/ics/IC-13897273724036325999 create mode 100644 js/src/ics/IC-13921079828401338443 create mode 100644 js/src/ics/IC-13956483640505359679 create mode 100644 js/src/ics/IC-1396220819944324854 create mode 100644 js/src/ics/IC-13968336765600219575 create mode 100644 js/src/ics/IC-13970198218191718150 create mode 100644 js/src/ics/IC-13973523225442191237 create mode 100644 js/src/ics/IC-13976813150224281378 create mode 100644 js/src/ics/IC-13998294700404197465 create mode 100644 js/src/ics/IC-14052287005514388927 create mode 100644 js/src/ics/IC-14117263075278951151 create mode 100644 js/src/ics/IC-14123896615027276117 create mode 100644 js/src/ics/IC-14130460441626628276 create mode 100644 js/src/ics/IC-14144766053941653023 create mode 100644 js/src/ics/IC-1414880105904709695 create mode 100644 js/src/ics/IC-14150618541272524050 create mode 100644 js/src/ics/IC-14162189632336807272 create mode 100644 js/src/ics/IC-14187676263726922411 create mode 100644 js/src/ics/IC-14195953354760445669 create mode 100644 js/src/ics/IC-14200755824617605140 create mode 100644 js/src/ics/IC-14204410074732422434 create mode 100644 js/src/ics/IC-14220090459296499202 create mode 100644 js/src/ics/IC-1422276730860130965 create mode 100644 js/src/ics/IC-14223030849999757218 create mode 100644 js/src/ics/IC-14224859134046417490 create mode 100644 js/src/ics/IC-14229624103423851641 create mode 100644 js/src/ics/IC-14246505469395708684 create mode 100644 js/src/ics/IC-14281653422476756083 create mode 100644 js/src/ics/IC-14283904817563706615 create mode 100644 js/src/ics/IC-14288027680938726747 create mode 100644 js/src/ics/IC-14298534756209246351 create mode 100644 js/src/ics/IC-14311069532179393026 create mode 100644 js/src/ics/IC-14331161007341784256 create mode 100644 js/src/ics/IC-14339088406296197105 create mode 100644 js/src/ics/IC-14354680038107022059 create mode 100644 js/src/ics/IC-14362161806700298319 create mode 100644 js/src/ics/IC-14413012798209215909 create mode 100644 js/src/ics/IC-14461154631329666657 create mode 100644 js/src/ics/IC-14467883914263481337 create mode 100644 js/src/ics/IC-14489346579519751547 create mode 100644 js/src/ics/IC-14496628861062968371 create mode 100644 js/src/ics/IC-14527407928280247926 create mode 100644 js/src/ics/IC-14554493060237194384 create mode 100644 js/src/ics/IC-14563408594424938637 create mode 100644 js/src/ics/IC-14567866124878772554 create mode 100644 js/src/ics/IC-14626558405453506165 create mode 100644 js/src/ics/IC-14628011205963112067 create mode 100644 js/src/ics/IC-1468766867779691211 create mode 100644 js/src/ics/IC-14704840864205952478 create mode 100644 js/src/ics/IC-14712683113271789853 create mode 100644 js/src/ics/IC-14729315179854293649 create mode 100644 js/src/ics/IC-14737756895956693 create mode 100644 js/src/ics/IC-14752691146145831027 create mode 100644 js/src/ics/IC-1475711424344730393 create mode 100644 js/src/ics/IC-14778912386275267097 create mode 100644 js/src/ics/IC-14807800099883036295 create mode 100644 js/src/ics/IC-14809712869255117667 create mode 100644 js/src/ics/IC-14810953188900809801 create mode 100644 js/src/ics/IC-14814903859502936283 create mode 100644 js/src/ics/IC-14824099102875933291 create mode 100644 js/src/ics/IC-1482567358729930735 create mode 100644 js/src/ics/IC-14830994789469329991 create mode 100644 js/src/ics/IC-14868959734744316604 create mode 100644 js/src/ics/IC-14915757337629635975 create mode 100644 js/src/ics/IC-14954089963405707637 create mode 100644 js/src/ics/IC-14989789579183259278 create mode 100644 js/src/ics/IC-14998253286370425907 create mode 100644 js/src/ics/IC-15021385070842040776 create mode 100644 js/src/ics/IC-15035644798634038466 create mode 100644 js/src/ics/IC-15059931753717096427 create mode 100644 js/src/ics/IC-15066543668900739549 create mode 100644 js/src/ics/IC-1506858868501291641 create mode 100644 js/src/ics/IC-15091287448359619416 create mode 100644 js/src/ics/IC-15095481451536776188 create mode 100644 js/src/ics/IC-15101574030554362130 create mode 100644 js/src/ics/IC-15110406232392833946 create mode 100644 js/src/ics/IC-15122227476588696652 create mode 100644 js/src/ics/IC-1513045088330615991 create mode 100644 js/src/ics/IC-15130802706756202910 create mode 100644 js/src/ics/IC-15132418029182055989 create mode 100644 js/src/ics/IC-15147177876626450886 create mode 100644 js/src/ics/IC-15156872336781672293 create mode 100644 js/src/ics/IC-15178909475978467084 create mode 100644 js/src/ics/IC-15200613056540070697 create mode 100644 js/src/ics/IC-15206564085425805792 create mode 100644 js/src/ics/IC-15218842393645411021 create mode 100644 js/src/ics/IC-15237843965976528717 create mode 100644 js/src/ics/IC-15245480520633794906 create mode 100644 js/src/ics/IC-15247978184118655068 create mode 100644 js/src/ics/IC-15256063064043402161 create mode 100644 js/src/ics/IC-15256845708303439675 create mode 100644 js/src/ics/IC-15256894484672306899 create mode 100644 js/src/ics/IC-15261488265697596324 create mode 100644 js/src/ics/IC-15270022190426507533 create mode 100644 js/src/ics/IC-15276382482033055864 create mode 100644 js/src/ics/IC-15281522977235745903 create mode 100644 js/src/ics/IC-15291494922982619894 create mode 100644 js/src/ics/IC-15299409602153111814 create mode 100644 js/src/ics/IC-15310789324411277655 create mode 100644 js/src/ics/IC-15324427682562725367 create mode 100644 js/src/ics/IC-15326146453845061467 create mode 100644 js/src/ics/IC-15352591983625765146 create mode 100644 js/src/ics/IC-15380481758331451160 create mode 100644 js/src/ics/IC-15434203544764041676 create mode 100644 js/src/ics/IC-15434732477982591583 create mode 100644 js/src/ics/IC-1543617745482107482 create mode 100644 js/src/ics/IC-1544352321194837078 create mode 100644 js/src/ics/IC-15445061814796593256 create mode 100644 js/src/ics/IC-15471644747976782201 create mode 100644 js/src/ics/IC-15482899218233437130 create mode 100644 js/src/ics/IC-1548481327602403487 create mode 100644 js/src/ics/IC-15503679691755473313 create mode 100644 js/src/ics/IC-1551596676474711944 create mode 100644 js/src/ics/IC-1553317233990934446 create mode 100644 js/src/ics/IC-15575561699811901548 create mode 100644 js/src/ics/IC-15578522933277279246 create mode 100644 js/src/ics/IC-15594862229984184183 create mode 100644 js/src/ics/IC-156017073758642248 create mode 100644 js/src/ics/IC-15607155572177135408 create mode 100644 js/src/ics/IC-1561934718361445124 create mode 100644 js/src/ics/IC-15641157417691695382 create mode 100644 js/src/ics/IC-15647871084071096245 create mode 100644 js/src/ics/IC-15664021278566613298 create mode 100644 js/src/ics/IC-15665475069516480819 create mode 100644 js/src/ics/IC-15665533781681879826 create mode 100644 js/src/ics/IC-156666557929437089 create mode 100644 js/src/ics/IC-15670054774371412494 create mode 100644 js/src/ics/IC-15690989141793533292 create mode 100644 js/src/ics/IC-15701153857556437688 create mode 100644 js/src/ics/IC-15703166559612210896 create mode 100644 js/src/ics/IC-15734495085669042066 create mode 100644 js/src/ics/IC-15744850445352658239 create mode 100644 js/src/ics/IC-15761189120968104974 create mode 100644 js/src/ics/IC-15764820530268627074 create mode 100644 js/src/ics/IC-15772659658134430490 create mode 100644 js/src/ics/IC-15783749619028334769 create mode 100644 js/src/ics/IC-15784845121327496478 create mode 100644 js/src/ics/IC-1578690047484083694 create mode 100644 js/src/ics/IC-15805593711153201813 create mode 100644 js/src/ics/IC-15821008227049644203 create mode 100644 js/src/ics/IC-15851642846257800120 create mode 100644 js/src/ics/IC-15980272252901078068 create mode 100644 js/src/ics/IC-1598824005327988934 create mode 100644 js/src/ics/IC-15995853631243213777 create mode 100644 js/src/ics/IC-16001020454003752679 create mode 100644 js/src/ics/IC-16021804920950381964 create mode 100644 js/src/ics/IC-16026809682949283923 create mode 100644 js/src/ics/IC-1606030695044352806 create mode 100644 js/src/ics/IC-16061132850755538181 create mode 100644 js/src/ics/IC-16063664025510308365 create mode 100644 js/src/ics/IC-16070776591766294213 create mode 100644 js/src/ics/IC-16076808003286742872 create mode 100644 js/src/ics/IC-1608112832159864779 create mode 100644 js/src/ics/IC-16083582160266340449 create mode 100644 js/src/ics/IC-16083659671668501989 create mode 100644 js/src/ics/IC-16094422463908910611 create mode 100644 js/src/ics/IC-16102950291961954136 create mode 100644 js/src/ics/IC-16121396575455359152 create mode 100644 js/src/ics/IC-16124720736972446092 create mode 100644 js/src/ics/IC-16136230262803458414 create mode 100644 js/src/ics/IC-16150605594131551637 create mode 100644 js/src/ics/IC-16154473313194127728 create mode 100644 js/src/ics/IC-16166239202911500667 create mode 100644 js/src/ics/IC-16174291589317550903 create mode 100644 js/src/ics/IC-16180687653006196821 create mode 100644 js/src/ics/IC-1618600175832804022 create mode 100644 js/src/ics/IC-16195997200473740336 create mode 100644 js/src/ics/IC-161974646781488000 create mode 100644 js/src/ics/IC-16227756009333563992 create mode 100644 js/src/ics/IC-1627400993137997584 create mode 100644 js/src/ics/IC-16280462555922375898 create mode 100644 js/src/ics/IC-16294827684364476198 create mode 100644 js/src/ics/IC-16296220530659520538 create mode 100644 js/src/ics/IC-16302938893583030197 create mode 100644 js/src/ics/IC-16316788967681582913 create mode 100644 js/src/ics/IC-16317548204222040719 create mode 100644 js/src/ics/IC-16324777759269612328 create mode 100644 js/src/ics/IC-1634739098904739531 create mode 100644 js/src/ics/IC-1635501914358270870 create mode 100644 js/src/ics/IC-16369833480082781658 create mode 100644 js/src/ics/IC-16374656114163620899 create mode 100644 js/src/ics/IC-1638383586556121771 create mode 100644 js/src/ics/IC-16396647195197475809 create mode 100644 js/src/ics/IC-16398001397064690244 create mode 100644 js/src/ics/IC-16412785163782828143 create mode 100644 js/src/ics/IC-16441932411964214517 create mode 100644 js/src/ics/IC-16444569505671344216 create mode 100644 js/src/ics/IC-16447784970019255691 create mode 100644 js/src/ics/IC-16456037603459887409 create mode 100644 js/src/ics/IC-16473305132307886320 create mode 100644 js/src/ics/IC-16492928734702167289 create mode 100644 js/src/ics/IC-16536605270292443508 create mode 100644 js/src/ics/IC-16546279636009970594 create mode 100644 js/src/ics/IC-16546794286948420345 create mode 100644 js/src/ics/IC-16557056797325753112 create mode 100644 js/src/ics/IC-16581406946776729085 create mode 100644 js/src/ics/IC-16585010222894519915 create mode 100644 js/src/ics/IC-16606329988385761398 create mode 100644 js/src/ics/IC-16622623138591522525 create mode 100644 js/src/ics/IC-16625574802904276802 create mode 100644 js/src/ics/IC-16625967148908603541 create mode 100644 js/src/ics/IC-16628473567969918110 create mode 100644 js/src/ics/IC-16662032354709854999 create mode 100644 js/src/ics/IC-16665929507764626742 create mode 100644 js/src/ics/IC-16682031519227121100 create mode 100644 js/src/ics/IC-16691336148681222157 create mode 100644 js/src/ics/IC-16702403310026065928 create mode 100644 js/src/ics/IC-16706212125424985810 create mode 100644 js/src/ics/IC-16739666423033416984 create mode 100644 js/src/ics/IC-16744391240382581557 create mode 100644 js/src/ics/IC-16750844397036450523 create mode 100644 js/src/ics/IC-1675953501727852675 create mode 100644 js/src/ics/IC-16761661378458221911 create mode 100644 js/src/ics/IC-1677144798147218081 create mode 100644 js/src/ics/IC-16810720249147781773 create mode 100644 js/src/ics/IC-16843569621895605781 create mode 100644 js/src/ics/IC-16894807033258179497 create mode 100644 js/src/ics/IC-16896933975358668103 create mode 100644 js/src/ics/IC-16929910075128602681 create mode 100644 js/src/ics/IC-16962286447891923863 create mode 100644 js/src/ics/IC-1697596976209236913 create mode 100644 js/src/ics/IC-16977823490136600386 create mode 100644 js/src/ics/IC-16997233238971559737 create mode 100644 js/src/ics/IC-17001888958166851542 create mode 100644 js/src/ics/IC-17008048015808328062 create mode 100644 js/src/ics/IC-17030656571181434301 create mode 100644 js/src/ics/IC-17034129802980087269 create mode 100644 js/src/ics/IC-17049830041849044806 create mode 100644 js/src/ics/IC-17054177827044753950 create mode 100644 js/src/ics/IC-17072361331064894952 create mode 100644 js/src/ics/IC-1707959048926965928 create mode 100644 js/src/ics/IC-17094936275664989501 create mode 100644 js/src/ics/IC-1710672456797280749 create mode 100644 js/src/ics/IC-17124708235541468188 create mode 100644 js/src/ics/IC-17133745156678627147 create mode 100644 js/src/ics/IC-17137945674274924239 create mode 100644 js/src/ics/IC-17139371222773197350 create mode 100644 js/src/ics/IC-17140783973773984614 create mode 100644 js/src/ics/IC-17143168296190575955 create mode 100644 js/src/ics/IC-17143656987586251558 create mode 100644 js/src/ics/IC-17157214466461301985 create mode 100644 js/src/ics/IC-1718347208533669718 create mode 100644 js/src/ics/IC-17194952183924216031 create mode 100644 js/src/ics/IC-17200512045638306662 create mode 100644 js/src/ics/IC-17202574952621097581 create mode 100644 js/src/ics/IC-17206702365849189612 create mode 100644 js/src/ics/IC-17218157902369351333 create mode 100644 js/src/ics/IC-17219233629473999621 create mode 100644 js/src/ics/IC-17223794167792224979 create mode 100644 js/src/ics/IC-17243291150669084667 create mode 100644 js/src/ics/IC-17245147196178324728 create mode 100644 js/src/ics/IC-17250028833087076103 create mode 100644 js/src/ics/IC-17283064744871819413 create mode 100644 js/src/ics/IC-17287232743506522707 create mode 100644 js/src/ics/IC-17303372224456508774 create mode 100644 js/src/ics/IC-17311424909765776333 create mode 100644 js/src/ics/IC-1731653344172329244 create mode 100644 js/src/ics/IC-17341274183022673861 create mode 100644 js/src/ics/IC-17369591371278226621 create mode 100644 js/src/ics/IC-17377678630321335324 create mode 100644 js/src/ics/IC-17402807312835872528 create mode 100644 js/src/ics/IC-17404785894496485648 create mode 100644 js/src/ics/IC-17409096388200987766 create mode 100644 js/src/ics/IC-17421839695520615129 create mode 100644 js/src/ics/IC-1742917343698058941 create mode 100644 js/src/ics/IC-17431225583265888174 create mode 100644 js/src/ics/IC-17433811116324676658 create mode 100644 js/src/ics/IC-17435886047030795391 create mode 100644 js/src/ics/IC-17461554138527416107 create mode 100644 js/src/ics/IC-17465787569802424915 create mode 100644 js/src/ics/IC-17478019032397489303 create mode 100644 js/src/ics/IC-17500653588999119138 create mode 100644 js/src/ics/IC-17523830714429615508 create mode 100644 js/src/ics/IC-17538293816173927979 create mode 100644 js/src/ics/IC-17553867699806252475 create mode 100644 js/src/ics/IC-17565183669852008737 create mode 100644 js/src/ics/IC-1757527689596980995 create mode 100644 js/src/ics/IC-17604194641356900798 create mode 100644 js/src/ics/IC-17609203402393407740 create mode 100644 js/src/ics/IC-17619171276207721564 create mode 100644 js/src/ics/IC-17619594449876844546 create mode 100644 js/src/ics/IC-17647621666440692093 create mode 100644 js/src/ics/IC-1765703006862995331 create mode 100644 js/src/ics/IC-17694320777855220627 create mode 100644 js/src/ics/IC-17700930231562942520 create mode 100644 js/src/ics/IC-17708013622254109918 create mode 100644 js/src/ics/IC-17728547256082126010 create mode 100644 js/src/ics/IC-17740269958270359325 create mode 100644 js/src/ics/IC-17757130859605688788 create mode 100644 js/src/ics/IC-17772381250193455234 create mode 100644 js/src/ics/IC-17809225714392331196 create mode 100644 js/src/ics/IC-17829093428407408025 create mode 100644 js/src/ics/IC-17836645186823502871 create mode 100644 js/src/ics/IC-17872027683831176768 create mode 100644 js/src/ics/IC-17882229252473860350 create mode 100644 js/src/ics/IC-17904590481600338695 create mode 100644 js/src/ics/IC-17915188919478386689 create mode 100644 js/src/ics/IC-17916278593513441896 create mode 100644 js/src/ics/IC-17919747057367750288 create mode 100644 js/src/ics/IC-17921446924779061187 create mode 100644 js/src/ics/IC-17977958804376690512 create mode 100644 js/src/ics/IC-17991001654696064903 create mode 100644 js/src/ics/IC-17996793111526515057 create mode 100644 js/src/ics/IC-18024960594532879479 create mode 100644 js/src/ics/IC-18026600390025347800 create mode 100644 js/src/ics/IC-18027735950718257946 create mode 100644 js/src/ics/IC-18045588146049567594 create mode 100644 js/src/ics/IC-18061435983453055086 create mode 100644 js/src/ics/IC-18063391690975188185 create mode 100644 js/src/ics/IC-18082601175560036483 create mode 100644 js/src/ics/IC-18083887163005789614 create mode 100644 js/src/ics/IC-1812428509537670571 create mode 100644 js/src/ics/IC-18138572930094200708 create mode 100644 js/src/ics/IC-18150499382853049364 create mode 100644 js/src/ics/IC-18163004627835258171 create mode 100644 js/src/ics/IC-18163352791804677298 create mode 100644 js/src/ics/IC-18168596951306988086 create mode 100644 js/src/ics/IC-18177577239575973132 create mode 100644 js/src/ics/IC-18203033874725942972 create mode 100644 js/src/ics/IC-18205290136643812152 create mode 100644 js/src/ics/IC-18215232378759789035 create mode 100644 js/src/ics/IC-18230162535045614918 create mode 100644 js/src/ics/IC-18233255133612278157 create mode 100644 js/src/ics/IC-18247437866360058214 create mode 100644 js/src/ics/IC-18247511447866385793 create mode 100644 js/src/ics/IC-18255000213765161667 create mode 100644 js/src/ics/IC-18260918275196662745 create mode 100644 js/src/ics/IC-18269332780259816901 create mode 100644 js/src/ics/IC-18273421188824580010 create mode 100644 js/src/ics/IC-1829882015200888732 create mode 100644 js/src/ics/IC-18300707677101983051 create mode 100644 js/src/ics/IC-18364728046067680159 create mode 100644 js/src/ics/IC-18383069888075440090 create mode 100644 js/src/ics/IC-18406681373742992801 create mode 100644 js/src/ics/IC-18417415188337939512 create mode 100644 js/src/ics/IC-1874721558703988683 create mode 100644 js/src/ics/IC-187764657074712339 create mode 100644 js/src/ics/IC-188624896502903694 create mode 100644 js/src/ics/IC-1899740917641139130 create mode 100644 js/src/ics/IC-191092073745633310 create mode 100644 js/src/ics/IC-1911222769264596611 create mode 100644 js/src/ics/IC-1914090163038826176 create mode 100644 js/src/ics/IC-1922088450768176119 create mode 100644 js/src/ics/IC-1922379877290903206 create mode 100644 js/src/ics/IC-1930651877465110134 create mode 100644 js/src/ics/IC-1958498882277703804 create mode 100644 js/src/ics/IC-1978813921514302351 create mode 100644 js/src/ics/IC-1984731683141195983 create mode 100644 js/src/ics/IC-2011520596613052330 create mode 100644 js/src/ics/IC-2062548415379116244 create mode 100644 js/src/ics/IC-2069761895861418575 create mode 100644 js/src/ics/IC-2071781605961187052 create mode 100644 js/src/ics/IC-2074656138179039797 create mode 100644 js/src/ics/IC-2081802683341159475 create mode 100644 js/src/ics/IC-2086723106745968256 create mode 100644 js/src/ics/IC-2086905995182716458 create mode 100644 js/src/ics/IC-210144046857212322 create mode 100644 js/src/ics/IC-2137848763953584890 create mode 100644 js/src/ics/IC-2143448554454499349 create mode 100644 js/src/ics/IC-2151648659228270655 create mode 100644 js/src/ics/IC-216425788329978311 create mode 100644 js/src/ics/IC-2169251083567393299 create mode 100644 js/src/ics/IC-2171431250058728502 create mode 100644 js/src/ics/IC-2184863063398148428 create mode 100644 js/src/ics/IC-2230606841539842551 create mode 100644 js/src/ics/IC-2273202721796384800 create mode 100644 js/src/ics/IC-2313082164892530755 create mode 100644 js/src/ics/IC-2339634224401801487 create mode 100644 js/src/ics/IC-2351162846336746035 create mode 100644 js/src/ics/IC-2371990067430049343 create mode 100644 js/src/ics/IC-2377599860335463454 create mode 100644 js/src/ics/IC-2380892506045607779 create mode 100644 js/src/ics/IC-2398402272777244131 create mode 100644 js/src/ics/IC-2417302517823498608 create mode 100644 js/src/ics/IC-2418707696100325399 create mode 100644 js/src/ics/IC-2454948850716611951 create mode 100644 js/src/ics/IC-2456834969277128085 create mode 100644 js/src/ics/IC-2462731431393133002 create mode 100644 js/src/ics/IC-2515826279634114248 create mode 100644 js/src/ics/IC-2518253502660787428 create mode 100644 js/src/ics/IC-2521244443826978133 create mode 100644 js/src/ics/IC-2531978278637808078 create mode 100644 js/src/ics/IC-2535451704436036055 create mode 100644 js/src/ics/IC-2542825496446283237 create mode 100644 js/src/ics/IC-2584985458187775789 create mode 100644 js/src/ics/IC-2618512630462482380 create mode 100644 js/src/ics/IC-2624898344269778408 create mode 100644 js/src/ics/IC-2644556544581678306 create mode 100644 js/src/ics/IC-2645532145448443217 create mode 100644 js/src/ics/IC-2661083574516437070 create mode 100644 js/src/ics/IC-2669068402497370744 create mode 100644 js/src/ics/IC-2686711967840485705 create mode 100644 js/src/ics/IC-2691121023243741501 create mode 100644 js/src/ics/IC-2702772690004335189 create mode 100644 js/src/ics/IC-2708659804234438728 create mode 100644 js/src/ics/IC-2737678301559937239 create mode 100644 js/src/ics/IC-2765459467037608334 create mode 100644 js/src/ics/IC-2767613240500855107 create mode 100644 js/src/ics/IC-2773590376861193527 create mode 100644 js/src/ics/IC-2782409437992023769 create mode 100644 js/src/ics/IC-280026093892213862 create mode 100644 js/src/ics/IC-2801956725434653136 create mode 100644 js/src/ics/IC-2802425936511893854 create mode 100644 js/src/ics/IC-2827143466525184837 create mode 100644 js/src/ics/IC-2855688269616687597 create mode 100644 js/src/ics/IC-2873965502031799334 create mode 100644 js/src/ics/IC-287542670551658275 create mode 100644 js/src/ics/IC-2895026259980035856 create mode 100644 js/src/ics/IC-2912402446003854960 create mode 100644 js/src/ics/IC-2913871485666489552 create mode 100644 js/src/ics/IC-291878540700978050 create mode 100644 js/src/ics/IC-292082082355467009 create mode 100644 js/src/ics/IC-2928815103741675983 create mode 100644 js/src/ics/IC-2958411735556139423 create mode 100644 js/src/ics/IC-2966024549592476080 create mode 100644 js/src/ics/IC-2983342025737404834 create mode 100644 js/src/ics/IC-2990975653483082955 create mode 100644 js/src/ics/IC-2992382339529556418 create mode 100644 js/src/ics/IC-3016091860216907838 create mode 100644 js/src/ics/IC-3024635330905737690 create mode 100644 js/src/ics/IC-3050564922038072872 create mode 100644 js/src/ics/IC-3058041403847434208 create mode 100644 js/src/ics/IC-3058288795472298567 create mode 100644 js/src/ics/IC-3063208630223808341 create mode 100644 js/src/ics/IC-3063897698311975033 create mode 100644 js/src/ics/IC-3065981700777779924 create mode 100644 js/src/ics/IC-3070543937284829139 create mode 100644 js/src/ics/IC-3107997055811569125 create mode 100644 js/src/ics/IC-3108375503482564051 create mode 100644 js/src/ics/IC-3126533402459306811 create mode 100644 js/src/ics/IC-3129554586835639708 create mode 100644 js/src/ics/IC-3130944617629361877 create mode 100644 js/src/ics/IC-3141748223018335851 create mode 100644 js/src/ics/IC-3149342849615121298 create mode 100644 js/src/ics/IC-315159741714676948 create mode 100644 js/src/ics/IC-3151621465039598092 create mode 100644 js/src/ics/IC-3159826668269198227 create mode 100644 js/src/ics/IC-3180778674546850643 create mode 100644 js/src/ics/IC-3183032258049838025 create mode 100644 js/src/ics/IC-3184817209321377926 create mode 100644 js/src/ics/IC-3188547504096831872 create mode 100644 js/src/ics/IC-3209469901421149634 create mode 100644 js/src/ics/IC-3210025847986191306 create mode 100644 js/src/ics/IC-3215707204901826833 create mode 100644 js/src/ics/IC-3221536603393431694 create mode 100644 js/src/ics/IC-3242710856889481812 create mode 100644 js/src/ics/IC-3254310163569751649 create mode 100644 js/src/ics/IC-3260469094742591393 create mode 100644 js/src/ics/IC-3270125778517387953 create mode 100644 js/src/ics/IC-3285495661201347501 create mode 100644 js/src/ics/IC-3291639657746952837 create mode 100644 js/src/ics/IC-3303567693918747615 create mode 100644 js/src/ics/IC-3313907665922919113 create mode 100644 js/src/ics/IC-3316780861999244382 create mode 100644 js/src/ics/IC-3365998306684347245 create mode 100644 js/src/ics/IC-337983161629110517 create mode 100644 js/src/ics/IC-3388123219511355535 create mode 100644 js/src/ics/IC-3430589870118667057 create mode 100644 js/src/ics/IC-3451635243707423569 create mode 100644 js/src/ics/IC-3456421405836740213 create mode 100644 js/src/ics/IC-3463540458717575441 create mode 100644 js/src/ics/IC-3481031266271930715 create mode 100644 js/src/ics/IC-3512058922300613252 create mode 100644 js/src/ics/IC-3528013366198793326 create mode 100644 js/src/ics/IC-3528179051561271653 create mode 100644 js/src/ics/IC-3530211928626575094 create mode 100644 js/src/ics/IC-3551621975038476869 create mode 100644 js/src/ics/IC-3559333848528880282 create mode 100644 js/src/ics/IC-3568082001678279740 create mode 100644 js/src/ics/IC-3569882059995853558 create mode 100644 js/src/ics/IC-3589849304579682331 create mode 100644 js/src/ics/IC-3597138435105657726 create mode 100644 js/src/ics/IC-3609972302888278654 create mode 100644 js/src/ics/IC-3612832018387859729 create mode 100644 js/src/ics/IC-3634148346840572296 create mode 100644 js/src/ics/IC-3656206024072327113 create mode 100644 js/src/ics/IC-3657932750771746404 create mode 100644 js/src/ics/IC-3661072867427592162 create mode 100644 js/src/ics/IC-3661695729403573203 create mode 100644 js/src/ics/IC-3672696817653550044 create mode 100644 js/src/ics/IC-3679450300823375305 create mode 100644 js/src/ics/IC-3682576107139758084 create mode 100644 js/src/ics/IC-3734812142467418625 create mode 100644 js/src/ics/IC-3755018854119379339 create mode 100644 js/src/ics/IC-3773285914794781769 create mode 100644 js/src/ics/IC-3777372779978486243 create mode 100644 js/src/ics/IC-3783993352614114791 create mode 100644 js/src/ics/IC-3797926286349396013 create mode 100644 js/src/ics/IC-3808918365377850068 create mode 100644 js/src/ics/IC-3865431538426642194 create mode 100644 js/src/ics/IC-3867479862096930136 create mode 100644 js/src/ics/IC-3870915099258776426 create mode 100644 js/src/ics/IC-389003273598954999 create mode 100644 js/src/ics/IC-3917163428349655949 create mode 100644 js/src/ics/IC-3949900529100100863 create mode 100644 js/src/ics/IC-3964603549364967584 create mode 100644 js/src/ics/IC-39690460880282582 create mode 100644 js/src/ics/IC-3978516112237392526 create mode 100644 js/src/ics/IC-3980529659776200209 create mode 100644 js/src/ics/IC-3990626075643434207 create mode 100644 js/src/ics/IC-3995686981063035752 create mode 100644 js/src/ics/IC-4000443357665273090 create mode 100644 js/src/ics/IC-4028281825672479567 create mode 100644 js/src/ics/IC-4030969467382293263 create mode 100644 js/src/ics/IC-4047821176947237630 create mode 100644 js/src/ics/IC-406074042512431995 create mode 100644 js/src/ics/IC-4063194770314682956 create mode 100644 js/src/ics/IC-4069361993612748503 create mode 100644 js/src/ics/IC-4070939822708021300 create mode 100644 js/src/ics/IC-4078436961597644502 create mode 100644 js/src/ics/IC-4106844363038176762 create mode 100644 js/src/ics/IC-4116168477963531058 create mode 100644 js/src/ics/IC-41191806326866852 create mode 100644 js/src/ics/IC-4127463736148707198 create mode 100644 js/src/ics/IC-4137503656080954450 create mode 100644 js/src/ics/IC-414410497084563379 create mode 100644 js/src/ics/IC-4159338440671789798 create mode 100644 js/src/ics/IC-4183842994047523642 create mode 100644 js/src/ics/IC-419206947237103119 create mode 100644 js/src/ics/IC-4201435969598747070 create mode 100644 js/src/ics/IC-4213864849714302958 create mode 100644 js/src/ics/IC-4253798086806600477 create mode 100644 js/src/ics/IC-4257898183961413318 create mode 100644 js/src/ics/IC-428929725231831370 create mode 100644 js/src/ics/IC-4290628426590161433 create mode 100644 js/src/ics/IC-4314897430777610180 create mode 100644 js/src/ics/IC-4331034240427156470 create mode 100644 js/src/ics/IC-4349140574576985106 create mode 100644 js/src/ics/IC-4356010842119990164 create mode 100644 js/src/ics/IC-4401115047547016029 create mode 100644 js/src/ics/IC-4469743735075377828 create mode 100644 js/src/ics/IC-4529465499681039560 create mode 100644 js/src/ics/IC-4531364307335516741 create mode 100644 js/src/ics/IC-4540536284992510594 create mode 100644 js/src/ics/IC-455359788701706473 create mode 100644 js/src/ics/IC-4564453466100177384 create mode 100644 js/src/ics/IC-4570824905465268802 create mode 100644 js/src/ics/IC-4586879335310093030 create mode 100644 js/src/ics/IC-4615780852236812813 create mode 100644 js/src/ics/IC-4633639322269444908 create mode 100644 js/src/ics/IC-463435529406221163 create mode 100644 js/src/ics/IC-4667474526973057585 create mode 100644 js/src/ics/IC-4668691876088627929 create mode 100644 js/src/ics/IC-4681946795141297256 create mode 100644 js/src/ics/IC-4701671027380290987 create mode 100644 js/src/ics/IC-4731098206248976372 create mode 100644 js/src/ics/IC-4734497559573485904 create mode 100644 js/src/ics/IC-4735590702341055761 create mode 100644 js/src/ics/IC-4736397757847713077 create mode 100644 js/src/ics/IC-4739648521757046986 create mode 100644 js/src/ics/IC-4744040428186374519 create mode 100644 js/src/ics/IC-4764951245913829783 create mode 100644 js/src/ics/IC-4807651754683386837 create mode 100644 js/src/ics/IC-4837639617296355283 create mode 100644 js/src/ics/IC-4845452116642991738 create mode 100644 js/src/ics/IC-4891342749109966432 create mode 100644 js/src/ics/IC-4900135455193282383 create mode 100644 js/src/ics/IC-4922149867090114317 create mode 100644 js/src/ics/IC-4963669926436995651 create mode 100644 js/src/ics/IC-4980379635059490652 create mode 100644 js/src/ics/IC-4982387211093858531 create mode 100644 js/src/ics/IC-4983691950823390195 create mode 100644 js/src/ics/IC-4990566579533878012 create mode 100644 js/src/ics/IC-5023487226246351503 create mode 100644 js/src/ics/IC-5031122507432221980 create mode 100644 js/src/ics/IC-5045618420272476443 create mode 100644 js/src/ics/IC-5069792978291141863 create mode 100644 js/src/ics/IC-5074177821418432695 create mode 100644 js/src/ics/IC-5087120774109976541 create mode 100644 js/src/ics/IC-5093742640529975629 create mode 100644 js/src/ics/IC-5107105040617672305 create mode 100644 js/src/ics/IC-5151588910615654670 create mode 100644 js/src/ics/IC-51552858227663770 create mode 100644 js/src/ics/IC-5159868623055647136 create mode 100644 js/src/ics/IC-5170848910968615373 create mode 100644 js/src/ics/IC-5173344172117297366 create mode 100644 js/src/ics/IC-5200828597209498575 create mode 100644 js/src/ics/IC-5203330381890490451 create mode 100644 js/src/ics/IC-5214159996564928378 create mode 100644 js/src/ics/IC-5229682133416320795 create mode 100644 js/src/ics/IC-5292473895363177205 create mode 100644 js/src/ics/IC-5298416090638667837 create mode 100644 js/src/ics/IC-5314653691660087053 create mode 100644 js/src/ics/IC-5316601505449798967 create mode 100644 js/src/ics/IC-5325110385863222471 create mode 100644 js/src/ics/IC-5325479602864963535 create mode 100644 js/src/ics/IC-5356911276060368919 create mode 100644 js/src/ics/IC-5360274303237669571 create mode 100644 js/src/ics/IC-5366859542488836052 create mode 100644 js/src/ics/IC-537262894942906764 create mode 100644 js/src/ics/IC-5414419622920062469 create mode 100644 js/src/ics/IC-5430422129922568042 create mode 100644 js/src/ics/IC-5431138521638409901 create mode 100644 js/src/ics/IC-5440563467445612687 create mode 100644 js/src/ics/IC-5451562074139472869 create mode 100644 js/src/ics/IC-5453413639121254243 create mode 100644 js/src/ics/IC-5453706424808110088 create mode 100644 js/src/ics/IC-5475933309292952269 create mode 100644 js/src/ics/IC-548882788670680882 create mode 100644 js/src/ics/IC-5498468084005282890 create mode 100644 js/src/ics/IC-5503857666127213563 create mode 100644 js/src/ics/IC-551759920627692530 create mode 100644 js/src/ics/IC-5532241740121324706 create mode 100644 js/src/ics/IC-5535867792675904524 create mode 100644 js/src/ics/IC-5557600775286138031 create mode 100644 js/src/ics/IC-5577207826876614659 create mode 100644 js/src/ics/IC-5621344425638133163 create mode 100644 js/src/ics/IC-5622365618808743691 create mode 100644 js/src/ics/IC-5626904542189522402 create mode 100644 js/src/ics/IC-5641070235743673050 create mode 100644 js/src/ics/IC-5655558484629346613 create mode 100644 js/src/ics/IC-5666456393611175420 create mode 100644 js/src/ics/IC-5671110871170019000 create mode 100644 js/src/ics/IC-5678260749392815029 create mode 100644 js/src/ics/IC-5718826192652598978 create mode 100644 js/src/ics/IC-5727692861382456992 create mode 100644 js/src/ics/IC-5733502973680379365 create mode 100644 js/src/ics/IC-5756273448623453072 create mode 100644 js/src/ics/IC-5775164289335658528 create mode 100644 js/src/ics/IC-5786249113263803994 create mode 100644 js/src/ics/IC-579257625803382067 create mode 100644 js/src/ics/IC-5813034366357900449 create mode 100644 js/src/ics/IC-5819847375259697467 create mode 100644 js/src/ics/IC-5835529469182302568 create mode 100644 js/src/ics/IC-5846323929830966129 create mode 100644 js/src/ics/IC-5849615840270306761 create mode 100644 js/src/ics/IC-5855891115550373556 create mode 100644 js/src/ics/IC-5869987350935109062 create mode 100644 js/src/ics/IC-5872242747911214759 create mode 100644 js/src/ics/IC-5874239926455863724 create mode 100644 js/src/ics/IC-587714778299262616 create mode 100644 js/src/ics/IC-588384615805920198 create mode 100644 js/src/ics/IC-5912250539169622605 create mode 100644 js/src/ics/IC-5912323616554975669 create mode 100644 js/src/ics/IC-5913967622441221915 create mode 100644 js/src/ics/IC-5920990077679333046 create mode 100644 js/src/ics/IC-5979933657154175813 create mode 100644 js/src/ics/IC-5981087199954198415 create mode 100644 js/src/ics/IC-5981532190828677479 create mode 100644 js/src/ics/IC-5982182292180846915 create mode 100644 js/src/ics/IC-5991742124680723496 create mode 100644 js/src/ics/IC-5999742380082135166 create mode 100644 js/src/ics/IC-600504079898778130 create mode 100644 js/src/ics/IC-6009444823097086357 create mode 100644 js/src/ics/IC-6019576791496131862 create mode 100644 js/src/ics/IC-6061207598748454306 create mode 100644 js/src/ics/IC-6082115889906159497 create mode 100644 js/src/ics/IC-6087499400459459326 create mode 100644 js/src/ics/IC-6098254129790034277 create mode 100644 js/src/ics/IC-6101894920461306288 create mode 100644 js/src/ics/IC-610213485237308342 create mode 100644 js/src/ics/IC-6105652248863429548 create mode 100644 js/src/ics/IC-6127367941508481067 create mode 100644 js/src/ics/IC-6135345967831715705 create mode 100644 js/src/ics/IC-6143375524470104030 create mode 100644 js/src/ics/IC-6146020855536251424 create mode 100644 js/src/ics/IC-6146325095462273887 create mode 100644 js/src/ics/IC-615433728494893218 create mode 100644 js/src/ics/IC-6158212624399616553 create mode 100644 js/src/ics/IC-6159868938875897971 create mode 100644 js/src/ics/IC-6183110164745970583 create mode 100644 js/src/ics/IC-6210440649435489795 create mode 100644 js/src/ics/IC-6212775784017808964 create mode 100644 js/src/ics/IC-6235677804899620724 create mode 100644 js/src/ics/IC-6240639567071266349 create mode 100644 js/src/ics/IC-6245643355357745767 create mode 100644 js/src/ics/IC-625074041988396194 create mode 100644 js/src/ics/IC-6261712165203039516 create mode 100644 js/src/ics/IC-6292702835226523330 create mode 100644 js/src/ics/IC-6327522087412591704 create mode 100644 js/src/ics/IC-6330274544238710646 create mode 100644 js/src/ics/IC-6340399081515649191 create mode 100644 js/src/ics/IC-6341944345095833427 create mode 100644 js/src/ics/IC-6360555972558397887 create mode 100644 js/src/ics/IC-636392079608777021 create mode 100644 js/src/ics/IC-6400233992713918968 create mode 100644 js/src/ics/IC-6449820065704212551 create mode 100644 js/src/ics/IC-647091038417072018 create mode 100644 js/src/ics/IC-6472000057917485609 create mode 100644 js/src/ics/IC-6514508776943165331 create mode 100644 js/src/ics/IC-6515912138002560906 create mode 100644 js/src/ics/IC-6516656865559158023 create mode 100644 js/src/ics/IC-6519158448193854731 create mode 100644 js/src/ics/IC-6536480825513853421 create mode 100644 js/src/ics/IC-654735065054311339 create mode 100644 js/src/ics/IC-6596086071328775033 create mode 100644 js/src/ics/IC-6632537767881657296 create mode 100644 js/src/ics/IC-6634032363341560936 create mode 100644 js/src/ics/IC-6648431281659226653 create mode 100644 js/src/ics/IC-6655497693124912829 create mode 100644 js/src/ics/IC-6673320317353405836 create mode 100644 js/src/ics/IC-6676114981265147186 create mode 100644 js/src/ics/IC-6705368495046246180 create mode 100644 js/src/ics/IC-6715353510766004631 create mode 100644 js/src/ics/IC-6721597167480484729 create mode 100644 js/src/ics/IC-6721693850971571311 create mode 100644 js/src/ics/IC-6721824873076198479 create mode 100644 js/src/ics/IC-6752409692062461485 create mode 100644 js/src/ics/IC-677106290285116179 create mode 100644 js/src/ics/IC-6797217433273716714 create mode 100644 js/src/ics/IC-6816786854972243760 create mode 100644 js/src/ics/IC-6818829038527474643 create mode 100644 js/src/ics/IC-6824775793783396742 create mode 100644 js/src/ics/IC-6827892447804868454 create mode 100644 js/src/ics/IC-6831699885929882581 create mode 100644 js/src/ics/IC-6845756836940205003 create mode 100644 js/src/ics/IC-684607117327143518 create mode 100644 js/src/ics/IC-6855513314369875080 create mode 100644 js/src/ics/IC-6858616511397494805 create mode 100644 js/src/ics/IC-6859461870347346752 create mode 100644 js/src/ics/IC-6865598851008758714 create mode 100644 js/src/ics/IC-6868447145767669823 create mode 100644 js/src/ics/IC-6870789570020117766 create mode 100644 js/src/ics/IC-6887264002064944094 create mode 100644 js/src/ics/IC-6938079888860718492 create mode 100644 js/src/ics/IC-6978157832134484043 create mode 100644 js/src/ics/IC-6980487891696488724 create mode 100644 js/src/ics/IC-6982304726945942578 create mode 100644 js/src/ics/IC-698368224462398174 create mode 100644 js/src/ics/IC-6985684912028731373 create mode 100644 js/src/ics/IC-699245192487902193 create mode 100644 js/src/ics/IC-6998649725787362515 create mode 100644 js/src/ics/IC-6999334146529986366 create mode 100644 js/src/ics/IC-7005290164786924814 create mode 100644 js/src/ics/IC-7006336842200308514 create mode 100644 js/src/ics/IC-700786831797247594 create mode 100644 js/src/ics/IC-7024210860932854393 create mode 100644 js/src/ics/IC-7026816496132132923 create mode 100644 js/src/ics/IC-70272839060919129 create mode 100644 js/src/ics/IC-7061950734640137756 create mode 100644 js/src/ics/IC-7084355145539501606 create mode 100644 js/src/ics/IC-7110280990772449778 create mode 100644 js/src/ics/IC-7117088071630770506 create mode 100644 js/src/ics/IC-7133664460836359581 create mode 100644 js/src/ics/IC-7167465578550532482 create mode 100644 js/src/ics/IC-7173802388303836688 create mode 100644 js/src/ics/IC-7202736064201176555 create mode 100644 js/src/ics/IC-7220026805480361100 create mode 100644 js/src/ics/IC-7235661149420205537 create mode 100644 js/src/ics/IC-7250684370862830639 create mode 100644 js/src/ics/IC-726275027529054686 create mode 100644 js/src/ics/IC-7267775787848262760 create mode 100644 js/src/ics/IC-7276738268032779131 create mode 100644 js/src/ics/IC-731101809626422680 create mode 100644 js/src/ics/IC-7314986533314100677 create mode 100644 js/src/ics/IC-7324892400700704689 create mode 100644 js/src/ics/IC-7324956736683671941 create mode 100644 js/src/ics/IC-7339472814877822799 create mode 100644 js/src/ics/IC-7350554386930401733 create mode 100644 js/src/ics/IC-7360746468769580882 create mode 100644 js/src/ics/IC-7362853432073309735 create mode 100644 js/src/ics/IC-736676615944560765 create mode 100644 js/src/ics/IC-7404248840167653361 create mode 100644 js/src/ics/IC-7408088356929918646 create mode 100644 js/src/ics/IC-7409538886074621816 create mode 100644 js/src/ics/IC-7425475827528203933 create mode 100644 js/src/ics/IC-7434900830251242148 create mode 100644 js/src/ics/IC-745904529816712807 create mode 100644 js/src/ics/IC-7486529677653082600 create mode 100644 js/src/ics/IC-749116032814679234 create mode 100644 js/src/ics/IC-7492639846094803244 create mode 100644 js/src/ics/IC-7499173717495355685 create mode 100644 js/src/ics/IC-7503353916431455277 create mode 100644 js/src/ics/IC-751687832949406719 create mode 100644 js/src/ics/IC-7558157803468401724 create mode 100644 js/src/ics/IC-7564196606949402877 create mode 100644 js/src/ics/IC-7567606418741977363 create mode 100644 js/src/ics/IC-7568466058094061231 create mode 100644 js/src/ics/IC-7581138345160930295 create mode 100644 js/src/ics/IC-7584402331764181517 create mode 100644 js/src/ics/IC-758837353040836026 create mode 100644 js/src/ics/IC-7626298430772506162 create mode 100644 js/src/ics/IC-7639062178051447962 create mode 100644 js/src/ics/IC-7645375823311335156 create mode 100644 js/src/ics/IC-7649343913925262713 create mode 100644 js/src/ics/IC-7684497546958413653 create mode 100644 js/src/ics/IC-769874876471461951 create mode 100644 js/src/ics/IC-7708211997325567179 create mode 100644 js/src/ics/IC-7719784825117209774 create mode 100644 js/src/ics/IC-7757860598185740927 create mode 100644 js/src/ics/IC-7768433527213643412 create mode 100644 js/src/ics/IC-7791800684512152753 create mode 100644 js/src/ics/IC-7804041312612862365 create mode 100644 js/src/ics/IC-7866166923509172853 create mode 100644 js/src/ics/IC-7869157210104551129 create mode 100644 js/src/ics/IC-7870884289306445919 create mode 100644 js/src/ics/IC-7895134038915974605 create mode 100644 js/src/ics/IC-7909848207463708484 create mode 100644 js/src/ics/IC-7917106339670149229 create mode 100644 js/src/ics/IC-7930724512359688784 create mode 100644 js/src/ics/IC-7940724580282964946 create mode 100644 js/src/ics/IC-7948263610858036054 create mode 100644 js/src/ics/IC-7951837257564624315 create mode 100644 js/src/ics/IC-7952192849644477208 create mode 100644 js/src/ics/IC-7972057111904247804 create mode 100644 js/src/ics/IC-8001703547456055322 create mode 100644 js/src/ics/IC-8009553409671560982 create mode 100644 js/src/ics/IC-802216659212149853 create mode 100644 js/src/ics/IC-8068678896796315186 create mode 100644 js/src/ics/IC-807303826890643662 create mode 100644 js/src/ics/IC-8075975975025262858 create mode 100644 js/src/ics/IC-8085671503585936599 create mode 100644 js/src/ics/IC-8101078221050368849 create mode 100644 js/src/ics/IC-8108183892012730001 create mode 100644 js/src/ics/IC-8111883778987399440 create mode 100644 js/src/ics/IC-8131647849764614667 create mode 100644 js/src/ics/IC-8137744976260600065 create mode 100644 js/src/ics/IC-8142046115317896438 create mode 100644 js/src/ics/IC-8142965712298942684 create mode 100644 js/src/ics/IC-8155132706777070304 create mode 100644 js/src/ics/IC-8180528644816477753 create mode 100644 js/src/ics/IC-8182823701706162214 create mode 100644 js/src/ics/IC-8193213348312547492 create mode 100644 js/src/ics/IC-8199823677791083428 create mode 100644 js/src/ics/IC-8215484261361241131 create mode 100644 js/src/ics/IC-8216349263939615631 create mode 100644 js/src/ics/IC-8230559266677649540 create mode 100644 js/src/ics/IC-8233321740058095794 create mode 100644 js/src/ics/IC-8236049176462706622 create mode 100644 js/src/ics/IC-8244482935373369685 create mode 100644 js/src/ics/IC-8244631324132828388 create mode 100644 js/src/ics/IC-8254164986441511102 create mode 100644 js/src/ics/IC-8254418371745474891 create mode 100644 js/src/ics/IC-8295071825394113903 create mode 100644 js/src/ics/IC-8304559682286002846 create mode 100644 js/src/ics/IC-8315217340573356278 create mode 100644 js/src/ics/IC-8317733766362443569 create mode 100644 js/src/ics/IC-8322473950258781440 create mode 100644 js/src/ics/IC-832278648520639690 create mode 100644 js/src/ics/IC-8326071184532710890 create mode 100644 js/src/ics/IC-8355419085300232965 create mode 100644 js/src/ics/IC-8360592877849122155 create mode 100644 js/src/ics/IC-8363578138225385166 create mode 100644 js/src/ics/IC-8403239149345319813 create mode 100644 js/src/ics/IC-8413322494742765965 create mode 100644 js/src/ics/IC-8420671501376903345 create mode 100644 js/src/ics/IC-8429088277321985112 create mode 100644 js/src/ics/IC-8441206218065884468 create mode 100644 js/src/ics/IC-8442127857693820938 create mode 100644 js/src/ics/IC-8442598027497994034 create mode 100644 js/src/ics/IC-8443741239559716080 create mode 100644 js/src/ics/IC-8445141178915289773 create mode 100644 js/src/ics/IC-847530939114946120 create mode 100644 js/src/ics/IC-8476731158983138059 create mode 100644 js/src/ics/IC-8481490251351291794 create mode 100644 js/src/ics/IC-8501101688775670023 create mode 100644 js/src/ics/IC-850629062811003910 create mode 100644 js/src/ics/IC-8518561424476582843 create mode 100644 js/src/ics/IC-852149399956264048 create mode 100644 js/src/ics/IC-8534257520509712648 create mode 100644 js/src/ics/IC-8540470795437792712 create mode 100644 js/src/ics/IC-8558874767732896280 create mode 100644 js/src/ics/IC-8559109891190089019 create mode 100644 js/src/ics/IC-8585837622815890575 create mode 100644 js/src/ics/IC-8601040439805555324 create mode 100644 js/src/ics/IC-8605376481005836786 create mode 100644 js/src/ics/IC-8610836031911855894 create mode 100644 js/src/ics/IC-8616612317712480790 create mode 100644 js/src/ics/IC-8618671683994336078 create mode 100644 js/src/ics/IC-8622514010011455349 create mode 100644 js/src/ics/IC-8630183055865625216 create mode 100644 js/src/ics/IC-8648689368816333021 create mode 100644 js/src/ics/IC-8674212790026628899 create mode 100644 js/src/ics/IC-8708623109992990057 create mode 100644 js/src/ics/IC-8714373314762342458 create mode 100644 js/src/ics/IC-8717527894172818884 create mode 100644 js/src/ics/IC-8720531975905999486 create mode 100644 js/src/ics/IC-8722343896312957455 create mode 100644 js/src/ics/IC-8726193584855817371 create mode 100644 js/src/ics/IC-8726371440541008632 create mode 100644 js/src/ics/IC-8736858826767240875 create mode 100644 js/src/ics/IC-8743022270375700073 create mode 100644 js/src/ics/IC-8784848970440649925 create mode 100644 js/src/ics/IC-8792325727821224946 create mode 100644 js/src/ics/IC-8798666721954004916 create mode 100644 js/src/ics/IC-8823236652876382714 create mode 100644 js/src/ics/IC-8823597251267430225 create mode 100644 js/src/ics/IC-884268059723707606 create mode 100644 js/src/ics/IC-8849974549760789440 create mode 100644 js/src/ics/IC-8850589965328179479 create mode 100644 js/src/ics/IC-8851692584952403385 create mode 100644 js/src/ics/IC-8853423124788182920 create mode 100644 js/src/ics/IC-8854506138512858772 create mode 100644 js/src/ics/IC-8875849149003083422 create mode 100644 js/src/ics/IC-8877294232782861220 create mode 100644 js/src/ics/IC-8883504650163102320 create mode 100644 js/src/ics/IC-8885076315408518481 create mode 100644 js/src/ics/IC-8906228050932337182 create mode 100644 js/src/ics/IC-8948583931810245738 create mode 100644 js/src/ics/IC-89948756699479799 create mode 100644 js/src/ics/IC-9001279303262868808 create mode 100644 js/src/ics/IC-9016572976303657578 create mode 100644 js/src/ics/IC-9024129248431175636 create mode 100644 js/src/ics/IC-9024603486414797067 create mode 100644 js/src/ics/IC-9068370305687006223 create mode 100644 js/src/ics/IC-907219630550004812 create mode 100644 js/src/ics/IC-908139079542668886 create mode 100644 js/src/ics/IC-9101669341400883942 create mode 100644 js/src/ics/IC-9131463022250286799 create mode 100644 js/src/ics/IC-914618578567048327 create mode 100644 js/src/ics/IC-9150792826415987483 create mode 100644 js/src/ics/IC-9151989501444644471 create mode 100644 js/src/ics/IC-9174168230444628686 create mode 100644 js/src/ics/IC-9204215648363835601 create mode 100644 js/src/ics/IC-9207945744466625582 create mode 100644 js/src/ics/IC-9227137605983198345 create mode 100644 js/src/ics/IC-9232985867061065700 create mode 100644 js/src/ics/IC-9237484516049187040 create mode 100644 js/src/ics/IC-9237928901674183252 create mode 100644 js/src/ics/IC-9241680487677976030 create mode 100644 js/src/ics/IC-9259202069011985421 create mode 100644 js/src/ics/IC-9269862329904473956 create mode 100644 js/src/ics/IC-9277230435407334463 create mode 100644 js/src/ics/IC-9277645843586731829 create mode 100644 js/src/ics/IC-9286654478851807920 create mode 100644 js/src/ics/IC-9288392477050382459 create mode 100644 js/src/ics/IC-9292709240371023995 create mode 100644 js/src/ics/IC-9295154719658582522 create mode 100644 js/src/ics/IC-9295303214710262444 create mode 100644 js/src/ics/IC-9315883869159875436 create mode 100644 js/src/ics/IC-9342121970605574416 create mode 100644 js/src/ics/IC-9345518466920727586 create mode 100644 js/src/ics/IC-9346103948563292422 create mode 100644 js/src/ics/IC-9362119496493489065 create mode 100644 js/src/ics/IC-9367473185132767844 create mode 100644 js/src/ics/IC-9389242458480391583 create mode 100644 js/src/ics/IC-9392012973422799465 create mode 100644 js/src/ics/IC-9393358715217716730 create mode 100644 js/src/ics/IC-9398310652853512136 create mode 100644 js/src/ics/IC-942975193168022395 create mode 100644 js/src/ics/IC-9452175063057999653 create mode 100644 js/src/ics/IC-9491230334521679912 create mode 100644 js/src/ics/IC-9533267757058197559 create mode 100644 js/src/ics/IC-9573953316357395344 create mode 100644 js/src/ics/IC-9585383870753227774 create mode 100644 js/src/ics/IC-9587117297918663607 create mode 100644 js/src/ics/IC-959124955268769284 create mode 100644 js/src/ics/IC-9603353749932629576 create mode 100644 js/src/ics/IC-9658388761974449119 create mode 100644 js/src/ics/IC-9671460492835606492 create mode 100644 js/src/ics/IC-9683159600389630575 create mode 100644 js/src/ics/IC-9729795167523645589 create mode 100644 js/src/ics/IC-973618382294854402 create mode 100644 js/src/ics/IC-9778741650967686308 create mode 100644 js/src/ics/IC-9841770053655394962 create mode 100644 js/src/ics/IC-9843527680704020017 create mode 100644 js/src/ics/IC-9861241337687476640 create mode 100644 js/src/ics/IC-9864679896375120796 create mode 100644 js/src/ics/IC-9884033488871678626 create mode 100644 js/src/ics/IC-9945672477509952136 create mode 100644 js/src/ics/IC-9958937109052491671 create mode 100644 js/src/ics/IC-9973119692938145424 create mode 100644 js/src/ics/IC-9978339837634607339 create mode 100644 js/src/ics/IC-9980784582763935427 create mode 100644 js/src/ics/IC-9988742469133872172 create mode 100644 js/src/ics/IC-999481620998529653 diff --git a/js/src/ics/IC-10012932722129304576 b/js/src/ics/IC-10012932722129304576 new file mode 100644 index 0000000000000..7209b102d4750 --- /dev/null +++ b/js/src/ics/IC-10012932722129304576 @@ -0,0 +1 @@ +GetName, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(3) LASTUSED(5) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(1) OP(LoadFixedSlot) ID(2) ID(1) OFFSET(2) OP(GuardIsNotUninitializedLexical) ID(2) OP(LoadOperandResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10017063470928229984 b/js/src/ics/IC-10017063470928229984 new file mode 100644 index 0000000000000..92b1b8b71a95a --- /dev/null +++ b/js/src/ics/IC-10017063470928229984 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToString) ID(2) OP(GuardToString) ID(3) OP(CompareStringResult) JSOP(StrictEq) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10024653209997799430 b/js/src/ics/IC-10024653209997799430 new file mode 100644 index 0000000000000..36c6e8448a8f5 --- /dev/null +++ b/js/src/ics/IC-10024653209997799430 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Float16) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10027192055534650466 b/js/src/ics/IC-10027192055534650466 new file mode 100644 index 0000000000000..e63f0d1283547 --- /dev/null +++ b/js/src/ics/IC-10027192055534650466 @@ -0,0 +1 @@ +SetElem, 3, 6, 9, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(7) LASTUSED(6) LASTUSED(3) LASTUSED(4) LASTUSED(7) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToString) ID(2) OP(GuardStringToNumber) ID(2) ID(3) OP(TruncateDoubleToUInt32) ID(3) ID(4) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(5) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int32) ID(5) ID(4) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10047658442846226757 b/js/src/ics/IC-10047658442846226757 new file mode 100644 index 0000000000000..8a75cf3ed0553 --- /dev/null +++ b/js/src/ics/IC-10047658442846226757 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(ASinH) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10071222831863122338 b/js/src/ics/IC-10071222831863122338 new file mode 100644 index 0000000000000..ac94fb43045a8 --- /dev/null +++ b/js/src/ics/IC-10071222831863122338 @@ -0,0 +1 @@ +GetElem, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadDenseElementResult) ID(0) ID(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10085408470993969915 b/js/src/ics/IC-10085408470993969915 new file mode 100644 index 0000000000000..e941949b589d6 --- /dev/null +++ b/js/src/ics/IC-10085408470993969915 @@ -0,0 +1 @@ +GetProp, 1, 5, 15, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(Id) , LASTUSED(13) LASTUSED(13) LASTUSED(13) LASTUSED(9) LASTUSED(13) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadScriptedProxyHandler) ID(1) ID(0) OP(LoadWrapperTarget) ID(0) ID(2) BOOL(1) OP(GuardIsNativeObject) ID(2) OP(GuardShape) ID(1) OFFSET(1) OP(LoadObject) ID(3) OFFSET(2) OP(GuardShape) ID(3) OFFSET(3) OP(LoadFixedSlot) ID(4) ID(3) OFFSET(4) OP(GuardToObject) ID(4) OP(GuardClass) ID(4) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(4) OFFSET(5) OFFSET(6) OP(CallScriptedProxyGetResult) ID(2) ID(0) ID(1) ID(4) OFFSET(7) UINT32(135968) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10112295838932053588 b/js/src/ics/IC-10112295838932053588 new file mode 100644 index 0000000000000..5b464b8663288 --- /dev/null +++ b/js/src/ics/IC-10112295838932053588 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(3) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(GuardIsNotProxy) ID(1) OP(IsCrossRealmArrayConstructorResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10120036528695626238 b/js/src/ics/IC-10120036528695626238 new file mode 100644 index 0000000000000..3836eb4e2a6a5 --- /dev/null +++ b/js/src/ics/IC-10120036528695626238 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(0) LASTUSED(3) LASTUSED(4) LASTUSED(4) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardToBoolean) ID(1) OP(BooleanToNumber) ID(1) ID(3) OP(CompareDoubleResult) JSOP(Gt) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10133658182771939722 b/js/src/ics/IC-10133658182771939722 new file mode 100644 index 0000000000000..4595b74fd9cbd --- /dev/null +++ b/js/src/ics/IC-10133658182771939722 @@ -0,0 +1 @@ +GetElem, 2, 5, 11, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(9) LASTUSED(9) LASTUSED(7) LASTUSED(5) LASTUSED(8) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadScriptedProxyHandler) ID(2) ID(0) OP(LoadWrapperTarget) ID(0) ID(3) BOOL(1) OP(GuardIsNativeObject) ID(3) OP(GuardShape) ID(2) OFFSET(1) OP(LoadProtoObject) ID(4) OFFSET(2) ID(2) OP(GuardShape) ID(4) OFFSET(3) OP(MegamorphicLoadSlotByValueResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10146627587987531577 b/js/src/ics/IC-10146627587987531577 new file mode 100644 index 0000000000000..7a9129bfffa73 --- /dev/null +++ b/js/src/ics/IC-10146627587987531577 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNumber) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float16) ID(3) ID(2) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10174150775558148628 b/js/src/ics/IC-10174150775558148628 new file mode 100644 index 0000000000000..85e43b9036bed --- /dev/null +++ b/js/src/ics/IC-10174150775558148628 @@ -0,0 +1 @@ +GetElem, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(String) , LASTUSED(3) LASTUSED(2) , OP(GuardToString) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(LoadStringLengthResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10183979387394653126 b/js/src/ics/IC-10183979387394653126 new file mode 100644 index 0000000000000..e1710ee7e8424 --- /dev/null +++ b/js/src/ics/IC-10183979387394653126 @@ -0,0 +1 @@ +In, 2, 4, 10, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(6) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(1) OP(GuardToSymbol) ID(0) OP(GuardSpecificSymbol) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(1) OP(GuardShape) ID(2) OFFSET(3) OP(LoadProtoObject) ID(3) OFFSET(4) ID(1) OP(GuardShape) ID(3) OFFSET(5) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10190184921897590573 b/js/src/ics/IC-10190184921897590573 new file mode 100644 index 0000000000000..45dc9fcdc0318 --- /dev/null +++ b/js/src/ics/IC-10190184921897590573 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToString) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToString) ID(3) OP(StringEndsWithResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10206623616188944477 b/js/src/ics/IC-10206623616188944477 new file mode 100644 index 0000000000000..b22a4e7630185 --- /dev/null +++ b/js/src/ics/IC-10206623616188944477 @@ -0,0 +1 @@ +Call, 1, 5, 11, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(8) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(CallInt32ToString) ID(3) ID(4) OP(NewStringObjectResult) OFFSET(4) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1021055887912932210 b/js/src/ics/IC-1021055887912932210 new file mode 100644 index 0000000000000..b08e3dc4e7118 --- /dev/null +++ b/js/src/ics/IC-1021055887912932210 @@ -0,0 +1 @@ +SetElem, 3, 6, 9, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(7) LASTUSED(6) LASTUSED(3) LASTUSED(4) LASTUSED(7) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToString) ID(2) OP(GuardStringToNumber) ID(2) ID(3) OP(TruncateDoubleToUInt32) ID(3) ID(4) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(5) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint8) ID(5) ID(4) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10229792663333787841 b/js/src/ics/IC-10229792663333787841 new file mode 100644 index 0000000000000..d5c040fefcd17 --- /dev/null +++ b/js/src/ics/IC-10229792663333787841 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(3) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(GuardIsNonResizableTypedArray) ID(1) OP(LoadArrayBufferViewLengthInt32Result) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10285160584534782478 b/js/src/ics/IC-10285160584534782478 new file mode 100644 index 0000000000000..87abbdb83c5d0 --- /dev/null +++ b/js/src/ics/IC-10285160584534782478 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(NewMapObjectResult) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10287899934032377038 b/js/src/ics/IC-10287899934032377038 new file mode 100644 index 0000000000000..423c9ece61831 --- /dev/null +++ b/js/src/ics/IC-10287899934032377038 @@ -0,0 +1 @@ +Call, 1, 7, 15, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardIsNumber) ID(5) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(GuardToBoolean) ID(6) OP(StoreDataViewValueResult) ID(2) ID(4) ID(5) ID(6) SCALARTYPE(Float64) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10296630081760163552 b/js/src/ics/IC-10296630081760163552 new file mode 100644 index 0000000000000..b0309ca27febf --- /dev/null +++ b/js/src/ics/IC-10296630081760163552 @@ -0,0 +1 @@ +Call, 1, 9, 17, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(15) LASTUSED(8) LASTUSED(15) LASTUSED(11) LASTUSED(15) LASTUSED(14) LASTUSED(15) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardHasAttachedArrayBuffer) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32ModUint32) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToInt32) ID(5) OP(Int32ToIntPtr) ID(5) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToInt32) ID(7) OP(Int32ToIntPtr) ID(7) ID(8) OP(TypedArrayFillResult) ID(2) ID(4) ID(6) ID(8) SCALARTYPE(Int32) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10323304896754139606 b/js/src/ics/IC-10323304896754139606 new file mode 100644 index 0000000000000..bc08221d014cc --- /dev/null +++ b/js/src/ics/IC-10323304896754139606 @@ -0,0 +1 @@ +GetElem, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadDynamicSlotResult) ID(0) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10337334507454623397 b/js/src/ics/IC-10337334507454623397 new file mode 100644 index 0000000000000..8d33378f46599 --- /dev/null +++ b/js/src/ics/IC-10337334507454623397 @@ -0,0 +1 @@ +GetElemSuper, 3, 4, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(2) LASTUSED(0) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardStringToIndex) ID(1) ID(3) OP(GuardShape) ID(0) OFFSET(0) OP(LoadDenseElementResult) ID(0) ID(3) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10354653151230292671 b/js/src/ics/IC-10354653151230292671 new file mode 100644 index 0000000000000..1eb7214ee41dd --- /dev/null +++ b/js/src/ics/IC-10354653151230292671 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(3) , OP(GuardToString) ID(0) OP(GuardStringToNumber) ID(0) ID(2) OP(GuardIsNumber) ID(1) OP(CompareDoubleResult) JSOP(Eq) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10387960712561871230 b/js/src/ics/IC-10387960712561871230 new file mode 100644 index 0000000000000..7253b6eb260ff --- /dev/null +++ b/js/src/ics/IC-10387960712561871230 @@ -0,0 +1 @@ +GetProp, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(0) LASTUSED(4) , OP(GuardNonDoubleType) ID(0) VALUETYPE(JSVAL_TYPE_STRING) OP(LoadObject) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(0) OP(CheckWeakValueResultForDynamicSlot) ID(1) OFFSET(7) OFFSET(8) OP(UncheckedLoadWeakObjectResult) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10390855945778908237 b/js/src/ics/IC-10390855945778908237 new file mode 100644 index 0000000000000..f12bbd6f059b2 --- /dev/null +++ b/js/src/ics/IC-10390855945778908237 @@ -0,0 +1 @@ +SetElem, 3, 4, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardStringToIndex) ID(1) ID(3) OP(GuardShape) ID(0) OFFSET(0) OP(StoreDenseElementHole) ID(0) ID(3) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10398018477319480099 b/js/src/ics/IC-10398018477319480099 new file mode 100644 index 0000000000000..a8d6d9e92340e --- /dev/null +++ b/js/src/ics/IC-10398018477319480099 @@ -0,0 +1 @@ +Call, 1, 3, 9, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(2) LASTUSED(7) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10419927781334253497 b/js/src/ics/IC-10419927781334253497 new file mode 100644 index 0000000000000..34e92ad7987c8 --- /dev/null +++ b/js/src/ics/IC-10419927781334253497 @@ -0,0 +1 @@ +Call, 1, 5, 14, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(12) LASTUSED(12) LASTUSED(12) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardHasAttachedArrayBuffer) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardShape) ID(3) OFFSET(3) OP(GuardHasAttachedArrayBuffer) ID(3) OP(LoadInt32AsIntPtrConstant) OFFSET(4) ID(4) OP(TypedArraySetResult) ID(2) ID(3) ID(4) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10467058652674703426 b/js/src/ics/IC-10467058652674703426 new file mode 100644 index 0000000000000..8639315749e2c --- /dev/null +++ b/js/src/ics/IC-10467058652674703426 @@ -0,0 +1 @@ +Call, 1, 7, 13, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(10) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(AtomicsAddResult) ID(2) ID(4) ID(6) SCALARTYPE(Int8) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10493323457472461123 b/js/src/ics/IC-10493323457472461123 new file mode 100644 index 0000000000000..78ca743538ee7 --- /dev/null +++ b/js/src/ics/IC-10493323457472461123 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasJitEntry) ID(1) OP(GuardFunctionIsConstructor) ID(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(34) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10504739238754050285 b/js/src/ics/IC-10504739238754050285 new file mode 100644 index 0000000000000..a380953c8ad9e --- /dev/null +++ b/js/src/ics/IC-10504739238754050285 @@ -0,0 +1 @@ +Compare, 2, 4, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardBooleanToInt32) ID(1) ID(3) OP(CompareInt32Result) JSOP(Eq) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10508634394369394069 b/js/src/ics/IC-10508634394369394069 new file mode 100644 index 0000000000000..a08632355dab7 --- /dev/null +++ b/js/src/ics/IC-10508634394369394069 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasJitEntry) ID(1) OP(GuardNotClassConstructor) ID(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10517045791805761861 b/js/src/ics/IC-10517045791805761861 new file mode 100644 index 0000000000000..1c71de507a919 --- /dev/null +++ b/js/src/ics/IC-10517045791805761861 @@ -0,0 +1 @@ +GetProp, 1, 1, 5, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardDynamicSlotValue) ID(0) OFFSET(1) OFFSET(2) OP(CallNativeGetterResult) ID(0) OFFSET(3) BOOL(1) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10539062004584484050 b/js/src/ics/IC-10539062004584484050 new file mode 100644 index 0000000000000..a3e66bc7b0b71 --- /dev/null +++ b/js/src/ics/IC-10539062004584484050 @@ -0,0 +1 @@ +GetPropSuper, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(0) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadInt32ArrayLengthResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10552508641524210829 b/js/src/ics/IC-10552508641524210829 new file mode 100644 index 0000000000000..c9f8db3c731d1 --- /dev/null +++ b/js/src/ics/IC-10552508641524210829 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToString) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToString) ID(3) OP(StringLastIndexOfResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10557077917219503953 b/js/src/ics/IC-10557077917219503953 new file mode 100644 index 0000000000000..f1d0d0645784c --- /dev/null +++ b/js/src/ics/IC-10557077917219503953 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToBoolean) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(BigUint64) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10557234435714705037 b/js/src/ics/IC-10557234435714705037 new file mode 100644 index 0000000000000..ca79b705d2749 --- /dev/null +++ b/js/src/ics/IC-10557234435714705037 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(SetSizeResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1057791614928279724 b/js/src/ics/IC-1057791614928279724 new file mode 100644 index 0000000000000..ed06b14209efe --- /dev/null +++ b/js/src/ics/IC-1057791614928279724 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(2) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(2) OP(CompareDoubleResult) JSOP(Ge) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10594532515162574745 b/js/src/ics/IC-10594532515162574745 new file mode 100644 index 0000000000000..a64255f01ce45 --- /dev/null +++ b/js/src/ics/IC-10594532515162574745 @@ -0,0 +1 @@ +SetElem, 3, 6, 12, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(10) LASTUSED(2) LASTUSED(10) LASTUSED(5) LASTUSED(7) LASTUSED(9) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(0) OP(GuardShape) ID(3) OFFSET(3) OP(LoadProtoObject) ID(4) OFFSET(4) ID(0) OP(GuardShape) ID(4) OFFSET(5) OP(LoadProtoObject) ID(5) OFFSET(6) ID(0) OP(GuardShape) ID(5) OFFSET(7) OP(AddAndStoreDynamicSlot) ID(0) OFFSET(8) ID(2) OFFSET(9) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1059520217747093635 b/js/src/ics/IC-1059520217747093635 new file mode 100644 index 0000000000000..a3076fc442c28 --- /dev/null +++ b/js/src/ics/IC-1059520217747093635 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(ObjectToStringResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10624605180333492108 b/js/src/ics/IC-10624605180333492108 new file mode 100644 index 0000000000000..ee8d6f56a89a0 --- /dev/null +++ b/js/src/ics/IC-10624605180333492108 @@ -0,0 +1 @@ +Call, 1, 8, 15, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(10) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Uint8) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10631882817250290341 b/js/src/ics/IC-10631882817250290341 new file mode 100644 index 0000000000000..d3d679f98b896 --- /dev/null +++ b/js/src/ics/IC-10631882817250290341 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(ACos) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10632368867850150164 b/js/src/ics/IC-10632368867850150164 new file mode 100644 index 0000000000000..89c7d898f5495 --- /dev/null +++ b/js/src/ics/IC-10632368867850150164 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(GuardIsUndefined) ID(1) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(CompareDoubleResult) JSOP(Gt) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1065699860197787893 b/js/src/ics/IC-1065699860197787893 new file mode 100644 index 0000000000000..370fe45803892 --- /dev/null +++ b/js/src/ics/IC-1065699860197787893 @@ -0,0 +1 @@ +Call, 1, 7, 15, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardIsNumber) ID(5) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(GuardToBoolean) ID(6) OP(StoreDataViewValueResult) ID(2) ID(4) ID(5) ID(6) SCALARTYPE(Float16) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10666528917422509453 b/js/src/ics/IC-10666528917422509453 new file mode 100644 index 0000000000000..6c6754d8cf6c7 --- /dev/null +++ b/js/src/ics/IC-10666528917422509453 @@ -0,0 +1 @@ +GetElemSuper, 3, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(3) LASTUSED(0) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadDenseElementResult) ID(0) ID(1) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10705031122100274016 b/js/src/ics/IC-10705031122100274016 new file mode 100644 index 0000000000000..91141a36ba488 --- /dev/null +++ b/js/src/ics/IC-10705031122100274016 @@ -0,0 +1 @@ +GetName, 1, 4, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(2) LASTUSED(3) LASTUSED(5) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(LoadFixedSlot) ID(3) ID(2) OFFSET(1) OP(GuardIsNotUninitializedLexical) ID(3) OP(LoadOperandResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10705525611129912618 b/js/src/ics/IC-10705525611129912618 new file mode 100644 index 0000000000000..7de6020b1b349 --- /dev/null +++ b/js/src/ics/IC-10705525611129912618 @@ -0,0 +1 @@ +CloseIter, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(5) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadFixedSlot) ID(1) ID(0) OFFSET(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(2) OFFSET(3) OP(CloseIterScriptedResult) ID(0) ID(1) COMPLETIONKIND(Normal) UINT32(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10713018433347600908 b/js/src/ics/IC-10713018433347600908 new file mode 100644 index 0000000000000..7d61b99bc1642 --- /dev/null +++ b/js/src/ics/IC-10713018433347600908 @@ -0,0 +1 @@ +Call, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(4) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToString) ID(2) OP(RegExpHasCaptureGroupsResult) ID(1) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10714232282968382548 b/js/src/ics/IC-10714232282968382548 new file mode 100644 index 0000000000000..f3919f72c574e --- /dev/null +++ b/js/src/ics/IC-10714232282968382548 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint8) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10722218364273034881 b/js/src/ics/IC-10722218364273034881 new file mode 100644 index 0000000000000..7ba2e6e2b1044 --- /dev/null +++ b/js/src/ics/IC-10722218364273034881 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Float32) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10728486856959292234 b/js/src/ics/IC-10728486856959292234 new file mode 100644 index 0000000000000..c3d8ecc0e46f3 --- /dev/null +++ b/js/src/ics/IC-10728486856959292234 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint16) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10739734239018832127 b/js/src/ics/IC-10739734239018832127 new file mode 100644 index 0000000000000..4950b638f3d53 --- /dev/null +++ b/js/src/ics/IC-10739734239018832127 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32BitOrResult) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10783119225808419178 b/js/src/ics/IC-10783119225808419178 new file mode 100644 index 0000000000000..d863a4d6fa0dc --- /dev/null +++ b/js/src/ics/IC-10783119225808419178 @@ -0,0 +1 @@ +Call, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(LoadFixedSlotResult) ID(1) OFFSET(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10785410580519018791 b/js/src/ics/IC-10785410580519018791 new file mode 100644 index 0000000000000..82e166dc362d8 --- /dev/null +++ b/js/src/ics/IC-10785410580519018791 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(2) OP(GuardToInt32) ID(3) OP(MathImulResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10785774754033130732 b/js/src/ics/IC-10785774754033130732 new file mode 100644 index 0000000000000..844dde3d29870 --- /dev/null +++ b/js/src/ics/IC-10785774754033130732 @@ -0,0 +1 @@ +Call, 1, 8, 15, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(10) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardIsNullOrUndefined) ID(5) OP(LoadInt32Constant) OFFSET(2) ID(6) OP(LoadBooleanConstant) BOOL(0) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Int8) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10799558662845372007 b/js/src/ics/IC-10799558662845372007 new file mode 100644 index 0000000000000..a9f7d7919676c --- /dev/null +++ b/js/src/ics/IC-10799558662845372007 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(GuardIsNullOrUndefined) ID(0) OP(GuardIsNullOrUndefined) ID(1) OP(LoadBooleanResult) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-108091804264432729 b/js/src/ics/IC-108091804264432729 new file mode 100644 index 0000000000000..48e6fc6549d5c --- /dev/null +++ b/js/src/ics/IC-108091804264432729 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToInt32) ID(2) OP(GuardInt32IsNonNegative) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToBigInt) ID(3) OP(BigIntAsUintNResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10835907626368138623 b/js/src/ics/IC-10835907626368138623 new file mode 100644 index 0000000000000..00db20d575f0d --- /dev/null +++ b/js/src/ics/IC-10835907626368138623 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardBooleanToInt32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int32) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10844197858476861698 b/js/src/ics/IC-10844197858476861698 new file mode 100644 index 0000000000000..a69a6b65109d0 --- /dev/null +++ b/js/src/ics/IC-10844197858476861698 @@ -0,0 +1 @@ +Call, 1, 7, 17, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(6) LASTUSED(4) LASTUSED(7) LASTUSED(9) LASTUSED(15) LASTUSED(15) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(LoadFixedSlot) ID(4) ID(1) OFFSET(0) OP(GuardSpecificFunction) ID(3) OFFSET(1) OFFSET(2) OP(GuardToObject) ID(4) OP(GuardSpecificFunction) ID(4) OFFSET(3) OFFSET(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToObject) ID(5) OP(GuardShape) ID(5) OFFSET(5) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(GuardToSymbol) ID(6) OP(MapGetSymbolResult) ID(5) ID(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10845060487352600691 b/js/src/ics/IC-10845060487352600691 new file mode 100644 index 0000000000000..b9ae9dfbea0a6 --- /dev/null +++ b/js/src/ics/IC-10845060487352600691 @@ -0,0 +1 @@ +GetElem, 2, 2, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Symbol) STUBFIELD(Id) , LASTUSED(5) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardIsNotDOMProxy) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(ProxyGetResult) ID(0) OFFSET(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10864341715849999487 b/js/src/ics/IC-10864341715849999487 new file mode 100644 index 0000000000000..40fbf9e52fb94 --- /dev/null +++ b/js/src/ics/IC-10864341715849999487 @@ -0,0 +1 @@ +SetProp, 2, 5, 10, JSVAL_TYPE_UNKNOWN, 72, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(8) LASTUSED(8) LASTUSED(3) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(2) OFFSET(1) ID(0) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(0) OP(GuardShape) ID(3) OFFSET(4) OP(LoadProtoObject) ID(4) OFFSET(5) ID(0) OP(GuardShape) ID(4) OFFSET(6) OP(AddAndStoreFixedSlot) ID(0) OFFSET(7) ID(1) OFFSET(8) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10889474852253441039 b/js/src/ics/IC-10889474852253441039 new file mode 100644 index 0000000000000..3f9bf906a5fcf --- /dev/null +++ b/js/src/ics/IC-10889474852253441039 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(2) LASTUSED(3) , OP(GuardToInt32) ID(0) OP(GuardIsNumber) ID(1) OP(TruncateDoubleToUInt32) ID(1) ID(2) OP(Int32BitAndResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10891149831505669090 b/js/src/ics/IC-10891149831505669090 new file mode 100644 index 0000000000000..7dd300dafca1c --- /dev/null +++ b/js/src/ics/IC-10891149831505669090 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10892791689614926029 b/js/src/ics/IC-10892791689614926029 new file mode 100644 index 0000000000000..fa224bcdf6b6d --- /dev/null +++ b/js/src/ics/IC-10892791689614926029 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(LoadDoubleResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10918584040860798834 b/js/src/ics/IC-10918584040860798834 new file mode 100644 index 0000000000000..7a395f4682048 --- /dev/null +++ b/js/src/ics/IC-10918584040860798834 @@ -0,0 +1 @@ +HasOwn, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(1) OP(GuardToInt32) ID(0) OP(GuardShape) ID(1) OFFSET(0) OP(LoadDenseElementExistsResult) ID(1) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10923317551992982900 b/js/src/ics/IC-10923317551992982900 new file mode 100644 index 0000000000000..0bca09148a59b --- /dev/null +++ b/js/src/ics/IC-10923317551992982900 @@ -0,0 +1 @@ +SetProp, 2, 4, 7, JSVAL_TYPE_UNKNOWN, 72, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(5) LASTUSED(3) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardObjectFuseProperty) ID(2) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(LoadObject) ID(3) OFFSET(7) OP(CallScriptedSetter) ID(0) ID(3) ID(1) BOOL(1) OFFSET(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10926954779920259261 b/js/src/ics/IC-10926954779920259261 new file mode 100644 index 0000000000000..b7f88879cf3ed --- /dev/null +++ b/js/src/ics/IC-10926954779920259261 @@ -0,0 +1 @@ +GetProp, 1, 1, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardClass) ID(0) GUARDCLASSKIND(Array) OP(LoadInt32ArrayLengthResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10979775141347768108 b/js/src/ics/IC-10979775141347768108 new file mode 100644 index 0000000000000..81b3bc6d775d7 --- /dev/null +++ b/js/src/ics/IC-10979775141347768108 @@ -0,0 +1 @@ +GetProp, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(3) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(1) OFFSET(1) ID(0) OP(GuardShape) ID(1) OFFSET(2) OP(LoadProtoObject) ID(2) OFFSET(3) ID(0) OP(GuardShape) ID(2) OFFSET(4) OP(LoadProtoObject) ID(3) OFFSET(5) ID(0) OP(GuardShape) ID(3) OFFSET(6) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-10990951273432093646 b/js/src/ics/IC-10990951273432093646 new file mode 100644 index 0000000000000..34a7ceac7bfd0 --- /dev/null +++ b/js/src/ics/IC-10990951273432093646 @@ -0,0 +1 @@ +Call, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(LoadFixedSlotTypedResult) ID(1) OFFSET(0) VALUETYPE(JSVAL_TYPE_STRING) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11012461244502181753 b/js/src/ics/IC-11012461244502181753 new file mode 100644 index 0000000000000..a8da0fcda452d --- /dev/null +++ b/js/src/ics/IC-11012461244502181753 @@ -0,0 +1 @@ +Call, 1, 4, 13, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(11) LASTUSED(2) LASTUSED(11) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(Array) OP(GuardArrayIsPacked) ID(3) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(69) UINT32(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11017584780111727090 b/js/src/ics/IC-11017584780111727090 new file mode 100644 index 0000000000000..d4933927dc2e6 --- /dev/null +++ b/js/src/ics/IC-11017584780111727090 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardBooleanToInt32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint8) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11018256844882494789 b/js/src/ics/IC-11018256844882494789 new file mode 100644 index 0000000000000..b3600af862947 --- /dev/null +++ b/js/src/ics/IC-11018256844882494789 @@ -0,0 +1 @@ +HasOwn, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(1) OP(GuardToString) ID(0) OP(GuardStringToIndex) ID(0) ID(2) OP(GuardIsNativeObject) ID(1) OP(LoadDenseElementExistsResult) ID(1) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11038123939989769693 b/js/src/ics/IC-11038123939989769693 new file mode 100644 index 0000000000000..16987551938ba --- /dev/null +++ b/js/src/ics/IC-11038123939989769693 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(0) LASTUSED(3) LASTUSED(3) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardIsNumber) ID(1) OP(CompareDoubleResult) JSOP(Ge) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11042919346822061224 b/js/src/ics/IC-11042919346822061224 new file mode 100644 index 0000000000000..f734850a088d0 --- /dev/null +++ b/js/src/ics/IC-11042919346822061224 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Float16) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11049174715014180988 b/js/src/ics/IC-11049174715014180988 new file mode 100644 index 0000000000000..3d9a087acc909 --- /dev/null +++ b/js/src/ics/IC-11049174715014180988 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(2) OP(GuardToInt32) ID(3) OP(Int32PowResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11060220060333108715 b/js/src/ics/IC-11060220060333108715 new file mode 100644 index 0000000000000..79cca6bc40ff0 --- /dev/null +++ b/js/src/ics/IC-11060220060333108715 @@ -0,0 +1 @@ +BinaryArith, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(4) LASTUSED(4) , OP(GuardIsNumber) ID(0) OP(TruncateDoubleToUInt32) ID(0) ID(2) OP(GuardIsNumber) ID(1) OP(TruncateDoubleToUInt32) ID(1) ID(3) OP(Int32BitAndResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11082178700814934535 b/js/src/ics/IC-11082178700814934535 new file mode 100644 index 0000000000000..d51546db16d1d --- /dev/null +++ b/js/src/ics/IC-11082178700814934535 @@ -0,0 +1 @@ +In, 2, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(3) LASTUSED(5) , OP(GuardToObject) ID(1) OP(GuardToString) ID(0) OP(GuardSpecificAtom) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardShape) ID(2) OFFSET(3) OP(LoadBooleanResult) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11088247450335219404 b/js/src/ics/IC-11088247450335219404 new file mode 100644 index 0000000000000..0a82ee22cf3d3 --- /dev/null +++ b/js/src/ics/IC-11088247450335219404 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallNativeFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11099301388699508111 b/js/src/ics/IC-11099301388699508111 new file mode 100644 index 0000000000000..781e67e20f009 --- /dev/null +++ b/js/src/ics/IC-11099301388699508111 @@ -0,0 +1 @@ +Compare, 2, 4, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardBooleanToInt32) ID(1) ID(3) OP(CompareInt32Result) JSOP(Ge) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11108365595478169871 b/js/src/ics/IC-11108365595478169871 new file mode 100644 index 0000000000000..fa7f2378d726b --- /dev/null +++ b/js/src/ics/IC-11108365595478169871 @@ -0,0 +1 @@ +Call, 1, 5, 11, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(9) LASTUSED(8) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(AtomicsLoadResult) ID(2) ID(4) SCALARTYPE(Int32) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11108560576299426297 b/js/src/ics/IC-11108560576299426297 new file mode 100644 index 0000000000000..a2b808636cdd3 --- /dev/null +++ b/js/src/ics/IC-11108560576299426297 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToBigInt) ID(5) OP(AtomicsExchangeResult) ID(2) ID(4) ID(5) SCALARTYPE(BigInt64) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11125824584033702639 b/js/src/ics/IC-11125824584033702639 new file mode 100644 index 0000000000000..1e8faa89f44b0 --- /dev/null +++ b/js/src/ics/IC-11125824584033702639 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Float64) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11126707063016432122 b/js/src/ics/IC-11126707063016432122 new file mode 100644 index 0000000000000..31733f0e59b5d --- /dev/null +++ b/js/src/ics/IC-11126707063016432122 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint32) ID(4) ID(3) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11155126938465675967 b/js/src/ics/IC-11155126938465675967 new file mode 100644 index 0000000000000..37dcf3f6885b3 --- /dev/null +++ b/js/src/ics/IC-11155126938465675967 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToInt32) ID(2) OP(MathSignInt32Result) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11159457153374891709 b/js/src/ics/IC-11159457153374891709 new file mode 100644 index 0000000000000..99f0d146049ae --- /dev/null +++ b/js/src/ics/IC-11159457153374891709 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToObject) ID(3) OP(GuardIsNotArrayBufferMaybeShared) ID(3) OP(GuardIsNotProxy) ID(3) OP(NewTypedArrayFromArrayResult) OFFSET(4) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11178347053423973510 b/js/src/ics/IC-11178347053423973510 new file mode 100644 index 0000000000000..51d8a3edbe14a --- /dev/null +++ b/js/src/ics/IC-11178347053423973510 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Int16) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11211612145964873406 b/js/src/ics/IC-11211612145964873406 new file mode 100644 index 0000000000000..170cfab3c8fe5 --- /dev/null +++ b/js/src/ics/IC-11211612145964873406 @@ -0,0 +1 @@ +SetElem, 3, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(StoreDenseElement) ID(0) ID(1) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11243479038559379129 b/js/src/ics/IC-11243479038559379129 new file mode 100644 index 0000000000000..02c0a2fb1593a --- /dev/null +++ b/js/src/ics/IC-11243479038559379129 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(WeakMapGetObjectResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11250125306565772198 b/js/src/ics/IC-11250125306565772198 new file mode 100644 index 0000000000000..28f254e1af9e0 --- /dev/null +++ b/js/src/ics/IC-11250125306565772198 @@ -0,0 +1 @@ +GetElem, 2, 2, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(String) STUBFIELD(Id) , LASTUSED(5) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardIsNotDOMProxy) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(ProxyGetResult) ID(0) OFFSET(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11252846724706279705 b/js/src/ics/IC-11252846724706279705 new file mode 100644 index 0000000000000..1e78074a0f034 --- /dev/null +++ b/js/src/ics/IC-11252846724706279705 @@ -0,0 +1 @@ +SetElem, 3, 4, 8, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(6) LASTUSED(2) LASTUSED(6) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(0) OP(GuardShape) ID(3) OFFSET(3) OP(AddAndStoreFixedSlot) ID(0) OFFSET(4) ID(2) OFFSET(5) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11263448588881622669 b/js/src/ics/IC-11263448588881622669 new file mode 100644 index 0000000000000..da7abb675072d --- /dev/null +++ b/js/src/ics/IC-11263448588881622669 @@ -0,0 +1 @@ +GetElem, 2, 2, 8, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(String) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakValue) , LASTUSED(5) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(0) OFFSET(1) OP(GuardObjectFuseProperty) ID(0) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(0) OFFSET(7) OFFSET(8) OP(UncheckedLoadWeakValueResult) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11293654638617896162 b/js/src/ics/IC-11293654638617896162 new file mode 100644 index 0000000000000..a4a336ef22cec --- /dev/null +++ b/js/src/ics/IC-11293654638617896162 @@ -0,0 +1 @@ +GetProp, 1, 2, 8, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(7) OP(RegExpFlagResult) ID(0) INT32(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11297337085505550617 b/js/src/ics/IC-11297337085505550617 new file mode 100644 index 0000000000000..be318ab29971e --- /dev/null +++ b/js/src/ics/IC-11297337085505550617 @@ -0,0 +1 @@ +GetName, 1, 6, 10, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(2) LASTUSED(3) LASTUSED(5) LASTUSED(7) LASTUSED(8) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(LoadEnclosingEnvironment) ID(2) ID(3) OP(GuardShape) ID(3) OFFSET(1) OP(LoadEnclosingEnvironment) ID(3) ID(4) OP(GuardShape) ID(4) OFFSET(2) OP(LoadDynamicSlot) ID(5) ID(4) OFFSET(3) OP(LoadOperandResult) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1130563304257587708 b/js/src/ics/IC-1130563304257587708 new file mode 100644 index 0000000000000..41e9dd2551c36 --- /dev/null +++ b/js/src/ics/IC-1130563304257587708 @@ -0,0 +1 @@ +GetElem, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(String) , LASTUSED(4) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardClass) ID(0) GUARDCLASSKIND(Array) OP(LoadInt32ArrayLengthResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11320172572546773151 b/js/src/ics/IC-11320172572546773151 new file mode 100644 index 0000000000000..4a6fafd0fd179 --- /dev/null +++ b/js/src/ics/IC-11320172572546773151 @@ -0,0 +1 @@ +SetProp, 2, 4, 7, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(5) LASTUSED(3) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadFixedSlot) ID(2) ID(0) OFFSET(1) OP(LoadGetterSetterFunction) ID(2) BOOL(0) BOOL(0) ID(3) OP(GuardFunctionScript) ID(3) OFFSET(2) OFFSET(3) OP(CallScriptedSetter) ID(0) ID(3) ID(1) BOOL(1) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11321571101584858952 b/js/src/ics/IC-11321571101584858952 new file mode 100644 index 0000000000000..746f33df01a24 --- /dev/null +++ b/js/src/ics/IC-11321571101584858952 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(3) , OP(GuardIsNull) ID(0) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(GuardToInt32) ID(1) OP(CompareInt32Result) JSOP(Gt) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11326524844255251184 b/js/src/ics/IC-11326524844255251184 new file mode 100644 index 0000000000000..1f2fc4a924d90 --- /dev/null +++ b/js/src/ics/IC-11326524844255251184 @@ -0,0 +1 @@ +GetElem, 2, 4, 9, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(Symbol) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(6) , OP(GuardNonDoubleType) ID(0) VALUETYPE(JSVAL_TYPE_BOOLEAN) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(2) OP(GuardShape) ID(3) OFFSET(4) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11329216527069876807 b/js/src/ics/IC-11329216527069876807 new file mode 100644 index 0000000000000..95da404a2b228 --- /dev/null +++ b/js/src/ics/IC-11329216527069876807 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathSignNumberResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11342028399540104729 b/js/src/ics/IC-11342028399540104729 new file mode 100644 index 0000000000000..bfc4f972db0c8 --- /dev/null +++ b/js/src/ics/IC-11342028399540104729 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardHasAttachedArrayBuffer) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardIsNumber) ID(3) OP(LoadInt32AsIntPtrConstant) OFFSET(3) ID(4) OP(LoadArrayBufferViewLength) ID(2) ID(5) OP(TypedArrayFillResult) ID(2) ID(3) ID(4) ID(5) SCALARTYPE(Float64) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11342449414654468824 b/js/src/ics/IC-11342449414654468824 new file mode 100644 index 0000000000000..676f9149eaa4a --- /dev/null +++ b/js/src/ics/IC-11342449414654468824 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(ReflectGetPrototypeOfResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11366109308614220038 b/js/src/ics/IC-11366109308614220038 new file mode 100644 index 0000000000000..1bda81345a63e --- /dev/null +++ b/js/src/ics/IC-11366109308614220038 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNumber) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float16) ID(3) ID(2) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11376266815919996863 b/js/src/ics/IC-11376266815919996863 new file mode 100644 index 0000000000000..cdd5a37635115 --- /dev/null +++ b/js/src/ics/IC-11376266815919996863 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(RawPointer) STUBFIELD(RawPointer) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardAnyClass) ID(1) OFFSET(0) OP(CallClassHook) ID(1) ID(0) CALLFLAGS(1) UINT32(1) OFFSET(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11417613263274110541 b/js/src/ics/IC-11417613263274110541 new file mode 100644 index 0000000000000..fa7c69f9b8aff --- /dev/null +++ b/js/src/ics/IC-11417613263274110541 @@ -0,0 +1 @@ +Call, 1, 3, 9, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(2) LASTUSED(7) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11454413586868258316 b/js/src/ics/IC-11454413586868258316 new file mode 100644 index 0000000000000..fbbd9027dbde9 --- /dev/null +++ b/js/src/ics/IC-11454413586868258316 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNumber) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float64) ID(3) ID(2) BOOL(1) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11458870435822720219 b/js/src/ics/IC-11458870435822720219 new file mode 100644 index 0000000000000..f3511df2902b1 --- /dev/null +++ b/js/src/ics/IC-11458870435822720219 @@ -0,0 +1 @@ +Call, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToString) ID(1) OP(GetFirstDollarIndexResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11474570303586391308 b/js/src/ics/IC-11474570303586391308 new file mode 100644 index 0000000000000..600dab935229e --- /dev/null +++ b/js/src/ics/IC-11474570303586391308 @@ -0,0 +1 @@ +GetElemSuper, 3, 3, 9, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(String) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(2) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(0) OFFSET(1) OP(GuardObjectFuseProperty) ID(0) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(7) OP(SetSizeResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11480314688100767565 b/js/src/ics/IC-11480314688100767565 new file mode 100644 index 0000000000000..033f9245bcf42 --- /dev/null +++ b/js/src/ics/IC-11480314688100767565 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Int16) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11480950816980033955 b/js/src/ics/IC-11480950816980033955 new file mode 100644 index 0000000000000..e98cf7c84735d --- /dev/null +++ b/js/src/ics/IC-11480950816980033955 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardShape) ID(3) OFFSET(4) OP(GuardArrayIsPacked) ID(3) OP(NumberMinMaxArrayResult) ID(3) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1149008753018867496 b/js/src/ics/IC-1149008753018867496 new file mode 100644 index 0000000000000..38d5ec92036b7 --- /dev/null +++ b/js/src/ics/IC-1149008753018867496 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNumber) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float64) ID(3) ID(2) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11497767217347158124 b/js/src/ics/IC-11497767217347158124 new file mode 100644 index 0000000000000..38e93ef8ef16c --- /dev/null +++ b/js/src/ics/IC-11497767217347158124 @@ -0,0 +1 @@ +GetElemSuper, 3, 3, 6, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) LASTUSED(0) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadDynamicSlotResult) ID(0) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11508998258759747115 b/js/src/ics/IC-11508998258759747115 new file mode 100644 index 0000000000000..4865ce11da276 --- /dev/null +++ b/js/src/ics/IC-11508998258759747115 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFloorNumberResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11532719234975304443 b/js/src/ics/IC-11532719234975304443 new file mode 100644 index 0000000000000..56b8efc869853 --- /dev/null +++ b/js/src/ics/IC-11532719234975304443 @@ -0,0 +1 @@ +ToPropertyKey, 1, 1, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) , OP(GuardToSymbol) ID(0) OP(LoadSymbolResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1154511991230356778 b/js/src/ics/IC-1154511991230356778 new file mode 100644 index 0000000000000..98cc23fd3297b --- /dev/null +++ b/js/src/ics/IC-1154511991230356778 @@ -0,0 +1 @@ +CloseIter, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(5) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadFixedSlot) ID(1) ID(0) OFFSET(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(2) OFFSET(3) OP(CloseIterScriptedResult) ID(0) ID(1) COMPLETIONKIND(Throw) UINT32(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11549215406510528747 b/js/src/ics/IC-11549215406510528747 new file mode 100644 index 0000000000000..e3d21570520b8 --- /dev/null +++ b/js/src/ics/IC-11549215406510528747 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFloorToInt32Result) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11574571414559288473 b/js/src/ics/IC-11574571414559288473 new file mode 100644 index 0000000000000..eec7506fd337d --- /dev/null +++ b/js/src/ics/IC-11574571414559288473 @@ -0,0 +1 @@ +HasOwn, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(1) OP(GuardToInt32) ID(0) OP(GuardIsNativeObject) ID(1) OP(LoadDenseElementExistsResult) ID(1) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11575965914216701705 b/js/src/ics/IC-11575965914216701705 new file mode 100644 index 0000000000000..a1dee46efe458 --- /dev/null +++ b/js/src/ics/IC-11575965914216701705 @@ -0,0 +1 @@ +GetProp, 1, 1, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardClass) ID(0) GUARDCLASSKIND(MappedArguments) OP(GuardArgumentsObjectFlags) ID(0) BYTE(8) OP(LoadFixedSlotResult) ID(0) OFFSET(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11584630481534884288 b/js/src/ics/IC-11584630481534884288 new file mode 100644 index 0000000000000..8c1b77dd60ef3 --- /dev/null +++ b/js/src/ics/IC-11584630481534884288 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Double) STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardIsNull) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardIsUndefined) ID(1) OP(LoadDoubleConstant) OFFSET(1) ID(3) OP(CompareDoubleResult) JSOP(Gt) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-115956099603421614 b/js/src/ics/IC-115956099603421614 new file mode 100644 index 0000000000000..778b3b7a802d1 --- /dev/null +++ b/js/src/ics/IC-115956099603421614 @@ -0,0 +1 @@ +GetPropSuper, 2, 2, 7, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(2) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardSpecificObject) ID(0) OFFSET(0) OP(GuardObjectFuseProperty) ID(0) OFFSET(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) BOOL(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(Set) OP(SetSizeResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11600883776069615550 b/js/src/ics/IC-11600883776069615550 new file mode 100644 index 0000000000000..9ad2b671f3f45 --- /dev/null +++ b/js/src/ics/IC-11600883776069615550 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Double) STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardIsUndefined) ID(1) OP(LoadDoubleConstant) OFFSET(1) ID(3) OP(CompareDoubleResult) JSOP(Le) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1160638201342710981 b/js/src/ics/IC-1160638201342710981 new file mode 100644 index 0000000000000..526babf810cef --- /dev/null +++ b/js/src/ics/IC-1160638201342710981 @@ -0,0 +1 @@ +GetElem, 2, 4, 11, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(9) LASTUSED(9) LASTUSED(5) LASTUSED(8) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(GuardNoDenseElements) ID(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardShape) ID(3) OFFSET(4) OP(GuardNoDenseElements) ID(3) OP(LoadDenseElementHoleResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1163104847051405417 b/js/src/ics/IC-1163104847051405417 new file mode 100644 index 0000000000000..723ddf9e6cfc4 --- /dev/null +++ b/js/src/ics/IC-1163104847051405417 @@ -0,0 +1 @@ +GetElem, 2, 3, 9, JSVAL_TYPE_UNKNOWN, 88, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(3) LASTUSED(2) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardObjectFuseProperty) ID(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(0) OP(CheckWeakValueResultForDynamicSlot) ID(2) OFFSET(8) OFFSET(9) OP(UncheckedLoadWeakObjectResult) OFFSET(10) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11654432696377733861 b/js/src/ics/IC-11654432696377733861 new file mode 100644 index 0000000000000..9de2454d47c5d --- /dev/null +++ b/js/src/ics/IC-11654432696377733861 @@ -0,0 +1 @@ +ToPropertyKey, 1, 1, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) , OP(GuardToInt32) ID(0) OP(LoadInt32Result) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11672428136127135434 b/js/src/ics/IC-11672428136127135434 new file mode 100644 index 0000000000000..c5dc1d747d3e9 --- /dev/null +++ b/js/src/ics/IC-11672428136127135434 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint32) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11717237524687619883 b/js/src/ics/IC-11717237524687619883 new file mode 100644 index 0000000000000..e7bfd3d28db39 --- /dev/null +++ b/js/src/ics/IC-11717237524687619883 @@ -0,0 +1 @@ +Call, 1, 7, 13, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) LASTUSED(10) LASTUSED(10) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToInt32) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32MinMax) BOOL(1) ID(2) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToInt32) ID(5) OP(Int32MinMax) BOOL(1) ID(4) ID(5) ID(6) OP(LoadInt32Result) ID(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11720463879807711297 b/js/src/ics/IC-11720463879807711297 new file mode 100644 index 0000000000000..35c32d852860b --- /dev/null +++ b/js/src/ics/IC-11720463879807711297 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasJitEntry) ID(1) OP(GuardFunctionIsConstructor) ID(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(33) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11728749527861571239 b/js/src/ics/IC-11728749527861571239 new file mode 100644 index 0000000000000..a660e1f3a8784 --- /dev/null +++ b/js/src/ics/IC-11728749527861571239 @@ -0,0 +1 @@ +Call, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(NumberMinMaxArrayResult) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11739825854642521065 b/js/src/ics/IC-11739825854642521065 new file mode 100644 index 0000000000000..dc16c7f4e2e6e --- /dev/null +++ b/js/src/ics/IC-11739825854642521065 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(TruncateDoubleToUInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32BitOrResult) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11751293708003933641 b/js/src/ics/IC-11751293708003933641 new file mode 100644 index 0000000000000..634740d6732fa --- /dev/null +++ b/js/src/ics/IC-11751293708003933641 @@ -0,0 +1 @@ +SetElem, 3, 3, 6, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(AllocateAndStoreDynamicSlot) ID(0) OFFSET(2) ID(2) OFFSET(3) OFFSET(4) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11753442557781561422 b/js/src/ics/IC-11753442557781561422 new file mode 100644 index 0000000000000..5499f901af5a9 --- /dev/null +++ b/js/src/ics/IC-11753442557781561422 @@ -0,0 +1 @@ +Call, 1, 7, 13, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) LASTUSED(10) LASTUSED(10) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToInt32) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32MinMax) BOOL(0) ID(2) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToInt32) ID(5) OP(Int32MinMax) BOOL(0) ID(4) ID(5) ID(6) OP(LoadInt32Result) ID(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11797152210899251011 b/js/src/ics/IC-11797152210899251011 new file mode 100644 index 0000000000000..6ed343f794f59 --- /dev/null +++ b/js/src/ics/IC-11797152210899251011 @@ -0,0 +1 @@ +GetName, 1, 5, 10, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(3) LASTUSED(5) LASTUSED(7) LASTUSED(8) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(1) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadEnclosingEnvironment) ID(2) ID(3) OP(GuardShape) ID(3) OFFSET(3) OP(LoadDynamicSlot) ID(4) ID(3) OFFSET(4) OP(LoadOperandResult) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11837681195604493712 b/js/src/ics/IC-11837681195604493712 new file mode 100644 index 0000000000000..e54a06abf7b2b --- /dev/null +++ b/js/src/ics/IC-11837681195604493712 @@ -0,0 +1 @@ +GetElem, 2, 4, 14, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(12) LASTUSED(12) LASTUSED(8) LASTUSED(11) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardClass) ID(0) GUARDCLASSKIND(Array) OP(GuardIndexIsNotDenseElement) ID(0) ID(1) OP(GuardInt32IsNonNegative) ID(1) OP(GuardProto) ID(0) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(GuardNoDenseElements) ID(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardShape) ID(3) OFFSET(4) OP(GuardNoDenseElements) ID(3) OP(CallGetSparseElementResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11845180153158895363 b/js/src/ics/IC-11845180153158895363 new file mode 100644 index 0000000000000..394f1a0123610 --- /dev/null +++ b/js/src/ics/IC-11845180153158895363 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardIsNumber) ID(3) OP(MathFunctionNumberResult) ID(3) UNARYMATHFUNC(Log) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11863523924152214302 b/js/src/ics/IC-11863523924152214302 new file mode 100644 index 0000000000000..e610c32f63c5c --- /dev/null +++ b/js/src/ics/IC-11863523924152214302 @@ -0,0 +1 @@ +CloseIter, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(5) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadDynamicSlot) ID(1) ID(0) OFFSET(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(2) OFFSET(3) OP(CloseIterScriptedResult) ID(0) ID(1) COMPLETIONKIND(Normal) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11894253971728676207 b/js/src/ics/IC-11894253971728676207 new file mode 100644 index 0000000000000..092b82252dd8e --- /dev/null +++ b/js/src/ics/IC-11894253971728676207 @@ -0,0 +1 @@ +Call, 1, 6, 17, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(15) LASTUSED(15) LASTUSED(4) LASTUSED(7) LASTUSED(15) LASTUSED(13) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardObjectIdentity) ID(3) ID(1) OP(LoadBoundFunctionTarget) ID(1) ID(4) OP(GuardClass) ID(4) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(4) OFFSET(0) OFFSET(1) OP(GuardShape) ID(4) OFFSET(2) OP(LoadObject) ID(5) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(4) ID(5) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallBoundScriptedFunction) ID(1) ID(4) ID(0) CALLFLAGS(97) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11895890575808877920 b/js/src/ics/IC-11895890575808877920 new file mode 100644 index 0000000000000..0ea1f90bbdcd4 --- /dev/null +++ b/js/src/ics/IC-11895890575808877920 @@ -0,0 +1 @@ +SetElem, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(5) LASTUSED(2) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNullOrUndefined) ID(2) OP(LoadInt32Constant) OFFSET(1) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int16) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11897578746080597689 b/js/src/ics/IC-11897578746080597689 new file mode 100644 index 0000000000000..f6eeb802d9251 --- /dev/null +++ b/js/src/ics/IC-11897578746080597689 @@ -0,0 +1 @@ +SetProp, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(2) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(AddAndStoreFixedSlot) ID(0) OFFSET(1) ID(1) OFFSET(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11900209573568550991 b/js/src/ics/IC-11900209573568550991 new file mode 100644 index 0000000000000..0ecd635069a68 --- /dev/null +++ b/js/src/ics/IC-11900209573568550991 @@ -0,0 +1 @@ +GetProp, 1, 1, 5, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(Value) , LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardSpecificObject) ID(0) OFFSET(0) OP(GuardObjectFuseProperty) ID(0) OFFSET(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) BOOL(0) OP(LoadValueResult) OFFSET(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11915705574977581913 b/js/src/ics/IC-11915705574977581913 new file mode 100644 index 0000000000000..a69d91fe28d9e --- /dev/null +++ b/js/src/ics/IC-11915705574977581913 @@ -0,0 +1 @@ +GetElem, 2, 3, 9, JSVAL_TYPE_UNKNOWN, 88, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakValue) , LASTUSED(3) LASTUSED(2) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardObjectFuseProperty) ID(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(0) OP(CheckWeakValueResultForDynamicSlot) ID(2) OFFSET(8) OFFSET(9) OP(UncheckedLoadWeakValueResult) OFFSET(10) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11917784147139259625 b/js/src/ics/IC-11917784147139259625 new file mode 100644 index 0000000000000..fa916ce8d501e --- /dev/null +++ b/js/src/ics/IC-11917784147139259625 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(2) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(GuardToBoolean) ID(1) OP(BooleanToNumber) ID(1) ID(2) OP(CompareDoubleResult) JSOP(Eq) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11920954854556069503 b/js/src/ics/IC-11920954854556069503 new file mode 100644 index 0000000000000..0eeeceff8fce5 --- /dev/null +++ b/js/src/ics/IC-11920954854556069503 @@ -0,0 +1 @@ +Call, 1, 8, 14, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(12) LASTUSED(8) LASTUSED(12) LASTUSED(10) LASTUSED(12) LASTUSED(12) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(LoadBooleanConstant) BOOL(0) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Int8) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11922998074703375584 b/js/src/ics/IC-11922998074703375584 new file mode 100644 index 0000000000000..7652de415957b --- /dev/null +++ b/js/src/ics/IC-11922998074703375584 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(7) LASTUSED(4) LASTUSED(7) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(GuardSpecificFunction) ID(3) OFFSET(0) OFFSET(1) OP(CallBoundScriptedFunction) ID(1) ID(3) ID(0) CALLFLAGS(65) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11926030484686920413 b/js/src/ics/IC-11926030484686920413 new file mode 100644 index 0000000000000..ba6b5cc2984f3 --- /dev/null +++ b/js/src/ics/IC-11926030484686920413 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(DoubleParseIntResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11929523768962332961 b/js/src/ics/IC-11929523768962332961 new file mode 100644 index 0000000000000..807ba7575dd3b --- /dev/null +++ b/js/src/ics/IC-11929523768962332961 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(10) LASTUSED(10) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(2) ID(3) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(97) UINT32(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11966432795011431208 b/js/src/ics/IC-11966432795011431208 new file mode 100644 index 0000000000000..cf458b93c8454 --- /dev/null +++ b/js/src/ics/IC-11966432795011431208 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint32) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11971878972146791849 b/js/src/ics/IC-11971878972146791849 new file mode 100644 index 0000000000000..09010538f0cdc --- /dev/null +++ b/js/src/ics/IC-11971878972146791849 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(NewSetObjectResult) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11973731599994297577 b/js/src/ics/IC-11973731599994297577 new file mode 100644 index 0000000000000..567a2cb4b0936 --- /dev/null +++ b/js/src/ics/IC-11973731599994297577 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawPointer) , LASTUSED(0) LASTUSED(2) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(MathRandomResult) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11974869848038048031 b/js/src/ics/IC-11974869848038048031 new file mode 100644 index 0000000000000..dac1676dc718a --- /dev/null +++ b/js/src/ics/IC-11974869848038048031 @@ -0,0 +1 @@ +In, 2, 3, 9, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(7) LASTUSED(7) LASTUSED(6) , OP(GuardToObject) ID(1) OP(GuardToInt32) ID(0) OP(GuardClass) ID(1) GUARDCLASSKIND(UnmappedArguments) OP(GuardProto) ID(1) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(GuardNoDenseElements) ID(2) OP(LoadArgumentsObjectArgExistsResult) ID(1) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1197555389676146502 b/js/src/ics/IC-1197555389676146502 new file mode 100644 index 0000000000000..afa47fc42e810 --- /dev/null +++ b/js/src/ics/IC-1197555389676146502 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(4) LASTUSED(4) , OP(GuardToBoolean) ID(0) OP(BooleanToNumber) ID(0) ID(2) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(3) OP(CompareDoubleResult) JSOP(Ne) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-11992046825318127452 b/js/src/ics/IC-11992046825318127452 new file mode 100644 index 0000000000000..b1815c075f270 --- /dev/null +++ b/js/src/ics/IC-11992046825318127452 @@ -0,0 +1 @@ +UnaryArith, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(1) OP(DoubleNegationResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1199785264712320331 b/js/src/ics/IC-1199785264712320331 new file mode 100644 index 0000000000000..edb558d43f289 --- /dev/null +++ b/js/src/ics/IC-1199785264712320331 @@ -0,0 +1 @@ +BindName, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(6) LASTUSED(5) , OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(0) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(GuardShape) ID(2) OFFSET(1) OP(LoadDynamicSlot) ID(3) ID(2) OFFSET(2) OP(GuardIsNotUninitializedLexical) ID(3) OP(LoadObjectResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12007963213199633266 b/js/src/ics/IC-12007963213199633266 new file mode 100644 index 0000000000000..d4df49b04df86 --- /dev/null +++ b/js/src/ics/IC-12007963213199633266 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int16) ID(4) ID(3) BOOL(1) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12041464180932850200 b/js/src/ics/IC-12041464180932850200 new file mode 100644 index 0000000000000..166e2fcb23cbf --- /dev/null +++ b/js/src/ics/IC-12041464180932850200 @@ -0,0 +1 @@ +SetElem, 3, 3, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(1) LASTUSED(1) , OP(GuardToObject) ID(0) OP(MegamorphicSetElement) ID(0) ID(1) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12065190136681622706 b/js/src/ics/IC-12065190136681622706 new file mode 100644 index 0000000000000..9ffa9db69c66b --- /dev/null +++ b/js/src/ics/IC-12065190136681622706 @@ -0,0 +1 @@ +Compare, 2, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(GuardIsUndefined) ID(0) OP(CompareNullUndefinedResult) JSOP(Eq) BOOL(1) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12078685233027911076 b/js/src/ics/IC-12078685233027911076 new file mode 100644 index 0000000000000..722a13829e234 --- /dev/null +++ b/js/src/ics/IC-12078685233027911076 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(0) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12125345230025462642 b/js/src/ics/IC-12125345230025462642 new file mode 100644 index 0000000000000..270c4a966a9ac --- /dev/null +++ b/js/src/ics/IC-12125345230025462642 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallNativeFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12128525700402149420 b/js/src/ics/IC-12128525700402149420 new file mode 100644 index 0000000000000..a5d5a9b4896e5 --- /dev/null +++ b/js/src/ics/IC-12128525700402149420 @@ -0,0 +1 @@ +Call, 1, 9, 16, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) LASTUSED(10) LASTUSED(10) LASTUSED(13) LASTUSED(13) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(5) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToInt32) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32MinMax) BOOL(1) ID(2) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToInt32) ID(5) OP(Int32MinMax) BOOL(1) ID(4) ID(5) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToInt32) ID(7) OP(Int32MinMax) BOOL(1) ID(6) ID(7) ID(8) OP(LoadInt32Result) ID(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12140967404139583523 b/js/src/ics/IC-12140967404139583523 new file mode 100644 index 0000000000000..fcbd9650aeac2 --- /dev/null +++ b/js/src/ics/IC-12140967404139583523 @@ -0,0 +1 @@ +Call, 1, 5, 13, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardArrayIsPacked) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(LoadArgumentFixedSlot) ID(4) BYTE(0) OP(GuardToInt32) ID(4) OP(PackedArraySliceResult) OFFSET(3) ID(2) ID(3) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12145809946683612898 b/js/src/ics/IC-12145809946683612898 new file mode 100644 index 0000000000000..6068fffa6fe69 --- /dev/null +++ b/js/src/ics/IC-12145809946683612898 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(7) LASTUSED(9) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(2) OP(GuardShape) ID(3) OFFSET(4) OP(LoadProtoObject) ID(4) OFFSET(5) ID(2) OP(GuardShape) ID(4) OFFSET(6) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(ArrayPush) ID(2) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12169621141189477120 b/js/src/ics/IC-12169621141189477120 new file mode 100644 index 0000000000000..0b26b7ace8780 --- /dev/null +++ b/js/src/ics/IC-12169621141189477120 @@ -0,0 +1 @@ +GetElem, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardToInt32Index) ID(1) ID(2) OP(GuardShape) ID(0) OFFSET(0) OP(LoadDenseElementResult) ID(0) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12171152205929690452 b/js/src/ics/IC-12171152205929690452 new file mode 100644 index 0000000000000..b968b1fb78b89 --- /dev/null +++ b/js/src/ics/IC-12171152205929690452 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint8Clamped) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12196014049427297313 b/js/src/ics/IC-12196014049427297313 new file mode 100644 index 0000000000000..eb360dbdae562 --- /dev/null +++ b/js/src/ics/IC-12196014049427297313 @@ -0,0 +1 @@ +Call, 1, 6, 14, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(12) LASTUSED(10) LASTUSED(12) LASTUSED(12) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardHasAttachedArrayBuffer) ID(2) OP(GuardFuse) REALMFUSE(12) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArrayBufferViewLength) ID(2) ID(5) OP(TypedArraySubarrayResult) OFFSET(3) ID(2) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12201504879653295403 b/js/src/ics/IC-12201504879653295403 new file mode 100644 index 0000000000000..a2116ddfc3137 --- /dev/null +++ b/js/src/ics/IC-12201504879653295403 @@ -0,0 +1 @@ +Compare, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(1) LASTUSED(2) , OP(GuardToInt32) ID(0) OP(GuardBooleanToInt32) ID(1) ID(2) OP(CompareInt32Result) JSOP(Le) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12202322731571668158 b/js/src/ics/IC-12202322731571668158 new file mode 100644 index 0000000000000..15083233b098b --- /dev/null +++ b/js/src/ics/IC-12202322731571668158 @@ -0,0 +1 @@ +GetProp, 1, 1, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadInt32ArrayLengthResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12203565973789721200 b/js/src/ics/IC-12203565973789721200 new file mode 100644 index 0000000000000..2c1a60b200517 --- /dev/null +++ b/js/src/ics/IC-12203565973789721200 @@ -0,0 +1 @@ +GetProp, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(0) LASTUSED(4) , OP(GuardNonDoubleType) ID(0) VALUETYPE(JSVAL_TYPE_BOOLEAN) OP(LoadObject) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(1) OFFSET(7) OFFSET(8) OP(UncheckedLoadWeakObjectResult) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1220410939266165701 b/js/src/ics/IC-1220410939266165701 new file mode 100644 index 0000000000000..cbe6851f13404 --- /dev/null +++ b/js/src/ics/IC-1220410939266165701 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(226) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12209746183633700082 b/js/src/ics/IC-12209746183633700082 new file mode 100644 index 0000000000000..91c8cf06b634e --- /dev/null +++ b/js/src/ics/IC-12209746183633700082 @@ -0,0 +1 @@ +SetProp, 2, 5, 10, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) STUBFIELD(RawInt32) , LASTUSED(8) LASTUSED(8) LASTUSED(3) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(2) OFFSET(1) ID(0) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(0) OP(GuardShape) ID(3) OFFSET(4) OP(LoadProtoObject) ID(4) OFFSET(5) ID(0) OP(GuardShape) ID(4) OFFSET(6) OP(AllocateAndStoreDynamicSlot) ID(0) OFFSET(7) ID(1) OFFSET(8) OFFSET(9) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12223037103699642874 b/js/src/ics/IC-12223037103699642874 new file mode 100644 index 0000000000000..9761848d7697d --- /dev/null +++ b/js/src/ics/IC-12223037103699642874 @@ -0,0 +1 @@ +GetElem, 2, 5, 14, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(12) LASTUSED(12) LASTUSED(5) LASTUSED(8) LASTUSED(11) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(GuardNoDenseElements) ID(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardShape) ID(3) OFFSET(4) OP(GuardNoDenseElements) ID(3) OP(LoadObject) ID(4) OFFSET(5) OP(GuardShape) ID(4) OFFSET(6) OP(GuardNoDenseElements) ID(4) OP(LoadDenseElementHoleResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12229925625792126666 b/js/src/ics/IC-12229925625792126666 new file mode 100644 index 0000000000000..43d67ca92c6de --- /dev/null +++ b/js/src/ics/IC-12229925625792126666 @@ -0,0 +1 @@ +Call, 1, 7, 16, JSVAL_TYPE_UNKNOWN, 72, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(14) LASTUSED(10) LASTUSED(12) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToObject) ID(3) OP(GuardShape) ID(3) OFFSET(4) OP(LoadProtoObject) ID(4) OFFSET(5) ID(3) OP(GuardShape) ID(4) OFFSET(6) OP(LoadProtoObject) ID(5) OFFSET(7) ID(3) OP(GuardShape) ID(5) OFFSET(8) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(ArrayPush) ID(3) ID(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12233302930724022918 b/js/src/ics/IC-12233302930724022918 new file mode 100644 index 0000000000000..5f1835d59e438 --- /dev/null +++ b/js/src/ics/IC-12233302930724022918 @@ -0,0 +1 @@ +SetElem, 3, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(StoreDenseElement) ID(0) ID(1) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12245285497735887338 b/js/src/ics/IC-12245285497735887338 new file mode 100644 index 0000000000000..c00af10935905 --- /dev/null +++ b/js/src/ics/IC-12245285497735887338 @@ -0,0 +1 @@ +GetName, 1, 5, 9, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(2) LASTUSED(4) LASTUSED(6) LASTUSED(7) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(GuardShape) ID(2) OFFSET(1) OP(LoadEnclosingEnvironment) ID(2) ID(3) OP(GuardShape) ID(3) OFFSET(2) OP(LoadDynamicSlot) ID(4) ID(3) OFFSET(3) OP(LoadOperandResult) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12249314329615632638 b/js/src/ics/IC-12249314329615632638 new file mode 100644 index 0000000000000..828a1c2b39597 --- /dev/null +++ b/js/src/ics/IC-12249314329615632638 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(33) UINT32(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12256373031424411132 b/js/src/ics/IC-12256373031424411132 new file mode 100644 index 0000000000000..3a15bf15ce8d8 --- /dev/null +++ b/js/src/ics/IC-12256373031424411132 @@ -0,0 +1 @@ +Call, 1, 6, 17, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(15) LASTUSED(15) LASTUSED(4) LASTUSED(7) LASTUSED(15) LASTUSED(13) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(1) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardObjectIdentity) ID(3) ID(1) OP(LoadBoundFunctionTarget) ID(1) ID(4) OP(GuardClass) ID(4) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(4) OFFSET(0) OFFSET(1) OP(GuardShape) ID(4) OFFSET(2) OP(LoadObject) ID(5) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(4) ID(5) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallBoundScriptedFunction) ID(1) ID(4) ID(0) CALLFLAGS(97) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12258217476841598370 b/js/src/ics/IC-12258217476841598370 new file mode 100644 index 0000000000000..12801fb73ef0b --- /dev/null +++ b/js/src/ics/IC-12258217476841598370 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(NewSetObjectFromIterableResult) OFFSET(4) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12289877284398697974 b/js/src/ics/IC-12289877284398697974 new file mode 100644 index 0000000000000..a6d079b1a6b01 --- /dev/null +++ b/js/src/ics/IC-12289877284398697974 @@ -0,0 +1 @@ +BinaryArith, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(4) LASTUSED(4) , OP(GuardIsNumber) ID(0) OP(TruncateDoubleToUInt32) ID(0) ID(2) OP(GuardIsNumber) ID(1) OP(TruncateDoubleToUInt32) ID(1) ID(3) OP(Int32BitXorResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12307589128357386290 b/js/src/ics/IC-12307589128357386290 new file mode 100644 index 0000000000000..1a6fd5f6d875a --- /dev/null +++ b/js/src/ics/IC-12307589128357386290 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint16) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12331206339995042354 b/js/src/ics/IC-12331206339995042354 new file mode 100644 index 0000000000000..4cf690a5daadb --- /dev/null +++ b/js/src/ics/IC-12331206339995042354 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(225) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1233965829917535966 b/js/src/ics/IC-1233965829917535966 new file mode 100644 index 0000000000000..bcc1a653bec9d --- /dev/null +++ b/js/src/ics/IC-1233965829917535966 @@ -0,0 +1 @@ +Call, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(LoadObjectResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12345710976435458483 b/js/src/ics/IC-12345710976435458483 new file mode 100644 index 0000000000000..1366eb374a16d --- /dev/null +++ b/js/src/ics/IC-12345710976435458483 @@ -0,0 +1 @@ +GetElemSuper, 3, 4, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(1) LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToInt32Index) ID(1) ID(3) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIndexIsNotDenseElement) ID(0) ID(3) OP(CallNativeGetElementSuperResult) ID(0) ID(3) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12352350110830558107 b/js/src/ics/IC-12352350110830558107 new file mode 100644 index 0000000000000..07489ddf6e2a1 --- /dev/null +++ b/js/src/ics/IC-12352350110830558107 @@ -0,0 +1 @@ +Call, 1, 8, 16, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) LASTUSED(14) LASTUSED(8) LASTUSED(14) LASTUSED(10) LASTUSED(14) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardIsUndefined) ID(5) OP(LoadDoubleConstant) OFFSET(2) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Float64) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12371675856128831185 b/js/src/ics/IC-12371675856128831185 new file mode 100644 index 0000000000000..a02cb2c4b721b --- /dev/null +++ b/js/src/ics/IC-12371675856128831185 @@ -0,0 +1 @@ +SetElem, 3, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(StoreDenseElementHole) ID(0) ID(1) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12385358395433347552 b/js/src/ics/IC-12385358395433347552 new file mode 100644 index 0000000000000..10a27d26469ad --- /dev/null +++ b/js/src/ics/IC-12385358395433347552 @@ -0,0 +1 @@ +GetProp, 1, 2, 9, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(RawPointer) STUBFIELD(JSObject) STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadWrapperTarget) ID(0) ID(1) BOOL(0) OP(GuardCompartment) ID(1) OFFSET(1) OFFSET(2) OP(GuardShape) ID(1) OFFSET(3) OP(LoadFixedSlotResult) ID(1) OFFSET(4) OP(WrapResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1239752390732558512 b/js/src/ics/IC-1239752390732558512 new file mode 100644 index 0000000000000..73e908c8629b1 --- /dev/null +++ b/js/src/ics/IC-1239752390732558512 @@ -0,0 +1 @@ +HasOwn, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(1) OP(GuardToString) ID(0) OP(GuardStringToIndex) ID(0) ID(2) OP(GuardShape) ID(1) OFFSET(0) OP(LoadDenseElementExistsResult) ID(1) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12407352839699051567 b/js/src/ics/IC-12407352839699051567 new file mode 100644 index 0000000000000..8aff17cbf20cf --- /dev/null +++ b/js/src/ics/IC-12407352839699051567 @@ -0,0 +1 @@ +Call, 1, 5, 12, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardHasAttachedArrayBuffer) ID(2) OP(GuardFuse) REALMFUSE(12) OP(LoadInt32AsIntPtrConstant) OFFSET(3) ID(3) OP(LoadArrayBufferViewLength) ID(2) ID(4) OP(TypedArraySubarrayResult) OFFSET(4) ID(2) ID(3) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12443551273558633822 b/js/src/ics/IC-12443551273558633822 new file mode 100644 index 0000000000000..aa3d1b260efe7 --- /dev/null +++ b/js/src/ics/IC-12443551273558633822 @@ -0,0 +1 @@ +GetName, 1, 5, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(2) LASTUSED(3) LASTUSED(4) LASTUSED(6) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(LoadEnclosingEnvironment) ID(2) ID(3) OP(LoadFixedSlot) ID(4) ID(3) OFFSET(1) OP(GuardIsNotUninitializedLexical) ID(4) OP(LoadOperandResult) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12487802332971824960 b/js/src/ics/IC-12487802332971824960 new file mode 100644 index 0000000000000..185e0f2ed4798 --- /dev/null +++ b/js/src/ics/IC-12487802332971824960 @@ -0,0 +1 @@ +CloseIter, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadFixedSlot) ID(1) ID(0) OFFSET(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(2) OFFSET(3) OP(CloseIterScriptedResult) ID(0) ID(1) COMPLETIONKIND(Normal) UINT32(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12496184382435453157 b/js/src/ics/IC-12496184382435453157 new file mode 100644 index 0000000000000..583280e068a8a --- /dev/null +++ b/js/src/ics/IC-12496184382435453157 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(2) OP(GuardToInt32) ID(3) OP(CompareInt32Result) JSOP(StrictEq) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1249757521006731908 b/js/src/ics/IC-1249757521006731908 new file mode 100644 index 0000000000000..7e32c20df6e40 --- /dev/null +++ b/js/src/ics/IC-1249757521006731908 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(2) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(2) OP(CompareDoubleResult) JSOP(Le) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12498738451478602664 b/js/src/ics/IC-12498738451478602664 new file mode 100644 index 0000000000000..b1ed38e435e9d --- /dev/null +++ b/js/src/ics/IC-12498738451478602664 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint32) BOOL(0) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12516077265661064965 b/js/src/ics/IC-12516077265661064965 new file mode 100644 index 0000000000000..8c89ddaff0df9 --- /dev/null +++ b/js/src/ics/IC-12516077265661064965 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToString) ID(2) OP(LoadStringResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12548582455891075725 b/js/src/ics/IC-12548582455891075725 new file mode 100644 index 0000000000000..47232e244c733 --- /dev/null +++ b/js/src/ics/IC-12548582455891075725 @@ -0,0 +1 @@ +HasOwn, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(1) OP(GuardToString) ID(0) OP(GuardStringToIndex) ID(0) ID(2) OP(GuardShape) ID(1) OFFSET(0) OP(LoadDenseElementHoleExistsResult) ID(1) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12550843294731269611 b/js/src/ics/IC-12550843294731269611 new file mode 100644 index 0000000000000..cdaef8cd321da --- /dev/null +++ b/js/src/ics/IC-12550843294731269611 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(5) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(3) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(ResizableArrayBuffer) OP(LoadArgumentFixedSlot) ID(4) BYTE(2) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(NewTypedArrayFromArrayBufferResult) OFFSET(4) ID(3) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12551184882861653836 b/js/src/ics/IC-12551184882861653836 new file mode 100644 index 0000000000000..a1042a3f5f461 --- /dev/null +++ b/js/src/ics/IC-12551184882861653836 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(GuardIsResizableTypedArray) ID(1) OP(GuardResizableArrayBufferViewInBoundsOrDetached) ID(1) OP(ResizableTypedArrayLengthInt32Result) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12563077197556992774 b/js/src/ics/IC-12563077197556992774 new file mode 100644 index 0000000000000..ba14835a66e30 --- /dev/null +++ b/js/src/ics/IC-12563077197556992774 @@ -0,0 +1 @@ +Call, 1, 3, 9, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(2) LASTUSED(7) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12581823821343441875 b/js/src/ics/IC-12581823821343441875 new file mode 100644 index 0000000000000..50976478443a3 --- /dev/null +++ b/js/src/ics/IC-12581823821343441875 @@ -0,0 +1 @@ +OptimizeSpreadCall, 1, 1, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardArrayIsPacked) ID(0) OP(GuardFuse) REALMFUSE(0) OP(LoadObjectResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12587110550698455113 b/js/src/ics/IC-12587110550698455113 new file mode 100644 index 0000000000000..e5acccfb79569 --- /dev/null +++ b/js/src/ics/IC-12587110550698455113 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardStringToIndex) ID(1) ID(2) OP(GuardIsNativeObject) ID(0) OP(LoadDenseElementResult) ID(0) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12595348712287346529 b/js/src/ics/IC-12595348712287346529 new file mode 100644 index 0000000000000..d3db128202867 --- /dev/null +++ b/js/src/ics/IC-12595348712287346529 @@ -0,0 +1 @@ +In, 2, 4, 10, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(6) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(1) OP(GuardToString) ID(0) OP(GuardSpecificAtom) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(1) OP(GuardShape) ID(2) OFFSET(3) OP(LoadProtoObject) ID(3) OFFSET(4) ID(1) OP(GuardShape) ID(3) OFFSET(5) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12598398037025850460 b/js/src/ics/IC-12598398037025850460 new file mode 100644 index 0000000000000..4a08e997a138e --- /dev/null +++ b/js/src/ics/IC-12598398037025850460 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(Log1P) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12607204059847499564 b/js/src/ics/IC-12607204059847499564 new file mode 100644 index 0000000000000..62c414d26512c --- /dev/null +++ b/js/src/ics/IC-12607204059847499564 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardIsNumber) ID(1) OP(GuardNumberToIntPtrIndex) ID(1) BOOL(0) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint8) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12631430526166016177 b/js/src/ics/IC-12631430526166016177 new file mode 100644 index 0000000000000..0113b7453a77a --- /dev/null +++ b/js/src/ics/IC-12631430526166016177 @@ -0,0 +1 @@ +Compare, 2, 4, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardBooleanToInt32) ID(1) ID(3) OP(CompareInt32Result) JSOP(Le) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12635275125499063241 b/js/src/ics/IC-12635275125499063241 new file mode 100644 index 0000000000000..2448017cdebc7 --- /dev/null +++ b/js/src/ics/IC-12635275125499063241 @@ -0,0 +1 @@ +GetPropSuper, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(2) LASTUSED(0) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadDynamicSlotResult) ID(0) OFFSET(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12650195333268884682 b/js/src/ics/IC-12650195333268884682 new file mode 100644 index 0000000000000..a15616f563829 --- /dev/null +++ b/js/src/ics/IC-12650195333268884682 @@ -0,0 +1 @@ +Call, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(AssertFloat32Result) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1266649421690466245 b/js/src/ics/IC-1266649421690466245 new file mode 100644 index 0000000000000..e1b0a853935de --- /dev/null +++ b/js/src/ics/IC-1266649421690466245 @@ -0,0 +1 @@ +SetProp, 2, 2, 3, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Id) , LASTUSED(1) LASTUSED(1) , OP(GuardToObject) ID(0) OP(MegamorphicStoreSlot) ID(0) OFFSET(0) ID(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12670139211231267888 b/js/src/ics/IC-12670139211231267888 new file mode 100644 index 0000000000000..77a5a8c293d9d --- /dev/null +++ b/js/src/ics/IC-12670139211231267888 @@ -0,0 +1 @@ +GetElem, 2, 3, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Symbol) STUBFIELD(JSObject) , LASTUSED(5) LASTUSED(2) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardClass) ID(0) GUARDCLASSKIND(UnmappedArguments) OP(GuardArgumentsObjectFlags) ID(0) BYTE(2) OP(GuardObjectHasSameRealm) ID(0) OP(LoadObject) ID(2) OFFSET(1) OP(LoadObjectResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12672156301222351563 b/js/src/ics/IC-12672156301222351563 new file mode 100644 index 0000000000000..7e345ccfe7f9f --- /dev/null +++ b/js/src/ics/IC-12672156301222351563 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int8) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12683654241500161406 b/js/src/ics/IC-12683654241500161406 new file mode 100644 index 0000000000000..c0a0af3f4d5fd --- /dev/null +++ b/js/src/ics/IC-12683654241500161406 @@ -0,0 +1 @@ +Call, 1, 8, 14, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(12) LASTUSED(8) LASTUSED(12) LASTUSED(10) LASTUSED(12) LASTUSED(12) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(LoadBooleanConstant) BOOL(0) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Uint8) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12699136477779093932 b/js/src/ics/IC-12699136477779093932 new file mode 100644 index 0000000000000..4dd7ba76932d9 --- /dev/null +++ b/js/src/ics/IC-12699136477779093932 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(RawPointer) STUBFIELD(RawPointer) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardAnyClass) ID(1) OFFSET(0) OP(GuardBoundFunctionIsConstructor) ID(1) OP(CallClassHook) ID(1) ID(0) CALLFLAGS(33) UINT32(0) OFFSET(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12726821881891537036 b/js/src/ics/IC-12726821881891537036 new file mode 100644 index 0000000000000..8f9dc7f110b4e --- /dev/null +++ b/js/src/ics/IC-12726821881891537036 @@ -0,0 +1 @@ +SetElem, 3, 3, 6, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(AddAndStoreFixedSlot) ID(0) OFFSET(2) ID(2) OFFSET(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12729550702382520945 b/js/src/ics/IC-12729550702382520945 new file mode 100644 index 0000000000000..236815455a957 --- /dev/null +++ b/js/src/ics/IC-12729550702382520945 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNumber) ID(1) OP(GuardNumberToIntPtrIndex) ID(1) BOOL(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint8) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12735248903735755888 b/js/src/ics/IC-12735248903735755888 new file mode 100644 index 0000000000000..b59a4c6e977a0 --- /dev/null +++ b/js/src/ics/IC-12735248903735755888 @@ -0,0 +1 @@ +SetElem, 3, 6, 9, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(7) LASTUSED(6) LASTUSED(3) LASTUSED(4) LASTUSED(7) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToString) ID(2) OP(GuardStringToNumber) ID(2) ID(3) OP(TruncateDoubleToUInt32) ID(3) ID(4) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(5) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint16) ID(5) ID(4) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12778322974528517410 b/js/src/ics/IC-12778322974528517410 new file mode 100644 index 0000000000000..f1e5907b7b6e7 --- /dev/null +++ b/js/src/ics/IC-12778322974528517410 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Uint32) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12787153739956192081 b/js/src/ics/IC-12787153739956192081 new file mode 100644 index 0000000000000..efad55fcd6ba3 --- /dev/null +++ b/js/src/ics/IC-12787153739956192081 @@ -0,0 +1 @@ +GetName, 1, 5, 9, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(4) LASTUSED(6) LASTUSED(7) , OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(0) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(GuardShape) ID(2) OFFSET(1) OP(LoadEnclosingEnvironment) ID(2) ID(3) OP(GuardShape) ID(3) OFFSET(2) OP(LoadDynamicSlot) ID(4) ID(3) OFFSET(3) OP(LoadOperandResult) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12817398985788194896 b/js/src/ics/IC-12817398985788194896 new file mode 100644 index 0000000000000..d7d1a58e75ae2 --- /dev/null +++ b/js/src/ics/IC-12817398985788194896 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Float64) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12824617670150603619 b/js/src/ics/IC-12824617670150603619 new file mode 100644 index 0000000000000..08a4ae53189bd --- /dev/null +++ b/js/src/ics/IC-12824617670150603619 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(TruncateDoubleToUInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32URightShiftResult) ID(2) ID(1) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1286034681513999872 b/js/src/ics/IC-1286034681513999872 new file mode 100644 index 0000000000000..19b7e3b5d188f --- /dev/null +++ b/js/src/ics/IC-1286034681513999872 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(97) UINT32(0) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1289055945440076065 b/js/src/ics/IC-1289055945440076065 new file mode 100644 index 0000000000000..2e202d2b8c1af --- /dev/null +++ b/js/src/ics/IC-1289055945440076065 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(SinH) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12898163203561858565 b/js/src/ics/IC-12898163203561858565 new file mode 100644 index 0000000000000..55a1572b06d01 --- /dev/null +++ b/js/src/ics/IC-12898163203561858565 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(2) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(2) OP(CompareDoubleResult) JSOP(Lt) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12943703669575335204 b/js/src/ics/IC-12943703669575335204 new file mode 100644 index 0000000000000..5e4d8001d12f3 --- /dev/null +++ b/js/src/ics/IC-12943703669575335204 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardToInt32) ID(0) OP(GuardIsNullOrUndefined) ID(1) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(Int32BitXorResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12978522289822245675 b/js/src/ics/IC-12978522289822245675 new file mode 100644 index 0000000000000..dee6f26468939 --- /dev/null +++ b/js/src/ics/IC-12978522289822245675 @@ -0,0 +1 @@ +Call, 1, 8, 15, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(10) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Int32) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12981357691094245271 b/js/src/ics/IC-12981357691094245271 new file mode 100644 index 0000000000000..ff96ae722af8b --- /dev/null +++ b/js/src/ics/IC-12981357691094245271 @@ -0,0 +1 @@ +Compare, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(CompareInt32Result) JSOP(Lt) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12981527137183523177 b/js/src/ics/IC-12981527137183523177 new file mode 100644 index 0000000000000..83dd5fe92e3c2 --- /dev/null +++ b/js/src/ics/IC-12981527137183523177 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathSignNumberToInt32Result) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-12997906975415912917 b/js/src/ics/IC-12997906975415912917 new file mode 100644 index 0000000000000..94120369adb08 --- /dev/null +++ b/js/src/ics/IC-12997906975415912917 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(WeakMap) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(WeakMapHasObjectResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13002166095676503091 b/js/src/ics/IC-13002166095676503091 new file mode 100644 index 0000000000000..758767b9b1462 --- /dev/null +++ b/js/src/ics/IC-13002166095676503091 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Double) STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardIsNull) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardIsUndefined) ID(1) OP(LoadDoubleConstant) OFFSET(1) ID(3) OP(CompareDoubleResult) JSOP(Lt) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13003696480971919932 b/js/src/ics/IC-13003696480971919932 new file mode 100644 index 0000000000000..dbf8576808bea --- /dev/null +++ b/js/src/ics/IC-13003696480971919932 @@ -0,0 +1 @@ +GetElem, 2, 4, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(8) LASTUSED(2) LASTUSED(8) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardStringToIndex) ID(1) ID(2) OP(GuardClass) ID(0) GUARDCLASSKIND(UnmappedArguments) OP(GuardProto) ID(0) OFFSET(0) OP(LoadObject) ID(3) OFFSET(1) OP(GuardShape) ID(3) OFFSET(2) OP(GuardNoDenseElements) ID(3) OP(LoadArgumentsObjectArgHoleResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13011662256902718091 b/js/src/ics/IC-13011662256902718091 new file mode 100644 index 0000000000000..e8e549c53e091 --- /dev/null +++ b/js/src/ics/IC-13011662256902718091 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardShape) ID(3) OFFSET(4) OP(RegExpFlagResult) ID(3) INT32(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13033903474341569707 b/js/src/ics/IC-13033903474341569707 new file mode 100644 index 0000000000000..405eb9da85a61 --- /dev/null +++ b/js/src/ics/IC-13033903474341569707 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13043784027947946539 b/js/src/ics/IC-13043784027947946539 new file mode 100644 index 0000000000000..15ade6a272189 --- /dev/null +++ b/js/src/ics/IC-13043784027947946539 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13051015350853341929 b/js/src/ics/IC-13051015350853341929 new file mode 100644 index 0000000000000..397e99f0f1b7a --- /dev/null +++ b/js/src/ics/IC-13051015350853341929 @@ -0,0 +1 @@ +Call, 1, 8, 15, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(10) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardIsNullOrUndefined) ID(5) OP(LoadInt32Constant) OFFSET(2) ID(6) OP(LoadBooleanConstant) BOOL(0) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Uint8) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13081187640352631583 b/js/src/ics/IC-13081187640352631583 new file mode 100644 index 0000000000000..abb4cacc0dc4a --- /dev/null +++ b/js/src/ics/IC-13081187640352631583 @@ -0,0 +1 @@ +HasOwn, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Symbol) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(3) , OP(GuardToObject) ID(1) OP(GuardToSymbol) ID(0) OP(GuardSpecificSymbol) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13083324281158730695 b/js/src/ics/IC-13083324281158730695 new file mode 100644 index 0000000000000..b607fc6227a3a --- /dev/null +++ b/js/src/ics/IC-13083324281158730695 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(225) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13085205972210035871 b/js/src/ics/IC-13085205972210035871 new file mode 100644 index 0000000000000..97ac247624c68 --- /dev/null +++ b/js/src/ics/IC-13085205972210035871 @@ -0,0 +1 @@ +Call, 1, 3, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(8) LASTUSED(2) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardNotClassConstructor) ID(2) OP(GuardFunctionHasJitEntry) ID(2) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(3) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13105678602020066221 b/js/src/ics/IC-13105678602020066221 new file mode 100644 index 0000000000000..0963c9de159d6 --- /dev/null +++ b/js/src/ics/IC-13105678602020066221 @@ -0,0 +1 @@ +Call, 1, 3, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(8) LASTUSED(2) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardNotClassConstructor) ID(2) OP(GuardFunctionHasJitEntry) ID(2) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(3) UINT32(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13108599658801043492 b/js/src/ics/IC-13108599658801043492 new file mode 100644 index 0000000000000..6f7a420fd8fd3 --- /dev/null +++ b/js/src/ics/IC-13108599658801043492 @@ -0,0 +1 @@ +Call, 1, 8, 16, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(14) LASTUSED(8) LASTUSED(14) LASTUSED(10) LASTUSED(14) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardIsNullOrUndefined) ID(5) OP(LoadInt32Constant) OFFSET(2) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Int16) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13110895715554840408 b/js/src/ics/IC-13110895715554840408 new file mode 100644 index 0000000000000..119d6ddb04cc5 --- /dev/null +++ b/js/src/ics/IC-13110895715554840408 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int32) ID(4) ID(3) BOOL(1) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13116667660014893331 b/js/src/ics/IC-13116667660014893331 new file mode 100644 index 0000000000000..01d3a25933fb7 --- /dev/null +++ b/js/src/ics/IC-13116667660014893331 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardShape) ID(3) OFFSET(4) OP(RegExpFlagResult) ID(3) INT32(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1314572759126981884 b/js/src/ics/IC-1314572759126981884 new file mode 100644 index 0000000000000..ff944a5f98f93 --- /dev/null +++ b/js/src/ics/IC-1314572759126981884 @@ -0,0 +1 @@ +SetElem, 3, 3, 5, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(Value) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardSpecificValue) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(AllocateAndStoreDynamicSlot) ID(0) OFFSET(2) ID(2) OFFSET(3) OFFSET(4) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13174815646869447150 b/js/src/ics/IC-13174815646869447150 new file mode 100644 index 0000000000000..4b5772b60bd2b --- /dev/null +++ b/js/src/ics/IC-13174815646869447150 @@ -0,0 +1 @@ +Compare, 2, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(GuardIsUndefined) ID(0) OP(CompareNullUndefinedResult) JSOP(Ne) BOOL(1) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13177021243244537568 b/js/src/ics/IC-13177021243244537568 new file mode 100644 index 0000000000000..ae8b918f074d4 --- /dev/null +++ b/js/src/ics/IC-13177021243244537568 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32RightShiftResult) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13191825944594179624 b/js/src/ics/IC-13191825944594179624 new file mode 100644 index 0000000000000..dbda9ebe883fb --- /dev/null +++ b/js/src/ics/IC-13191825944594179624 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13193174032408027607 b/js/src/ics/IC-13193174032408027607 new file mode 100644 index 0000000000000..362a1fdc0baaa --- /dev/null +++ b/js/src/ics/IC-13193174032408027607 @@ -0,0 +1 @@ +SetProp, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(Id) STUBFIELD(WeakValue) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardHasGetterSetter) ID(0) OFFSET(0) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(CallScriptedSetter) ID(0) ID(2) ID(1) BOOL(1) OFFSET(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13202553063534550925 b/js/src/ics/IC-13202553063534550925 new file mode 100644 index 0000000000000..3ec682835fd49 --- /dev/null +++ b/js/src/ics/IC-13202553063534550925 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Int16) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13213951643209372357 b/js/src/ics/IC-13213951643209372357 new file mode 100644 index 0000000000000..ffb94d60112b4 --- /dev/null +++ b/js/src/ics/IC-13213951643209372357 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardBooleanToInt32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int8) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13215801888775527267 b/js/src/ics/IC-13215801888775527267 new file mode 100644 index 0000000000000..f2c50c4b2325e --- /dev/null +++ b/js/src/ics/IC-13215801888775527267 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNumber) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float32) ID(3) ID(2) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13219400405226357578 b/js/src/ics/IC-13219400405226357578 new file mode 100644 index 0000000000000..a52afac1a1268 --- /dev/null +++ b/js/src/ics/IC-13219400405226357578 @@ -0,0 +1 @@ +GetElem, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(1) , OP(GuardToObject) ID(0) OP(GuardIsNull) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadFixedSlotResult) ID(0) OFFSET(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13222916196804984928 b/js/src/ics/IC-13222916196804984928 new file mode 100644 index 0000000000000..889bf661843d2 --- /dev/null +++ b/js/src/ics/IC-13222916196804984928 @@ -0,0 +1 @@ +SetElem, 3, 4, 8, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(0) OP(GuardShape) ID(3) OFFSET(3) OP(AllocateAndStoreDynamicSlot) ID(0) OFFSET(4) ID(2) OFFSET(5) OFFSET(6) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-132325594514648605 b/js/src/ics/IC-132325594514648605 new file mode 100644 index 0000000000000..ccd3c79f7a339 --- /dev/null +++ b/js/src/ics/IC-132325594514648605 @@ -0,0 +1 @@ +GetElem, 2, 3, 9, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(7) LASTUSED(7) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardClass) ID(0) GUARDCLASSKIND(MappedArguments) OP(GuardProto) ID(0) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(GuardNoDenseElements) ID(2) OP(LoadArgumentsObjectArgHoleResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13257172125999579457 b/js/src/ics/IC-13257172125999579457 new file mode 100644 index 0000000000000..4efa35b1a02dc --- /dev/null +++ b/js/src/ics/IC-13257172125999579457 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardIsNumber) ID(1) OP(GuardNumberToIntPtrIndex) ID(1) BOOL(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint8) ID(4) ID(3) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13266905752506190131 b/js/src/ics/IC-13266905752506190131 new file mode 100644 index 0000000000000..dce74757ce499 --- /dev/null +++ b/js/src/ics/IC-13266905752506190131 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(NewTypedArrayFromLengthResult) OFFSET(4) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13267965840024089330 b/js/src/ics/IC-13267965840024089330 new file mode 100644 index 0000000000000..eb50c902e1851 --- /dev/null +++ b/js/src/ics/IC-13267965840024089330 @@ -0,0 +1 @@ +Call, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(LoadFixedSlotTypedResult) ID(1) OFFSET(0) VALUETYPE(JSVAL_TYPE_INT32) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13271239178108435093 b/js/src/ics/IC-13271239178108435093 new file mode 100644 index 0000000000000..31db48913f29a --- /dev/null +++ b/js/src/ics/IC-13271239178108435093 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Int32) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13376562380096345472 b/js/src/ics/IC-13376562380096345472 new file mode 100644 index 0000000000000..3a09dcb9fd7b4 --- /dev/null +++ b/js/src/ics/IC-13376562380096345472 @@ -0,0 +1 @@ +SetProp, 2, 3, 7, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardClass) ID(0) GUARDCLASSKIND(WindowProxy) OP(LoadWrapperTarget) ID(0) ID(2) BOOL(0) OP(GuardSpecificObject) ID(2) OFFSET(0) OP(GuardShape) ID(2) OFFSET(1) OP(StoreDynamicSlot) ID(2) OFFSET(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13384588600075681597 b/js/src/ics/IC-13384588600075681597 new file mode 100644 index 0000000000000..532f5360631a9 --- /dev/null +++ b/js/src/ics/IC-13384588600075681597 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int16) ID(4) ID(3) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13414121263549175469 b/js/src/ics/IC-13414121263549175469 new file mode 100644 index 0000000000000..855a0867af3d2 --- /dev/null +++ b/js/src/ics/IC-13414121263549175469 @@ -0,0 +1 @@ +HasOwn, 2, 2, 7, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(Shape) , LASTUSED(5) LASTUSED(2) , OP(GuardToObject) ID(1) OP(GuardShape) ID(1) OFFSET(0) OP(GuardNoDenseElements) ID(1) OP(GuardToString) ID(0) OP(StringToAtom) ID(0) OP(SmallObjectVariableKeyHasOwnResult) ID(0) OFFSET(1) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13417568664826714804 b/js/src/ics/IC-13417568664826714804 new file mode 100644 index 0000000000000..dbef0181acb41 --- /dev/null +++ b/js/src/ics/IC-13417568664826714804 @@ -0,0 +1 @@ +Call, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToString) ID(2) OP(GuardStringToInt32) ID(2) ID(3) OP(LoadInt32Result) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13427353002263075219 b/js/src/ics/IC-13427353002263075219 new file mode 100644 index 0000000000000..79d99a01405b4 --- /dev/null +++ b/js/src/ics/IC-13427353002263075219 @@ -0,0 +1 @@ +GetElem, 2, 4, 12, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(10) LASTUSED(2) LASTUSED(10) LASTUSED(9) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardStringToIndex) ID(1) ID(2) OP(GuardClass) ID(0) GUARDCLASSKIND(PlainObject) OP(GuardIndexIsNotDenseElement) ID(0) ID(2) OP(GuardInt32IsNonNegative) ID(2) OP(GuardProto) ID(0) OFFSET(0) OP(LoadObject) ID(3) OFFSET(1) OP(GuardShape) ID(3) OFFSET(2) OP(GuardNoDenseElements) ID(3) OP(CallGetSparseElementResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13433654559768403866 b/js/src/ics/IC-13433654559768403866 new file mode 100644 index 0000000000000..24cfb0f0fef47 --- /dev/null +++ b/js/src/ics/IC-13433654559768403866 @@ -0,0 +1 @@ +GetName, 1, 7, 12, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(2) LASTUSED(3) LASTUSED(5) LASTUSED(7) LASTUSED(9) LASTUSED(10) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(LoadEnclosingEnvironment) ID(2) ID(3) OP(GuardShape) ID(3) OFFSET(1) OP(LoadEnclosingEnvironment) ID(3) ID(4) OP(GuardShape) ID(4) OFFSET(2) OP(LoadEnclosingEnvironment) ID(4) ID(5) OP(GuardShape) ID(5) OFFSET(3) OP(LoadDynamicSlot) ID(6) ID(5) OFFSET(4) OP(LoadOperandResult) ID(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13453167643054042561 b/js/src/ics/IC-13453167643054042561 new file mode 100644 index 0000000000000..8de60466d8b1f --- /dev/null +++ b/js/src/ics/IC-13453167643054042561 @@ -0,0 +1 @@ +SetElem, 3, 3, 9, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(7) LASTUSED(7) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardClass) ID(0) GUARDCLASSKIND(PlainObject) OP(GuardIndexIsNotDenseElement) ID(0) ID(1) OP(GuardIsExtensible) ID(0) OP(GuardInt32IsNonNegative) ID(1) OP(GuardNullProto) ID(0) OP(CallAddOrUpdateSparseElementHelper) ID(0) ID(1) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-134685456544051856 b/js/src/ics/IC-134685456544051856 new file mode 100644 index 0000000000000..f7609aa2a0f66 --- /dev/null +++ b/js/src/ics/IC-134685456544051856 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(9) LASTUSED(9) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(2) ID(3) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(33) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13471159476725365323 b/js/src/ics/IC-13471159476725365323 new file mode 100644 index 0000000000000..5f8103dd02cda --- /dev/null +++ b/js/src/ics/IC-13471159476725365323 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13471620504449912811 b/js/src/ics/IC-13471620504449912811 new file mode 100644 index 0000000000000..4a5559bf512ce --- /dev/null +++ b/js/src/ics/IC-13471620504449912811 @@ -0,0 +1 @@ +Call, 1, 3, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(8) LASTUSED(2) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardNotClassConstructor) ID(2) OP(GuardFunctionHasNoJitEntry) ID(2) OP(CallNativeFunction) ID(2) ID(0) CALLFLAGS(3) UINT32(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13473257844410089377 b/js/src/ics/IC-13473257844410089377 new file mode 100644 index 0000000000000..1a760dcaa8444 --- /dev/null +++ b/js/src/ics/IC-13473257844410089377 @@ -0,0 +1 @@ +SetProp, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardFunctionIsNonBuiltinCtor) ID(0) OP(AllocateAndStoreDynamicSlot) ID(0) OFFSET(1) ID(1) OFFSET(2) OFFSET(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13501956760510915436 b/js/src/ics/IC-13501956760510915436 new file mode 100644 index 0000000000000..9da7e7fc6cbd2 --- /dev/null +++ b/js/src/ics/IC-13501956760510915436 @@ -0,0 +1 @@ +GetElem, 2, 2, 7, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(GuardFixedSlotValue) ID(0) OFFSET(2) OFFSET(3) OP(CallNativeGetterResult) ID(0) OFFSET(4) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1351863608263831257 b/js/src/ics/IC-1351863608263831257 new file mode 100644 index 0000000000000..bbab72e0e4ab3 --- /dev/null +++ b/js/src/ics/IC-1351863608263831257 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardStringToIndex) ID(1) ID(2) OP(GuardShape) ID(0) OFFSET(0) OP(LoadDenseElementResult) ID(0) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13533339276683470532 b/js/src/ics/IC-13533339276683470532 new file mode 100644 index 0000000000000..568627c888bc8 --- /dev/null +++ b/js/src/ics/IC-13533339276683470532 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(GuardToSymbol) ID(0) OP(GuardIsNumber) ID(1) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13536195992539915258 b/js/src/ics/IC-13536195992539915258 new file mode 100644 index 0000000000000..427f75465d1e7 --- /dev/null +++ b/js/src/ics/IC-13536195992539915258 @@ -0,0 +1 @@ +SetElem, 3, 3, 6, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(AddAndStoreFixedSlot) ID(0) OFFSET(2) ID(2) OFFSET(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13555736913312993277 b/js/src/ics/IC-13555736913312993277 new file mode 100644 index 0000000000000..6c9ef2546e36c --- /dev/null +++ b/js/src/ics/IC-13555736913312993277 @@ -0,0 +1 @@ +Call, 1, 4, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(3) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToInt32) ID(1) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(Int32MinMax) BOOL(1) ID(1) ID(2) ID(3) OP(LoadInt32Result) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13556009625476393953 b/js/src/ics/IC-13556009625476393953 new file mode 100644 index 0000000000000..56132d4a519a4 --- /dev/null +++ b/js/src/ics/IC-13556009625476393953 @@ -0,0 +1 @@ +SetElem, 3, 6, 9, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(7) LASTUSED(6) LASTUSED(3) LASTUSED(4) LASTUSED(7) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToString) ID(2) OP(GuardStringToNumber) ID(2) ID(3) OP(DoubleToUint8Clamped) ID(3) ID(4) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(5) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint8Clamped) ID(5) ID(4) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13559342151354789534 b/js/src/ics/IC-13559342151354789534 new file mode 100644 index 0000000000000..9241d9fa6ae0c --- /dev/null +++ b/js/src/ics/IC-13559342151354789534 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(BigInt64) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13578765989722205494 b/js/src/ics/IC-13578765989722205494 new file mode 100644 index 0000000000000..48a518a875647 --- /dev/null +++ b/js/src/ics/IC-13578765989722205494 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToInt32) ID(2) OP(GuardInt32IsNonNegative) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToBigInt) ID(3) OP(BigIntAsIntNResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13590805774714694855 b/js/src/ics/IC-13590805774714694855 new file mode 100644 index 0000000000000..58241cb0740d7 --- /dev/null +++ b/js/src/ics/IC-13590805774714694855 @@ -0,0 +1 @@ +Compare, 2, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(GuardIsNull) ID(0) OP(CompareNullUndefinedResult) JSOP(Eq) BOOL(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13598851409407123945 b/js/src/ics/IC-13598851409407123945 new file mode 100644 index 0000000000000..c58bf5784acc3 --- /dev/null +++ b/js/src/ics/IC-13598851409407123945 @@ -0,0 +1 @@ +GetProp, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardShape) ID(1) OFFSET(2) OP(CallNativeGetterResult) ID(0) OFFSET(3) BOOL(1) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13612588813206562818 b/js/src/ics/IC-13612588813206562818 new file mode 100644 index 0000000000000..a560b5bc2a411 --- /dev/null +++ b/js/src/ics/IC-13612588813206562818 @@ -0,0 +1 @@ +GetElem, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(Value) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(1) , OP(GuardToObject) ID(0) OP(GuardSpecificValue) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadDynamicSlotResult) ID(0) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13625293738303124290 b/js/src/ics/IC-13625293738303124290 new file mode 100644 index 0000000000000..1800c783d6f10 --- /dev/null +++ b/js/src/ics/IC-13625293738303124290 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToBoolean) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Uint8) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13642100787672430064 b/js/src/ics/IC-13642100787672430064 new file mode 100644 index 0000000000000..6b77265d25a6f --- /dev/null +++ b/js/src/ics/IC-13642100787672430064 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(Set) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(SetAddResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13648456409911318231 b/js/src/ics/IC-13648456409911318231 new file mode 100644 index 0000000000000..8330b76541684 --- /dev/null +++ b/js/src/ics/IC-13648456409911318231 @@ -0,0 +1 @@ +Call, 1, 5, 11, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(9) LASTUSED(8) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(AtomicsLoadResult) ID(2) ID(4) SCALARTYPE(BigUint64) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13650715547761725318 b/js/src/ics/IC-13650715547761725318 new file mode 100644 index 0000000000000..5dee67b7fad88 --- /dev/null +++ b/js/src/ics/IC-13650715547761725318 @@ -0,0 +1 @@ +Call, 1, 8, 15, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(10) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Uint16) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13698406506563248093 b/js/src/ics/IC-13698406506563248093 new file mode 100644 index 0000000000000..59017f3bf074a --- /dev/null +++ b/js/src/ics/IC-13698406506563248093 @@ -0,0 +1 @@ +SetElem, 3, 4, 8, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(3) OFFSET(2) OP(GuardShape) ID(3) OFFSET(3) OP(CallNativeSetter) ID(0) OFFSET(4) ID(2) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13713553301365407662 b/js/src/ics/IC-13713553301365407662 new file mode 100644 index 0000000000000..f562eb9a65d72 --- /dev/null +++ b/js/src/ics/IC-13713553301365407662 @@ -0,0 +1 @@ +SetElem, 3, 7, 14, JSVAL_TYPE_UNKNOWN, 96, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(12) LASTUSED(2) LASTUSED(12) LASTUSED(5) LASTUSED(7) LASTUSED(9) LASTUSED(11) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(0) OP(GuardShape) ID(3) OFFSET(3) OP(LoadProtoObject) ID(4) OFFSET(4) ID(0) OP(GuardShape) ID(4) OFFSET(5) OP(LoadProtoObject) ID(5) OFFSET(6) ID(0) OP(GuardShape) ID(5) OFFSET(7) OP(LoadProtoObject) ID(6) OFFSET(8) ID(0) OP(GuardShape) ID(6) OFFSET(9) OP(AddAndStoreFixedSlot) ID(0) OFFSET(10) ID(2) OFFSET(11) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13721563172958389941 b/js/src/ics/IC-13721563172958389941 new file mode 100644 index 0000000000000..c56a95582f504 --- /dev/null +++ b/js/src/ics/IC-13721563172958389941 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(0) LASTUSED(3) LASTUSED(4) LASTUSED(4) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(3) OP(CompareDoubleResult) JSOP(Lt) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13726068251736320735 b/js/src/ics/IC-13726068251736320735 new file mode 100644 index 0000000000000..5f1ca786ae5e4 --- /dev/null +++ b/js/src/ics/IC-13726068251736320735 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(DateFillLocalTimeSlots) ID(2) OP(LoadFixedSlot) ID(3) ID(2) OFFSET(3) OP(DateSecondsFromSecondsIntoYearResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1373711190724684948 b/js/src/ics/IC-1373711190724684948 new file mode 100644 index 0000000000000..e94814420a11c --- /dev/null +++ b/js/src/ics/IC-1373711190724684948 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Shape) , LASTUSED(0) LASTUSED(3) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(GuardFuse) REALMFUSE(14) OP(HasShapeResult) ID(1) OFFSET(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1378554472176792638 b/js/src/ics/IC-1378554472176792638 new file mode 100644 index 0000000000000..d3fa918bb4887 --- /dev/null +++ b/js/src/ics/IC-1378554472176792638 @@ -0,0 +1 @@ +SetProp, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(2) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(StoreDynamicSlot) ID(0) OFFSET(1) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13812622730687272193 b/js/src/ics/IC-13812622730687272193 new file mode 100644 index 0000000000000..dc96f24afbda1 --- /dev/null +++ b/js/src/ics/IC-13812622730687272193 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(3) , OP(GuardIsNullOrUndefined) ID(0) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32BitAndResult) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13832093419347002950 b/js/src/ics/IC-13832093419347002950 new file mode 100644 index 0000000000000..fa84d22fb56d3 --- /dev/null +++ b/js/src/ics/IC-13832093419347002950 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToBigInt) ID(0) OP(GuardToBigInt) ID(1) OP(CompareBigIntResult) JSOP(Gt) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13834587576954467767 b/js/src/ics/IC-13834587576954467767 new file mode 100644 index 0000000000000..fc0365124d202 --- /dev/null +++ b/js/src/ics/IC-13834587576954467767 @@ -0,0 +1 @@ +GetElem, 2, 3, 9, JSVAL_TYPE_UNKNOWN, 88, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(3) LASTUSED(2) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardObjectFuseProperty) ID(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(2) OFFSET(8) OFFSET(9) OP(UncheckedLoadWeakObjectResult) OFFSET(10) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13841379517215814936 b/js/src/ics/IC-13841379517215814936 new file mode 100644 index 0000000000000..dcd269783a471 --- /dev/null +++ b/js/src/ics/IC-13841379517215814936 @@ -0,0 +1 @@ +UnaryArith, 1, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(2) LASTUSED(3) , OP(GuardToBigInt) ID(0) OP(BigIntToIntPtr) ID(0) ID(1) OP(BigIntPtrNegation) ID(1) ID(2) OP(IntPtrToBigIntResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1386704165739255941 b/js/src/ics/IC-1386704165739255941 new file mode 100644 index 0000000000000..b7a4325951122 --- /dev/null +++ b/js/src/ics/IC-1386704165739255941 @@ -0,0 +1 @@ +HasOwn, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(1) LASTUSED(2) , OP(GuardToObject) ID(1) OP(GuardIsUndefined) ID(0) OP(GuardShape) ID(1) OFFSET(0) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13876270104054221329 b/js/src/ics/IC-13876270104054221329 new file mode 100644 index 0000000000000..0916b2b721bd3 --- /dev/null +++ b/js/src/ics/IC-13876270104054221329 @@ -0,0 +1 @@ +Call, 1, 5, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToString) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(LinearizeForCharAccess) ID(2) ID(3) ID(4) OP(LoadStringCharCodeResult) ID(4) ID(3) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13880620641127642606 b/js/src/ics/IC-13880620641127642606 new file mode 100644 index 0000000000000..8b0921495ded2 --- /dev/null +++ b/js/src/ics/IC-13880620641127642606 @@ -0,0 +1 @@ +Call, 1, 5, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(LoadArgumentFixedSlot) ID(4) BYTE(0) OP(MapSetResult) ID(2) ID(3) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13897273724036325999 b/js/src/ics/IC-13897273724036325999 new file mode 100644 index 0000000000000..4f0853bae8206 --- /dev/null +++ b/js/src/ics/IC-13897273724036325999 @@ -0,0 +1 @@ +GetElemSuper, 3, 5, 9, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) LASTUSED(7) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadDynamicSlot) ID(3) ID(0) OFFSET(2) OP(LoadGetterSetterFunction) ID(3) BOOL(1) BOOL(0) ID(4) OP(GuardFunctionScript) ID(4) OFFSET(3) OFFSET(4) OP(CallScriptedGetterResult) ID(2) ID(4) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13921079828401338443 b/js/src/ics/IC-13921079828401338443 new file mode 100644 index 0000000000000..bb88e622ebc5d --- /dev/null +++ b/js/src/ics/IC-13921079828401338443 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint8) ID(4) ID(3) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13956483640505359679 b/js/src/ics/IC-13956483640505359679 new file mode 100644 index 0000000000000..94053e28f2ace --- /dev/null +++ b/js/src/ics/IC-13956483640505359679 @@ -0,0 +1 @@ +Call, 1, 3, 9, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(2) LASTUSED(7) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(3) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1396220819944324854 b/js/src/ics/IC-1396220819944324854 new file mode 100644 index 0000000000000..fdb3cff1ad586 --- /dev/null +++ b/js/src/ics/IC-1396220819944324854 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardStringToIndex) ID(1) ID(2) OP(GuardClass) ID(0) GUARDCLASSKIND(MappedArguments) OP(LoadArgumentsObjectArgResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13968336765600219575 b/js/src/ics/IC-13968336765600219575 new file mode 100644 index 0000000000000..2761432c5d474 --- /dev/null +++ b/js/src/ics/IC-13968336765600219575 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(9) LASTUSED(9) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(2) ID(3) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(97) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13970198218191718150 b/js/src/ics/IC-13970198218191718150 new file mode 100644 index 0000000000000..f524b1a8eb703 --- /dev/null +++ b/js/src/ics/IC-13970198218191718150 @@ -0,0 +1 @@ +GetProp, 1, 2, 8, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(7) OP(RegExpFlagResult) ID(0) INT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13973523225442191237 b/js/src/ics/IC-13973523225442191237 new file mode 100644 index 0000000000000..8cb5c171de3ef --- /dev/null +++ b/js/src/ics/IC-13973523225442191237 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(WeakMapHasObjectResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13976813150224281378 b/js/src/ics/IC-13976813150224281378 new file mode 100644 index 0000000000000..3278a654d9060 --- /dev/null +++ b/js/src/ics/IC-13976813150224281378 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardToInt32) ID(0) OP(GuardIsNullOrUndefined) ID(1) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(Int32RightShiftResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-13998294700404197465 b/js/src/ics/IC-13998294700404197465 new file mode 100644 index 0000000000000..79661e9f31b60 --- /dev/null +++ b/js/src/ics/IC-13998294700404197465 @@ -0,0 +1 @@ +SetElem, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(Double) , LASTUSED(6) LASTUSED(5) LASTUSED(2) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsUndefined) ID(2) OP(LoadDoubleConstant) OFFSET(1) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float32) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14052287005514388927 b/js/src/ics/IC-14052287005514388927 new file mode 100644 index 0000000000000..a24c8bb978d19 --- /dev/null +++ b/js/src/ics/IC-14052287005514388927 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToBoolean) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Int16) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14117263075278951151 b/js/src/ics/IC-14117263075278951151 new file mode 100644 index 0000000000000..97844b20e0239 --- /dev/null +++ b/js/src/ics/IC-14117263075278951151 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawPointer) , LASTUSED(0) LASTUSED(3) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(GuardAnyClass) ID(1) OFFSET(0) OP(LoadObjectResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14123896615027276117 b/js/src/ics/IC-14123896615027276117 new file mode 100644 index 0000000000000..1c59c7c5ea9bc --- /dev/null +++ b/js/src/ics/IC-14123896615027276117 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint8Clamped) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14130460441626628276 b/js/src/ics/IC-14130460441626628276 new file mode 100644 index 0000000000000..0836d3a837024 --- /dev/null +++ b/js/src/ics/IC-14130460441626628276 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(1) LASTUSED(2) , OP(GuardToInt32) ID(0) OP(GuardBooleanToInt32) ID(1) ID(2) OP(Int32BitOrResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14144766053941653023 b/js/src/ics/IC-14144766053941653023 new file mode 100644 index 0000000000000..45f79226930eb --- /dev/null +++ b/js/src/ics/IC-14144766053941653023 @@ -0,0 +1 @@ +SetElem, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(Double) , LASTUSED(6) LASTUSED(5) LASTUSED(2) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsUndefined) ID(2) OP(LoadDoubleConstant) OFFSET(1) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float64) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1414880105904709695 b/js/src/ics/IC-1414880105904709695 new file mode 100644 index 0000000000000..f637e2eb901ce --- /dev/null +++ b/js/src/ics/IC-1414880105904709695 @@ -0,0 +1 @@ +Call, 1, 8, 15, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(10) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Uint32) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14150618541272524050 b/js/src/ics/IC-14150618541272524050 new file mode 100644 index 0000000000000..4747e56e779e1 --- /dev/null +++ b/js/src/ics/IC-14150618541272524050 @@ -0,0 +1 @@ +Call, 1, 8, 16, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(14) LASTUSED(8) LASTUSED(14) LASTUSED(10) LASTUSED(14) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardIsNullOrUndefined) ID(5) OP(LoadInt32Constant) OFFSET(2) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Uint16) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14162189632336807272 b/js/src/ics/IC-14162189632336807272 new file mode 100644 index 0000000000000..7c803b88eb67e --- /dev/null +++ b/js/src/ics/IC-14162189632336807272 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(1) LASTUSED(2) , OP(GuardToInt32) ID(0) OP(GuardBooleanToInt32) ID(1) ID(2) OP(Int32RightShiftResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14187676263726922411 b/js/src/ics/IC-14187676263726922411 new file mode 100644 index 0000000000000..9d9b4d3f82fb0 --- /dev/null +++ b/js/src/ics/IC-14187676263726922411 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Uint16) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14195953354760445669 b/js/src/ics/IC-14195953354760445669 new file mode 100644 index 0000000000000..4b8e8b70e34c1 --- /dev/null +++ b/js/src/ics/IC-14195953354760445669 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14200755824617605140 b/js/src/ics/IC-14200755824617605140 new file mode 100644 index 0000000000000..214d614bd9f87 --- /dev/null +++ b/js/src/ics/IC-14200755824617605140 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14204410074732422434 b/js/src/ics/IC-14204410074732422434 new file mode 100644 index 0000000000000..74205458af329 --- /dev/null +++ b/js/src/ics/IC-14204410074732422434 @@ -0,0 +1 @@ +Call, 1, 1, 2, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) , OP(FrameIsConstructingResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14220090459296499202 b/js/src/ics/IC-14220090459296499202 new file mode 100644 index 0000000000000..87484301739ca --- /dev/null +++ b/js/src/ics/IC-14220090459296499202 @@ -0,0 +1 @@ +SetElem, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(Double) , LASTUSED(6) LASTUSED(5) LASTUSED(2) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsUndefined) ID(2) OP(LoadDoubleConstant) OFFSET(1) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float16) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1422276730860130965 b/js/src/ics/IC-1422276730860130965 new file mode 100644 index 0000000000000..cdb9931d47851 --- /dev/null +++ b/js/src/ics/IC-1422276730860130965 @@ -0,0 +1 @@ +GetElem, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadFixedSlotResult) ID(0) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14223030849999757218 b/js/src/ics/IC-14223030849999757218 new file mode 100644 index 0000000000000..1d6932b79684b --- /dev/null +++ b/js/src/ics/IC-14223030849999757218 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasNoJitEntry) ID(1) OP(GuardNotClassConstructor) ID(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14224859134046417490 b/js/src/ics/IC-14224859134046417490 new file mode 100644 index 0000000000000..079165195e083 --- /dev/null +++ b/js/src/ics/IC-14224859134046417490 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathRoundToInt32Result) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14229624103423851641 b/js/src/ics/IC-14229624103423851641 new file mode 100644 index 0000000000000..3c1d5fcf20758 --- /dev/null +++ b/js/src/ics/IC-14229624103423851641 @@ -0,0 +1 @@ +Call, 1, 6, 14, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(6) LASTUSED(4) LASTUSED(7) LASTUSED(9) LASTUSED(12) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(LoadFixedSlot) ID(4) ID(1) OFFSET(0) OP(GuardSpecificFunction) ID(3) OFFSET(1) OFFSET(2) OP(GuardToObject) ID(4) OP(GuardSpecificFunction) ID(4) OFFSET(3) OFFSET(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToObject) ID(5) OP(ObjectToStringResult) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14246505469395708684 b/js/src/ics/IC-14246505469395708684 new file mode 100644 index 0000000000000..ae4be54b8e5be --- /dev/null +++ b/js/src/ics/IC-14246505469395708684 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(Set) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(SetHasResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14281653422476756083 b/js/src/ics/IC-14281653422476756083 new file mode 100644 index 0000000000000..446cdc81b864a --- /dev/null +++ b/js/src/ics/IC-14281653422476756083 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToString) ID(2) OP(LoadStringResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14283904817563706615 b/js/src/ics/IC-14283904817563706615 new file mode 100644 index 0000000000000..5d109bbf7dd67 --- /dev/null +++ b/js/src/ics/IC-14283904817563706615 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(Date) OP(DateFillLocalTimeSlots) ID(2) OP(LoadFixedSlot) ID(3) ID(2) OFFSET(2) OP(DateHoursFromSecondsIntoYearResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14288027680938726747 b/js/src/ics/IC-14288027680938726747 new file mode 100644 index 0000000000000..faa6f3b018b59 --- /dev/null +++ b/js/src/ics/IC-14288027680938726747 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(TruncateDoubleToUInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32URightShiftResult) ID(2) ID(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14298534756209246351 b/js/src/ics/IC-14298534756209246351 new file mode 100644 index 0000000000000..32b4b21bf1e93 --- /dev/null +++ b/js/src/ics/IC-14298534756209246351 @@ -0,0 +1 @@ +GetProp, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(1) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(1) OFFSET(7) OFFSET(8) OP(UncheckedLoadWeakObjectResult) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14311069532179393026 b/js/src/ics/IC-14311069532179393026 new file mode 100644 index 0000000000000..676c110785021 --- /dev/null +++ b/js/src/ics/IC-14311069532179393026 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Int16) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14331161007341784256 b/js/src/ics/IC-14331161007341784256 new file mode 100644 index 0000000000000..02e493cfb05f4 --- /dev/null +++ b/js/src/ics/IC-14331161007341784256 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14339088406296197105 b/js/src/ics/IC-14339088406296197105 new file mode 100644 index 0000000000000..0c3dc51741994 --- /dev/null +++ b/js/src/ics/IC-14339088406296197105 @@ -0,0 +1 @@ +GetProp, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(0) LASTUSED(4) , OP(GuardNonDoubleType) ID(0) VALUETYPE(JSVAL_TYPE_STRING) OP(LoadObject) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(1) OFFSET(7) OFFSET(8) OP(UncheckedLoadWeakObjectResult) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14354680038107022059 b/js/src/ics/IC-14354680038107022059 new file mode 100644 index 0000000000000..f49159a7f84df --- /dev/null +++ b/js/src/ics/IC-14354680038107022059 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Float64) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14362161806700298319 b/js/src/ics/IC-14362161806700298319 new file mode 100644 index 0000000000000..fbaf75742a40b --- /dev/null +++ b/js/src/ics/IC-14362161806700298319 @@ -0,0 +1 @@ +Call, 1, 8, 17, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(6) LASTUSED(4) LASTUSED(7) LASTUSED(9) LASTUSED(15) LASTUSED(15) LASTUSED(15) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(LoadFixedSlot) ID(4) ID(1) OFFSET(0) OP(GuardSpecificFunction) ID(3) OFFSET(1) OFFSET(2) OP(GuardToObject) ID(4) OP(GuardSpecificFunction) ID(4) OFFSET(3) OFFSET(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(2) OP(GuardToObject) ID(5) OP(GuardShape) ID(5) OFFSET(5) OP(LoadArgumentFixedSlot) ID(6) BYTE(1) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(MapSetResult) ID(5) ID(6) ID(7) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14413012798209215909 b/js/src/ics/IC-14413012798209215909 new file mode 100644 index 0000000000000..0b68b258204e7 --- /dev/null +++ b/js/src/ics/IC-14413012798209215909 @@ -0,0 +1 @@ +UnaryArith, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(1) OP(LoadDoubleResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14461154631329666657 b/js/src/ics/IC-14461154631329666657 new file mode 100644 index 0000000000000..d6925541a8873 --- /dev/null +++ b/js/src/ics/IC-14461154631329666657 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(225) UINT32(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14467883914263481337 b/js/src/ics/IC-14467883914263481337 new file mode 100644 index 0000000000000..849f445051bb5 --- /dev/null +++ b/js/src/ics/IC-14467883914263481337 @@ -0,0 +1 @@ +GetProp, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakValue) , LASTUSED(1) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(1) OFFSET(7) OFFSET(8) OP(UncheckedLoadWeakValueResult) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14489346579519751547 b/js/src/ics/IC-14489346579519751547 new file mode 100644 index 0000000000000..f064dacdfc690 --- /dev/null +++ b/js/src/ics/IC-14489346579519751547 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14496628861062968371 b/js/src/ics/IC-14496628861062968371 new file mode 100644 index 0000000000000..d545b72c6db0a --- /dev/null +++ b/js/src/ics/IC-14496628861062968371 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint8) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14527407928280247926 b/js/src/ics/IC-14527407928280247926 new file mode 100644 index 0000000000000..fdd985a4457f5 --- /dev/null +++ b/js/src/ics/IC-14527407928280247926 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(Log10) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14554493060237194384 b/js/src/ics/IC-14554493060237194384 new file mode 100644 index 0000000000000..7b52cfa2a73eb --- /dev/null +++ b/js/src/ics/IC-14554493060237194384 @@ -0,0 +1 @@ +GetName, 1, 5, 9, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(2) LASTUSED(4) LASTUSED(7) LASTUSED(7) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardShape) ID(2) OFFSET(3) OP(LoadObject) ID(3) OFFSET(4) OP(LoadObject) ID(4) OFFSET(5) OP(CallScriptedGetterResult) ID(3) ID(4) BOOL(1) OFFSET(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14563408594424938637 b/js/src/ics/IC-14563408594424938637 new file mode 100644 index 0000000000000..6bfcfacc18e4b --- /dev/null +++ b/js/src/ics/IC-14563408594424938637 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint32) ID(4) ID(3) BOOL(1) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14567866124878772554 b/js/src/ics/IC-14567866124878772554 new file mode 100644 index 0000000000000..71730de348116 --- /dev/null +++ b/js/src/ics/IC-14567866124878772554 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Float16) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14626558405453506165 b/js/src/ics/IC-14626558405453506165 new file mode 100644 index 0000000000000..59f6c9f63f65a --- /dev/null +++ b/js/src/ics/IC-14626558405453506165 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(97) UINT32(5) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14628011205963112067 b/js/src/ics/IC-14628011205963112067 new file mode 100644 index 0000000000000..640e79acb8855 --- /dev/null +++ b/js/src/ics/IC-14628011205963112067 @@ -0,0 +1 @@ +GetElem, 2, 4, 8, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(Value) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(1) LASTUSED(4) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardSpecificValue) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardObjectFuseProperty) ID(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(1) OP(LoadObject) ID(3) OFFSET(8) OP(CallScriptedGetterResult) ID(0) ID(3) BOOL(1) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1468766867779691211 b/js/src/ics/IC-1468766867779691211 new file mode 100644 index 0000000000000..07cbde53e990a --- /dev/null +++ b/js/src/ics/IC-1468766867779691211 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardBooleanToInt32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint16) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14704840864205952478 b/js/src/ics/IC-14704840864205952478 new file mode 100644 index 0000000000000..a1538644a0de6 --- /dev/null +++ b/js/src/ics/IC-14704840864205952478 @@ -0,0 +1 @@ +Compare, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(CompareInt32Result) JSOP(Eq) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14712683113271789853 b/js/src/ics/IC-14712683113271789853 new file mode 100644 index 0000000000000..c8060cd23ed63 --- /dev/null +++ b/js/src/ics/IC-14712683113271789853 @@ -0,0 +1 @@ +GetElem, 2, 4, 9, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(2) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardObjectFuseProperty) ID(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(1) OP(LoadObject) ID(3) OFFSET(8) OP(CallScriptedGetterResult) ID(0) ID(3) BOOL(0) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14729315179854293649 b/js/src/ics/IC-14729315179854293649 new file mode 100644 index 0000000000000..fb26d0c919c92 --- /dev/null +++ b/js/src/ics/IC-14729315179854293649 @@ -0,0 +1 @@ +Call, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(CallNumberToString) ID(2) ID(3) OP(LoadStringResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14737756895956693 b/js/src/ics/IC-14737756895956693 new file mode 100644 index 0000000000000..e3ce3fe12575c --- /dev/null +++ b/js/src/ics/IC-14737756895956693 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Float32) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14752691146145831027 b/js/src/ics/IC-14752691146145831027 new file mode 100644 index 0000000000000..993143d2c71ad --- /dev/null +++ b/js/src/ics/IC-14752691146145831027 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1475711424344730393 b/js/src/ics/IC-1475711424344730393 new file mode 100644 index 0000000000000..0ea35ebf0169d --- /dev/null +++ b/js/src/ics/IC-1475711424344730393 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(10) LASTUSED(10) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(2) ID(3) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(97) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14778912386275267097 b/js/src/ics/IC-14778912386275267097 new file mode 100644 index 0000000000000..d6acc40cb9be6 --- /dev/null +++ b/js/src/ics/IC-14778912386275267097 @@ -0,0 +1 @@ +GetName, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(3) LASTUSED(5) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(1) OP(LoadDynamicSlot) ID(2) ID(1) OFFSET(2) OP(GuardIsNotUninitializedLexical) ID(2) OP(LoadOperandResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14807800099883036295 b/js/src/ics/IC-14807800099883036295 new file mode 100644 index 0000000000000..71e0890217983 --- /dev/null +++ b/js/src/ics/IC-14807800099883036295 @@ -0,0 +1 @@ +Call, 1, 3, 9, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(2) LASTUSED(7) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14809712869255117667 b/js/src/ics/IC-14809712869255117667 new file mode 100644 index 0000000000000..c90d9a424d297 --- /dev/null +++ b/js/src/ics/IC-14809712869255117667 @@ -0,0 +1 @@ +Call, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(6) LASTUSED(6) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToString) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToString) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToString) ID(3) OP(StringReplaceStringResult) ID(1) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14810953188900809801 b/js/src/ics/IC-14810953188900809801 new file mode 100644 index 0000000000000..837e11647022a --- /dev/null +++ b/js/src/ics/IC-14810953188900809801 @@ -0,0 +1 @@ +GetElem, 2, 3, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(2) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardStringToIndex) ID(1) ID(2) OP(GuardIsNativeObject) ID(0) OP(GuardIndexIsNotDenseElement) ID(0) ID(2) OP(CallNativeGetElementResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14814903859502936283 b/js/src/ics/IC-14814903859502936283 new file mode 100644 index 0000000000000..ff8026caed93b --- /dev/null +++ b/js/src/ics/IC-14814903859502936283 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint16) ID(4) ID(3) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14824099102875933291 b/js/src/ics/IC-14824099102875933291 new file mode 100644 index 0000000000000..42ce77c20e0c3 --- /dev/null +++ b/js/src/ics/IC-14824099102875933291 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(AllocSite) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(NewArrayFromLengthResult) OFFSET(4) ID(3) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1482567358729930735 b/js/src/ics/IC-1482567358729930735 new file mode 100644 index 0000000000000..36757fdf7525a --- /dev/null +++ b/js/src/ics/IC-1482567358729930735 @@ -0,0 +1 @@ +Call, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(4) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToString) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToString) ID(2) OP(StringSplitStringResult) ID(1) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14830994789469329991 b/js/src/ics/IC-14830994789469329991 new file mode 100644 index 0000000000000..f7243cd4aea55 --- /dev/null +++ b/js/src/ics/IC-14830994789469329991 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToString) ID(0) OP(GuardToString) ID(1) OP(CompareStringResult) JSOP(Gt) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14868959734744316604 b/js/src/ics/IC-14868959734744316604 new file mode 100644 index 0000000000000..7cefcfb690d65 --- /dev/null +++ b/js/src/ics/IC-14868959734744316604 @@ -0,0 +1 @@ +BindName, 1, 4, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(4) LASTUSED(5) , OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(0) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(GuardShape) ID(2) OFFSET(1) OP(LoadEnclosingEnvironment) ID(2) ID(3) OP(LoadObjectResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14915757337629635975 b/js/src/ics/IC-14915757337629635975 new file mode 100644 index 0000000000000..b6dc2bd4f26e9 --- /dev/null +++ b/js/src/ics/IC-14915757337629635975 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(161) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14954089963405707637 b/js/src/ics/IC-14954089963405707637 new file mode 100644 index 0000000000000..6bff453ff1a34 --- /dev/null +++ b/js/src/ics/IC-14954089963405707637 @@ -0,0 +1 @@ +Call, 1, 3, 9, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(Date) OP(DateFillLocalTimeSlots) ID(2) OP(LoadFixedSlotResult) ID(2) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14989789579183259278 b/js/src/ics/IC-14989789579183259278 new file mode 100644 index 0000000000000..b5983723e1f15 --- /dev/null +++ b/js/src/ics/IC-14989789579183259278 @@ -0,0 +1 @@ +SetElem, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(5) LASTUSED(2) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNullOrUndefined) ID(2) OP(LoadInt32Constant) OFFSET(1) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int32) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-14998253286370425907 b/js/src/ics/IC-14998253286370425907 new file mode 100644 index 0000000000000..5a02a219ac4d9 --- /dev/null +++ b/js/src/ics/IC-14998253286370425907 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToInt32) ID(2) OP(LoadInt32Result) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15021385070842040776 b/js/src/ics/IC-15021385070842040776 new file mode 100644 index 0000000000000..abec56f9fe109 --- /dev/null +++ b/js/src/ics/IC-15021385070842040776 @@ -0,0 +1 @@ +BinaryArith, 2, 5, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(3) LASTUSED(4) LASTUSED(4) LASTUSED(5) , OP(GuardToBigInt) ID(0) OP(GuardToBigInt) ID(1) OP(BigIntToIntPtr) ID(0) ID(2) OP(BigIntToIntPtr) ID(1) ID(3) OP(BigIntPtrBitAnd) ID(2) ID(3) ID(4) OP(IntPtrToBigIntResult) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15035644798634038466 b/js/src/ics/IC-15035644798634038466 new file mode 100644 index 0000000000000..5be5251e40cba --- /dev/null +++ b/js/src/ics/IC-15035644798634038466 @@ -0,0 +1 @@ +GetProp, 1, 1, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardClass) ID(0) GUARDCLASSKIND(JSFunction) OP(LoadFunctionNameResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15059931753717096427 b/js/src/ics/IC-15059931753717096427 new file mode 100644 index 0000000000000..b9cfedda65828 --- /dev/null +++ b/js/src/ics/IC-15059931753717096427 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToString) ID(0) OP(GuardToString) ID(1) OP(CompareStringResult) JSOP(Ge) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15066543668900739549 b/js/src/ics/IC-15066543668900739549 new file mode 100644 index 0000000000000..c893529264416 --- /dev/null +++ b/js/src/ics/IC-15066543668900739549 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Double) STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardIsNull) ID(1) OP(LoadDoubleConstant) OFFSET(1) ID(3) OP(CompareDoubleResult) JSOP(Le) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1506858868501291641 b/js/src/ics/IC-1506858868501291641 new file mode 100644 index 0000000000000..0fed813d5ed73 --- /dev/null +++ b/js/src/ics/IC-1506858868501291641 @@ -0,0 +1 @@ +OptimizeSpreadCall, 1, 1, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Shape) , LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardClass) ID(0) GUARDCLASSKIND(UnmappedArguments) OP(GuardArgumentsObjectFlags) ID(0) BYTE(23) OP(GuardObjectHasSameRealm) ID(0) OP(GuardFuse) REALMFUSE(1) OP(ArrayFromArgumentsObjectResult) ID(0) OFFSET(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15091287448359619416 b/js/src/ics/IC-15091287448359619416 new file mode 100644 index 0000000000000..7fa60d7eeb942 --- /dev/null +++ b/js/src/ics/IC-15091287448359619416 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(GuardToSymbol) ID(0) OP(GuardToString) ID(1) OP(LoadBooleanResult) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15095481451536776188 b/js/src/ics/IC-15095481451536776188 new file mode 100644 index 0000000000000..bc3159f765eaa --- /dev/null +++ b/js/src/ics/IC-15095481451536776188 @@ -0,0 +1 @@ +CloseIter, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadFixedSlot) ID(1) ID(0) OFFSET(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(2) OFFSET(3) OP(CloseIterScriptedResult) ID(0) ID(1) COMPLETIONKIND(Throw) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15101574030554362130 b/js/src/ics/IC-15101574030554362130 new file mode 100644 index 0000000000000..f14fcbf33b511 --- /dev/null +++ b/js/src/ics/IC-15101574030554362130 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(1) LASTUSED(2) , OP(GuardToInt32) ID(0) OP(GuardBooleanToInt32) ID(1) ID(2) OP(Int32BitAndResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15110406232392833946 b/js/src/ics/IC-15110406232392833946 new file mode 100644 index 0000000000000..af8066d6c69fd --- /dev/null +++ b/js/src/ics/IC-15110406232392833946 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(66) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15122227476588696652 b/js/src/ics/IC-15122227476588696652 new file mode 100644 index 0000000000000..4c40541b89e5e --- /dev/null +++ b/js/src/ics/IC-15122227476588696652 @@ -0,0 +1 @@ +Call, 1, 8, 16, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) LASTUSED(14) LASTUSED(8) LASTUSED(14) LASTUSED(10) LASTUSED(14) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardIsUndefined) ID(5) OP(LoadDoubleConstant) OFFSET(2) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Float16) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1513045088330615991 b/js/src/ics/IC-1513045088330615991 new file mode 100644 index 0000000000000..5583a27e5327b --- /dev/null +++ b/js/src/ics/IC-1513045088330615991 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(5) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15130802706756202910 b/js/src/ics/IC-15130802706756202910 new file mode 100644 index 0000000000000..dca161323eb3b --- /dev/null +++ b/js/src/ics/IC-15130802706756202910 @@ -0,0 +1 @@ +Compare, 2, 4, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardBooleanToInt32) ID(1) ID(3) OP(CompareInt32Result) JSOP(Ne) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15132418029182055989 b/js/src/ics/IC-15132418029182055989 new file mode 100644 index 0000000000000..f738c0ec1ae40 --- /dev/null +++ b/js/src/ics/IC-15132418029182055989 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint16) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15147177876626450886 b/js/src/ics/IC-15147177876626450886 new file mode 100644 index 0000000000000..63daf30354a00 --- /dev/null +++ b/js/src/ics/IC-15147177876626450886 @@ -0,0 +1 @@ +GetElemSuper, 3, 3, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(1) LASTUSED(0) , OP(GuardToObject) ID(0) OP(MegamorphicLoadSlotByValueResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15156872336781672293 b/js/src/ics/IC-15156872336781672293 new file mode 100644 index 0000000000000..8de1ae46125fb --- /dev/null +++ b/js/src/ics/IC-15156872336781672293 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint32) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15178909475978467084 b/js/src/ics/IC-15178909475978467084 new file mode 100644 index 0000000000000..00cdbf7fbb7b4 --- /dev/null +++ b/js/src/ics/IC-15178909475978467084 @@ -0,0 +1 @@ +Call, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(Int32MinMaxArrayResult) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15200613056540070697 b/js/src/ics/IC-15200613056540070697 new file mode 100644 index 0000000000000..f8c413616bb20 --- /dev/null +++ b/js/src/ics/IC-15200613056540070697 @@ -0,0 +1 @@ +GetElem, 2, 4, 9, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(2) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadDynamicSlot) ID(2) ID(0) OFFSET(2) OP(LoadGetterSetterFunction) ID(2) BOOL(1) BOOL(0) ID(3) OP(GuardFunctionScript) ID(3) OFFSET(3) OFFSET(4) OP(CallScriptedGetterResult) ID(0) ID(3) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15206564085425805792 b/js/src/ics/IC-15206564085425805792 new file mode 100644 index 0000000000000..fc552d1e9f961 --- /dev/null +++ b/js/src/ics/IC-15206564085425805792 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToUint8Clamped) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint8Clamped) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15218842393645411021 b/js/src/ics/IC-15218842393645411021 new file mode 100644 index 0000000000000..2ab5708c71541 --- /dev/null +++ b/js/src/ics/IC-15218842393645411021 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(3) , OP(GuardIsNullOrUndefined) ID(0) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32BitOrResult) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15237843965976528717 b/js/src/ics/IC-15237843965976528717 new file mode 100644 index 0000000000000..1b27222152bc1 --- /dev/null +++ b/js/src/ics/IC-15237843965976528717 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(225) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15245480520633794906 b/js/src/ics/IC-15245480520633794906 new file mode 100644 index 0000000000000..2949cf8be58fa --- /dev/null +++ b/js/src/ics/IC-15245480520633794906 @@ -0,0 +1 @@ +SetElem, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(5) LASTUSED(2) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNullOrUndefined) ID(2) OP(LoadInt32Constant) OFFSET(1) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int8) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15247978184118655068 b/js/src/ics/IC-15247978184118655068 new file mode 100644 index 0000000000000..e6806cebacd6d --- /dev/null +++ b/js/src/ics/IC-15247978184118655068 @@ -0,0 +1 @@ +GetElem, 2, 3, 8, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(2) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardShape) ID(2) OFFSET(3) OP(LoadFixedSlotResult) ID(2) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15256063064043402161 b/js/src/ics/IC-15256063064043402161 new file mode 100644 index 0000000000000..4d592697f9c9f --- /dev/null +++ b/js/src/ics/IC-15256063064043402161 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasJitEntry) ID(1) OP(GuardNotClassConstructor) ID(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15256845708303439675 b/js/src/ics/IC-15256845708303439675 new file mode 100644 index 0000000000000..d3bccb22fbadd --- /dev/null +++ b/js/src/ics/IC-15256845708303439675 @@ -0,0 +1 @@ +In, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(1) OP(GuardIsResizableTypedArray) ID(1) OP(GuardToInt32) ID(0) OP(Int32ToIntPtr) ID(0) ID(2) OP(LoadTypedArrayElementExistsResult) ID(1) ID(2) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15256894484672306899 b/js/src/ics/IC-15256894484672306899 new file mode 100644 index 0000000000000..6914918ded075 --- /dev/null +++ b/js/src/ics/IC-15256894484672306899 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Double) STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardIsUndefined) ID(1) OP(LoadDoubleConstant) OFFSET(1) ID(3) OP(CompareDoubleResult) JSOP(Gt) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15261488265697596324 b/js/src/ics/IC-15261488265697596324 new file mode 100644 index 0000000000000..fa9a641998d87 --- /dev/null +++ b/js/src/ics/IC-15261488265697596324 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToObject) ID(1) OP(CompareObjectResult) JSOP(Eq) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15270022190426507533 b/js/src/ics/IC-15270022190426507533 new file mode 100644 index 0000000000000..688d5f048c4ac --- /dev/null +++ b/js/src/ics/IC-15270022190426507533 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(3) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15276382482033055864 b/js/src/ics/IC-15276382482033055864 new file mode 100644 index 0000000000000..acd87fba13e85 --- /dev/null +++ b/js/src/ics/IC-15276382482033055864 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToBigInt) ID(0) OP(GuardToInt32) ID(1) OP(CompareBigIntInt32Result) JSOP(Lt) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15281522977235745903 b/js/src/ics/IC-15281522977235745903 new file mode 100644 index 0000000000000..2b17f0c030545 --- /dev/null +++ b/js/src/ics/IC-15281522977235745903 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathTruncNumberResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15291494922982619894 b/js/src/ics/IC-15291494922982619894 new file mode 100644 index 0000000000000..564c3407d4afa --- /dev/null +++ b/js/src/ics/IC-15291494922982619894 @@ -0,0 +1 @@ +GetElemSuper, 3, 3, 6, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) LASTUSED(0) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadFixedSlotResult) ID(0) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15299409602153111814 b/js/src/ics/IC-15299409602153111814 new file mode 100644 index 0000000000000..0cb89e599edd7 --- /dev/null +++ b/js/src/ics/IC-15299409602153111814 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(ExpM1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15310789324411277655 b/js/src/ics/IC-15310789324411277655 new file mode 100644 index 0000000000000..3b5ba7ecc64b7 --- /dev/null +++ b/js/src/ics/IC-15310789324411277655 @@ -0,0 +1 @@ +Call, 1, 5, 11, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(9) LASTUSED(9) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardIsNumber) ID(2) OP(GuardIsNumber) ID(3) OP(LoadArgumentFixedSlot) ID(4) BYTE(0) OP(GuardIsNumber) ID(4) OP(MathHypot3NumberResult) ID(2) ID(3) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15324427682562725367 b/js/src/ics/IC-15324427682562725367 new file mode 100644 index 0000000000000..838030dc3e59c --- /dev/null +++ b/js/src/ics/IC-15324427682562725367 @@ -0,0 +1 @@ +GetElem, 2, 2, 7, JSVAL_TYPE_UNKNOWN, 72, STUBFIELD(String) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(0) OFFSET(1) OP(GuardObjectFuseProperty) ID(0) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(CallNativeGetterResult) ID(0) OFFSET(7) BOOL(1) OFFSET(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15326146453845061467 b/js/src/ics/IC-15326146453845061467 new file mode 100644 index 0000000000000..443b0b007b745 --- /dev/null +++ b/js/src/ics/IC-15326146453845061467 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(SetDeleteResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15352591983625765146 b/js/src/ics/IC-15352591983625765146 new file mode 100644 index 0000000000000..832e7a83ee900 --- /dev/null +++ b/js/src/ics/IC-15352591983625765146 @@ -0,0 +1 @@ +In, 2, 3, 7, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(Value) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(1) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(1) OP(GuardSpecificValue) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardShape) ID(2) OFFSET(3) OP(LoadBooleanResult) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15380481758331451160 b/js/src/ics/IC-15380481758331451160 new file mode 100644 index 0000000000000..981148a89905f --- /dev/null +++ b/js/src/ics/IC-15380481758331451160 @@ -0,0 +1 @@ +GetElem, 2, 3, 8, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(2) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardShape) ID(2) OFFSET(3) OP(LoadDynamicSlotResult) ID(2) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15434203544764041676 b/js/src/ics/IC-15434203544764041676 new file mode 100644 index 0000000000000..3adbfe841f002 --- /dev/null +++ b/js/src/ics/IC-15434203544764041676 @@ -0,0 +1 @@ +GetProp, 1, 1, 5, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(Value) , LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardSpecificObject) ID(0) OFFSET(0) OP(GuardObjectFuseProperty) ID(0) OFFSET(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) BOOL(1) OP(LoadValueResult) OFFSET(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15434732477982591583 b/js/src/ics/IC-15434732477982591583 new file mode 100644 index 0000000000000..c5c88b26dfa24 --- /dev/null +++ b/js/src/ics/IC-15434732477982591583 @@ -0,0 +1 @@ +SetElem, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(5) LASTUSED(3) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToString) ID(2) OP(GuardStringToNumber) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float32) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1543617745482107482 b/js/src/ics/IC-1543617745482107482 new file mode 100644 index 0000000000000..92e418bc1f616 --- /dev/null +++ b/js/src/ics/IC-1543617745482107482 @@ -0,0 +1 @@ +GetName, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(RawInt32) STUBFIELD(RawPointer) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) , OP(GuardGlobalGeneration) OFFSET(0) OFFSET(1) OP(LoadObject) ID(1) OFFSET(2) OP(LoadFixedSlotResult) ID(1) OFFSET(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1544352321194837078 b/js/src/ics/IC-1544352321194837078 new file mode 100644 index 0000000000000..dd7df222275a7 --- /dev/null +++ b/js/src/ics/IC-1544352321194837078 @@ -0,0 +1 @@ +Call, 1, 5, 12, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardArrayIsPacked) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(LoadInt32ArrayLength) ID(2) ID(4) OP(PackedArraySliceResult) OFFSET(3) ID(2) ID(3) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15445061814796593256 b/js/src/ics/IC-15445061814796593256 new file mode 100644 index 0000000000000..5c6f3d490c670 --- /dev/null +++ b/js/src/ics/IC-15445061814796593256 @@ -0,0 +1 @@ +Call, 1, 7, 15, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToBigInt) ID(5) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(GuardToBoolean) ID(6) OP(StoreDataViewValueResult) ID(2) ID(4) ID(5) ID(6) SCALARTYPE(BigInt64) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15471644747976782201 b/js/src/ics/IC-15471644747976782201 new file mode 100644 index 0000000000000..188cf70e18241 --- /dev/null +++ b/js/src/ics/IC-15471644747976782201 @@ -0,0 +1 @@ +GetElem, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardClass) ID(0) GUARDCLASSKIND(UnmappedArguments) OP(LoadArgumentsObjectArgResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15482899218233437130 b/js/src/ics/IC-15482899218233437130 new file mode 100644 index 0000000000000..17a5c9b23e1a9 --- /dev/null +++ b/js/src/ics/IC-15482899218233437130 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(BigInt64) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1548481327602403487 b/js/src/ics/IC-1548481327602403487 new file mode 100644 index 0000000000000..ef06247914040 --- /dev/null +++ b/js/src/ics/IC-1548481327602403487 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(TruncateDoubleToUInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32RightShiftResult) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15503679691755473313 b/js/src/ics/IC-15503679691755473313 new file mode 100644 index 0000000000000..17217a93b6348 --- /dev/null +++ b/js/src/ics/IC-15503679691755473313 @@ -0,0 +1 @@ +Call, 1, 6, 14, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(8) LASTUSED(7) LASTUSED(9) LASTUSED(12) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(2) ID(3) OP(GuardSpecificInt32) ID(3) INT32(0) OP(LoadBoundFunctionTarget) ID(2) ID(4) OP(GuardSpecificFunction) ID(4) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardIsNumber) ID(5) OP(MathFunctionNumberResult) ID(5) UNARYMATHFUNC(Log) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1551596676474711944 b/js/src/ics/IC-1551596676474711944 new file mode 100644 index 0000000000000..26b7bf2286c28 --- /dev/null +++ b/js/src/ics/IC-1551596676474711944 @@ -0,0 +1 @@ +Call, 1, 7, 15, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardIsNumber) ID(5) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(GuardToBoolean) ID(6) OP(StoreDataViewValueResult) ID(2) ID(4) ID(5) ID(6) SCALARTYPE(Float32) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1553317233990934446 b/js/src/ics/IC-1553317233990934446 new file mode 100644 index 0000000000000..7cdeab594ae84 --- /dev/null +++ b/js/src/ics/IC-1553317233990934446 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(0) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardIsNotProxy) ID(2) OP(ObjectKeysResult) ID(2) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15575561699811901548 b/js/src/ics/IC-15575561699811901548 new file mode 100644 index 0000000000000..c61fbea5f621a --- /dev/null +++ b/js/src/ics/IC-15575561699811901548 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(225) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15578522933277279246 b/js/src/ics/IC-15578522933277279246 new file mode 100644 index 0000000000000..892282ba5292a --- /dev/null +++ b/js/src/ics/IC-15578522933277279246 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15594862229984184183 b/js/src/ics/IC-15594862229984184183 new file mode 100644 index 0000000000000..fbaaf8fbd95e7 --- /dev/null +++ b/js/src/ics/IC-15594862229984184183 @@ -0,0 +1 @@ +GetPropSuper, 2, 2, 7, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardSpecificObject) ID(0) OFFSET(0) OP(GuardObjectFuseProperty) ID(0) OFFSET(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) BOOL(1) OP(GuardToObject) ID(1) OP(GuardShape) ID(1) OFFSET(6) OP(SetSizeResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-156017073758642248 b/js/src/ics/IC-156017073758642248 new file mode 100644 index 0000000000000..61e3d8f43301d --- /dev/null +++ b/js/src/ics/IC-156017073758642248 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(225) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15607155572177135408 b/js/src/ics/IC-15607155572177135408 new file mode 100644 index 0000000000000..ff50068d16c87 --- /dev/null +++ b/js/src/ics/IC-15607155572177135408 @@ -0,0 +1 @@ +GetProp, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(1) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(0) OP(CheckWeakValueResultForDynamicSlot) ID(1) OFFSET(7) OFFSET(8) OP(UncheckedLoadWeakObjectResult) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1561934718361445124 b/js/src/ics/IC-1561934718361445124 new file mode 100644 index 0000000000000..b0fb7a44c8369 --- /dev/null +++ b/js/src/ics/IC-1561934718361445124 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(2) LASTUSED(3) , OP(GuardToInt32) ID(0) OP(GuardIsNumber) ID(1) OP(TruncateDoubleToUInt32) ID(1) ID(2) OP(Int32RightShiftResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15641157417691695382 b/js/src/ics/IC-15641157417691695382 new file mode 100644 index 0000000000000..f7dc7e66f44c8 --- /dev/null +++ b/js/src/ics/IC-15641157417691695382 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Int16) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15647871084071096245 b/js/src/ics/IC-15647871084071096245 new file mode 100644 index 0000000000000..1384f6eefcd16 --- /dev/null +++ b/js/src/ics/IC-15647871084071096245 @@ -0,0 +1 @@ +Compare, 2, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(0) , OP(GuardIsNull) ID(1) OP(CompareNullUndefinedResult) JSOP(Ne) BOOL(0) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15664021278566613298 b/js/src/ics/IC-15664021278566613298 new file mode 100644 index 0000000000000..a58545a3c09ea --- /dev/null +++ b/js/src/ics/IC-15664021278566613298 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToSymbol) ID(0) OP(GuardToSymbol) ID(1) OP(CompareSymbolResult) JSOP(Eq) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15665475069516480819 b/js/src/ics/IC-15665475069516480819 new file mode 100644 index 0000000000000..356d7a5e4251b --- /dev/null +++ b/js/src/ics/IC-15665475069516480819 @@ -0,0 +1 @@ +UnaryArith, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(2) , OP(GuardToString) ID(0) OP(GuardStringToInt32) ID(0) ID(1) OP(LoadInt32Result) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15665533781681879826 b/js/src/ics/IC-15665533781681879826 new file mode 100644 index 0000000000000..866a1b5bf8cdc --- /dev/null +++ b/js/src/ics/IC-15665533781681879826 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(ACosH) OP(ReturnFromIC) diff --git a/js/src/ics/IC-156666557929437089 b/js/src/ics/IC-156666557929437089 new file mode 100644 index 0000000000000..aa80076ea2c16 --- /dev/null +++ b/js/src/ics/IC-156666557929437089 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(SetHasObjectResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15670054774371412494 b/js/src/ics/IC-15670054774371412494 new file mode 100644 index 0000000000000..ced842dc09dda --- /dev/null +++ b/js/src/ics/IC-15670054774371412494 @@ -0,0 +1 @@ +GetProp, 1, 4, 13, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(Id) , LASTUSED(11) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadScriptedProxyHandler) ID(1) ID(0) OP(LoadWrapperTarget) ID(0) ID(2) BOOL(1) OP(GuardIsNativeObject) ID(2) OP(GuardShape) ID(1) OFFSET(1) OP(LoadFixedSlot) ID(3) ID(1) OFFSET(2) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(3) OFFSET(3) OFFSET(4) OP(CallScriptedProxyGetResult) ID(2) ID(0) ID(1) ID(3) OFFSET(5) UINT32(131106) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15690989141793533292 b/js/src/ics/IC-15690989141793533292 new file mode 100644 index 0000000000000..2bf8da2ce2f7c --- /dev/null +++ b/js/src/ics/IC-15690989141793533292 @@ -0,0 +1 @@ +GetName, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardShape) ID(1) OFFSET(2) OP(LoadObject) ID(2) OFFSET(3) OP(GuardShape) ID(2) OFFSET(4) OP(LoadDynamicSlotResult) ID(2) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15701153857556437688 b/js/src/ics/IC-15701153857556437688 new file mode 100644 index 0000000000000..3f2dd26530bba --- /dev/null +++ b/js/src/ics/IC-15701153857556437688 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToString) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToString) ID(3) OP(StringStartsWithResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15703166559612210896 b/js/src/ics/IC-15703166559612210896 new file mode 100644 index 0000000000000..fc87c0bbd77c7 --- /dev/null +++ b/js/src/ics/IC-15703166559612210896 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToBigInt) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(BigUint64) ID(3) ID(2) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15734495085669042066 b/js/src/ics/IC-15734495085669042066 new file mode 100644 index 0000000000000..ca93716c6ab35 --- /dev/null +++ b/js/src/ics/IC-15734495085669042066 @@ -0,0 +1 @@ +BinaryArith, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToString) ID(0) OP(GuardStringToNumber) ID(0) ID(2) OP(TruncateDoubleToUInt32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32BitOrResult) ID(3) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15744850445352658239 b/js/src/ics/IC-15744850445352658239 new file mode 100644 index 0000000000000..528a5cc5bfb5b --- /dev/null +++ b/js/src/ics/IC-15744850445352658239 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(0) LASTUSED(3) LASTUSED(4) LASTUSED(4) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardToBoolean) ID(1) OP(BooleanToNumber) ID(1) ID(3) OP(CompareDoubleResult) JSOP(Ge) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15761189120968104974 b/js/src/ics/IC-15761189120968104974 new file mode 100644 index 0000000000000..ea6f875a035ed --- /dev/null +++ b/js/src/ics/IC-15761189120968104974 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToBigInt) ID(5) OP(AtomicsAndResult) ID(2) ID(4) ID(5) SCALARTYPE(BigUint64) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15764820530268627074 b/js/src/ics/IC-15764820530268627074 new file mode 100644 index 0000000000000..736d2f5c12cb8 --- /dev/null +++ b/js/src/ics/IC-15764820530268627074 @@ -0,0 +1 @@ +BinaryArith, 2, 5, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(3) LASTUSED(4) LASTUSED(4) LASTUSED(5) , OP(GuardToBigInt) ID(0) OP(GuardToBigInt) ID(1) OP(BigIntToIntPtr) ID(0) ID(2) OP(BigIntToIntPtr) ID(1) ID(3) OP(BigIntPtrRightShift) ID(2) ID(3) ID(4) OP(IntPtrToBigIntResult) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15772659658134430490 b/js/src/ics/IC-15772659658134430490 new file mode 100644 index 0000000000000..b4b5dde06ac7c --- /dev/null +++ b/js/src/ics/IC-15772659658134430490 @@ -0,0 +1 @@ +BinaryArith, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(4) LASTUSED(2) LASTUSED(3) LASTUSED(4) , OP(GuardToInt32) ID(0) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(2) OP(TruncateDoubleToUInt32) ID(2) ID(3) OP(Int32BitAndResult) ID(0) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15783749619028334769 b/js/src/ics/IC-15783749619028334769 new file mode 100644 index 0000000000000..52ecbee8a22a0 --- /dev/null +++ b/js/src/ics/IC-15783749619028334769 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(Bailout) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15784845121327496478 b/js/src/ics/IC-15784845121327496478 new file mode 100644 index 0000000000000..51e5e94724de1 --- /dev/null +++ b/js/src/ics/IC-15784845121327496478 @@ -0,0 +1 @@ +Compare, 2, 4, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardBooleanToInt32) ID(1) ID(3) OP(CompareInt32Result) JSOP(Lt) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1578690047484083694 b/js/src/ics/IC-1578690047484083694 new file mode 100644 index 0000000000000..586772e192f3b --- /dev/null +++ b/js/src/ics/IC-1578690047484083694 @@ -0,0 +1 @@ +Call, 1, 7, 13, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) LASTUSED(10) LASTUSED(10) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardIsNumber) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardIsNumber) ID(3) OP(NumberMinMax) BOOL(1) ID(2) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardIsNumber) ID(5) OP(NumberMinMax) BOOL(1) ID(4) ID(5) ID(6) OP(LoadDoubleResult) ID(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15805593711153201813 b/js/src/ics/IC-15805593711153201813 new file mode 100644 index 0000000000000..ca93fedc4168c --- /dev/null +++ b/js/src/ics/IC-15805593711153201813 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(FixedLengthArrayBuffer) OP(LoadUndefined) ID(4) OP(LoadUndefined) ID(5) OP(NewTypedArrayFromArrayBufferResult) OFFSET(4) ID(3) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15821008227049644203 b/js/src/ics/IC-15821008227049644203 new file mode 100644 index 0000000000000..31ce1ef828de9 --- /dev/null +++ b/js/src/ics/IC-15821008227049644203 @@ -0,0 +1 @@ +GetElem, 2, 6, 14, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(12) LASTUSED(11) LASTUSED(12) LASTUSED(12) LASTUSED(12) LASTUSED(12) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadScriptedProxyHandler) ID(2) ID(0) OP(LoadWrapperTarget) ID(0) ID(3) BOOL(1) OP(GuardIsNativeObject) ID(3) OP(GuardShape) ID(2) OFFSET(1) OP(LoadFixedSlot) ID(4) ID(2) OFFSET(2) OP(GuardToObject) ID(4) OP(GuardClass) ID(4) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(4) OFFSET(3) OFFSET(4) OP(IdToStringOrSymbol) ID(5) ID(1) OP(CallScriptedProxyGetByValueResult) ID(3) ID(0) ID(2) ID(5) ID(4) UINT32(131106) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15851642846257800120 b/js/src/ics/IC-15851642846257800120 new file mode 100644 index 0000000000000..f0219d8cbb948 --- /dev/null +++ b/js/src/ics/IC-15851642846257800120 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(String) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadConstantString) OFFSET(3) ID(3) OP(ArrayJoinResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15980272252901078068 b/js/src/ics/IC-15980272252901078068 new file mode 100644 index 0000000000000..89e5e816efcc2 --- /dev/null +++ b/js/src/ics/IC-15980272252901078068 @@ -0,0 +1 @@ +In, 2, 5, 12, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(8) LASTUSED(5) LASTUSED(7) LASTUSED(9) , OP(GuardToObject) ID(1) OP(GuardToString) ID(0) OP(GuardSpecificAtom) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(1) OP(GuardShape) ID(2) OFFSET(3) OP(LoadProtoObject) ID(3) OFFSET(4) ID(1) OP(GuardShape) ID(3) OFFSET(5) OP(LoadProtoObject) ID(4) OFFSET(6) ID(1) OP(GuardShape) ID(4) OFFSET(7) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1598824005327988934 b/js/src/ics/IC-1598824005327988934 new file mode 100644 index 0000000000000..e1ca75add0865 --- /dev/null +++ b/js/src/ics/IC-1598824005327988934 @@ -0,0 +1 @@ +SetElem, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(5) LASTUSED(2) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNullOrUndefined) ID(2) OP(LoadInt32Constant) OFFSET(1) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint32) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-15995853631243213777 b/js/src/ics/IC-15995853631243213777 new file mode 100644 index 0000000000000..0786638297162 --- /dev/null +++ b/js/src/ics/IC-15995853631243213777 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToBoolean) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Int32) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16001020454003752679 b/js/src/ics/IC-16001020454003752679 new file mode 100644 index 0000000000000..58a436a4badc7 --- /dev/null +++ b/js/src/ics/IC-16001020454003752679 @@ -0,0 +1 @@ +Call, 1, 6, 17, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(15) LASTUSED(15) LASTUSED(13) LASTUSED(15) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardHasAttachedArrayBuffer) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToObject) ID(3) OP(GuardShape) ID(3) OFFSET(3) OP(GuardHasAttachedArrayBuffer) ID(3) OP(LoadArgumentFixedSlot) ID(4) BYTE(0) OP(GuardToInt32) ID(4) OP(Int32ToIntPtr) ID(4) ID(5) OP(GuardIntPtrIsNonNegative) ID(5) OP(TypedArraySetResult) ID(2) ID(3) ID(5) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16021804920950381964 b/js/src/ics/IC-16021804920950381964 new file mode 100644 index 0000000000000..39e3c4540ddd3 --- /dev/null +++ b/js/src/ics/IC-16021804920950381964 @@ -0,0 +1 @@ +BinaryArith, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(4) LASTUSED(2) LASTUSED(3) LASTUSED(4) , OP(GuardToInt32) ID(0) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(2) OP(TruncateDoubleToUInt32) ID(2) ID(3) OP(Int32RightShiftResult) ID(0) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16026809682949283923 b/js/src/ics/IC-16026809682949283923 new file mode 100644 index 0000000000000..5afdc15f1e966 --- /dev/null +++ b/js/src/ics/IC-16026809682949283923 @@ -0,0 +1 @@ +SetElem, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(2) LASTUSED(6) LASTUSED(6) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardStringToIndex) ID(1) ID(3) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(4) OFFSET(1) ID(0) OP(GuardShape) ID(4) OFFSET(2) OP(StoreDenseElementHole) ID(0) ID(3) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1606030695044352806 b/js/src/ics/IC-1606030695044352806 new file mode 100644 index 0000000000000..46ee054cf69ee --- /dev/null +++ b/js/src/ics/IC-1606030695044352806 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32BitXorResult) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16061132850755538181 b/js/src/ics/IC-16061132850755538181 new file mode 100644 index 0000000000000..8102e04c921e9 --- /dev/null +++ b/js/src/ics/IC-16061132850755538181 @@ -0,0 +1 @@ +Call, 1, 3, 9, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(2) LASTUSED(7) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16063664025510308365 b/js/src/ics/IC-16063664025510308365 new file mode 100644 index 0000000000000..0a5abee2608c6 --- /dev/null +++ b/js/src/ics/IC-16063664025510308365 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(DateFillLocalTimeSlots) ID(2) OP(LoadFixedSlot) ID(3) ID(2) OFFSET(3) OP(DateMinutesFromSecondsIntoYearResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16070776591766294213 b/js/src/ics/IC-16070776591766294213 new file mode 100644 index 0000000000000..899ef48129132 --- /dev/null +++ b/js/src/ics/IC-16070776591766294213 @@ -0,0 +1 @@ +GetElemSuper, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(Value) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(1) LASTUSED(6) LASTUSED(4) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardSpecificValue) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadFixedSlot) ID(3) ID(0) OFFSET(2) OP(LoadGetterSetterFunction) ID(3) BOOL(1) BOOL(0) ID(4) OP(GuardFunctionScript) ID(4) OFFSET(3) OFFSET(4) OP(CallScriptedGetterResult) ID(2) ID(4) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16076808003286742872 b/js/src/ics/IC-16076808003286742872 new file mode 100644 index 0000000000000..7246c1801de50 --- /dev/null +++ b/js/src/ics/IC-16076808003286742872 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardIsNumber) ID(2) OP(GuardIsNumber) ID(3) OP(MathHypot2NumberResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1608112832159864779 b/js/src/ics/IC-1608112832159864779 new file mode 100644 index 0000000000000..7492ace7f34e4 --- /dev/null +++ b/js/src/ics/IC-1608112832159864779 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint32) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16083582160266340449 b/js/src/ics/IC-16083582160266340449 new file mode 100644 index 0000000000000..40e0b0e1a6d1c --- /dev/null +++ b/js/src/ics/IC-16083582160266340449 @@ -0,0 +1 @@ +SetProp, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(4) LASTUSED(4) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(2) OFFSET(1) ID(0) OP(GuardShape) ID(2) OFFSET(2) OP(AddAndStoreDynamicSlot) ID(0) OFFSET(3) ID(1) OFFSET(4) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16083659671668501989 b/js/src/ics/IC-16083659671668501989 new file mode 100644 index 0000000000000..ec2d6e7bce25f --- /dev/null +++ b/js/src/ics/IC-16083659671668501989 @@ -0,0 +1 @@ +Call, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(IsConstructorResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16094422463908910611 b/js/src/ics/IC-16094422463908910611 new file mode 100644 index 0000000000000..e05f71a86e0bc --- /dev/null +++ b/js/src/ics/IC-16094422463908910611 @@ -0,0 +1 @@ +Call, 1, 1, 2, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(JSObject) , LASTUSED(0) , OP(NewRegExpStringIteratorResult) OFFSET(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16102950291961954136 b/js/src/ics/IC-16102950291961954136 new file mode 100644 index 0000000000000..a5b0fe18a14e2 --- /dev/null +++ b/js/src/ics/IC-16102950291961954136 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardIsNumber) ID(2) OP(GuardIsNumber) ID(3) OP(MathAtan2NumberResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16121396575455359152 b/js/src/ics/IC-16121396575455359152 new file mode 100644 index 0000000000000..dc60c9141110e --- /dev/null +++ b/js/src/ics/IC-16121396575455359152 @@ -0,0 +1 @@ +GetElemSuper, 3, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(3) LASTUSED(0) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadDenseElementResult) ID(0) ID(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16124720736972446092 b/js/src/ics/IC-16124720736972446092 new file mode 100644 index 0000000000000..7d72db79f6954 --- /dev/null +++ b/js/src/ics/IC-16124720736972446092 @@ -0,0 +1 @@ +Call, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(6) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(LoadInstanceOfObjectResult) ID(3) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16136230262803458414 b/js/src/ics/IC-16136230262803458414 new file mode 100644 index 0000000000000..e0cc87ccccf44 --- /dev/null +++ b/js/src/ics/IC-16136230262803458414 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Int32) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16150605594131551637 b/js/src/ics/IC-16150605594131551637 new file mode 100644 index 0000000000000..8cb1dabf362f4 --- /dev/null +++ b/js/src/ics/IC-16150605594131551637 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(BigUint64) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16154473313194127728 b/js/src/ics/IC-16154473313194127728 new file mode 100644 index 0000000000000..69c3b943d0cea --- /dev/null +++ b/js/src/ics/IC-16154473313194127728 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(GuardToSymbol) ID(0) OP(GuardToString) ID(1) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16166239202911500667 b/js/src/ics/IC-16166239202911500667 new file mode 100644 index 0000000000000..9d1e737ed4c22 --- /dev/null +++ b/js/src/ics/IC-16166239202911500667 @@ -0,0 +1 @@ +GetElemSuper, 3, 4, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(2) LASTUSED(0) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(0) OP(GuardShape) ID(3) OFFSET(3) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16174291589317550903 b/js/src/ics/IC-16174291589317550903 new file mode 100644 index 0000000000000..876d5d4a9a229 --- /dev/null +++ b/js/src/ics/IC-16174291589317550903 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(97) UINT32(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16180687653006196821 b/js/src/ics/IC-16180687653006196821 new file mode 100644 index 0000000000000..438d0dee9d5f1 --- /dev/null +++ b/js/src/ics/IC-16180687653006196821 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32LeftShiftResult) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1618600175832804022 b/js/src/ics/IC-1618600175832804022 new file mode 100644 index 0000000000000..922a335be67fc --- /dev/null +++ b/js/src/ics/IC-1618600175832804022 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNumber) ID(1) OP(GuardNumberToIntPtrIndex) ID(1) BOOL(0) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint8) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16195997200473740336 b/js/src/ics/IC-16195997200473740336 new file mode 100644 index 0000000000000..1ecc918bff2db --- /dev/null +++ b/js/src/ics/IC-16195997200473740336 @@ -0,0 +1 @@ +Call, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(Int32MinMaxArrayResult) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-161974646781488000 b/js/src/ics/IC-161974646781488000 new file mode 100644 index 0000000000000..0e3f89db6c387 --- /dev/null +++ b/js/src/ics/IC-161974646781488000 @@ -0,0 +1 @@ +GetElemSuper, 3, 3, 9, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(String) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(0) OFFSET(1) OP(GuardObjectFuseProperty) ID(0) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(Set) OP(SetSizeResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16227756009333563992 b/js/src/ics/IC-16227756009333563992 new file mode 100644 index 0000000000000..0d8749f46edfa --- /dev/null +++ b/js/src/ics/IC-16227756009333563992 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasNoJitEntry) ID(1) OP(GuardFunctionIsConstructor) ID(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(33) UINT32(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1627400993137997584 b/js/src/ics/IC-1627400993137997584 new file mode 100644 index 0000000000000..e5be23bf1d509 --- /dev/null +++ b/js/src/ics/IC-1627400993137997584 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(3) , OP(GuardToString) ID(0) OP(GuardStringToNumber) ID(0) ID(2) OP(GuardIsNumber) ID(1) OP(CompareDoubleResult) JSOP(Lt) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16280462555922375898 b/js/src/ics/IC-16280462555922375898 new file mode 100644 index 0000000000000..0fb3258eda93e --- /dev/null +++ b/js/src/ics/IC-16280462555922375898 @@ -0,0 +1 @@ +Call, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(NumberMinMaxArrayResult) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16294827684364476198 b/js/src/ics/IC-16294827684364476198 new file mode 100644 index 0000000000000..4639df75896ef --- /dev/null +++ b/js/src/ics/IC-16294827684364476198 @@ -0,0 +1 @@ +BinaryArith, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(4) LASTUSED(2) LASTUSED(3) LASTUSED(4) , OP(GuardToInt32) ID(0) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(2) OP(TruncateDoubleToUInt32) ID(2) ID(3) OP(Int32LeftShiftResult) ID(0) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16296220530659520538 b/js/src/ics/IC-16296220530659520538 new file mode 100644 index 0000000000000..1b4fe92e123ef --- /dev/null +++ b/js/src/ics/IC-16296220530659520538 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathRoundNumberResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16302938893583030197 b/js/src/ics/IC-16302938893583030197 new file mode 100644 index 0000000000000..bb66b5374f973 --- /dev/null +++ b/js/src/ics/IC-16302938893583030197 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int16) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16316788967681582913 b/js/src/ics/IC-16316788967681582913 new file mode 100644 index 0000000000000..b7228400bb2ad --- /dev/null +++ b/js/src/ics/IC-16316788967681582913 @@ -0,0 +1 @@ +BinaryArith, 2, 5, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(3) LASTUSED(4) LASTUSED(4) LASTUSED(5) , OP(GuardToBigInt) ID(0) OP(GuardToBigInt) ID(1) OP(BigIntToIntPtr) ID(0) ID(2) OP(BigIntToIntPtr) ID(1) ID(3) OP(BigIntPtrLeftShift) ID(2) ID(3) ID(4) OP(IntPtrToBigIntResult) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16317548204222040719 b/js/src/ics/IC-16317548204222040719 new file mode 100644 index 0000000000000..0141e7049d453 --- /dev/null +++ b/js/src/ics/IC-16317548204222040719 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16324777759269612328 b/js/src/ics/IC-16324777759269612328 new file mode 100644 index 0000000000000..66bb8297d6877 --- /dev/null +++ b/js/src/ics/IC-16324777759269612328 @@ -0,0 +1 @@ +HasOwn, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToObject) ID(1) OP(GuardIsProxy) ID(1) OP(ProxyHasPropResult) ID(1) ID(0) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1634739098904739531 b/js/src/ics/IC-1634739098904739531 new file mode 100644 index 0000000000000..4129448bc905e --- /dev/null +++ b/js/src/ics/IC-1634739098904739531 @@ -0,0 +1 @@ +Call, 1, 9, 16, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) LASTUSED(10) LASTUSED(10) LASTUSED(13) LASTUSED(13) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(5) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardIsNumber) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardIsNumber) ID(3) OP(NumberMinMax) BOOL(1) ID(2) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardIsNumber) ID(5) OP(NumberMinMax) BOOL(1) ID(4) ID(5) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardIsNumber) ID(7) OP(NumberMinMax) BOOL(1) ID(6) ID(7) ID(8) OP(LoadDoubleResult) ID(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1635501914358270870 b/js/src/ics/IC-1635501914358270870 new file mode 100644 index 0000000000000..dc3421a4566b8 --- /dev/null +++ b/js/src/ics/IC-1635501914358270870 @@ -0,0 +1 @@ +In, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(String) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(3) , OP(GuardToObject) ID(1) OP(GuardToString) ID(0) OP(GuardSpecificAtom) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadBooleanResult) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16369833480082781658 b/js/src/ics/IC-16369833480082781658 new file mode 100644 index 0000000000000..82dade569b002 --- /dev/null +++ b/js/src/ics/IC-16369833480082781658 @@ -0,0 +1 @@ +In, 2, 4, 9, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(7) LASTUSED(7) LASTUSED(6) , OP(GuardToObject) ID(1) OP(GuardToString) ID(0) OP(GuardStringToIndex) ID(0) ID(2) OP(GuardShape) ID(1) OFFSET(0) OP(LoadObject) ID(3) OFFSET(1) OP(GuardShape) ID(3) OFFSET(2) OP(GuardNoDenseElements) ID(3) OP(LoadDenseElementHoleExistsResult) ID(1) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16374656114163620899 b/js/src/ics/IC-16374656114163620899 new file mode 100644 index 0000000000000..04b5f9bd78466 --- /dev/null +++ b/js/src/ics/IC-16374656114163620899 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToString) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToString) ID(3) OP(StringIncludesResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1638383586556121771 b/js/src/ics/IC-1638383586556121771 new file mode 100644 index 0000000000000..7d125394bd2d9 --- /dev/null +++ b/js/src/ics/IC-1638383586556121771 @@ -0,0 +1 @@ +UnaryArith, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) , OP(GuardIsNullOrUndefined) ID(0) OP(LoadInt32Constant) OFFSET(0) ID(1) OP(Int32NotResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16396647195197475809 b/js/src/ics/IC-16396647195197475809 new file mode 100644 index 0000000000000..d1b489719ee12 --- /dev/null +++ b/js/src/ics/IC-16396647195197475809 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(3) , OP(GuardToString) ID(0) OP(GuardStringToNumber) ID(0) ID(2) OP(GuardIsNumber) ID(1) OP(CompareDoubleResult) JSOP(Ge) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16398001397064690244 b/js/src/ics/IC-16398001397064690244 new file mode 100644 index 0000000000000..c216c04f5afce --- /dev/null +++ b/js/src/ics/IC-16398001397064690244 @@ -0,0 +1 @@ +GetElemSuper, 3, 5, 9, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(2) LASTUSED(7) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(3) OFFSET(2) OP(GuardShape) ID(3) OFFSET(3) OP(LoadObject) ID(4) OFFSET(4) OP(CallScriptedGetterResult) ID(2) ID(4) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16412785163782828143 b/js/src/ics/IC-16412785163782828143 new file mode 100644 index 0000000000000..9838b87a303aa --- /dev/null +++ b/js/src/ics/IC-16412785163782828143 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(10) LASTUSED(10) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(2) ID(3) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(97) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16441932411964214517 b/js/src/ics/IC-16441932411964214517 new file mode 100644 index 0000000000000..79055d1c7e598 --- /dev/null +++ b/js/src/ics/IC-16441932411964214517 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(Date) OP(LoadFixedSlotTypedResult) ID(3) OFFSET(4) VALUETYPE(JSVAL_TYPE_DOUBLE) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16444569505671344216 b/js/src/ics/IC-16444569505671344216 new file mode 100644 index 0000000000000..e4b5285326043 --- /dev/null +++ b/js/src/ics/IC-16444569505671344216 @@ -0,0 +1 @@ +In, 2, 3, 9, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(7) LASTUSED(7) LASTUSED(6) , OP(GuardToObject) ID(1) OP(GuardToInt32) ID(0) OP(GuardClass) ID(1) GUARDCLASSKIND(MappedArguments) OP(GuardProto) ID(1) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(GuardNoDenseElements) ID(2) OP(LoadArgumentsObjectArgExistsResult) ID(1) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16447784970019255691 b/js/src/ics/IC-16447784970019255691 new file mode 100644 index 0000000000000..c7be830b18583 --- /dev/null +++ b/js/src/ics/IC-16447784970019255691 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int32) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16456037603459887409 b/js/src/ics/IC-16456037603459887409 new file mode 100644 index 0000000000000..5481054f231f7 --- /dev/null +++ b/js/src/ics/IC-16456037603459887409 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(BigUint64) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16473305132307886320 b/js/src/ics/IC-16473305132307886320 new file mode 100644 index 0000000000000..2251974117ac6 --- /dev/null +++ b/js/src/ics/IC-16473305132307886320 @@ -0,0 +1 @@ +GetProp, 1, 1, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardClass) ID(0) GUARDCLASSKIND(MappedArguments) OP(LoadArgumentsObjectLengthResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16492928734702167289 b/js/src/ics/IC-16492928734702167289 new file mode 100644 index 0000000000000..c36ca4cf918cb --- /dev/null +++ b/js/src/ics/IC-16492928734702167289 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToBigInt) ID(0) OP(GuardToInt32) ID(1) OP(CompareBigIntInt32Result) JSOP(Eq) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16536605270292443508 b/js/src/ics/IC-16536605270292443508 new file mode 100644 index 0000000000000..b5abe05220e90 --- /dev/null +++ b/js/src/ics/IC-16536605270292443508 @@ -0,0 +1 @@ +GetProp, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(Id) , LASTUSED(10) LASTUSED(10) LASTUSED(10) LASTUSED(10) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadScriptedProxyHandler) ID(1) ID(0) OP(LoadWrapperTarget) ID(0) ID(2) BOOL(1) OP(GuardIsNativeObject) ID(2) OP(GuardShape) ID(1) OFFSET(1) OP(LoadFixedSlot) ID(3) ID(1) OFFSET(2) OP(GuardToObject) ID(3) OP(GuardSpecificFunction) ID(3) OFFSET(3) OFFSET(4) OP(CallScriptedProxyGetResult) ID(2) ID(0) ID(1) ID(3) OFFSET(5) UINT32(133665) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16546279636009970594 b/js/src/ics/IC-16546279636009970594 new file mode 100644 index 0000000000000..3137a88939ca5 --- /dev/null +++ b/js/src/ics/IC-16546279636009970594 @@ -0,0 +1 @@ +UnaryArith, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) , OP(GuardIsNull) ID(0) OP(LoadInt32Constant) OFFSET(0) ID(1) OP(LoadInt32Result) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16546794286948420345 b/js/src/ics/IC-16546794286948420345 new file mode 100644 index 0000000000000..8b35dca645ce3 --- /dev/null +++ b/js/src/ics/IC-16546794286948420345 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Uint32) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16557056797325753112 b/js/src/ics/IC-16557056797325753112 new file mode 100644 index 0000000000000..7c047520c03ae --- /dev/null +++ b/js/src/ics/IC-16557056797325753112 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(SetAddResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16581406946776729085 b/js/src/ics/IC-16581406946776729085 new file mode 100644 index 0000000000000..c43a4caab11d4 --- /dev/null +++ b/js/src/ics/IC-16581406946776729085 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToSymbol) ID(3) OP(MapGetSymbolResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16585010222894519915 b/js/src/ics/IC-16585010222894519915 new file mode 100644 index 0000000000000..e771fe983b0e1 --- /dev/null +++ b/js/src/ics/IC-16585010222894519915 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(3) , OP(GuardToBoolean) ID(0) OP(BooleanToNumber) ID(0) ID(2) OP(GuardIsNumber) ID(1) OP(CompareDoubleResult) JSOP(Eq) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16606329988385761398 b/js/src/ics/IC-16606329988385761398 new file mode 100644 index 0000000000000..5f700f4e293e3 --- /dev/null +++ b/js/src/ics/IC-16606329988385761398 @@ -0,0 +1 @@ +GetProp, 1, 5, 14, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(Id) , LASTUSED(12) LASTUSED(12) LASTUSED(12) LASTUSED(9) LASTUSED(12) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadScriptedProxyHandler) ID(1) ID(0) OP(LoadWrapperTarget) ID(0) ID(2) BOOL(1) OP(GuardIsNativeObject) ID(2) OP(GuardShape) ID(1) OFFSET(1) OP(LoadObject) ID(3) OFFSET(2) OP(GuardShape) ID(3) OFFSET(3) OP(LoadFixedSlot) ID(4) ID(3) OFFSET(4) OP(GuardToObject) ID(4) OP(GuardSpecificFunction) ID(4) OFFSET(5) OFFSET(6) OP(CallScriptedProxyGetResult) ID(2) ID(0) ID(1) ID(4) OFFSET(7) UINT32(135968) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16622623138591522525 b/js/src/ics/IC-16622623138591522525 new file mode 100644 index 0000000000000..48e0cff4ee966 --- /dev/null +++ b/js/src/ics/IC-16622623138591522525 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToString) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(LoadStringCharCodeResult) ID(2) ID(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16625574802904276802 b/js/src/ics/IC-16625574802904276802 new file mode 100644 index 0000000000000..1860a50379dbb --- /dev/null +++ b/js/src/ics/IC-16625574802904276802 @@ -0,0 +1 @@ +GetProp, 1, 4, 13, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(Id) , LASTUSED(11) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadScriptedProxyHandler) ID(1) ID(0) OP(LoadWrapperTarget) ID(0) ID(2) BOOL(1) OP(GuardIsNativeObject) ID(2) OP(GuardShape) ID(1) OFFSET(1) OP(LoadFixedSlot) ID(3) ID(1) OFFSET(2) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(3) OFFSET(3) OFFSET(4) OP(CallScriptedProxyGetResult) ID(2) ID(0) ID(1) ID(3) OFFSET(5) UINT32(133665) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16625967148908603541 b/js/src/ics/IC-16625967148908603541 new file mode 100644 index 0000000000000..e5f8d18638c73 --- /dev/null +++ b/js/src/ics/IC-16625967148908603541 @@ -0,0 +1 @@ +GetElem, 2, 4, 9, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(Symbol) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(6) , OP(GuardNonDoubleType) ID(0) VALUETYPE(JSVAL_TYPE_SYMBOL) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(2) OP(GuardShape) ID(3) OFFSET(4) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16628473567969918110 b/js/src/ics/IC-16628473567969918110 new file mode 100644 index 0000000000000..888b58fb63d04 --- /dev/null +++ b/js/src/ics/IC-16628473567969918110 @@ -0,0 +1 @@ +GetElem, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(String) , LASTUSED(4) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardClass) ID(0) GUARDCLASSKIND(MappedArguments) OP(LoadArgumentsObjectLengthResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16662032354709854999 b/js/src/ics/IC-16662032354709854999 new file mode 100644 index 0000000000000..25bf6579c1d8f --- /dev/null +++ b/js/src/ics/IC-16662032354709854999 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Float16) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16665929507764626742 b/js/src/ics/IC-16665929507764626742 new file mode 100644 index 0000000000000..b3ecef4b6530b --- /dev/null +++ b/js/src/ics/IC-16665929507764626742 @@ -0,0 +1 @@ +Call, 1, 7, 15, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(5) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToBigInt) ID(5) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(GuardToBigInt) ID(6) OP(AtomicsCompareExchangeResult) ID(2) ID(4) ID(5) ID(6) SCALARTYPE(BigUint64) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16682031519227121100 b/js/src/ics/IC-16682031519227121100 new file mode 100644 index 0000000000000..0128a78ac0c7b --- /dev/null +++ b/js/src/ics/IC-16682031519227121100 @@ -0,0 +1 @@ +CloseIter, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(3) LASTUSED(6) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardShape) ID(1) OFFSET(2) OP(LoadDynamicSlot) ID(2) ID(1) OFFSET(3) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(4) OFFSET(5) OP(CloseIterScriptedResult) ID(0) ID(2) COMPLETIONKIND(Throw) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16691336148681222157 b/js/src/ics/IC-16691336148681222157 new file mode 100644 index 0000000000000..a4c736fbd14e2 --- /dev/null +++ b/js/src/ics/IC-16691336148681222157 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(GuardIsNullOrUndefined) ID(0) OP(GuardIsNullOrUndefined) ID(1) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16702403310026065928 b/js/src/ics/IC-16702403310026065928 new file mode 100644 index 0000000000000..d3c943f7038b2 --- /dev/null +++ b/js/src/ics/IC-16702403310026065928 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToString) ID(3) OP(NewStringObjectResult) OFFSET(4) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16706212125424985810 b/js/src/ics/IC-16706212125424985810 new file mode 100644 index 0000000000000..f83f38e3ee155 --- /dev/null +++ b/js/src/ics/IC-16706212125424985810 @@ -0,0 +1 @@ +SetProp, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(2) OFFSET(1) ID(0) OP(GuardShape) ID(2) OFFSET(2) OP(AllocateAndStoreDynamicSlot) ID(0) OFFSET(3) ID(1) OFFSET(4) OFFSET(5) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16739666423033416984 b/js/src/ics/IC-16739666423033416984 new file mode 100644 index 0000000000000..e111bc6025c9c --- /dev/null +++ b/js/src/ics/IC-16739666423033416984 @@ -0,0 +1 @@ +GetElem, 2, 3, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Symbol) STUBFIELD(JSObject) , LASTUSED(5) LASTUSED(2) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardClass) ID(0) GUARDCLASSKIND(MappedArguments) OP(GuardArgumentsObjectFlags) ID(0) BYTE(2) OP(GuardObjectHasSameRealm) ID(0) OP(LoadObject) ID(2) OFFSET(1) OP(LoadObjectResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16744391240382581557 b/js/src/ics/IC-16744391240382581557 new file mode 100644 index 0000000000000..f6424b924af17 --- /dev/null +++ b/js/src/ics/IC-16744391240382581557 @@ -0,0 +1 @@ +Call, 1, 8, 14, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(12) LASTUSED(8) LASTUSED(12) LASTUSED(10) LASTUSED(12) LASTUSED(12) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(LoadBooleanConstant) BOOL(0) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Int8) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16750844397036450523 b/js/src/ics/IC-16750844397036450523 new file mode 100644 index 0000000000000..4c2f895021a91 --- /dev/null +++ b/js/src/ics/IC-16750844397036450523 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(Map) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(MapGetResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1675953501727852675 b/js/src/ics/IC-1675953501727852675 new file mode 100644 index 0000000000000..5a094a0a73c5e --- /dev/null +++ b/js/src/ics/IC-1675953501727852675 @@ -0,0 +1 @@ +GetProp, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(3) LASTUSED(4) , OP(GuardIsNumber) ID(0) OP(LoadObject) ID(1) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(1) OP(GuardShape) ID(2) OFFSET(3) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16761661378458221911 b/js/src/ics/IC-16761661378458221911 new file mode 100644 index 0000000000000..a1b2d6f17bedc --- /dev/null +++ b/js/src/ics/IC-16761661378458221911 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNumber) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float32) ID(3) ID(2) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1677144798147218081 b/js/src/ics/IC-1677144798147218081 new file mode 100644 index 0000000000000..174f088074192 --- /dev/null +++ b/js/src/ics/IC-1677144798147218081 @@ -0,0 +1 @@ +SetElem, 3, 3, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Value) STUBFIELD(Id) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardIsNotDOMProxy) ID(0) OP(GuardSpecificValue) ID(1) OFFSET(0) OP(ProxySet) ID(0) OFFSET(1) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16810720249147781773 b/js/src/ics/IC-16810720249147781773 new file mode 100644 index 0000000000000..65c33ebcab85c --- /dev/null +++ b/js/src/ics/IC-16810720249147781773 @@ -0,0 +1 @@ +Call, 1, 3, 9, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(2) LASTUSED(7) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16843569621895605781 b/js/src/ics/IC-16843569621895605781 new file mode 100644 index 0000000000000..d5ab325aa30ee --- /dev/null +++ b/js/src/ics/IC-16843569621895605781 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(9) LASTUSED(9) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(2) ID(3) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(97) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16894807033258179497 b/js/src/ics/IC-16894807033258179497 new file mode 100644 index 0000000000000..feef455a0fffb --- /dev/null +++ b/js/src/ics/IC-16894807033258179497 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Float32) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16896933975358668103 b/js/src/ics/IC-16896933975358668103 new file mode 100644 index 0000000000000..3272cbf482f39 --- /dev/null +++ b/js/src/ics/IC-16896933975358668103 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(Cbrt) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16929910075128602681 b/js/src/ics/IC-16929910075128602681 new file mode 100644 index 0000000000000..5e3e90b8f3646 --- /dev/null +++ b/js/src/ics/IC-16929910075128602681 @@ -0,0 +1 @@ +Call, 1, 7, 17, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(6) LASTUSED(4) LASTUSED(7) LASTUSED(9) LASTUSED(15) LASTUSED(15) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(LoadFixedSlot) ID(4) ID(1) OFFSET(0) OP(GuardSpecificFunction) ID(3) OFFSET(1) OFFSET(2) OP(GuardToObject) ID(4) OP(GuardSpecificFunction) ID(4) OFFSET(3) OFFSET(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToObject) ID(5) OP(GuardShape) ID(5) OFFSET(5) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(GuardToSymbol) ID(6) OP(MapHasSymbolResult) ID(5) ID(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16962286447891923863 b/js/src/ics/IC-16962286447891923863 new file mode 100644 index 0000000000000..340e095de0549 --- /dev/null +++ b/js/src/ics/IC-16962286447891923863 @@ -0,0 +1 @@ +SetElem, 3, 6, 9, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(7) LASTUSED(6) LASTUSED(3) LASTUSED(4) LASTUSED(7) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToString) ID(2) OP(GuardStringToNumber) ID(2) ID(3) OP(TruncateDoubleToUInt32) ID(3) ID(4) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(5) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int16) ID(5) ID(4) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1697596976209236913 b/js/src/ics/IC-1697596976209236913 new file mode 100644 index 0000000000000..fa4c72106876c --- /dev/null +++ b/js/src/ics/IC-1697596976209236913 @@ -0,0 +1 @@ +GetElemSuper, 3, 4, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(2) LASTUSED(0) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardStringToIndex) ID(1) ID(3) OP(GuardShape) ID(0) OFFSET(0) OP(LoadDenseElementResult) ID(0) ID(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16977823490136600386 b/js/src/ics/IC-16977823490136600386 new file mode 100644 index 0000000000000..3921df60f812a --- /dev/null +++ b/js/src/ics/IC-16977823490136600386 @@ -0,0 +1 @@ +Call, 1, 6, 16, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(14) LASTUSED(14) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(MappedArguments) OP(GuardArgumentsObjectFlags) ID(3) BYTE(21) OP(LoadArgumentFixedSlot) ID(4) BYTE(1) OP(GuardToInt32) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToInt32) ID(5) OP(ArgumentsSliceResult) OFFSET(4) ID(3) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-16997233238971559737 b/js/src/ics/IC-16997233238971559737 new file mode 100644 index 0000000000000..f821d73f70231 --- /dev/null +++ b/js/src/ics/IC-16997233238971559737 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToBoolean) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Int8) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17001888958166851542 b/js/src/ics/IC-17001888958166851542 new file mode 100644 index 0000000000000..ca6d0254d0717 --- /dev/null +++ b/js/src/ics/IC-17001888958166851542 @@ -0,0 +1 @@ +GetProp, 1, 1, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardClass) ID(0) GUARDCLASSKIND(UnmappedArguments) OP(LoadArgumentsObjectLengthResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17008048015808328062 b/js/src/ics/IC-17008048015808328062 new file mode 100644 index 0000000000000..d8df0e3c700bd --- /dev/null +++ b/js/src/ics/IC-17008048015808328062 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(1) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17030656571181434301 b/js/src/ics/IC-17030656571181434301 new file mode 100644 index 0000000000000..78833f0d47b3c --- /dev/null +++ b/js/src/ics/IC-17030656571181434301 @@ -0,0 +1 @@ +GetElem, 2, 3, 9, JSVAL_TYPE_UNKNOWN, 88, STUBFIELD(Symbol) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(0) LASTUSED(2) LASTUSED(6) , OP(GuardNonDoubleType) ID(0) VALUETYPE(JSVAL_TYPE_STRING) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardSpecificObject) ID(2) OFFSET(2) OP(GuardObjectFuseProperty) ID(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(2) OFFSET(8) OFFSET(9) OP(UncheckedLoadWeakObjectResult) OFFSET(10) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17034129802980087269 b/js/src/ics/IC-17034129802980087269 new file mode 100644 index 0000000000000..41570c33d3251 --- /dev/null +++ b/js/src/ics/IC-17034129802980087269 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardBooleanToInt32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int16) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17049830041849044806 b/js/src/ics/IC-17049830041849044806 new file mode 100644 index 0000000000000..cffac7e9bdda2 --- /dev/null +++ b/js/src/ics/IC-17049830041849044806 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToBoolean) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Uint16) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17054177827044753950 b/js/src/ics/IC-17054177827044753950 new file mode 100644 index 0000000000000..b58fa357639f5 --- /dev/null +++ b/js/src/ics/IC-17054177827044753950 @@ -0,0 +1 @@ +GetElem, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(1) , OP(GuardToObject) ID(0) OP(GuardIsUndefined) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadFixedSlotResult) ID(0) OFFSET(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17072361331064894952 b/js/src/ics/IC-17072361331064894952 new file mode 100644 index 0000000000000..937c99cecb8d4 --- /dev/null +++ b/js/src/ics/IC-17072361331064894952 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Float32) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1707959048926965928 b/js/src/ics/IC-1707959048926965928 new file mode 100644 index 0000000000000..50d2593f78ac8 --- /dev/null +++ b/js/src/ics/IC-1707959048926965928 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(5) LASTUSED(5) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(3) OFFSET(1) ID(0) OP(GuardShape) ID(3) OFFSET(2) OP(StoreDenseElementHole) ID(0) ID(1) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17094936275664989501 b/js/src/ics/IC-17094936275664989501 new file mode 100644 index 0000000000000..d37612f400126 --- /dev/null +++ b/js/src/ics/IC-17094936275664989501 @@ -0,0 +1 @@ +Call, 1, 6, 16, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(14) LASTUSED(14) LASTUSED(4) LASTUSED(7) LASTUSED(14) LASTUSED(12) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardObjectIdentity) ID(3) ID(1) OP(LoadBoundFunctionTarget) ID(1) ID(4) OP(GuardSpecificFunction) ID(4) OFFSET(0) OFFSET(1) OP(GuardShape) ID(4) OFFSET(2) OP(LoadObject) ID(5) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(4) ID(5) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallBoundScriptedFunction) ID(1) ID(4) ID(0) CALLFLAGS(97) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1710672456797280749 b/js/src/ics/IC-1710672456797280749 new file mode 100644 index 0000000000000..99ef1b12df70b --- /dev/null +++ b/js/src/ics/IC-1710672456797280749 @@ -0,0 +1 @@ +Compare, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(CompareInt32Result) JSOP(Ge) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17124708235541468188 b/js/src/ics/IC-17124708235541468188 new file mode 100644 index 0000000000000..b2aeda195d5ea --- /dev/null +++ b/js/src/ics/IC-17124708235541468188 @@ -0,0 +1 @@ +SetElem, 3, 3, 6, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(AddAndStoreDynamicSlot) ID(0) OFFSET(2) ID(2) OFFSET(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17133745156678627147 b/js/src/ics/IC-17133745156678627147 new file mode 100644 index 0000000000000..a88b873098afe --- /dev/null +++ b/js/src/ics/IC-17133745156678627147 @@ -0,0 +1 @@ +GetElem, 2, 3, 11, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(9) LASTUSED(9) LASTUSED(8) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardClass) ID(0) GUARDCLASSKIND(PlainObject) OP(GuardIndexIsNotDenseElement) ID(0) ID(1) OP(GuardInt32IsNonNegative) ID(1) OP(GuardProto) ID(0) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(GuardNoDenseElements) ID(2) OP(CallGetSparseElementResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17137945674274924239 b/js/src/ics/IC-17137945674274924239 new file mode 100644 index 0000000000000..34feef1683a19 --- /dev/null +++ b/js/src/ics/IC-17137945674274924239 @@ -0,0 +1 @@ +GetProp, 1, 1, 3, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Id) , LASTUSED(1) , OP(GuardToObject) ID(0) OP(MegamorphicLoadSlotResult) ID(0) OFFSET(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17139371222773197350 b/js/src/ics/IC-17139371222773197350 new file mode 100644 index 0000000000000..963114898d062 --- /dev/null +++ b/js/src/ics/IC-17139371222773197350 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFRoundNumberResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17140783973773984614 b/js/src/ics/IC-17140783973773984614 new file mode 100644 index 0000000000000..647bea77ebf37 --- /dev/null +++ b/js/src/ics/IC-17140783973773984614 @@ -0,0 +1 @@ +SetProp, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Id) , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardIsNotDOMProxy) ID(0) OP(ProxySet) ID(0) OFFSET(0) ID(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17143168296190575955 b/js/src/ics/IC-17143168296190575955 new file mode 100644 index 0000000000000..224bc15ac47a2 --- /dev/null +++ b/js/src/ics/IC-17143168296190575955 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(WeakMap) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(WeakMapGetObjectResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17143656987586251558 b/js/src/ics/IC-17143656987586251558 new file mode 100644 index 0000000000000..1776c8a536873 --- /dev/null +++ b/js/src/ics/IC-17143656987586251558 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(PackedArrayShiftResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17157214466461301985 b/js/src/ics/IC-17157214466461301985 new file mode 100644 index 0000000000000..b248d6b8e6a91 --- /dev/null +++ b/js/src/ics/IC-17157214466461301985 @@ -0,0 +1 @@ +Call, 1, 8, 14, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(12) LASTUSED(8) LASTUSED(12) LASTUSED(10) LASTUSED(12) LASTUSED(12) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(LoadBooleanConstant) BOOL(0) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Uint8) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1718347208533669718 b/js/src/ics/IC-1718347208533669718 new file mode 100644 index 0000000000000..5a05b509cfcef --- /dev/null +++ b/js/src/ics/IC-1718347208533669718 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(5) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(3) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(FixedLengthArrayBuffer) OP(LoadArgumentFixedSlot) ID(4) BYTE(2) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(NewTypedArrayFromArrayBufferResult) OFFSET(4) ID(3) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17194952183924216031 b/js/src/ics/IC-17194952183924216031 new file mode 100644 index 0000000000000..c4a61c53f3974 --- /dev/null +++ b/js/src/ics/IC-17194952183924216031 @@ -0,0 +1 @@ +Call, 1, 3, 9, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(DateFillLocalTimeSlots) ID(2) OP(LoadFixedSlotResult) ID(2) OFFSET(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17200512045638306662 b/js/src/ics/IC-17200512045638306662 new file mode 100644 index 0000000000000..8dc8fbd556035 --- /dev/null +++ b/js/src/ics/IC-17200512045638306662 @@ -0,0 +1 @@ +BinaryArith, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToString) ID(0) OP(GuardStringToNumber) ID(0) ID(2) OP(TruncateDoubleToUInt32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32RightShiftResult) ID(3) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17202574952621097581 b/js/src/ics/IC-17202574952621097581 new file mode 100644 index 0000000000000..a50eb5cef5ae7 --- /dev/null +++ b/js/src/ics/IC-17202574952621097581 @@ -0,0 +1 @@ +GetElem, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadDynamicSlotResult) ID(0) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17206702365849189612 b/js/src/ics/IC-17206702365849189612 new file mode 100644 index 0000000000000..e626d63f82293 --- /dev/null +++ b/js/src/ics/IC-17206702365849189612 @@ -0,0 +1 @@ +GetElem, 2, 3, 8, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardObjectFuseProperty) ID(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(1) OP(CallNativeGetterResult) ID(0) OFFSET(8) BOOL(1) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17218157902369351333 b/js/src/ics/IC-17218157902369351333 new file mode 100644 index 0000000000000..e504d0354b82f --- /dev/null +++ b/js/src/ics/IC-17218157902369351333 @@ -0,0 +1 @@ +UnaryArith, 1, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(2) LASTUSED(3) , OP(GuardToBigInt) ID(0) OP(BigIntToIntPtr) ID(0) ID(1) OP(BigIntPtrDec) ID(1) ID(2) OP(IntPtrToBigIntResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17219233629473999621 b/js/src/ics/IC-17219233629473999621 new file mode 100644 index 0000000000000..aea2e4a6d28db --- /dev/null +++ b/js/src/ics/IC-17219233629473999621 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(SinNative) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17223794167792224979 b/js/src/ics/IC-17223794167792224979 new file mode 100644 index 0000000000000..6b0edd06ea8c4 --- /dev/null +++ b/js/src/ics/IC-17223794167792224979 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(TruncateDoubleToUInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32BitAndResult) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17243291150669084667 b/js/src/ics/IC-17243291150669084667 new file mode 100644 index 0000000000000..f7bb30269e7ae --- /dev/null +++ b/js/src/ics/IC-17243291150669084667 @@ -0,0 +1 @@ +Call, 1, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(3) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(StoreFixedSlotUndefinedResult) ID(1) OFFSET(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17245147196178324728 b/js/src/ics/IC-17245147196178324728 new file mode 100644 index 0000000000000..68842fedf8e1f --- /dev/null +++ b/js/src/ics/IC-17245147196178324728 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17250028833087076103 b/js/src/ics/IC-17250028833087076103 new file mode 100644 index 0000000000000..e679d1381b4a4 --- /dev/null +++ b/js/src/ics/IC-17250028833087076103 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToSymbol) ID(0) OP(GuardToSymbol) ID(1) OP(CompareSymbolResult) JSOP(Ne) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17283064744871819413 b/js/src/ics/IC-17283064744871819413 new file mode 100644 index 0000000000000..1325fba84731f --- /dev/null +++ b/js/src/ics/IC-17283064744871819413 @@ -0,0 +1 @@ +Call, 1, 5, 11, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(9) LASTUSED(9) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardArrayIsPacked) ID(2) OP(LoadInt32Constant) OFFSET(3) ID(3) OP(LoadInt32ArrayLength) ID(2) ID(4) OP(PackedArraySliceResult) OFFSET(4) ID(2) ID(3) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17287232743506522707 b/js/src/ics/IC-17287232743506522707 new file mode 100644 index 0000000000000..f12bae2aa5f9e --- /dev/null +++ b/js/src/ics/IC-17287232743506522707 @@ -0,0 +1 @@ +SetElem, 3, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(ProxySetByValue) ID(0) ID(1) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17303372224456508774 b/js/src/ics/IC-17303372224456508774 new file mode 100644 index 0000000000000..d22ac95f6c0f3 --- /dev/null +++ b/js/src/ics/IC-17303372224456508774 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardIsNumber) ID(2) OP(GuardIsNumber) ID(3) OP(CompareDoubleSameValueResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17311424909765776333 b/js/src/ics/IC-17311424909765776333 new file mode 100644 index 0000000000000..c0c26c0c3882a --- /dev/null +++ b/js/src/ics/IC-17311424909765776333 @@ -0,0 +1 @@ +GetProp, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(Id) , LASTUSED(10) LASTUSED(10) LASTUSED(10) LASTUSED(10) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadScriptedProxyHandler) ID(1) ID(0) OP(LoadWrapperTarget) ID(0) ID(2) BOOL(1) OP(GuardIsNativeObject) ID(2) OP(GuardShape) ID(1) OFFSET(1) OP(LoadFixedSlot) ID(3) ID(1) OFFSET(2) OP(GuardToObject) ID(3) OP(GuardSpecificFunction) ID(3) OFFSET(3) OFFSET(4) OP(CallScriptedProxyGetResult) ID(2) ID(0) ID(1) ID(3) OFFSET(5) UINT32(199456) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1731653344172329244 b/js/src/ics/IC-1731653344172329244 new file mode 100644 index 0000000000000..1d32858645492 --- /dev/null +++ b/js/src/ics/IC-1731653344172329244 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(GuardIsNotProxy) ID(1) OP(GuardIsNonResizableTypedArray) ID(1) OP(LoadArrayBufferViewLengthInt32Result) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17341274183022673861 b/js/src/ics/IC-17341274183022673861 new file mode 100644 index 0000000000000..c362958c82f05 --- /dev/null +++ b/js/src/ics/IC-17341274183022673861 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToInt32) ID(2) OP(MathClz32Result) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17369591371278226621 b/js/src/ics/IC-17369591371278226621 new file mode 100644 index 0000000000000..add2e9df78f7b --- /dev/null +++ b/js/src/ics/IC-17369591371278226621 @@ -0,0 +1 @@ +GetElem, 2, 2, 8, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(Symbol) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(5) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(0) OFFSET(1) OP(GuardObjectFuseProperty) ID(0) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(0) OFFSET(7) OFFSET(8) OP(UncheckedLoadWeakObjectResult) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17377678630321335324 b/js/src/ics/IC-17377678630321335324 new file mode 100644 index 0000000000000..68730c6effec9 --- /dev/null +++ b/js/src/ics/IC-17377678630321335324 @@ -0,0 +1 @@ +Call, 1, 1, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) , OP(GuardFuse) REALMFUSE(14) OP(LoadBooleanResult) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17402807312835872528 b/js/src/ics/IC-17402807312835872528 new file mode 100644 index 0000000000000..cb23ef48038c1 --- /dev/null +++ b/js/src/ics/IC-17402807312835872528 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasNoJitEntry) ID(1) OP(GuardFunctionIsConstructor) ID(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(34) UINT32(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17404785894496485648 b/js/src/ics/IC-17404785894496485648 new file mode 100644 index 0000000000000..cd708991a29a1 --- /dev/null +++ b/js/src/ics/IC-17404785894496485648 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNumber) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float16) ID(3) ID(2) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17409096388200987766 b/js/src/ics/IC-17409096388200987766 new file mode 100644 index 0000000000000..419fe2f49c5fa --- /dev/null +++ b/js/src/ics/IC-17409096388200987766 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToInt32) ID(2) OP(AtomicsIsLockFreeResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17421839695520615129 b/js/src/ics/IC-17421839695520615129 new file mode 100644 index 0000000000000..5a90f2e68ffa9 --- /dev/null +++ b/js/src/ics/IC-17421839695520615129 @@ -0,0 +1 @@ +SetProp, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(CallSetArrayLength) ID(0) BOOL(1) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1742917343698058941 b/js/src/ics/IC-1742917343698058941 new file mode 100644 index 0000000000000..32489d4960d9c --- /dev/null +++ b/js/src/ics/IC-1742917343698058941 @@ -0,0 +1 @@ +BindName, 1, 1, 2, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) , OP(LoadObjectResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17431225583265888174 b/js/src/ics/IC-17431225583265888174 new file mode 100644 index 0000000000000..847f9751e451a --- /dev/null +++ b/js/src/ics/IC-17431225583265888174 @@ -0,0 +1 @@ +Call, 1, 5, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToInt32) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32MinMax) BOOL(0) ID(2) ID(3) ID(4) OP(LoadInt32Result) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17433811116324676658 b/js/src/ics/IC-17433811116324676658 new file mode 100644 index 0000000000000..be0832ee101df --- /dev/null +++ b/js/src/ics/IC-17433811116324676658 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasNoJitEntry) ID(1) OP(GuardFunctionIsConstructor) ID(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(33) UINT32(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17435886047030795391 b/js/src/ics/IC-17435886047030795391 new file mode 100644 index 0000000000000..a5e393ef31467 --- /dev/null +++ b/js/src/ics/IC-17435886047030795391 @@ -0,0 +1 @@ +GetElem, 2, 2, 8, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(String) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(5) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(0) OFFSET(1) OP(GuardObjectFuseProperty) ID(0) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(0) OFFSET(7) OFFSET(8) OP(UncheckedLoadWeakObjectResult) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17461554138527416107 b/js/src/ics/IC-17461554138527416107 new file mode 100644 index 0000000000000..93de239ee3ef3 --- /dev/null +++ b/js/src/ics/IC-17461554138527416107 @@ -0,0 +1 @@ +GetName, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(2) LASTUSED(4) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(LoadFixedSlot) ID(2) ID(1) OFFSET(1) OP(GuardIsNotUninitializedLexical) ID(2) OP(LoadOperandResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17465787569802424915 b/js/src/ics/IC-17465787569802424915 new file mode 100644 index 0000000000000..28ad05eb40fb6 --- /dev/null +++ b/js/src/ics/IC-17465787569802424915 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint32) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17478019032397489303 b/js/src/ics/IC-17478019032397489303 new file mode 100644 index 0000000000000..d3ff631e1040f --- /dev/null +++ b/js/src/ics/IC-17478019032397489303 @@ -0,0 +1 @@ +GetElem, 2, 5, 11, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(Value) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(7) LASTUSED(1) LASTUSED(4) LASTUSED(6) LASTUSED(8) , OP(GuardToObject) ID(0) OP(GuardSpecificValue) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(0) OP(GuardShape) ID(2) OFFSET(3) OP(LoadProtoObject) ID(3) OFFSET(4) ID(0) OP(GuardShape) ID(3) OFFSET(5) OP(LoadProtoObject) ID(4) OFFSET(6) ID(0) OP(GuardShape) ID(4) OFFSET(7) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17500653588999119138 b/js/src/ics/IC-17500653588999119138 new file mode 100644 index 0000000000000..721fccf2c2112 --- /dev/null +++ b/js/src/ics/IC-17500653588999119138 @@ -0,0 +1 @@ +In, 2, 5, 12, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(10) LASTUSED(10) LASTUSED(6) LASTUSED(9) , OP(GuardToObject) ID(1) OP(GuardToString) ID(0) OP(GuardStringToIndex) ID(0) ID(2) OP(GuardShape) ID(1) OFFSET(0) OP(LoadObject) ID(3) OFFSET(1) OP(GuardShape) ID(3) OFFSET(2) OP(GuardNoDenseElements) ID(3) OP(LoadObject) ID(4) OFFSET(3) OP(GuardShape) ID(4) OFFSET(4) OP(GuardNoDenseElements) ID(4) OP(LoadDenseElementHoleExistsResult) ID(1) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17523830714429615508 b/js/src/ics/IC-17523830714429615508 new file mode 100644 index 0000000000000..fb5635a99402a --- /dev/null +++ b/js/src/ics/IC-17523830714429615508 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToString) ID(0) OP(GuardToString) ID(1) OP(CompareStringResult) JSOP(Lt) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17538293816173927979 b/js/src/ics/IC-17538293816173927979 new file mode 100644 index 0000000000000..7ded805714ce7 --- /dev/null +++ b/js/src/ics/IC-17538293816173927979 @@ -0,0 +1 @@ +Call, 1, 8, 17, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(6) LASTUSED(4) LASTUSED(7) LASTUSED(9) LASTUSED(15) LASTUSED(15) LASTUSED(15) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(LoadFixedSlot) ID(4) ID(1) OFFSET(0) OP(GuardSpecificFunction) ID(3) OFFSET(1) OFFSET(2) OP(GuardToObject) ID(4) OP(GuardSpecificFunction) ID(4) OFFSET(3) OFFSET(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(2) OP(GuardToObject) ID(5) OP(GuardClass) ID(5) GUARDCLASSKIND(Map) OP(LoadArgumentFixedSlot) ID(6) BYTE(1) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(MapSetResult) ID(5) ID(6) ID(7) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17553867699806252475 b/js/src/ics/IC-17553867699806252475 new file mode 100644 index 0000000000000..023cb0f7fa929 --- /dev/null +++ b/js/src/ics/IC-17553867699806252475 @@ -0,0 +1 @@ +GetElemSuper, 3, 5, 10, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(2) LASTUSED(0) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(0) OP(GuardShape) ID(3) OFFSET(3) OP(LoadProtoObject) ID(4) OFFSET(4) ID(0) OP(GuardShape) ID(4) OFFSET(5) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17565183669852008737 b/js/src/ics/IC-17565183669852008737 new file mode 100644 index 0000000000000..ead346cab32c7 --- /dev/null +++ b/js/src/ics/IC-17565183669852008737 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint8) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1757527689596980995 b/js/src/ics/IC-1757527689596980995 new file mode 100644 index 0000000000000..eedad3d027e93 --- /dev/null +++ b/js/src/ics/IC-1757527689596980995 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToBoolean) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(BigInt64) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17604194641356900798 b/js/src/ics/IC-17604194641356900798 new file mode 100644 index 0000000000000..938482a691cf8 --- /dev/null +++ b/js/src/ics/IC-17604194641356900798 @@ -0,0 +1 @@ +Call, 1, 4, 14, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(12) LASTUSED(2) LASTUSED(12) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(Array) OP(GuardArrayIsPacked) ID(3) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardNotClassConstructor) ID(2) OP(GuardFunctionHasNoJitEntry) ID(2) OP(CallNativeFunction) ID(2) ID(0) CALLFLAGS(5) UINT32(5) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17609203402393407740 b/js/src/ics/IC-17609203402393407740 new file mode 100644 index 0000000000000..de8e6e20686cb --- /dev/null +++ b/js/src/ics/IC-17609203402393407740 @@ -0,0 +1 @@ +GetProp, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardShape) ID(1) OFFSET(2) OP(LoadFixedSlotResult) ID(1) OFFSET(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17619171276207721564 b/js/src/ics/IC-17619171276207721564 new file mode 100644 index 0000000000000..d8c0ce44c908e --- /dev/null +++ b/js/src/ics/IC-17619171276207721564 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToInt32) ID(2) OP(MathAbsInt32Result) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17619594449876844546 b/js/src/ics/IC-17619594449876844546 new file mode 100644 index 0000000000000..8fc89a191b96f --- /dev/null +++ b/js/src/ics/IC-17619594449876844546 @@ -0,0 +1 @@ +GetElem, 2, 4, 9, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(Value) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(1) LASTUSED(4) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardSpecificValue) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(0) OP(GuardShape) ID(2) OFFSET(3) OP(LoadProtoObject) ID(3) OFFSET(4) ID(0) OP(GuardShape) ID(3) OFFSET(5) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17647621666440692093 b/js/src/ics/IC-17647621666440692093 new file mode 100644 index 0000000000000..ae3ad52e08bc7 --- /dev/null +++ b/js/src/ics/IC-17647621666440692093 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(WeakSetHasObjectResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1765703006862995331 b/js/src/ics/IC-1765703006862995331 new file mode 100644 index 0000000000000..96589cead916f --- /dev/null +++ b/js/src/ics/IC-1765703006862995331 @@ -0,0 +1 @@ +GetElem, 2, 4, 9, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(Symbol) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(6) , OP(GuardIsNumber) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(2) OP(GuardShape) ID(3) OFFSET(4) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17694320777855220627 b/js/src/ics/IC-17694320777855220627 new file mode 100644 index 0000000000000..060efdfb8a471 --- /dev/null +++ b/js/src/ics/IC-17694320777855220627 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToBigInt) ID(0) OP(GuardToBigInt) ID(1) OP(CompareBigIntResult) JSOP(Eq) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17700930231562942520 b/js/src/ics/IC-17700930231562942520 new file mode 100644 index 0000000000000..14dc0211d8a5a --- /dev/null +++ b/js/src/ics/IC-17700930231562942520 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathAbsNumberResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17708013622254109918 b/js/src/ics/IC-17708013622254109918 new file mode 100644 index 0000000000000..6dfa115a79b72 --- /dev/null +++ b/js/src/ics/IC-17708013622254109918 @@ -0,0 +1 @@ +GetElem, 2, 3, 8, JSVAL_TYPE_UNKNOWN, 72, STUBFIELD(Symbol) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(0) OFFSET(1) OP(GuardObjectFuseProperty) ID(0) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(LoadObject) ID(2) OFFSET(7) OP(CallScriptedGetterResult) ID(0) ID(2) BOOL(1) OFFSET(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17728547256082126010 b/js/src/ics/IC-17728547256082126010 new file mode 100644 index 0000000000000..a06580bb4481e --- /dev/null +++ b/js/src/ics/IC-17728547256082126010 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(3) , OP(GuardToString) ID(0) OP(GuardStringToNumber) ID(0) ID(2) OP(GuardIsNumber) ID(1) OP(CompareDoubleResult) JSOP(Ne) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17740269958270359325 b/js/src/ics/IC-17740269958270359325 new file mode 100644 index 0000000000000..03ee405d46914 --- /dev/null +++ b/js/src/ics/IC-17740269958270359325 @@ -0,0 +1 @@ +BinaryArith, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(4) LASTUSED(2) LASTUSED(3) LASTUSED(4) , OP(GuardToInt32) ID(0) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(2) OP(TruncateDoubleToUInt32) ID(2) ID(3) OP(Int32BitXorResult) ID(0) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17757130859605688788 b/js/src/ics/IC-17757130859605688788 new file mode 100644 index 0000000000000..6356582204a23 --- /dev/null +++ b/js/src/ics/IC-17757130859605688788 @@ -0,0 +1 @@ +GetElem, 2, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(2) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(0) OP(GuardShape) ID(2) OFFSET(3) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17772381250193455234 b/js/src/ics/IC-17772381250193455234 new file mode 100644 index 0000000000000..c09bba5360a06 --- /dev/null +++ b/js/src/ics/IC-17772381250193455234 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint8) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17809225714392331196 b/js/src/ics/IC-17809225714392331196 new file mode 100644 index 0000000000000..e8f110624b658 --- /dev/null +++ b/js/src/ics/IC-17809225714392331196 @@ -0,0 +1 @@ +HasOwn, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Value) STUBFIELD(WeakShape) , LASTUSED(1) LASTUSED(2) , OP(GuardToObject) ID(1) OP(GuardSpecificValue) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17829093428407408025 b/js/src/ics/IC-17829093428407408025 new file mode 100644 index 0000000000000..275ed47fb245a --- /dev/null +++ b/js/src/ics/IC-17829093428407408025 @@ -0,0 +1 @@ +GetProp, 1, 2, 8, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(7) OP(RegExpFlagResult) ID(0) INT32(32) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17836645186823502871 b/js/src/ics/IC-17836645186823502871 new file mode 100644 index 0000000000000..cba33416936fa --- /dev/null +++ b/js/src/ics/IC-17836645186823502871 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Uint16) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17872027683831176768 b/js/src/ics/IC-17872027683831176768 new file mode 100644 index 0000000000000..d46e3b2b4869e --- /dev/null +++ b/js/src/ics/IC-17872027683831176768 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(MapHasObjectResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17882229252473860350 b/js/src/ics/IC-17882229252473860350 new file mode 100644 index 0000000000000..0418138529691 --- /dev/null +++ b/js/src/ics/IC-17882229252473860350 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32BitAndResult) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17904590481600338695 b/js/src/ics/IC-17904590481600338695 new file mode 100644 index 0000000000000..90a1faf2d5866 --- /dev/null +++ b/js/src/ics/IC-17904590481600338695 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Int8) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17915188919478386689 b/js/src/ics/IC-17915188919478386689 new file mode 100644 index 0000000000000..2f40ab0f503fe --- /dev/null +++ b/js/src/ics/IC-17915188919478386689 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToString) ID(3) OP(SetHasStringResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17916278593513441896 b/js/src/ics/IC-17916278593513441896 new file mode 100644 index 0000000000000..e854901dac732 --- /dev/null +++ b/js/src/ics/IC-17916278593513441896 @@ -0,0 +1 @@ +GetProp, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 72, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(3) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(LoadObject) ID(2) OFFSET(7) OP(CallScriptedGetterResult) ID(0) ID(2) BOOL(1) OFFSET(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17919747057367750288 b/js/src/ics/IC-17919747057367750288 new file mode 100644 index 0000000000000..f6f92997c3a12 --- /dev/null +++ b/js/src/ics/IC-17919747057367750288 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17921446924779061187 b/js/src/ics/IC-17921446924779061187 new file mode 100644 index 0000000000000..d37280f636ea5 --- /dev/null +++ b/js/src/ics/IC-17921446924779061187 @@ -0,0 +1 @@ +GetProp, 1, 1, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(1) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17977958804376690512 b/js/src/ics/IC-17977958804376690512 new file mode 100644 index 0000000000000..a1a024d0c98d3 --- /dev/null +++ b/js/src/ics/IC-17977958804376690512 @@ -0,0 +1 @@ +HasOwn, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(String) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(3) , OP(GuardToObject) ID(1) OP(GuardToString) ID(0) OP(GuardSpecificAtom) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17991001654696064903 b/js/src/ics/IC-17991001654696064903 new file mode 100644 index 0000000000000..9bb1fb96d52a3 --- /dev/null +++ b/js/src/ics/IC-17991001654696064903 @@ -0,0 +1 @@ +GetProp, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardFixedSlotValue) ID(0) OFFSET(1) OFFSET(2) OP(LoadObject) ID(1) OFFSET(3) OP(CallScriptedGetterResult) ID(0) ID(1) BOOL(1) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-17996793111526515057 b/js/src/ics/IC-17996793111526515057 new file mode 100644 index 0000000000000..fe7e57268e06f --- /dev/null +++ b/js/src/ics/IC-17996793111526515057 @@ -0,0 +1 @@ +SetElem, 3, 6, 12, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(10) LASTUSED(2) LASTUSED(10) LASTUSED(5) LASTUSED(7) LASTUSED(9) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(0) OP(GuardShape) ID(3) OFFSET(3) OP(LoadProtoObject) ID(4) OFFSET(4) ID(0) OP(GuardShape) ID(4) OFFSET(5) OP(LoadProtoObject) ID(5) OFFSET(6) ID(0) OP(GuardShape) ID(5) OFFSET(7) OP(AddAndStoreFixedSlot) ID(0) OFFSET(8) ID(2) OFFSET(9) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18024960594532879479 b/js/src/ics/IC-18024960594532879479 new file mode 100644 index 0000000000000..44ea6d4808aaf --- /dev/null +++ b/js/src/ics/IC-18024960594532879479 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(Exp) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18026600390025347800 b/js/src/ics/IC-18026600390025347800 new file mode 100644 index 0000000000000..5ecfcfd3b5b51 --- /dev/null +++ b/js/src/ics/IC-18026600390025347800 @@ -0,0 +1 @@ +GetElem, 2, 6, 13, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(11) LASTUSED(10) LASTUSED(11) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadScriptedProxyHandler) ID(2) ID(0) OP(LoadWrapperTarget) ID(0) ID(3) BOOL(1) OP(GuardIsNativeObject) ID(3) OP(GuardShape) ID(2) OFFSET(1) OP(LoadFixedSlot) ID(4) ID(2) OFFSET(2) OP(GuardToObject) ID(4) OP(GuardSpecificFunction) ID(4) OFFSET(3) OFFSET(4) OP(IdToStringOrSymbol) ID(5) ID(1) OP(CallScriptedProxyGetByValueResult) ID(3) ID(0) ID(2) ID(5) ID(4) UINT32(133920) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18027735950718257946 b/js/src/ics/IC-18027735950718257946 new file mode 100644 index 0000000000000..92f8f4ec7c71f --- /dev/null +++ b/js/src/ics/IC-18027735950718257946 @@ -0,0 +1 @@ +GetElemSuper, 3, 4, 8, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(GuardFixedSlotValue) ID(0) OFFSET(2) OFFSET(3) OP(LoadObject) ID(3) OFFSET(4) OP(CallScriptedGetterResult) ID(2) ID(3) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18045588146049567594 b/js/src/ics/IC-18045588146049567594 new file mode 100644 index 0000000000000..a5be0d2ce55c5 --- /dev/null +++ b/js/src/ics/IC-18045588146049567594 @@ -0,0 +1 @@ +OptimizeGetIterator, 1, 1, 2, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) , OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18061435983453055086 b/js/src/ics/IC-18061435983453055086 new file mode 100644 index 0000000000000..a98bc742577c4 --- /dev/null +++ b/js/src/ics/IC-18061435983453055086 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToString) ID(0) OP(GuardToString) ID(1) OP(CompareStringResult) JSOP(Le) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18063391690975188185 b/js/src/ics/IC-18063391690975188185 new file mode 100644 index 0000000000000..1b95fe991a972 --- /dev/null +++ b/js/src/ics/IC-18063391690975188185 @@ -0,0 +1 @@ +UnaryArith, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(2) , OP(GuardToString) ID(0) OP(GuardStringToNumber) ID(0) ID(1) OP(LoadDoubleResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18082601175560036483 b/js/src/ics/IC-18082601175560036483 new file mode 100644 index 0000000000000..fa62e8f5a88e2 --- /dev/null +++ b/js/src/ics/IC-18082601175560036483 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(10) LASTUSED(2) LASTUSED(10) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(UnmappedArguments) OP(GuardArgumentsObjectFlags) ID(3) BYTE(20) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(68) UINT32(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18083887163005789614 b/js/src/ics/IC-18083887163005789614 new file mode 100644 index 0000000000000..7e3e3a245617b --- /dev/null +++ b/js/src/ics/IC-18083887163005789614 @@ -0,0 +1 @@ +CloseIter, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(5) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadDynamicSlot) ID(1) ID(0) OFFSET(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(2) OFFSET(3) OP(CloseIterScriptedResult) ID(0) ID(1) COMPLETIONKIND(Throw) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1812428509537670571 b/js/src/ics/IC-1812428509537670571 new file mode 100644 index 0000000000000..5cd8e47b07b4f --- /dev/null +++ b/js/src/ics/IC-1812428509537670571 @@ -0,0 +1 @@ +GetName, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(3) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadFixedSlot) ID(1) ID(0) OFFSET(1) OP(GuardIsNotUninitializedLexical) ID(1) OP(LoadOperandResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18138572930094200708 b/js/src/ics/IC-18138572930094200708 new file mode 100644 index 0000000000000..09bf738071df4 --- /dev/null +++ b/js/src/ics/IC-18138572930094200708 @@ -0,0 +1 @@ +Call, 1, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(IsCallableResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18150499382853049364 b/js/src/ics/IC-18150499382853049364 new file mode 100644 index 0000000000000..5e7bfae16d6dc --- /dev/null +++ b/js/src/ics/IC-18150499382853049364 @@ -0,0 +1 @@ +SetProp, 2, 4, 8, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(6) LASTUSED(6) LASTUSED(3) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(2) OFFSET(1) ID(0) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(0) OP(GuardShape) ID(3) OFFSET(4) OP(AddAndStoreDynamicSlot) ID(0) OFFSET(5) ID(1) OFFSET(6) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18163004627835258171 b/js/src/ics/IC-18163004627835258171 new file mode 100644 index 0000000000000..b2d634ffb91d8 --- /dev/null +++ b/js/src/ics/IC-18163004627835258171 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(10) LASTUSED(10) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(2) ID(3) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(33) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18163352791804677298 b/js/src/ics/IC-18163352791804677298 new file mode 100644 index 0000000000000..99cecd68c6c9b --- /dev/null +++ b/js/src/ics/IC-18163352791804677298 @@ -0,0 +1 @@ +GetProp, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardShape) ID(1) OFFSET(2) OP(LoadDynamicSlotResult) ID(1) OFFSET(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18168596951306988086 b/js/src/ics/IC-18168596951306988086 new file mode 100644 index 0000000000000..6299359a92a60 --- /dev/null +++ b/js/src/ics/IC-18168596951306988086 @@ -0,0 +1 @@ +GetElem, 2, 5, 12, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(8) LASTUSED(2) LASTUSED(5) LASTUSED(7) LASTUSED(9) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(0) OP(GuardShape) ID(2) OFFSET(3) OP(LoadProtoObject) ID(3) OFFSET(4) ID(0) OP(GuardShape) ID(3) OFFSET(5) OP(LoadProtoObject) ID(4) OFFSET(6) ID(0) OP(GuardShape) ID(4) OFFSET(7) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18177577239575973132 b/js/src/ics/IC-18177577239575973132 new file mode 100644 index 0000000000000..7ee681634b0d9 --- /dev/null +++ b/js/src/ics/IC-18177577239575973132 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(GuardToSymbol) ID(0) OP(GuardIsNumber) ID(1) OP(LoadBooleanResult) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18203033874725942972 b/js/src/ics/IC-18203033874725942972 new file mode 100644 index 0000000000000..2b06a6110b641 --- /dev/null +++ b/js/src/ics/IC-18203033874725942972 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(9) LASTUSED(9) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(2) ID(3) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(97) UINT32(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18205290136643812152 b/js/src/ics/IC-18205290136643812152 new file mode 100644 index 0000000000000..f92137f68a6f0 --- /dev/null +++ b/js/src/ics/IC-18205290136643812152 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(ASin) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18215232378759789035 b/js/src/ics/IC-18215232378759789035 new file mode 100644 index 0000000000000..f3f7594345047 --- /dev/null +++ b/js/src/ics/IC-18215232378759789035 @@ -0,0 +1 @@ +GetName, 1, 5, 9, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(3) LASTUSED(4) LASTUSED(7) LASTUSED(7) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(1) OP(LoadDynamicSlot) ID(2) ID(1) OFFSET(2) OP(LoadGetterSetterFunction) ID(2) BOOL(1) BOOL(0) ID(3) OP(GuardFunctionScript) ID(3) OFFSET(3) OFFSET(4) OP(LoadObject) ID(4) OFFSET(5) OP(CallScriptedGetterResult) ID(4) ID(3) BOOL(1) OFFSET(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18230162535045614918 b/js/src/ics/IC-18230162535045614918 new file mode 100644 index 0000000000000..22548cc9cebe8 --- /dev/null +++ b/js/src/ics/IC-18230162535045614918 @@ -0,0 +1 @@ +Call, 1, 9, 16, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) LASTUSED(10) LASTUSED(10) LASTUSED(13) LASTUSED(13) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(5) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToInt32) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32MinMax) BOOL(0) ID(2) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToInt32) ID(5) OP(Int32MinMax) BOOL(0) ID(4) ID(5) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToInt32) ID(7) OP(Int32MinMax) BOOL(0) ID(6) ID(7) ID(8) OP(LoadInt32Result) ID(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18233255133612278157 b/js/src/ics/IC-18233255133612278157 new file mode 100644 index 0000000000000..ca0ca415f777d --- /dev/null +++ b/js/src/ics/IC-18233255133612278157 @@ -0,0 +1 @@ +GetElem, 2, 4, 9, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(2) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadFixedSlot) ID(2) ID(0) OFFSET(2) OP(LoadGetterSetterFunction) ID(2) BOOL(1) BOOL(0) ID(3) OP(GuardFunctionScript) ID(3) OFFSET(3) OFFSET(4) OP(CallScriptedGetterResult) ID(0) ID(3) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18247437866360058214 b/js/src/ics/IC-18247437866360058214 new file mode 100644 index 0000000000000..9e31c3fa15405 --- /dev/null +++ b/js/src/ics/IC-18247437866360058214 @@ -0,0 +1 @@ +Call, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToString) ID(2) OP(GuardStringToNumber) ID(2) ID(3) OP(LoadDoubleResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18247511447866385793 b/js/src/ics/IC-18247511447866385793 new file mode 100644 index 0000000000000..3d62aaea903f4 --- /dev/null +++ b/js/src/ics/IC-18247511447866385793 @@ -0,0 +1 @@ +In, 2, 4, 11, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(9) LASTUSED(9) LASTUSED(5) LASTUSED(8) , OP(GuardToObject) ID(1) OP(GuardToInt32) ID(0) OP(GuardShape) ID(1) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(GuardNoDenseElements) ID(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardShape) ID(3) OFFSET(4) OP(GuardNoDenseElements) ID(3) OP(LoadDenseElementHoleExistsResult) ID(1) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18255000213765161667 b/js/src/ics/IC-18255000213765161667 new file mode 100644 index 0000000000000..aca95f790cfa0 --- /dev/null +++ b/js/src/ics/IC-18255000213765161667 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint8) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18260918275196662745 b/js/src/ics/IC-18260918275196662745 new file mode 100644 index 0000000000000..4b4ab0dd5e619 --- /dev/null +++ b/js/src/ics/IC-18260918275196662745 @@ -0,0 +1 @@ +GetElem, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(String) STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18269332780259816901 b/js/src/ics/IC-18269332780259816901 new file mode 100644 index 0000000000000..9c62faa6ead37 --- /dev/null +++ b/js/src/ics/IC-18269332780259816901 @@ -0,0 +1 @@ +CloseIter, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadDynamicSlot) ID(1) ID(0) OFFSET(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(2) OFFSET(3) OP(CloseIterScriptedResult) ID(0) ID(1) COMPLETIONKIND(Throw) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18273421188824580010 b/js/src/ics/IC-18273421188824580010 new file mode 100644 index 0000000000000..38d3c9e04399d --- /dev/null +++ b/js/src/ics/IC-18273421188824580010 @@ -0,0 +1 @@ +UnaryArith, 1, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(GuardBooleanToInt32) ID(0) ID(1) OP(LoadInt32Result) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1829882015200888732 b/js/src/ics/IC-1829882015200888732 new file mode 100644 index 0000000000000..2af2134841a60 --- /dev/null +++ b/js/src/ics/IC-1829882015200888732 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Int32) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18300707677101983051 b/js/src/ics/IC-18300707677101983051 new file mode 100644 index 0000000000000..940fa07bd3385 --- /dev/null +++ b/js/src/ics/IC-18300707677101983051 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18364728046067680159 b/js/src/ics/IC-18364728046067680159 new file mode 100644 index 0000000000000..215a74ec74fe9 --- /dev/null +++ b/js/src/ics/IC-18364728046067680159 @@ -0,0 +1 @@ +CloseIter, 1, 3, 9, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(3) LASTUSED(7) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardShape) ID(1) OFFSET(2) OP(LoadDynamicSlot) ID(2) ID(1) OFFSET(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(2) OFFSET(4) OFFSET(5) OP(CloseIterScriptedResult) ID(0) ID(2) COMPLETIONKIND(Normal) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18383069888075440090 b/js/src/ics/IC-18383069888075440090 new file mode 100644 index 0000000000000..b3b51e541465e --- /dev/null +++ b/js/src/ics/IC-18383069888075440090 @@ -0,0 +1 @@ +OptimizeSpreadCall, 1, 1, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Shape) , LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardClass) ID(0) GUARDCLASSKIND(MappedArguments) OP(GuardArgumentsObjectFlags) ID(0) BYTE(23) OP(GuardObjectHasSameRealm) ID(0) OP(GuardFuse) REALMFUSE(1) OP(ArrayFromArgumentsObjectResult) ID(0) OFFSET(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18406681373742992801 b/js/src/ics/IC-18406681373742992801 new file mode 100644 index 0000000000000..e4c5b28c5ca04 --- /dev/null +++ b/js/src/ics/IC-18406681373742992801 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(9) LASTUSED(9) LASTUSED(4) LASTUSED(9) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasJitEntry) ID(3) OP(GuardNotClassConstructor) ID(3) OP(CallBoundScriptedFunction) ID(1) ID(3) ID(0) CALLFLAGS(1) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-18417415188337939512 b/js/src/ics/IC-18417415188337939512 new file mode 100644 index 0000000000000..af1ac0430defd --- /dev/null +++ b/js/src/ics/IC-18417415188337939512 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Double) STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardIsUndefined) ID(1) OP(LoadDoubleConstant) OFFSET(1) ID(3) OP(CompareDoubleResult) JSOP(Lt) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1874721558703988683 b/js/src/ics/IC-1874721558703988683 new file mode 100644 index 0000000000000..41c7e1eca6742 --- /dev/null +++ b/js/src/ics/IC-1874721558703988683 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(2) LASTUSED(3) , OP(GuardToInt32) ID(0) OP(GuardIsNumber) ID(1) OP(TruncateDoubleToUInt32) ID(1) ID(2) OP(Int32URightShiftResult) ID(0) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-187764657074712339 b/js/src/ics/IC-187764657074712339 new file mode 100644 index 0000000000000..a7db1f04e1289 --- /dev/null +++ b/js/src/ics/IC-187764657074712339 @@ -0,0 +1 @@ +Call, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(String) , LASTUSED(0) LASTUSED(2) LASTUSED(4) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNull) ID(2) OP(LoadConstantString) OFFSET(2) ID(3) OP(LoadStringResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-188624896502903694 b/js/src/ics/IC-188624896502903694 new file mode 100644 index 0000000000000..8204b8bdae911 --- /dev/null +++ b/js/src/ics/IC-188624896502903694 @@ -0,0 +1 @@ +BindName, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(5) LASTUSED(4) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(1) OP(LoadDynamicSlot) ID(2) ID(1) OFFSET(2) OP(GuardIsNotUninitializedLexical) ID(2) OP(LoadObjectResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1899740917641139130 b/js/src/ics/IC-1899740917641139130 new file mode 100644 index 0000000000000..8fd1eb6ef1256 --- /dev/null +++ b/js/src/ics/IC-1899740917641139130 @@ -0,0 +1 @@ +Call, 1, 7, 16, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(6) LASTUSED(4) LASTUSED(7) LASTUSED(9) LASTUSED(14) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(LoadFixedSlot) ID(4) ID(1) OFFSET(0) OP(GuardSpecificFunction) ID(3) OFFSET(1) OFFSET(2) OP(GuardToObject) ID(4) OP(GuardSpecificFunction) ID(4) OFFSET(3) OFFSET(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToObject) ID(5) OP(GuardClass) ID(5) GUARDCLASSKIND(Map) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(MapGetResult) ID(5) ID(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-191092073745633310 b/js/src/ics/IC-191092073745633310 new file mode 100644 index 0000000000000..707e822ad5cab --- /dev/null +++ b/js/src/ics/IC-191092073745633310 @@ -0,0 +1 @@ +Call, 1, 6, 14, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(12) LASTUSED(12) LASTUSED(12) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(MappedArguments) OP(GuardArgumentsObjectFlags) ID(3) BYTE(21) OP(LoadInt32Constant) OFFSET(4) ID(4) OP(LoadArgumentsObjectLength) ID(3) ID(5) OP(ArgumentsSliceResult) OFFSET(5) ID(3) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1911222769264596611 b/js/src/ics/IC-1911222769264596611 new file mode 100644 index 0000000000000..8aefebb7120cb --- /dev/null +++ b/js/src/ics/IC-1911222769264596611 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToString) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(GuardSpecificInt32) ID(3) INT32(10) OP(NumberParseIntResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1914090163038826176 b/js/src/ics/IC-1914090163038826176 new file mode 100644 index 0000000000000..ef2c6e73699fd --- /dev/null +++ b/js/src/ics/IC-1914090163038826176 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadInt32Constant) OFFSET(4) ID(3) OP(NewTypedArrayFromLengthResult) OFFSET(5) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1922088450768176119 b/js/src/ics/IC-1922088450768176119 new file mode 100644 index 0000000000000..92910baf510a1 --- /dev/null +++ b/js/src/ics/IC-1922088450768176119 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(CosNative) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1922379877290903206 b/js/src/ics/IC-1922379877290903206 new file mode 100644 index 0000000000000..ace52466a8899 --- /dev/null +++ b/js/src/ics/IC-1922379877290903206 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNumber) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float32) ID(3) ID(2) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1930651877465110134 b/js/src/ics/IC-1930651877465110134 new file mode 100644 index 0000000000000..e7ca27af71390 --- /dev/null +++ b/js/src/ics/IC-1930651877465110134 @@ -0,0 +1 @@ +GetElem, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardClass) ID(0) GUARDCLASSKIND(MappedArguments) OP(LoadArgumentsObjectArgResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1958498882277703804 b/js/src/ics/IC-1958498882277703804 new file mode 100644 index 0000000000000..69cf42a93d800 --- /dev/null +++ b/js/src/ics/IC-1958498882277703804 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Int32) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1978813921514302351 b/js/src/ics/IC-1978813921514302351 new file mode 100644 index 0000000000000..97d8eb7b40e6f --- /dev/null +++ b/js/src/ics/IC-1978813921514302351 @@ -0,0 +1 @@ +Call, 1, 3, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(8) LASTUSED(2) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardNotClassConstructor) ID(2) OP(GuardFunctionHasNoJitEntry) ID(2) OP(CallNativeFunction) ID(2) ID(0) CALLFLAGS(3) UINT32(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-1984731683141195983 b/js/src/ics/IC-1984731683141195983 new file mode 100644 index 0000000000000..1a335b2ac2fe3 --- /dev/null +++ b/js/src/ics/IC-1984731683141195983 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Double) STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardIsUndefined) ID(1) OP(LoadDoubleConstant) OFFSET(1) ID(3) OP(CompareDoubleResult) JSOP(Ge) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2011520596613052330 b/js/src/ics/IC-2011520596613052330 new file mode 100644 index 0000000000000..c920d2f134478 --- /dev/null +++ b/js/src/ics/IC-2011520596613052330 @@ -0,0 +1 @@ +GetProp, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(3) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadDynamicSlot) ID(1) ID(0) OFFSET(1) OP(LoadGetterSetterFunction) ID(1) BOOL(1) BOOL(0) ID(2) OP(GuardFunctionScript) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedGetterResult) ID(0) ID(2) BOOL(1) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2062548415379116244 b/js/src/ics/IC-2062548415379116244 new file mode 100644 index 0000000000000..051984bfb9747 --- /dev/null +++ b/js/src/ics/IC-2062548415379116244 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(Date) OP(DateFillLocalTimeSlots) ID(2) OP(LoadFixedSlot) ID(3) ID(2) OFFSET(2) OP(DateMinutesFromSecondsIntoYearResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2069761895861418575 b/js/src/ics/IC-2069761895861418575 new file mode 100644 index 0000000000000..8c2984698432d --- /dev/null +++ b/js/src/ics/IC-2069761895861418575 @@ -0,0 +1 @@ +SetElem, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(5) LASTUSED(2) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNullOrUndefined) ID(2) OP(LoadInt32Constant) OFFSET(1) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint16) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2071781605961187052 b/js/src/ics/IC-2071781605961187052 new file mode 100644 index 0000000000000..95cf35c2ed801 --- /dev/null +++ b/js/src/ics/IC-2071781605961187052 @@ -0,0 +1 @@ +SetElem, 3, 3, 6, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(StoreDynamicSlot) ID(0) OFFSET(2) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2074656138179039797 b/js/src/ics/IC-2074656138179039797 new file mode 100644 index 0000000000000..9465839c57e10 --- /dev/null +++ b/js/src/ics/IC-2074656138179039797 @@ -0,0 +1 @@ +LazyConstant, 0, 0, 2, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Value) , , OP(LoadValueResult) OFFSET(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2081802683341159475 b/js/src/ics/IC-2081802683341159475 new file mode 100644 index 0000000000000..a77a109ef12a3 --- /dev/null +++ b/js/src/ics/IC-2081802683341159475 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasNoJitEntry) ID(1) OP(GuardNotClassConstructor) ID(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(2) UINT32(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2086723106745968256 b/js/src/ics/IC-2086723106745968256 new file mode 100644 index 0000000000000..2f3ee3d589570 --- /dev/null +++ b/js/src/ics/IC-2086723106745968256 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(2) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(2) OP(CompareDoubleResult) JSOP(Ne) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2086905995182716458 b/js/src/ics/IC-2086905995182716458 new file mode 100644 index 0000000000000..a319f5fe1d37c --- /dev/null +++ b/js/src/ics/IC-2086905995182716458 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-210144046857212322 b/js/src/ics/IC-210144046857212322 new file mode 100644 index 0000000000000..8f462c0c2e97b --- /dev/null +++ b/js/src/ics/IC-210144046857212322 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(Array) OP(GuardArrayIsPacked) ID(3) OP(NumberMinMaxArrayResult) ID(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2137848763953584890 b/js/src/ics/IC-2137848763953584890 new file mode 100644 index 0000000000000..638b70b0657d1 --- /dev/null +++ b/js/src/ics/IC-2137848763953584890 @@ -0,0 +1 @@ +GetElem, 2, 3, 8, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(GuardFixedSlotValue) ID(0) OFFSET(2) OFFSET(3) OP(LoadObject) ID(2) OFFSET(4) OP(CallScriptedGetterResult) ID(0) ID(2) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2143448554454499349 b/js/src/ics/IC-2143448554454499349 new file mode 100644 index 0000000000000..c2058f93d6e18 --- /dev/null +++ b/js/src/ics/IC-2143448554454499349 @@ -0,0 +1 @@ +GetElem, 2, 3, 9, JSVAL_TYPE_UNKNOWN, 88, STUBFIELD(String) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(0) LASTUSED(2) LASTUSED(6) , OP(GuardNonDoubleType) ID(0) VALUETYPE(JSVAL_TYPE_STRING) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardSpecificObject) ID(2) OFFSET(2) OP(GuardObjectFuseProperty) ID(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(2) OFFSET(8) OFFSET(9) OP(UncheckedLoadWeakObjectResult) OFFSET(10) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2151648659228270655 b/js/src/ics/IC-2151648659228270655 new file mode 100644 index 0000000000000..47ef14acb4566 --- /dev/null +++ b/js/src/ics/IC-2151648659228270655 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToString) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(LoadStringCharResult) ID(2) ID(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-216425788329978311 b/js/src/ics/IC-216425788329978311 new file mode 100644 index 0000000000000..a76bd3173672e --- /dev/null +++ b/js/src/ics/IC-216425788329978311 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint16) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2169251083567393299 b/js/src/ics/IC-2169251083567393299 new file mode 100644 index 0000000000000..6a576b1058527 --- /dev/null +++ b/js/src/ics/IC-2169251083567393299 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardShape) ID(3) OFFSET(4) OP(LoadFixedSlotTypedResult) ID(3) OFFSET(5) VALUETYPE(JSVAL_TYPE_DOUBLE) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2171431250058728502 b/js/src/ics/IC-2171431250058728502 new file mode 100644 index 0000000000000..f99f9a80b4449 --- /dev/null +++ b/js/src/ics/IC-2171431250058728502 @@ -0,0 +1 @@ +GetName, 1, 1, 2, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) , OP(LoadDynamicSlotResult) ID(0) OFFSET(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2184863063398148428 b/js/src/ics/IC-2184863063398148428 new file mode 100644 index 0000000000000..f3cb522e311c8 --- /dev/null +++ b/js/src/ics/IC-2184863063398148428 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(3) , OP(GuardIsNullOrUndefined) ID(0) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32RightShiftResult) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2230606841539842551 b/js/src/ics/IC-2230606841539842551 new file mode 100644 index 0000000000000..58bb102d70d0f --- /dev/null +++ b/js/src/ics/IC-2230606841539842551 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2273202721796384800 b/js/src/ics/IC-2273202721796384800 new file mode 100644 index 0000000000000..19b714e83c5e3 --- /dev/null +++ b/js/src/ics/IC-2273202721796384800 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(10) LASTUSED(10) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(2) ID(3) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(98) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2313082164892530755 b/js/src/ics/IC-2313082164892530755 new file mode 100644 index 0000000000000..7618644006aef --- /dev/null +++ b/js/src/ics/IC-2313082164892530755 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(3) , OP(GuardToString) ID(0) OP(GuardStringToNumber) ID(0) ID(2) OP(GuardIsNumber) ID(1) OP(CompareDoubleResult) JSOP(Gt) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2339634224401801487 b/js/src/ics/IC-2339634224401801487 new file mode 100644 index 0000000000000..c0025cd251955 --- /dev/null +++ b/js/src/ics/IC-2339634224401801487 @@ -0,0 +1 @@ +SetElem, 3, 4, 11, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(9) LASTUSED(9) LASTUSED(9) LASTUSED(8) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardClass) ID(0) GUARDCLASSKIND(PlainObject) OP(GuardIndexIsNotDenseElement) ID(0) ID(1) OP(GuardIsExtensible) ID(0) OP(GuardInt32IsNonNegative) ID(1) OP(GuardProto) ID(0) OFFSET(0) OP(LoadProtoObject) ID(3) OFFSET(1) ID(0) OP(GuardShape) ID(3) OFFSET(2) OP(CallAddOrUpdateSparseElementHelper) ID(0) ID(1) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2351162846336746035 b/js/src/ics/IC-2351162846336746035 new file mode 100644 index 0000000000000..3e9a4dc00d635 --- /dev/null +++ b/js/src/ics/IC-2351162846336746035 @@ -0,0 +1 @@ +GetProp, 1, 2, 8, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(7) OP(LoadArrayBufferByteLengthInt32Result) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2371990067430049343 b/js/src/ics/IC-2371990067430049343 new file mode 100644 index 0000000000000..56d45f9804580 --- /dev/null +++ b/js/src/ics/IC-2371990067430049343 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(8) LASTUSED(8) LASTUSED(4) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(2) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(3) OFFSET(0) OFFSET(1) OP(CallBoundScriptedFunction) ID(1) ID(3) ID(0) CALLFLAGS(65) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2377599860335463454 b/js/src/ics/IC-2377599860335463454 new file mode 100644 index 0000000000000..4983a2cd9dfdd --- /dev/null +++ b/js/src/ics/IC-2377599860335463454 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(ATan) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2380892506045607779 b/js/src/ics/IC-2380892506045607779 new file mode 100644 index 0000000000000..4d2c6e1f80835 --- /dev/null +++ b/js/src/ics/IC-2380892506045607779 @@ -0,0 +1 @@ +Compare, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(1) LASTUSED(2) , OP(GuardToInt32) ID(0) OP(GuardBooleanToInt32) ID(1) ID(2) OP(CompareInt32Result) JSOP(Eq) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2398402272777244131 b/js/src/ics/IC-2398402272777244131 new file mode 100644 index 0000000000000..e8565b27ebb58 --- /dev/null +++ b/js/src/ics/IC-2398402272777244131 @@ -0,0 +1 @@ +Call, 1, 7, 13, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(10) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(AtomicsOrResult) ID(2) ID(4) ID(6) SCALARTYPE(Int8) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2417302517823498608 b/js/src/ics/IC-2417302517823498608 new file mode 100644 index 0000000000000..0b40922977c66 --- /dev/null +++ b/js/src/ics/IC-2417302517823498608 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(Map) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(MapHasResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2418707696100325399 b/js/src/ics/IC-2418707696100325399 new file mode 100644 index 0000000000000..1f546aa572bd4 --- /dev/null +++ b/js/src/ics/IC-2418707696100325399 @@ -0,0 +1 @@ +GetProp, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(4) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardShape) ID(1) OFFSET(2) OP(GuardFixedSlotValue) ID(1) OFFSET(3) OFFSET(4) OP(LoadObject) ID(2) OFFSET(5) OP(CallScriptedGetterResult) ID(0) ID(2) BOOL(1) OFFSET(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2454948850716611951 b/js/src/ics/IC-2454948850716611951 new file mode 100644 index 0000000000000..287d53911cd4a --- /dev/null +++ b/js/src/ics/IC-2454948850716611951 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardToInt32) ID(0) OP(GuardIsNullOrUndefined) ID(1) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(Int32BitOrResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2456834969277128085 b/js/src/ics/IC-2456834969277128085 new file mode 100644 index 0000000000000..5a9e4668dedf8 --- /dev/null +++ b/js/src/ics/IC-2456834969277128085 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(3) , OP(GuardIsNull) ID(0) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(GuardToInt32) ID(1) OP(CompareInt32Result) JSOP(Le) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2462731431393133002 b/js/src/ics/IC-2462731431393133002 new file mode 100644 index 0000000000000..435e1b440432e --- /dev/null +++ b/js/src/ics/IC-2462731431393133002 @@ -0,0 +1 @@ +Compare, 2, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(0) , OP(GuardIsUndefined) ID(1) OP(CompareNullUndefinedResult) JSOP(Eq) BOOL(1) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2515826279634114248 b/js/src/ics/IC-2515826279634114248 new file mode 100644 index 0000000000000..a22ec7d40cba0 --- /dev/null +++ b/js/src/ics/IC-2515826279634114248 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasJitEntry) ID(1) OP(GuardNotClassConstructor) ID(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2518253502660787428 b/js/src/ics/IC-2518253502660787428 new file mode 100644 index 0000000000000..55bbd38f8991b --- /dev/null +++ b/js/src/ics/IC-2518253502660787428 @@ -0,0 +1 @@ +GetName, 1, 4, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(3) LASTUSED(5) , OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(0) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(LoadFixedSlot) ID(3) ID(2) OFFSET(1) OP(GuardIsNotUninitializedLexical) ID(3) OP(LoadOperandResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2521244443826978133 b/js/src/ics/IC-2521244443826978133 new file mode 100644 index 0000000000000..d5816c02e3872 --- /dev/null +++ b/js/src/ics/IC-2521244443826978133 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int32) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2531978278637808078 b/js/src/ics/IC-2531978278637808078 new file mode 100644 index 0000000000000..04948df72ebda --- /dev/null +++ b/js/src/ics/IC-2531978278637808078 @@ -0,0 +1 @@ +SetProp, 2, 4, 8, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(6) LASTUSED(3) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(2) OFFSET(1) ID(0) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(0) OP(GuardShape) ID(3) OFFSET(4) OP(AllocateAndStoreDynamicSlot) ID(0) OFFSET(5) ID(1) OFFSET(6) OFFSET(7) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2535451704436036055 b/js/src/ics/IC-2535451704436036055 new file mode 100644 index 0000000000000..9a42e491c5fc7 --- /dev/null +++ b/js/src/ics/IC-2535451704436036055 @@ -0,0 +1 @@ +SetElem, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(5) LASTUSED(2) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNullOrUndefined) ID(2) OP(LoadInt32Constant) OFFSET(1) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint8Clamped) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2542825496446283237 b/js/src/ics/IC-2542825496446283237 new file mode 100644 index 0000000000000..e4b65993fe24e --- /dev/null +++ b/js/src/ics/IC-2542825496446283237 @@ -0,0 +1 @@ +InstanceOf, 2, 4, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(4) LASTUSED(3) LASTUSED(6) , OP(GuardToObject) ID(1) OP(GuardShape) ID(1) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(LoadDynamicSlot) ID(3) ID(1) OFFSET(3) OP(GuardToObject) ID(3) OP(LoadInstanceOfObjectResult) ID(0) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2584985458187775789 b/js/src/ics/IC-2584985458187775789 new file mode 100644 index 0000000000000..1540b1ad4d1c6 --- /dev/null +++ b/js/src/ics/IC-2584985458187775789 @@ -0,0 +1 @@ +In, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToObject) ID(1) OP(GuardIsProxy) ID(1) OP(ProxyHasPropResult) ID(1) ID(0) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2618512630462482380 b/js/src/ics/IC-2618512630462482380 new file mode 100644 index 0000000000000..7111c23b0dc73 --- /dev/null +++ b/js/src/ics/IC-2618512630462482380 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(9) LASTUSED(9) LASTUSED(4) LASTUSED(9) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(1) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasJitEntry) ID(3) OP(GuardNotClassConstructor) ID(3) OP(CallBoundScriptedFunction) ID(1) ID(3) ID(0) CALLFLAGS(1) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2624898344269778408 b/js/src/ics/IC-2624898344269778408 new file mode 100644 index 0000000000000..fc4b0c5481261 --- /dev/null +++ b/js/src/ics/IC-2624898344269778408 @@ -0,0 +1 @@ +GetProp, 1, 2, 8, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(7) OP(RegExpFlagResult) ID(0) INT32(128) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2644556544581678306 b/js/src/ics/IC-2644556544581678306 new file mode 100644 index 0000000000000..dbc713e7fe956 --- /dev/null +++ b/js/src/ics/IC-2644556544581678306 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(Set) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(SetDeleteResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2645532145448443217 b/js/src/ics/IC-2645532145448443217 new file mode 100644 index 0000000000000..da55b51e6b262 --- /dev/null +++ b/js/src/ics/IC-2645532145448443217 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(3) , OP(GuardIsNull) ID(0) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(GuardToInt32) ID(1) OP(CompareInt32Result) JSOP(Ge) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2661083574516437070 b/js/src/ics/IC-2661083574516437070 new file mode 100644 index 0000000000000..18943283402a1 --- /dev/null +++ b/js/src/ics/IC-2661083574516437070 @@ -0,0 +1 @@ +SetElem, 3, 6, 9, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(7) LASTUSED(6) LASTUSED(3) LASTUSED(4) LASTUSED(7) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToString) ID(2) OP(GuardStringToNumber) ID(2) ID(3) OP(TruncateDoubleToUInt32) ID(3) ID(4) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(5) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint32) ID(5) ID(4) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2669068402497370744 b/js/src/ics/IC-2669068402497370744 new file mode 100644 index 0000000000000..7af3ed2b4bbc4 --- /dev/null +++ b/js/src/ics/IC-2669068402497370744 @@ -0,0 +1 @@ +Call, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(IsPackedArrayResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2686711967840485705 b/js/src/ics/IC-2686711967840485705 new file mode 100644 index 0000000000000..5ea4f196adc6c --- /dev/null +++ b/js/src/ics/IC-2686711967840485705 @@ -0,0 +1 @@ +Call, 1, 4, 14, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(12) LASTUSED(2) LASTUSED(12) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(Array) OP(GuardArrayIsPacked) ID(3) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardNotClassConstructor) ID(2) OP(GuardFunctionHasJitEntry) ID(2) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(5) UINT32(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2691121023243741501 b/js/src/ics/IC-2691121023243741501 new file mode 100644 index 0000000000000..59d85ad0a0e14 --- /dev/null +++ b/js/src/ics/IC-2691121023243741501 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToBigInt) ID(5) OP(AtomicsAndResult) ID(2) ID(4) ID(5) SCALARTYPE(BigInt64) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2702772690004335189 b/js/src/ics/IC-2702772690004335189 new file mode 100644 index 0000000000000..a86c5b32de659 --- /dev/null +++ b/js/src/ics/IC-2702772690004335189 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(3) , OP(GuardIsNullOrUndefined) ID(0) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32BitXorResult) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2708659804234438728 b/js/src/ics/IC-2708659804234438728 new file mode 100644 index 0000000000000..7b1b124938f04 --- /dev/null +++ b/js/src/ics/IC-2708659804234438728 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToString) ID(2) OP(StringToUpperCaseResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2737678301559937239 b/js/src/ics/IC-2737678301559937239 new file mode 100644 index 0000000000000..44efa390ab677 --- /dev/null +++ b/js/src/ics/IC-2737678301559937239 @@ -0,0 +1 @@ +Call, 1, 5, 14, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(12) LASTUSED(12) LASTUSED(12) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardHasAttachedArrayBuffer) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardShape) ID(3) OFFSET(3) OP(GuardHasAttachedArrayBuffer) ID(3) OP(LoadInt32AsIntPtrConstant) OFFSET(4) ID(4) OP(TypedArraySetResult) ID(2) ID(3) ID(4) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2765459467037608334 b/js/src/ics/IC-2765459467037608334 new file mode 100644 index 0000000000000..2cab19cfbcbf0 --- /dev/null +++ b/js/src/ics/IC-2765459467037608334 @@ -0,0 +1 @@ +Call, 1, 5, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardIsNumber) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardIsNumber) ID(3) OP(NumberMinMax) BOOL(1) ID(2) ID(3) ID(4) OP(LoadDoubleResult) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2767613240500855107 b/js/src/ics/IC-2767613240500855107 new file mode 100644 index 0000000000000..a4ac48533afd7 --- /dev/null +++ b/js/src/ics/IC-2767613240500855107 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToString) ID(2) OP(StringToLowerCaseResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2773590376861193527 b/js/src/ics/IC-2773590376861193527 new file mode 100644 index 0000000000000..ccaa5f8158a93 --- /dev/null +++ b/js/src/ics/IC-2773590376861193527 @@ -0,0 +1 @@ +SetProp, 2, 4, 8, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(6) LASTUSED(3) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(2) OFFSET(1) ID(0) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(0) OP(GuardShape) ID(3) OFFSET(4) OP(AllocateAndStoreDynamicSlot) ID(0) OFFSET(5) ID(1) OFFSET(6) OFFSET(7) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2782409437992023769 b/js/src/ics/IC-2782409437992023769 new file mode 100644 index 0000000000000..457d2728237ff --- /dev/null +++ b/js/src/ics/IC-2782409437992023769 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathF16RoundNumberResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-280026093892213862 b/js/src/ics/IC-280026093892213862 new file mode 100644 index 0000000000000..61488e413dbdb --- /dev/null +++ b/js/src/ics/IC-280026093892213862 @@ -0,0 +1 @@ +SetElem, 3, 5, 9, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(2) LASTUSED(7) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(3) OFFSET(2) OP(GuardShape) ID(3) OFFSET(3) OP(LoadObject) ID(4) OFFSET(4) OP(CallScriptedSetter) ID(0) ID(4) ID(2) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2801956725434653136 b/js/src/ics/IC-2801956725434653136 new file mode 100644 index 0000000000000..576280532be4e --- /dev/null +++ b/js/src/ics/IC-2801956725434653136 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Int16) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2802425936511893854 b/js/src/ics/IC-2802425936511893854 new file mode 100644 index 0000000000000..4ced3f72ca0ef --- /dev/null +++ b/js/src/ics/IC-2802425936511893854 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(BigInt64) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2827143466525184837 b/js/src/ics/IC-2827143466525184837 new file mode 100644 index 0000000000000..fbfe1a306845d --- /dev/null +++ b/js/src/ics/IC-2827143466525184837 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(ATanH) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2855688269616687597 b/js/src/ics/IC-2855688269616687597 new file mode 100644 index 0000000000000..ae31e30f5260d --- /dev/null +++ b/js/src/ics/IC-2855688269616687597 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(CosH) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2873965502031799334 b/js/src/ics/IC-2873965502031799334 new file mode 100644 index 0000000000000..7602b15b74779 --- /dev/null +++ b/js/src/ics/IC-2873965502031799334 @@ -0,0 +1 @@ +SetElem, 3, 5, 14, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(12) LASTUSED(12) LASTUSED(12) LASTUSED(8) LASTUSED(10) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardClass) ID(0) GUARDCLASSKIND(Array) OP(GuardIndexIsNotDenseElement) ID(0) ID(1) OP(GuardIsExtensible) ID(0) OP(GuardInt32IsNonNegative) ID(1) OP(GuardProto) ID(0) OFFSET(0) OP(LoadProtoObject) ID(3) OFFSET(1) ID(0) OP(GuardShape) ID(3) OFFSET(2) OP(LoadProtoObject) ID(4) OFFSET(3) ID(0) OP(GuardShape) ID(4) OFFSET(4) OP(GuardIndexIsValidUpdateOrAdd) ID(0) ID(1) OP(CallAddOrUpdateSparseElementHelper) ID(0) ID(1) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-287542670551658275 b/js/src/ics/IC-287542670551658275 new file mode 100644 index 0000000000000..657bd929c90c4 --- /dev/null +++ b/js/src/ics/IC-287542670551658275 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(5) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(3) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(FixedLengthSharedArrayBuffer) OP(LoadArgumentFixedSlot) ID(4) BYTE(2) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(NewTypedArrayFromArrayBufferResult) OFFSET(4) ID(3) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2895026259980035856 b/js/src/ics/IC-2895026259980035856 new file mode 100644 index 0000000000000..c0177fc04d91e --- /dev/null +++ b/js/src/ics/IC-2895026259980035856 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(0) LASTUSED(3) LASTUSED(3) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardIsNumber) ID(1) OP(CompareDoubleResult) JSOP(Gt) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2912402446003854960 b/js/src/ics/IC-2912402446003854960 new file mode 100644 index 0000000000000..85b2d0f123ac8 --- /dev/null +++ b/js/src/ics/IC-2912402446003854960 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(225) UINT32(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2913871485666489552 b/js/src/ics/IC-2913871485666489552 new file mode 100644 index 0000000000000..3e6b7be5ffce0 --- /dev/null +++ b/js/src/ics/IC-2913871485666489552 @@ -0,0 +1 @@ +GetProp, 1, 2, 8, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(0) OP(GuardClass) ID(0) GUARDCLASSKIND(Map) OP(MapSizeResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-291878540700978050 b/js/src/ics/IC-291878540700978050 new file mode 100644 index 0000000000000..18502a5487726 --- /dev/null +++ b/js/src/ics/IC-291878540700978050 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadFixedSlotTypedResult) ID(2) OFFSET(3) VALUETYPE(JSVAL_TYPE_DOUBLE) OP(ReturnFromIC) diff --git a/js/src/ics/IC-292082082355467009 b/js/src/ics/IC-292082082355467009 new file mode 100644 index 0000000000000..f4089b6d6cf41 --- /dev/null +++ b/js/src/ics/IC-292082082355467009 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardToInt32) ID(0) OP(GuardIsNull) ID(1) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(CompareInt32Result) JSOP(Lt) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2928815103741675983 b/js/src/ics/IC-2928815103741675983 new file mode 100644 index 0000000000000..9a5ee556a0607 --- /dev/null +++ b/js/src/ics/IC-2928815103741675983 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(Set) OP(SetSizeResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2958411735556139423 b/js/src/ics/IC-2958411735556139423 new file mode 100644 index 0000000000000..6c39c967c3202 --- /dev/null +++ b/js/src/ics/IC-2958411735556139423 @@ -0,0 +1 @@ +SetProp, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardSpecificObject) ID(0) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(StoreDynamicSlot) ID(0) OFFSET(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2966024549592476080 b/js/src/ics/IC-2966024549592476080 new file mode 100644 index 0000000000000..43558096365af --- /dev/null +++ b/js/src/ics/IC-2966024549592476080 @@ -0,0 +1 @@ +Call, 1, 7, 15, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(13) LASTUSED(11) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardHasAttachedArrayBuffer) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToBigInt) ID(3) OP(LoadArgumentFixedSlot) ID(4) BYTE(0) OP(GuardToInt32) ID(4) OP(Int32ToIntPtr) ID(4) ID(5) OP(LoadArrayBufferViewLength) ID(2) ID(6) OP(TypedArrayFillResult) ID(2) ID(3) ID(5) ID(6) SCALARTYPE(BigInt64) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2983342025737404834 b/js/src/ics/IC-2983342025737404834 new file mode 100644 index 0000000000000..7e459f7e625ec --- /dev/null +++ b/js/src/ics/IC-2983342025737404834 @@ -0,0 +1 @@ +Call, 1, 8, 15, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(10) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Int8) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2990975653483082955 b/js/src/ics/IC-2990975653483082955 new file mode 100644 index 0000000000000..9cf1f486f080f --- /dev/null +++ b/js/src/ics/IC-2990975653483082955 @@ -0,0 +1 @@ +GetElem, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIndexIsNotDenseElement) ID(0) ID(1) OP(CallNativeGetElementResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-2992382339529556418 b/js/src/ics/IC-2992382339529556418 new file mode 100644 index 0000000000000..606a15eb92f57 --- /dev/null +++ b/js/src/ics/IC-2992382339529556418 @@ -0,0 +1 @@ +GetProp, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 72, STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(3) , OP(GuardNonDoubleType) ID(0) VALUETYPE(JSVAL_TYPE_SYMBOL) OP(LoadObject) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(CallNativeGetterResult) ID(0) OFFSET(7) BOOL(1) OFFSET(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3016091860216907838 b/js/src/ics/IC-3016091860216907838 new file mode 100644 index 0000000000000..2688827db559b --- /dev/null +++ b/js/src/ics/IC-3016091860216907838 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToBigInt) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(BigInt64) ID(3) ID(2) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3024635330905737690 b/js/src/ics/IC-3024635330905737690 new file mode 100644 index 0000000000000..b2ad459fecb86 --- /dev/null +++ b/js/src/ics/IC-3024635330905737690 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardToInt32) ID(0) OP(GuardIsNull) ID(1) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(CompareInt32Result) JSOP(Ge) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3050564922038072872 b/js/src/ics/IC-3050564922038072872 new file mode 100644 index 0000000000000..7c0afa3e564b3 --- /dev/null +++ b/js/src/ics/IC-3050564922038072872 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToBigInt) ID(0) OP(GuardToInt32) ID(1) OP(CompareBigIntInt32Result) JSOP(Gt) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3058041403847434208 b/js/src/ics/IC-3058041403847434208 new file mode 100644 index 0000000000000..cf45cd0d595a2 --- /dev/null +++ b/js/src/ics/IC-3058041403847434208 @@ -0,0 +1 @@ +GetProp, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(4) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardShape) ID(1) OFFSET(2) OP(LoadDynamicSlot) ID(2) ID(1) OFFSET(3) OP(LoadGetterSetterFunction) ID(2) BOOL(1) BOOL(0) ID(3) OP(GuardFunctionScript) ID(3) OFFSET(4) OFFSET(5) OP(CallScriptedGetterResult) ID(0) ID(3) BOOL(1) OFFSET(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3058288795472298567 b/js/src/ics/IC-3058288795472298567 new file mode 100644 index 0000000000000..992831d84c401 --- /dev/null +++ b/js/src/ics/IC-3058288795472298567 @@ -0,0 +1 @@ +SetElem, 3, 4, 8, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(6) LASTUSED(2) LASTUSED(6) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(0) OP(GuardShape) ID(3) OFFSET(3) OP(AddAndStoreFixedSlot) ID(0) OFFSET(4) ID(2) OFFSET(5) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3063208630223808341 b/js/src/ics/IC-3063208630223808341 new file mode 100644 index 0000000000000..5342968d3b419 --- /dev/null +++ b/js/src/ics/IC-3063208630223808341 @@ -0,0 +1 @@ +GetElem, 2, 4, 9, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(2) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardObjectFuseProperty) ID(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(1) OP(LoadObject) ID(3) OFFSET(8) OP(CallScriptedGetterResult) ID(0) ID(3) BOOL(1) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3063897698311975033 b/js/src/ics/IC-3063897698311975033 new file mode 100644 index 0000000000000..ef979572a750b --- /dev/null +++ b/js/src/ics/IC-3063897698311975033 @@ -0,0 +1 @@ +GetElem, 2, 3, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(2) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardStringToIndex) ID(1) ID(2) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIndexIsNotDenseElement) ID(0) ID(2) OP(CallNativeGetElementResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3065981700777779924 b/js/src/ics/IC-3065981700777779924 new file mode 100644 index 0000000000000..7c8e7a7c0da06 --- /dev/null +++ b/js/src/ics/IC-3065981700777779924 @@ -0,0 +1 @@ +GetElem, 2, 3, 7, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(Symbol) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(GuardNonDoubleType) ID(0) VALUETYPE(JSVAL_TYPE_STRING) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(LoadDynamicSlotResult) ID(2) OFFSET(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3070543937284829139 b/js/src/ics/IC-3070543937284829139 new file mode 100644 index 0000000000000..baa0a0b89a1d5 --- /dev/null +++ b/js/src/ics/IC-3070543937284829139 @@ -0,0 +1 @@ +Call, 1, 8, 15, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(10) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Int8) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3107997055811569125 b/js/src/ics/IC-3107997055811569125 new file mode 100644 index 0000000000000..eeca2896144fe --- /dev/null +++ b/js/src/ics/IC-3107997055811569125 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToInt32) ID(2) OP(StringFromCodePointResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3108375503482564051 b/js/src/ics/IC-3108375503482564051 new file mode 100644 index 0000000000000..9de5100102ac2 --- /dev/null +++ b/js/src/ics/IC-3108375503482564051 @@ -0,0 +1 @@ +GetProp, 1, 2, 8, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(7) OP(ArrayBufferViewByteOffsetInt32Result) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3126533402459306811 b/js/src/ics/IC-3126533402459306811 new file mode 100644 index 0000000000000..3550eb20b5be5 --- /dev/null +++ b/js/src/ics/IC-3126533402459306811 @@ -0,0 +1 @@ +CloseIter, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(5) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadFixedSlot) ID(1) ID(0) OFFSET(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(2) OFFSET(3) OP(CloseIterScriptedResult) ID(0) ID(1) COMPLETIONKIND(Normal) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3129554586835639708 b/js/src/ics/IC-3129554586835639708 new file mode 100644 index 0000000000000..bf42b4b761aa0 --- /dev/null +++ b/js/src/ics/IC-3129554586835639708 @@ -0,0 +1 @@ +Compare, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(1) LASTUSED(2) , OP(GuardToInt32) ID(0) OP(GuardBooleanToInt32) ID(1) ID(2) OP(CompareInt32Result) JSOP(Ge) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3130944617629361877 b/js/src/ics/IC-3130944617629361877 new file mode 100644 index 0000000000000..4bea780f29e85 --- /dev/null +++ b/js/src/ics/IC-3130944617629361877 @@ -0,0 +1 @@ +SetProp, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardClass) ID(0) GUARDCLASSKIND(Array) OP(CallSetArrayLength) ID(0) BOOL(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3141748223018335851 b/js/src/ics/IC-3141748223018335851 new file mode 100644 index 0000000000000..985248ede647a --- /dev/null +++ b/js/src/ics/IC-3141748223018335851 @@ -0,0 +1 @@ +Call, 1, 5, 13, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(11) LASTUSED(11) LASTUSED(4) LASTUSED(7) LASTUSED(11) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardObjectIdentity) ID(3) ID(1) OP(LoadBoundFunctionTarget) ID(1) ID(4) OP(GuardClass) ID(4) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(4) OFFSET(0) OFFSET(1) OP(CallBoundScriptedFunction) ID(1) ID(4) ID(0) CALLFLAGS(225) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3149342849615121298 b/js/src/ics/IC-3149342849615121298 new file mode 100644 index 0000000000000..a18a8d25f5b30 --- /dev/null +++ b/js/src/ics/IC-3149342849615121298 @@ -0,0 +1 @@ +SetProp, 2, 4, 8, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(6) LASTUSED(6) LASTUSED(3) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(2) OFFSET(1) ID(0) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(0) OP(GuardShape) ID(3) OFFSET(4) OP(AddAndStoreFixedSlot) ID(0) OFFSET(5) ID(1) OFFSET(6) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-315159741714676948 b/js/src/ics/IC-315159741714676948 new file mode 100644 index 0000000000000..19a68db1062b8 --- /dev/null +++ b/js/src/ics/IC-315159741714676948 @@ -0,0 +1 @@ +GetElem, 2, 6, 14, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(12) LASTUSED(11) LASTUSED(12) LASTUSED(12) LASTUSED(12) LASTUSED(12) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadScriptedProxyHandler) ID(2) ID(0) OP(LoadWrapperTarget) ID(0) ID(3) BOOL(1) OP(GuardIsNativeObject) ID(3) OP(GuardShape) ID(2) OFFSET(1) OP(LoadFixedSlot) ID(4) ID(2) OFFSET(2) OP(GuardToObject) ID(4) OP(GuardClass) ID(4) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(4) OFFSET(3) OFFSET(4) OP(IdToStringOrSymbol) ID(5) ID(1) OP(CallScriptedProxyGetByValueResult) ID(3) ID(0) ID(2) ID(5) ID(4) UINT32(133920) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3151621465039598092 b/js/src/ics/IC-3151621465039598092 new file mode 100644 index 0000000000000..0af46086e03ff --- /dev/null +++ b/js/src/ics/IC-3151621465039598092 @@ -0,0 +1 @@ +GetElem, 2, 2, 7, JSVAL_TYPE_UNKNOWN, 72, STUBFIELD(Symbol) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(0) OFFSET(1) OP(GuardObjectFuseProperty) ID(0) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(CallNativeGetterResult) ID(0) OFFSET(7) BOOL(1) OFFSET(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3159826668269198227 b/js/src/ics/IC-3159826668269198227 new file mode 100644 index 0000000000000..bef64fa115d2f --- /dev/null +++ b/js/src/ics/IC-3159826668269198227 @@ -0,0 +1 @@ +Call, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(AssertFloat32Result) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3180778674546850643 b/js/src/ics/IC-3180778674546850643 new file mode 100644 index 0000000000000..2c436ef986051 --- /dev/null +++ b/js/src/ics/IC-3180778674546850643 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(2) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(GuardToBoolean) ID(1) OP(BooleanToNumber) ID(1) ID(2) OP(CompareDoubleResult) JSOP(Ne) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3183032258049838025 b/js/src/ics/IC-3183032258049838025 new file mode 100644 index 0000000000000..c2424b96712aa --- /dev/null +++ b/js/src/ics/IC-3183032258049838025 @@ -0,0 +1 @@ +CheckPrivateField, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Symbol) STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3184817209321377926 b/js/src/ics/IC-3184817209321377926 new file mode 100644 index 0000000000000..c0d9784388f72 --- /dev/null +++ b/js/src/ics/IC-3184817209321377926 @@ -0,0 +1 @@ +SetProp, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(2) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(StoreFixedSlot) ID(0) OFFSET(1) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3188547504096831872 b/js/src/ics/IC-3188547504096831872 new file mode 100644 index 0000000000000..27657c2583ab5 --- /dev/null +++ b/js/src/ics/IC-3188547504096831872 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Int32) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3209469901421149634 b/js/src/ics/IC-3209469901421149634 new file mode 100644 index 0000000000000..8718dc17a0753 --- /dev/null +++ b/js/src/ics/IC-3209469901421149634 @@ -0,0 +1 @@ +GetElemSuper, 3, 4, 9, JSVAL_TYPE_UNKNOWN, 88, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(3) LASTUSED(2) LASTUSED(0) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(3) OFFSET(2) OP(GuardObjectFuseProperty) ID(3) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(3) OFFSET(8) OFFSET(9) OP(UncheckedLoadWeakObjectResult) OFFSET(10) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3210025847986191306 b/js/src/ics/IC-3210025847986191306 new file mode 100644 index 0000000000000..5dfc690cc3a78 --- /dev/null +++ b/js/src/ics/IC-3210025847986191306 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(BigInt64) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3215707204901826833 b/js/src/ics/IC-3215707204901826833 new file mode 100644 index 0000000000000..2e1ff8d61388c --- /dev/null +++ b/js/src/ics/IC-3215707204901826833 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToBigInt) ID(5) OP(AtomicsExchangeResult) ID(2) ID(4) ID(5) SCALARTYPE(BigUint64) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3221536603393431694 b/js/src/ics/IC-3221536603393431694 new file mode 100644 index 0000000000000..307c91ffdc84b --- /dev/null +++ b/js/src/ics/IC-3221536603393431694 @@ -0,0 +1 @@ +Call, 1, 1, 2, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(JSObject) , LASTUSED(0) , OP(NewStringIteratorResult) OFFSET(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3242710856889481812 b/js/src/ics/IC-3242710856889481812 new file mode 100644 index 0000000000000..962dbaf611a87 --- /dev/null +++ b/js/src/ics/IC-3242710856889481812 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(0) LASTUSED(3) LASTUSED(3) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardIsNumber) ID(1) OP(CompareDoubleResult) JSOP(Lt) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3254310163569751649 b/js/src/ics/IC-3254310163569751649 new file mode 100644 index 0000000000000..e50081deb049a --- /dev/null +++ b/js/src/ics/IC-3254310163569751649 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardBooleanToInt32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint8Clamped) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3260469094742591393 b/js/src/ics/IC-3260469094742591393 new file mode 100644 index 0000000000000..23c1c0c137b63 --- /dev/null +++ b/js/src/ics/IC-3260469094742591393 @@ -0,0 +1 @@ +SetElem, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(5) LASTUSED(3) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToString) ID(2) OP(GuardStringToNumber) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float64) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3270125778517387953 b/js/src/ics/IC-3270125778517387953 new file mode 100644 index 0000000000000..a8fef0eeda8cf --- /dev/null +++ b/js/src/ics/IC-3270125778517387953 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToString) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToString) ID(3) OP(StringIndexOfResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3285495661201347501 b/js/src/ics/IC-3285495661201347501 new file mode 100644 index 0000000000000..c2b37b31240f8 --- /dev/null +++ b/js/src/ics/IC-3285495661201347501 @@ -0,0 +1 @@ +Compare, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(1) LASTUSED(2) , OP(GuardToInt32) ID(0) OP(GuardBooleanToInt32) ID(1) ID(2) OP(CompareInt32Result) JSOP(Ne) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3291639657746952837 b/js/src/ics/IC-3291639657746952837 new file mode 100644 index 0000000000000..896fc429c39c6 --- /dev/null +++ b/js/src/ics/IC-3291639657746952837 @@ -0,0 +1 @@ +GetElem, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(Value) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(1) , OP(GuardToObject) ID(0) OP(GuardSpecificValue) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadFixedSlotResult) ID(0) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3303567693918747615 b/js/src/ics/IC-3303567693918747615 new file mode 100644 index 0000000000000..ba2f81613a825 --- /dev/null +++ b/js/src/ics/IC-3303567693918747615 @@ -0,0 +1 @@ +GetName, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(2) LASTUSED(4) LASTUSED(6) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardShape) ID(2) OFFSET(3) OP(LoadObject) ID(3) OFFSET(4) OP(CallNativeGetterResult) ID(3) OFFSET(5) BOOL(1) OFFSET(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3313907665922919113 b/js/src/ics/IC-3313907665922919113 new file mode 100644 index 0000000000000..05c50a30c58c6 --- /dev/null +++ b/js/src/ics/IC-3313907665922919113 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3316780861999244382 b/js/src/ics/IC-3316780861999244382 new file mode 100644 index 0000000000000..42efe98470304 --- /dev/null +++ b/js/src/ics/IC-3316780861999244382 @@ -0,0 +1 @@ +GetProp, 1, 1, 4, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadFixedSlotResult) ID(0) OFFSET(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3365998306684347245 b/js/src/ics/IC-3365998306684347245 new file mode 100644 index 0000000000000..e3ab324efa16d --- /dev/null +++ b/js/src/ics/IC-3365998306684347245 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Float32) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-337983161629110517 b/js/src/ics/IC-337983161629110517 new file mode 100644 index 0000000000000..0bbafb487dad7 --- /dev/null +++ b/js/src/ics/IC-337983161629110517 @@ -0,0 +1 @@ +GetProp, 1, 1, 4, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadDynamicSlotResult) ID(0) OFFSET(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3388123219511355535 b/js/src/ics/IC-3388123219511355535 new file mode 100644 index 0000000000000..11fea9d029533 --- /dev/null +++ b/js/src/ics/IC-3388123219511355535 @@ -0,0 +1 @@ +GetProp, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(LoadObject) ID(1) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadDynamicSlotResult) ID(1) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3430589870118667057 b/js/src/ics/IC-3430589870118667057 new file mode 100644 index 0000000000000..96ed730dd263e --- /dev/null +++ b/js/src/ics/IC-3430589870118667057 @@ -0,0 +1 @@ +Call, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(AssertRecoveredOnBailoutResult) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3451635243707423569 b/js/src/ics/IC-3451635243707423569 new file mode 100644 index 0000000000000..c0f7d5e729afe --- /dev/null +++ b/js/src/ics/IC-3451635243707423569 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(FixedLengthSharedArrayBuffer) OP(LoadArgumentFixedSlot) ID(4) BYTE(1) OP(LoadUndefined) ID(5) OP(NewTypedArrayFromArrayBufferResult) OFFSET(4) ID(3) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3456421405836740213 b/js/src/ics/IC-3456421405836740213 new file mode 100644 index 0000000000000..58736f421af5a --- /dev/null +++ b/js/src/ics/IC-3456421405836740213 @@ -0,0 +1 @@ +BinaryArith, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToString) ID(0) OP(GuardStringToNumber) ID(0) ID(2) OP(TruncateDoubleToUInt32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32BitXorResult) ID(3) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3463540458717575441 b/js/src/ics/IC-3463540458717575441 new file mode 100644 index 0000000000000..aa88677694751 --- /dev/null +++ b/js/src/ics/IC-3463540458717575441 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(0) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3481031266271930715 b/js/src/ics/IC-3481031266271930715 new file mode 100644 index 0000000000000..742c442a805f8 --- /dev/null +++ b/js/src/ics/IC-3481031266271930715 @@ -0,0 +1 @@ +BindName, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(1) LASTUSED(2) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(LoadObjectResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3512058922300613252 b/js/src/ics/IC-3512058922300613252 new file mode 100644 index 0000000000000..b2b95b9dd7e99 --- /dev/null +++ b/js/src/ics/IC-3512058922300613252 @@ -0,0 +1 @@ +GetProp, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(1) OFFSET(1) ID(0) OP(GuardShape) ID(1) OFFSET(2) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3528013366198793326 b/js/src/ics/IC-3528013366198793326 new file mode 100644 index 0000000000000..653615a26559d --- /dev/null +++ b/js/src/ics/IC-3528013366198793326 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(3) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(Set) OP(LoadObjectResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3528179051561271653 b/js/src/ics/IC-3528179051561271653 new file mode 100644 index 0000000000000..6ee241b7313de --- /dev/null +++ b/js/src/ics/IC-3528179051561271653 @@ -0,0 +1 @@ +SetProp, 2, 5, 9, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(7) LASTUSED(4) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(LoadDynamicSlot) ID(3) ID(2) OFFSET(3) OP(LoadGetterSetterFunction) ID(3) BOOL(0) BOOL(0) ID(4) OP(GuardFunctionScript) ID(4) OFFSET(4) OFFSET(5) OP(CallScriptedSetter) ID(0) ID(4) ID(1) BOOL(1) OFFSET(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3530211928626575094 b/js/src/ics/IC-3530211928626575094 new file mode 100644 index 0000000000000..b908219a98b02 --- /dev/null +++ b/js/src/ics/IC-3530211928626575094 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToBigInt) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(BigUint64) ID(3) ID(2) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3551621975038476869 b/js/src/ics/IC-3551621975038476869 new file mode 100644 index 0000000000000..6a9e9fc382a46 --- /dev/null +++ b/js/src/ics/IC-3551621975038476869 @@ -0,0 +1 @@ +Call, 1, 8, 16, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(14) LASTUSED(8) LASTUSED(14) LASTUSED(10) LASTUSED(14) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardIsNullOrUndefined) ID(5) OP(LoadInt32Constant) OFFSET(2) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Int32) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3559333848528880282 b/js/src/ics/IC-3559333848528880282 new file mode 100644 index 0000000000000..1d3ed9913c195 --- /dev/null +++ b/js/src/ics/IC-3559333848528880282 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint32) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3568082001678279740 b/js/src/ics/IC-3568082001678279740 new file mode 100644 index 0000000000000..d29fa63a109d4 --- /dev/null +++ b/js/src/ics/IC-3568082001678279740 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardIsNumber) ID(1) OP(GuardNumberToIntPtrIndex) ID(1) BOOL(0) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int32) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3569882059995853558 b/js/src/ics/IC-3569882059995853558 new file mode 100644 index 0000000000000..5e96deafa363f --- /dev/null +++ b/js/src/ics/IC-3569882059995853558 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Double) STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardIsNull) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardIsUndefined) ID(1) OP(LoadDoubleConstant) OFFSET(1) ID(3) OP(CompareDoubleResult) JSOP(Ge) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3589849304579682331 b/js/src/ics/IC-3589849304579682331 new file mode 100644 index 0000000000000..c8ff76ad61187 --- /dev/null +++ b/js/src/ics/IC-3589849304579682331 @@ -0,0 +1 @@ +Call, 1, 8, 16, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) LASTUSED(14) LASTUSED(8) LASTUSED(14) LASTUSED(10) LASTUSED(14) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardIsUndefined) ID(5) OP(LoadDoubleConstant) OFFSET(2) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Float32) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3597138435105657726 b/js/src/ics/IC-3597138435105657726 new file mode 100644 index 0000000000000..67418ffb997ff --- /dev/null +++ b/js/src/ics/IC-3597138435105657726 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3609972302888278654 b/js/src/ics/IC-3609972302888278654 new file mode 100644 index 0000000000000..88510d166b6b9 --- /dev/null +++ b/js/src/ics/IC-3609972302888278654 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasNoJitEntry) ID(1) OP(GuardFunctionIsConstructor) ID(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(33) UINT32(0) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3612832018387859729 b/js/src/ics/IC-3612832018387859729 new file mode 100644 index 0000000000000..16d730bbe646d --- /dev/null +++ b/js/src/ics/IC-3612832018387859729 @@ -0,0 +1 @@ +GetName, 1, 7, 11, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(2) LASTUSED(3) LASTUSED(4) LASTUSED(6) LASTUSED(8) LASTUSED(9) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(LoadEnclosingEnvironment) ID(2) ID(3) OP(LoadEnclosingEnvironment) ID(3) ID(4) OP(GuardShape) ID(4) OFFSET(1) OP(LoadEnclosingEnvironment) ID(4) ID(5) OP(GuardShape) ID(5) OFFSET(2) OP(LoadDynamicSlot) ID(6) ID(5) OFFSET(3) OP(LoadOperandResult) ID(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3634148346840572296 b/js/src/ics/IC-3634148346840572296 new file mode 100644 index 0000000000000..72fd491af1de7 --- /dev/null +++ b/js/src/ics/IC-3634148346840572296 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(0) LASTUSED(3) LASTUSED(4) LASTUSED(4) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(3) OP(CompareDoubleResult) JSOP(Gt) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3656206024072327113 b/js/src/ics/IC-3656206024072327113 new file mode 100644 index 0000000000000..b40da17aa4efc --- /dev/null +++ b/js/src/ics/IC-3656206024072327113 @@ -0,0 +1 @@ +GetElem, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardIsNativeObject) ID(0) OP(LoadDenseElementResult) ID(0) ID(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3657932750771746404 b/js/src/ics/IC-3657932750771746404 new file mode 100644 index 0000000000000..344e8cf64ddd4 --- /dev/null +++ b/js/src/ics/IC-3657932750771746404 @@ -0,0 +1 @@ +GetProp, 1, 2, 8, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(7) OP(RegExpFlagResult) ID(0) INT32(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3661072867427592162 b/js/src/ics/IC-3661072867427592162 new file mode 100644 index 0000000000000..94d75eadf7b6e --- /dev/null +++ b/js/src/ics/IC-3661072867427592162 @@ -0,0 +1 @@ +GetName, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(RawInt32) STUBFIELD(RawPointer) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) , OP(GuardGlobalGeneration) OFFSET(0) OFFSET(1) OP(LoadObject) ID(1) OFFSET(2) OP(LoadDynamicSlotResult) ID(1) OFFSET(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3661695729403573203 b/js/src/ics/IC-3661695729403573203 new file mode 100644 index 0000000000000..08bf5d57a043b --- /dev/null +++ b/js/src/ics/IC-3661695729403573203 @@ -0,0 +1 @@ +GetProp, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(3) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadFixedSlot) ID(1) ID(0) OFFSET(1) OP(LoadGetterSetterFunction) ID(1) BOOL(1) BOOL(0) ID(2) OP(GuardFunctionScript) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedGetterResult) ID(0) ID(2) BOOL(1) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3672696817653550044 b/js/src/ics/IC-3672696817653550044 new file mode 100644 index 0000000000000..cdf3a4c06360c --- /dev/null +++ b/js/src/ics/IC-3672696817653550044 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3679450300823375305 b/js/src/ics/IC-3679450300823375305 new file mode 100644 index 0000000000000..4918102b58077 --- /dev/null +++ b/js/src/ics/IC-3679450300823375305 @@ -0,0 +1 @@ +SetProp, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(4) LASTUSED(4) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(2) OFFSET(1) ID(0) OP(GuardShape) ID(2) OFFSET(2) OP(AddAndStoreFixedSlot) ID(0) OFFSET(3) ID(1) OFFSET(4) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3682576107139758084 b/js/src/ics/IC-3682576107139758084 new file mode 100644 index 0000000000000..bd28d931a2d0c --- /dev/null +++ b/js/src/ics/IC-3682576107139758084 @@ -0,0 +1 @@ +Call, 1, 4, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(SameValueResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3734812142467418625 b/js/src/ics/IC-3734812142467418625 new file mode 100644 index 0000000000000..88ebd5678534a --- /dev/null +++ b/js/src/ics/IC-3734812142467418625 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Double) STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardIsNull) ID(1) OP(LoadDoubleConstant) OFFSET(1) ID(3) OP(CompareDoubleResult) JSOP(Gt) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3755018854119379339 b/js/src/ics/IC-3755018854119379339 new file mode 100644 index 0000000000000..2397926912b8c --- /dev/null +++ b/js/src/ics/IC-3755018854119379339 @@ -0,0 +1 @@ +HasOwn, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(1) OP(GuardToString) ID(0) OP(GuardStringToIndex) ID(0) ID(2) OP(GuardIsNativeObject) ID(1) OP(CallObjectHasSparseElementResult) ID(1) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3773285914794781769 b/js/src/ics/IC-3773285914794781769 new file mode 100644 index 0000000000000..d0d84644e7346 --- /dev/null +++ b/js/src/ics/IC-3773285914794781769 @@ -0,0 +1 @@ +GetElemSuper, 3, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(3) LASTUSED(0) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadDenseElementHoleResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3777372779978486243 b/js/src/ics/IC-3777372779978486243 new file mode 100644 index 0000000000000..21f90386c5faf --- /dev/null +++ b/js/src/ics/IC-3777372779978486243 @@ -0,0 +1 @@ +GetElem, 2, 3, 8, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(6) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(GuardNoDenseElements) ID(2) OP(LoadDenseElementHoleResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3783993352614114791 b/js/src/ics/IC-3783993352614114791 new file mode 100644 index 0000000000000..122a414e50741 --- /dev/null +++ b/js/src/ics/IC-3783993352614114791 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardShape) ID(3) OFFSET(4) OP(RegExpFlagResult) ID(3) INT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3797926286349396013 b/js/src/ics/IC-3797926286349396013 new file mode 100644 index 0000000000000..8999c34f981ef --- /dev/null +++ b/js/src/ics/IC-3797926286349396013 @@ -0,0 +1 @@ +GetElem, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(String) , LASTUSED(4) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardClass) ID(0) GUARDCLASSKIND(UnmappedArguments) OP(LoadArgumentsObjectLengthResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3808918365377850068 b/js/src/ics/IC-3808918365377850068 new file mode 100644 index 0000000000000..b685d6353a5fa --- /dev/null +++ b/js/src/ics/IC-3808918365377850068 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardToInt32) ID(0) OP(GuardIsNullOrUndefined) ID(1) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(Int32URightShiftResult) ID(0) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3865431538426642194 b/js/src/ics/IC-3865431538426642194 new file mode 100644 index 0000000000000..d08f270018048 --- /dev/null +++ b/js/src/ics/IC-3865431538426642194 @@ -0,0 +1 @@ +GetProp, 1, 2, 8, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(7) OP(LoadArrayBufferViewLengthInt32Result) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3867479862096930136 b/js/src/ics/IC-3867479862096930136 new file mode 100644 index 0000000000000..7f6290ece663a --- /dev/null +++ b/js/src/ics/IC-3867479862096930136 @@ -0,0 +1 @@ +Call, 1, 9, 16, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) LASTUSED(10) LASTUSED(10) LASTUSED(13) LASTUSED(13) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(5) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardIsNumber) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardIsNumber) ID(3) OP(NumberMinMax) BOOL(0) ID(2) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardIsNumber) ID(5) OP(NumberMinMax) BOOL(0) ID(4) ID(5) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardIsNumber) ID(7) OP(NumberMinMax) BOOL(0) ID(6) ID(7) ID(8) OP(LoadDoubleResult) ID(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3870915099258776426 b/js/src/ics/IC-3870915099258776426 new file mode 100644 index 0000000000000..f3fe880ff1d52 --- /dev/null +++ b/js/src/ics/IC-3870915099258776426 @@ -0,0 +1 @@ +GetProp, 1, 1, 3, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Id) , LASTUSED(1) , OP(GuardToObject) ID(0) OP(MegamorphicLoadSlotPermissiveResult) ID(0) OFFSET(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-389003273598954999 b/js/src/ics/IC-389003273598954999 new file mode 100644 index 0000000000000..19537425f074a --- /dev/null +++ b/js/src/ics/IC-389003273598954999 @@ -0,0 +1 @@ +GetProp, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 88, STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(GuardNonDoubleType) ID(0) VALUETYPE(JSVAL_TYPE_STRING) OP(LoadObject) ID(1) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardObjectFuseProperty) ID(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(2) OFFSET(8) OFFSET(9) OP(UncheckedLoadWeakObjectResult) OFFSET(10) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3917163428349655949 b/js/src/ics/IC-3917163428349655949 new file mode 100644 index 0000000000000..16dd315bf9922 --- /dev/null +++ b/js/src/ics/IC-3917163428349655949 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(ResizableArrayBuffer) OP(LoadUndefined) ID(4) OP(LoadUndefined) ID(5) OP(NewTypedArrayFromArrayBufferResult) OFFSET(4) ID(3) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3949900529100100863 b/js/src/ics/IC-3949900529100100863 new file mode 100644 index 0000000000000..e8fb31a60b58e --- /dev/null +++ b/js/src/ics/IC-3949900529100100863 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3964603549364967584 b/js/src/ics/IC-3964603549364967584 new file mode 100644 index 0000000000000..6604e590ced38 --- /dev/null +++ b/js/src/ics/IC-3964603549364967584 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardToInt32) ID(0) OP(GuardIsNull) ID(1) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(CompareInt32Result) JSOP(Le) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-39690460880282582 b/js/src/ics/IC-39690460880282582 new file mode 100644 index 0000000000000..1937a722a6845 --- /dev/null +++ b/js/src/ics/IC-39690460880282582 @@ -0,0 +1 @@ +Compare, 2, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(0) , OP(GuardIsNull) ID(1) OP(CompareNullUndefinedResult) JSOP(Eq) BOOL(0) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3978516112237392526 b/js/src/ics/IC-3978516112237392526 new file mode 100644 index 0000000000000..cd552fd24d0f4 --- /dev/null +++ b/js/src/ics/IC-3978516112237392526 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(FixedLengthSharedArrayBuffer) OP(LoadUndefined) ID(4) OP(LoadUndefined) ID(5) OP(NewTypedArrayFromArrayBufferResult) OFFSET(4) ID(3) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3980529659776200209 b/js/src/ics/IC-3980529659776200209 new file mode 100644 index 0000000000000..93190f976bb64 --- /dev/null +++ b/js/src/ics/IC-3980529659776200209 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int8) ID(4) ID(3) BOOL(1) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3990626075643434207 b/js/src/ics/IC-3990626075643434207 new file mode 100644 index 0000000000000..cb9e4d3c2976a --- /dev/null +++ b/js/src/ics/IC-3990626075643434207 @@ -0,0 +1 @@ +UnaryArith, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(2) , OP(GuardToString) ID(0) OP(GuardStringToInt32) ID(0) ID(1) OP(Int32NegationResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-3995686981063035752 b/js/src/ics/IC-3995686981063035752 new file mode 100644 index 0000000000000..cd805e96da0f4 --- /dev/null +++ b/js/src/ics/IC-3995686981063035752 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(GuardIsUndefined) ID(1) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(CompareDoubleResult) JSOP(Le) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4000443357665273090 b/js/src/ics/IC-4000443357665273090 new file mode 100644 index 0000000000000..f93cda74af2da --- /dev/null +++ b/js/src/ics/IC-4000443357665273090 @@ -0,0 +1 @@ +SetElem, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(5) LASTUSED(2) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNullOrUndefined) ID(2) OP(LoadInt32Constant) OFFSET(1) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint8) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4028281825672479567 b/js/src/ics/IC-4028281825672479567 new file mode 100644 index 0000000000000..9e6b82a140111 --- /dev/null +++ b/js/src/ics/IC-4028281825672479567 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasJitEntry) ID(1) OP(GuardFunctionIsConstructor) ID(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(33) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4030969467382293263 b/js/src/ics/IC-4030969467382293263 new file mode 100644 index 0000000000000..39c24d15a8c77 --- /dev/null +++ b/js/src/ics/IC-4030969467382293263 @@ -0,0 +1 @@ +CloseIter, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadDynamicSlot) ID(1) ID(0) OFFSET(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(2) OFFSET(3) OP(CloseIterScriptedResult) ID(0) ID(1) COMPLETIONKIND(Normal) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4047821176947237630 b/js/src/ics/IC-4047821176947237630 new file mode 100644 index 0000000000000..898b319b727c8 --- /dev/null +++ b/js/src/ics/IC-4047821176947237630 @@ -0,0 +1 @@ +Call, 1, 7, 16, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(14) LASTUSED(10) LASTUSED(14) LASTUSED(13) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardHasAttachedArrayBuffer) ID(2) OP(GuardFuse) REALMFUSE(12) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToInt32) ID(5) OP(Int32ToIntPtr) ID(5) ID(6) OP(TypedArraySubarrayResult) OFFSET(3) ID(2) ID(4) ID(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-406074042512431995 b/js/src/ics/IC-406074042512431995 new file mode 100644 index 0000000000000..b34909010fa19 --- /dev/null +++ b/js/src/ics/IC-406074042512431995 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasNoJitEntry) ID(1) OP(GuardFunctionIsConstructor) ID(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(33) UINT32(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4063194770314682956 b/js/src/ics/IC-4063194770314682956 new file mode 100644 index 0000000000000..8e2569d848255 --- /dev/null +++ b/js/src/ics/IC-4063194770314682956 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint16) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4069361993612748503 b/js/src/ics/IC-4069361993612748503 new file mode 100644 index 0000000000000..6acb2dec75e87 --- /dev/null +++ b/js/src/ics/IC-4069361993612748503 @@ -0,0 +1 @@ +SetElem, 3, 4, 8, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(3) OFFSET(2) OP(GuardObjectFuseProperty) ID(3) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(1) OP(CallNativeSetter) ID(0) OFFSET(8) ID(2) BOOL(1) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4070939822708021300 b/js/src/ics/IC-4070939822708021300 new file mode 100644 index 0000000000000..1411c5ac0e942 --- /dev/null +++ b/js/src/ics/IC-4070939822708021300 @@ -0,0 +1 @@ +In, 2, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(1) , OP(GuardToObject) ID(1) OP(MegamorphicHasPropResult) ID(1) ID(0) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4078436961597644502 b/js/src/ics/IC-4078436961597644502 new file mode 100644 index 0000000000000..2999dae4a5521 --- /dev/null +++ b/js/src/ics/IC-4078436961597644502 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Uint32) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4106844363038176762 b/js/src/ics/IC-4106844363038176762 new file mode 100644 index 0000000000000..c617e79adfa35 --- /dev/null +++ b/js/src/ics/IC-4106844363038176762 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToInt32) ID(2) OP(IndirectTruncateInt32Result) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4116168477963531058 b/js/src/ics/IC-4116168477963531058 new file mode 100644 index 0000000000000..a8afda585101b --- /dev/null +++ b/js/src/ics/IC-4116168477963531058 @@ -0,0 +1 @@ +GetElem, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardIsNativeObject) ID(0) OP(GuardIndexIsNotDenseElement) ID(0) ID(1) OP(CallNativeGetElementResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-41191806326866852 b/js/src/ics/IC-41191806326866852 new file mode 100644 index 0000000000000..ef1c675a61dae --- /dev/null +++ b/js/src/ics/IC-41191806326866852 @@ -0,0 +1 @@ +GetPropSuper, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardDynamicSlotValue) ID(0) OFFSET(1) OFFSET(2) OP(LoadObject) ID(2) OFFSET(3) OP(CallScriptedGetterResult) ID(1) ID(2) BOOL(1) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4127463736148707198 b/js/src/ics/IC-4127463736148707198 new file mode 100644 index 0000000000000..86f0f431251f6 --- /dev/null +++ b/js/src/ics/IC-4127463736148707198 @@ -0,0 +1 @@ +SetElem, 3, 8, 16, JSVAL_TYPE_UNKNOWN, 104, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(14) LASTUSED(2) LASTUSED(14) LASTUSED(5) LASTUSED(7) LASTUSED(9) LASTUSED(12) LASTUSED(13) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(0) OP(GuardShape) ID(3) OFFSET(3) OP(LoadProtoObject) ID(4) OFFSET(4) ID(0) OP(GuardShape) ID(4) OFFSET(5) OP(LoadProtoObject) ID(5) OFFSET(6) ID(0) OP(GuardShape) ID(5) OFFSET(7) OP(LoadProtoObject) ID(6) OFFSET(8) ID(0) OP(GuardShape) ID(6) OFFSET(9) OP(LoadProto) ID(6) ID(7) OP(GuardShape) ID(7) OFFSET(10) OP(AddAndStoreFixedSlot) ID(0) OFFSET(11) ID(2) OFFSET(12) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4137503656080954450 b/js/src/ics/IC-4137503656080954450 new file mode 100644 index 0000000000000..fc17025ee378e --- /dev/null +++ b/js/src/ics/IC-4137503656080954450 @@ -0,0 +1 @@ +SetProp, 2, 6, 12, JSVAL_TYPE_UNKNOWN, 88, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(10) LASTUSED(10) LASTUSED(3) LASTUSED(5) LASTUSED(7) LASTUSED(9) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(2) OFFSET(1) ID(0) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(0) OP(GuardShape) ID(3) OFFSET(4) OP(LoadProtoObject) ID(4) OFFSET(5) ID(0) OP(GuardShape) ID(4) OFFSET(6) OP(LoadProtoObject) ID(5) OFFSET(7) ID(0) OP(GuardShape) ID(5) OFFSET(8) OP(AddAndStoreFixedSlot) ID(0) OFFSET(9) ID(1) OFFSET(10) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-414410497084563379 b/js/src/ics/IC-414410497084563379 new file mode 100644 index 0000000000000..106c857671a6b --- /dev/null +++ b/js/src/ics/IC-414410497084563379 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(Date) OP(DateFillLocalTimeSlots) ID(2) OP(LoadFixedSlot) ID(3) ID(2) OFFSET(2) OP(DateSecondsFromSecondsIntoYearResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4159338440671789798 b/js/src/ics/IC-4159338440671789798 new file mode 100644 index 0000000000000..e6c0b86b849f7 --- /dev/null +++ b/js/src/ics/IC-4159338440671789798 @@ -0,0 +1 @@ +GetElem, 2, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(2) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(0) OP(GuardShape) ID(2) OFFSET(3) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4183842994047523642 b/js/src/ics/IC-4183842994047523642 new file mode 100644 index 0000000000000..a0cfbb26d061a --- /dev/null +++ b/js/src/ics/IC-4183842994047523642 @@ -0,0 +1 @@ +GetElem, 2, 3, 9, JSVAL_TYPE_UNKNOWN, 88, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakValue) , LASTUSED(3) LASTUSED(2) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardObjectFuseProperty) ID(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(2) OFFSET(8) OFFSET(9) OP(UncheckedLoadWeakValueResult) OFFSET(10) OP(ReturnFromIC) diff --git a/js/src/ics/IC-419206947237103119 b/js/src/ics/IC-419206947237103119 new file mode 100644 index 0000000000000..cc73762bfe257 --- /dev/null +++ b/js/src/ics/IC-419206947237103119 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Float64) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4201435969598747070 b/js/src/ics/IC-4201435969598747070 new file mode 100644 index 0000000000000..8767f4be2d65a --- /dev/null +++ b/js/src/ics/IC-4201435969598747070 @@ -0,0 +1 @@ +SetElem, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(5) LASTUSED(3) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToBoolean) ID(2) OP(BooleanToNumber) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float64) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4213864849714302958 b/js/src/ics/IC-4213864849714302958 new file mode 100644 index 0000000000000..7a9361e8d0727 --- /dev/null +++ b/js/src/ics/IC-4213864849714302958 @@ -0,0 +1 @@ +GetElem, 2, 3, 8, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(GuardDynamicSlotValue) ID(0) OFFSET(2) OFFSET(3) OP(LoadObject) ID(2) OFFSET(4) OP(CallScriptedGetterResult) ID(0) ID(2) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4253798086806600477 b/js/src/ics/IC-4253798086806600477 new file mode 100644 index 0000000000000..c8dc27676b4d4 --- /dev/null +++ b/js/src/ics/IC-4253798086806600477 @@ -0,0 +1 @@ +GetProp, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(0) LASTUSED(4) , OP(GuardIsNumber) ID(0) OP(LoadObject) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(1) OFFSET(7) OFFSET(8) OP(UncheckedLoadWeakObjectResult) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4257898183961413318 b/js/src/ics/IC-4257898183961413318 new file mode 100644 index 0000000000000..718a722e61b9d --- /dev/null +++ b/js/src/ics/IC-4257898183961413318 @@ -0,0 +1 @@ +SetElem, 3, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(String) STUBFIELD(Id) , LASTUSED(5) LASTUSED(4) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardIsNotDOMProxy) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(ProxySet) ID(0) OFFSET(1) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-428929725231831370 b/js/src/ics/IC-428929725231831370 new file mode 100644 index 0000000000000..7949dda2641f8 --- /dev/null +++ b/js/src/ics/IC-428929725231831370 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(PackedArrayPopResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4290628426590161433 b/js/src/ics/IC-4290628426590161433 new file mode 100644 index 0000000000000..3818011967be1 --- /dev/null +++ b/js/src/ics/IC-4290628426590161433 @@ -0,0 +1 @@ +BindName, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(2) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadFixedSlot) ID(1) ID(0) OFFSET(1) OP(GuardIsNotUninitializedLexical) ID(1) OP(LoadObjectResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4314897430777610180 b/js/src/ics/IC-4314897430777610180 new file mode 100644 index 0000000000000..a82cc5ee774cc --- /dev/null +++ b/js/src/ics/IC-4314897430777610180 @@ -0,0 +1 @@ +BinaryArith, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToString) ID(0) OP(GuardStringToNumber) ID(0) ID(2) OP(TruncateDoubleToUInt32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32LeftShiftResult) ID(3) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4331034240427156470 b/js/src/ics/IC-4331034240427156470 new file mode 100644 index 0000000000000..1eb43263467af --- /dev/null +++ b/js/src/ics/IC-4331034240427156470 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(TanNative) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4349140574576985106 b/js/src/ics/IC-4349140574576985106 new file mode 100644 index 0000000000000..ee0cee28648f5 --- /dev/null +++ b/js/src/ics/IC-4349140574576985106 @@ -0,0 +1 @@ +GetIterator, 1, 1, 3, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawPointer) , LASTUSED(1) , OP(GuardToObject) ID(0) OP(ObjectToIteratorResult) ID(0) OFFSET(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4356010842119990164 b/js/src/ics/IC-4356010842119990164 new file mode 100644 index 0000000000000..fae6d5124a0a5 --- /dev/null +++ b/js/src/ics/IC-4356010842119990164 @@ -0,0 +1 @@ +GetElemSuper, 3, 3, 8, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(Symbol) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(5) LASTUSED(2) LASTUSED(0) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(0) OFFSET(1) OP(GuardObjectFuseProperty) ID(0) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(0) OFFSET(7) OFFSET(8) OP(UncheckedLoadWeakObjectResult) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4401115047547016029 b/js/src/ics/IC-4401115047547016029 new file mode 100644 index 0000000000000..531f0655ecbc0 --- /dev/null +++ b/js/src/ics/IC-4401115047547016029 @@ -0,0 +1 @@ +GetProp, 1, 4, 13, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(Id) , LASTUSED(11) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadScriptedProxyHandler) ID(1) ID(0) OP(LoadWrapperTarget) ID(0) ID(2) BOOL(1) OP(GuardIsNativeObject) ID(2) OP(GuardShape) ID(1) OFFSET(1) OP(LoadFixedSlot) ID(3) ID(1) OFFSET(2) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(3) OFFSET(3) OFFSET(4) OP(CallScriptedProxyGetResult) ID(2) ID(0) ID(1) ID(3) OFFSET(5) UINT32(199456) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4469743735075377828 b/js/src/ics/IC-4469743735075377828 new file mode 100644 index 0000000000000..2c20ceb950c11 --- /dev/null +++ b/js/src/ics/IC-4469743735075377828 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(TruncateDoubleToUInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32LeftShiftResult) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4529465499681039560 b/js/src/ics/IC-4529465499681039560 new file mode 100644 index 0000000000000..0652ed4caa8d1 --- /dev/null +++ b/js/src/ics/IC-4529465499681039560 @@ -0,0 +1 @@ +SetElem, 3, 5, 10, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(8) LASTUSED(2) LASTUSED(8) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(0) OP(GuardShape) ID(3) OFFSET(3) OP(LoadProtoObject) ID(4) OFFSET(4) ID(0) OP(GuardShape) ID(4) OFFSET(5) OP(AddAndStoreFixedSlot) ID(0) OFFSET(6) ID(2) OFFSET(7) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4531364307335516741 b/js/src/ics/IC-4531364307335516741 new file mode 100644 index 0000000000000..860a2f83533cd --- /dev/null +++ b/js/src/ics/IC-4531364307335516741 @@ -0,0 +1 @@ +Call, 1, 6, 14, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(12) LASTUSED(12) LASTUSED(12) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(UnmappedArguments) OP(GuardArgumentsObjectFlags) ID(3) BYTE(21) OP(LoadInt32Constant) OFFSET(4) ID(4) OP(LoadArgumentsObjectLength) ID(3) ID(5) OP(ArgumentsSliceResult) OFFSET(5) ID(3) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4540536284992510594 b/js/src/ics/IC-4540536284992510594 new file mode 100644 index 0000000000000..1788ad720d800 --- /dev/null +++ b/js/src/ics/IC-4540536284992510594 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(LoadObjectResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-455359788701706473 b/js/src/ics/IC-455359788701706473 new file mode 100644 index 0000000000000..d635c05ef2e67 --- /dev/null +++ b/js/src/ics/IC-455359788701706473 @@ -0,0 +1 @@ +Call, 1, 7, 15, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardIsNumber) ID(5) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(GuardToBoolean) ID(6) OP(StoreDataViewValueResult) ID(2) ID(4) ID(5) ID(6) SCALARTYPE(Float64) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4564453466100177384 b/js/src/ics/IC-4564453466100177384 new file mode 100644 index 0000000000000..350aa3cdadf0c --- /dev/null +++ b/js/src/ics/IC-4564453466100177384 @@ -0,0 +1 @@ +BinaryArith, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(4) LASTUSED(2) LASTUSED(3) LASTUSED(4) , OP(GuardToInt32) ID(0) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(2) OP(TruncateDoubleToUInt32) ID(2) ID(3) OP(Int32URightShiftResult) ID(0) ID(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4570824905465268802 b/js/src/ics/IC-4570824905465268802 new file mode 100644 index 0000000000000..fe976beeaf0a8 --- /dev/null +++ b/js/src/ics/IC-4570824905465268802 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawPointer) STUBFIELD(Shape) STUBFIELD(AllocSite) , LASTUSED(0) LASTUSED(2) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardNoAllocationMetadataBuilder) OFFSET(2) OP(NewPlainObjectResult) UINT32(0) UINT32(0) ALLOCKIND(OBJECT4) OFFSET(3) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4586879335310093030 b/js/src/ics/IC-4586879335310093030 new file mode 100644 index 0000000000000..2dbcf9b075db3 --- /dev/null +++ b/js/src/ics/IC-4586879335310093030 @@ -0,0 +1 @@ +GetName, 1, 4, 7, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(LoadObject) ID(3) OFFSET(3) OP(CallScriptedGetterResult) ID(2) ID(3) BOOL(1) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4615780852236812813 b/js/src/ics/IC-4615780852236812813 new file mode 100644 index 0000000000000..70d9f89a3dc16 --- /dev/null +++ b/js/src/ics/IC-4615780852236812813 @@ -0,0 +1 @@ +BinaryArith, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToString) ID(0) OP(GuardStringToNumber) ID(0) ID(2) OP(TruncateDoubleToUInt32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32URightShiftResult) ID(3) ID(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4633639322269444908 b/js/src/ics/IC-4633639322269444908 new file mode 100644 index 0000000000000..7f53d2c154852 --- /dev/null +++ b/js/src/ics/IC-4633639322269444908 @@ -0,0 +1 @@ +Call, 1, 4, 13, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(11) LASTUSED(2) LASTUSED(11) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(MappedArguments) OP(GuardArgumentsObjectFlags) ID(3) BYTE(20) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(68) UINT32(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-463435529406221163 b/js/src/ics/IC-463435529406221163 new file mode 100644 index 0000000000000..99b0e56bd3522 --- /dev/null +++ b/js/src/ics/IC-463435529406221163 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(ObjectToStringResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4667474526973057585 b/js/src/ics/IC-4667474526973057585 new file mode 100644 index 0000000000000..a0967cdcb48f4 --- /dev/null +++ b/js/src/ics/IC-4667474526973057585 @@ -0,0 +1 @@ +Call, 1, 7, 13, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardHasAttachedArrayBuffer) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32ModUint32) ID(3) ID(4) OP(LoadInt32AsIntPtrConstant) OFFSET(3) ID(5) OP(LoadArrayBufferViewLength) ID(2) ID(6) OP(TypedArrayFillResult) ID(2) ID(4) ID(5) ID(6) SCALARTYPE(Int32) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4668691876088627929 b/js/src/ics/IC-4668691876088627929 new file mode 100644 index 0000000000000..1b13ab50d60dd --- /dev/null +++ b/js/src/ics/IC-4668691876088627929 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint8Clamped) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4681946795141297256 b/js/src/ics/IC-4681946795141297256 new file mode 100644 index 0000000000000..7db4014a97ac0 --- /dev/null +++ b/js/src/ics/IC-4681946795141297256 @@ -0,0 +1 @@ +Call, 1, 4, 14, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(12) LASTUSED(2) LASTUSED(12) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(MappedArguments) OP(GuardArgumentsObjectFlags) ID(3) BYTE(20) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardNotClassConstructor) ID(2) OP(GuardFunctionHasJitEntry) ID(2) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(4) UINT32(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4701671027380290987 b/js/src/ics/IC-4701671027380290987 new file mode 100644 index 0000000000000..25ba1ecc31d3d --- /dev/null +++ b/js/src/ics/IC-4701671027380290987 @@ -0,0 +1 @@ +GetProp, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 72, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(CallNativeGetterResult) ID(0) OFFSET(7) BOOL(1) OFFSET(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4731098206248976372 b/js/src/ics/IC-4731098206248976372 new file mode 100644 index 0000000000000..8f480531cbb10 --- /dev/null +++ b/js/src/ics/IC-4731098206248976372 @@ -0,0 +1 @@ +GetProp, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(3) LASTUSED(4) , OP(GuardNonDoubleType) ID(0) VALUETYPE(JSVAL_TYPE_BOOLEAN) OP(LoadObject) ID(1) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(1) OP(GuardShape) ID(2) OFFSET(3) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4734497559573485904 b/js/src/ics/IC-4734497559573485904 new file mode 100644 index 0000000000000..01c20790add04 --- /dev/null +++ b/js/src/ics/IC-4734497559573485904 @@ -0,0 +1 @@ +HasOwn, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(1) OP(GuardIsNonResizableTypedArray) ID(1) OP(GuardIsNumber) ID(0) OP(GuardNumberToIntPtrIndex) ID(0) BOOL(1) ID(2) OP(LoadTypedArrayElementExistsResult) ID(1) ID(2) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4735590702341055761 b/js/src/ics/IC-4735590702341055761 new file mode 100644 index 0000000000000..bd55ff24f601b --- /dev/null +++ b/js/src/ics/IC-4735590702341055761 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(10) LASTUSED(2) LASTUSED(10) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardShape) ID(3) OFFSET(2) OP(GuardArrayIsPacked) ID(3) OP(GuardSpecificFunction) ID(2) OFFSET(3) OFFSET(4) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(69) UINT32(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4736397757847713077 b/js/src/ics/IC-4736397757847713077 new file mode 100644 index 0000000000000..646f0d8b21911 --- /dev/null +++ b/js/src/ics/IC-4736397757847713077 @@ -0,0 +1 @@ +GetName, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(3) LASTUSED(5) LASTUSED(6) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(1) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadDynamicSlot) ID(3) ID(2) OFFSET(3) OP(LoadOperandResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4739648521757046986 b/js/src/ics/IC-4739648521757046986 new file mode 100644 index 0000000000000..3cc43b9724a5d --- /dev/null +++ b/js/src/ics/IC-4739648521757046986 @@ -0,0 +1 @@ +BindName, 1, 6, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(WeakShape) , LASTUSED(1) LASTUSED(2) LASTUSED(3) LASTUSED(5) LASTUSED(7) LASTUSED(8) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(LoadEnclosingEnvironment) ID(2) ID(3) OP(GuardShape) ID(3) OFFSET(1) OP(LoadEnclosingEnvironment) ID(3) ID(4) OP(GuardShape) ID(4) OFFSET(2) OP(LoadEnclosingEnvironment) ID(4) ID(5) OP(LoadObjectResult) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4744040428186374519 b/js/src/ics/IC-4744040428186374519 new file mode 100644 index 0000000000000..cbee9926f11f3 --- /dev/null +++ b/js/src/ics/IC-4744040428186374519 @@ -0,0 +1 @@ +Call, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(IsTypedArrayResult) ID(1) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4764951245913829783 b/js/src/ics/IC-4764951245913829783 new file mode 100644 index 0000000000000..ced80407d8a14 --- /dev/null +++ b/js/src/ics/IC-4764951245913829783 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Shape) , LASTUSED(0) LASTUSED(3) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(GuardFuse) REALMFUSE(9) OP(HasShapeResult) ID(1) OFFSET(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4807651754683386837 b/js/src/ics/IC-4807651754683386837 new file mode 100644 index 0000000000000..4fb89ee6fde20 --- /dev/null +++ b/js/src/ics/IC-4807651754683386837 @@ -0,0 +1 @@ +SetElem, 3, 6, 12, JSVAL_TYPE_UNKNOWN, 88, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) STUBFIELD(RawInt32) , LASTUSED(10) LASTUSED(2) LASTUSED(10) LASTUSED(5) LASTUSED(7) LASTUSED(9) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(0) OP(GuardShape) ID(3) OFFSET(3) OP(LoadProtoObject) ID(4) OFFSET(4) ID(0) OP(GuardShape) ID(4) OFFSET(5) OP(LoadProtoObject) ID(5) OFFSET(6) ID(0) OP(GuardShape) ID(5) OFFSET(7) OP(AllocateAndStoreDynamicSlot) ID(0) OFFSET(8) ID(2) OFFSET(9) OFFSET(10) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4837639617296355283 b/js/src/ics/IC-4837639617296355283 new file mode 100644 index 0000000000000..62e7cbcece8f5 --- /dev/null +++ b/js/src/ics/IC-4837639617296355283 @@ -0,0 +1 @@ +HasOwn, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(1) OP(GuardToInt32) ID(0) OP(GuardIsNativeObject) ID(1) OP(CallObjectHasSparseElementResult) ID(1) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4845452116642991738 b/js/src/ics/IC-4845452116642991738 new file mode 100644 index 0000000000000..54d4ef83c56fa --- /dev/null +++ b/js/src/ics/IC-4845452116642991738 @@ -0,0 +1 @@ +GetProp, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(Id) , LASTUSED(4) LASTUSED(7) LASTUSED(9) LASTUSED(8) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadScriptedProxyHandler) ID(1) ID(0) OP(LoadWrapperTarget) ID(0) ID(2) BOOL(1) OP(GuardIsNativeObject) ID(2) OP(GuardShape) ID(1) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(1) OP(GuardShape) ID(3) OFFSET(3) OP(MegamorphicLoadSlotResult) ID(2) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4891342749109966432 b/js/src/ics/IC-4891342749109966432 new file mode 100644 index 0000000000000..a0cedaf4cd0b1 --- /dev/null +++ b/js/src/ics/IC-4891342749109966432 @@ -0,0 +1 @@ +CheckPrivateField, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Symbol) STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadBooleanResult) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4900135455193282383 b/js/src/ics/IC-4900135455193282383 new file mode 100644 index 0000000000000..2b6813835f893 --- /dev/null +++ b/js/src/ics/IC-4900135455193282383 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4922149867090114317 b/js/src/ics/IC-4922149867090114317 new file mode 100644 index 0000000000000..4b3d41556af4b --- /dev/null +++ b/js/src/ics/IC-4922149867090114317 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4963669926436995651 b/js/src/ics/IC-4963669926436995651 new file mode 100644 index 0000000000000..73ea9ddd999bc --- /dev/null +++ b/js/src/ics/IC-4963669926436995651 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4980379635059490652 b/js/src/ics/IC-4980379635059490652 new file mode 100644 index 0000000000000..85d46081a7502 --- /dev/null +++ b/js/src/ics/IC-4980379635059490652 @@ -0,0 +1 @@ +SetElem, 3, 3, 6, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(StoreFixedSlot) ID(0) OFFSET(2) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4982387211093858531 b/js/src/ics/IC-4982387211093858531 new file mode 100644 index 0000000000000..56b9cbf533049 --- /dev/null +++ b/js/src/ics/IC-4982387211093858531 @@ -0,0 +1 @@ +In, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(1) OP(GuardIsNonResizableTypedArray) ID(1) OP(GuardToInt32) ID(0) OP(Int32ToIntPtr) ID(0) ID(2) OP(LoadTypedArrayElementExistsResult) ID(1) ID(2) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4983691950823390195 b/js/src/ics/IC-4983691950823390195 new file mode 100644 index 0000000000000..d2a71b67db6b9 --- /dev/null +++ b/js/src/ics/IC-4983691950823390195 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(0) LASTUSED(3) LASTUSED(3) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardIsNumber) ID(1) OP(CompareDoubleResult) JSOP(Le) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-4990566579533878012 b/js/src/ics/IC-4990566579533878012 new file mode 100644 index 0000000000000..5774a595714a4 --- /dev/null +++ b/js/src/ics/IC-4990566579533878012 @@ -0,0 +1 @@ +GetName, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(3) LASTUSED(6) LASTUSED(6) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(1) OP(GuardDynamicSlotValue) ID(1) OFFSET(2) OFFSET(3) OP(LoadObject) ID(2) OFFSET(4) OP(LoadObject) ID(3) OFFSET(5) OP(CallScriptedGetterResult) ID(2) ID(3) BOOL(1) OFFSET(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5023487226246351503 b/js/src/ics/IC-5023487226246351503 new file mode 100644 index 0000000000000..58ded79d178cb --- /dev/null +++ b/js/src/ics/IC-5023487226246351503 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(10) LASTUSED(10) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(2) ID(3) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(97) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5031122507432221980 b/js/src/ics/IC-5031122507432221980 new file mode 100644 index 0000000000000..2627d17397146 --- /dev/null +++ b/js/src/ics/IC-5031122507432221980 @@ -0,0 +1 @@ +Call, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(6) LASTUSED(6) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToString) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToInt32) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(CallSubstringKernelResult) ID(1) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5045618420272476443 b/js/src/ics/IC-5045618420272476443 new file mode 100644 index 0000000000000..253367f35c068 --- /dev/null +++ b/js/src/ics/IC-5045618420272476443 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(8) LASTUSED(8) LASTUSED(4) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(3) OFFSET(0) OFFSET(1) OP(CallBoundScriptedFunction) ID(1) ID(3) ID(0) CALLFLAGS(65) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5069792978291141863 b/js/src/ics/IC-5069792978291141863 new file mode 100644 index 0000000000000..955afdbc1c9e2 --- /dev/null +++ b/js/src/ics/IC-5069792978291141863 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToUint8Clamped) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint8Clamped) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5074177821418432695 b/js/src/ics/IC-5074177821418432695 new file mode 100644 index 0000000000000..c6245de96b94d --- /dev/null +++ b/js/src/ics/IC-5074177821418432695 @@ -0,0 +1 @@ +GetProp, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(Id) , LASTUSED(10) LASTUSED(10) LASTUSED(10) LASTUSED(10) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadScriptedProxyHandler) ID(1) ID(0) OP(LoadWrapperTarget) ID(0) ID(2) BOOL(1) OP(GuardIsNativeObject) ID(2) OP(GuardShape) ID(1) OFFSET(1) OP(LoadFixedSlot) ID(3) ID(1) OFFSET(2) OP(GuardToObject) ID(3) OP(GuardSpecificFunction) ID(3) OFFSET(3) OFFSET(4) OP(CallScriptedProxyGetResult) ID(2) ID(0) ID(1) ID(3) OFFSET(5) UINT32(131106) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5087120774109976541 b/js/src/ics/IC-5087120774109976541 new file mode 100644 index 0000000000000..12b2dbe03f826 --- /dev/null +++ b/js/src/ics/IC-5087120774109976541 @@ -0,0 +1 @@ +Call, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(6) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToString) ID(2) OP(LoadInt32Constant) OFFSET(2) ID(3) OP(NumberParseIntResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5093742640529975629 b/js/src/ics/IC-5093742640529975629 new file mode 100644 index 0000000000000..d74ac391affcb --- /dev/null +++ b/js/src/ics/IC-5093742640529975629 @@ -0,0 +1 @@ +CloseIter, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(3) LASTUSED(6) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardShape) ID(1) OFFSET(2) OP(LoadDynamicSlot) ID(2) ID(1) OFFSET(3) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(4) OFFSET(5) OP(CloseIterScriptedResult) ID(0) ID(2) COMPLETIONKIND(Normal) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5107105040617672305 b/js/src/ics/IC-5107105040617672305 new file mode 100644 index 0000000000000..9d00315c9ef77 --- /dev/null +++ b/js/src/ics/IC-5107105040617672305 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(3) , OP(GuardIsNullOrUndefined) ID(0) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32URightShiftResult) ID(2) ID(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5151588910615654670 b/js/src/ics/IC-5151588910615654670 new file mode 100644 index 0000000000000..925410378527b --- /dev/null +++ b/js/src/ics/IC-5151588910615654670 @@ -0,0 +1 @@ +BindName, 1, 6, 11, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(2) LASTUSED(3) LASTUSED(5) LASTUSED(9) LASTUSED(8) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(LoadEnclosingEnvironment) ID(2) ID(3) OP(GuardShape) ID(3) OFFSET(1) OP(LoadEnclosingEnvironment) ID(3) ID(4) OP(GuardShape) ID(4) OFFSET(2) OP(LoadDynamicSlot) ID(5) ID(4) OFFSET(3) OP(GuardIsNotUninitializedLexical) ID(5) OP(LoadObjectResult) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-51552858227663770 b/js/src/ics/IC-51552858227663770 new file mode 100644 index 0000000000000..bbdb591bcf060 --- /dev/null +++ b/js/src/ics/IC-51552858227663770 @@ -0,0 +1 @@ +In, 2, 3, 7, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(Value) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(1) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(1) OP(GuardSpecificValue) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(1) OP(GuardShape) ID(2) OFFSET(3) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5159868623055647136 b/js/src/ics/IC-5159868623055647136 new file mode 100644 index 0000000000000..e92228f8d90c9 --- /dev/null +++ b/js/src/ics/IC-5159868623055647136 @@ -0,0 +1 @@ +Call, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(IsTypedArrayResult) ID(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5170848910968615373 b/js/src/ics/IC-5170848910968615373 new file mode 100644 index 0000000000000..55bf2a3aa4845 --- /dev/null +++ b/js/src/ics/IC-5170848910968615373 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(225) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5173344172117297366 b/js/src/ics/IC-5173344172117297366 new file mode 100644 index 0000000000000..86ed8e8a591af --- /dev/null +++ b/js/src/ics/IC-5173344172117297366 @@ -0,0 +1 @@ +UnaryArith, 1, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(2) LASTUSED(3) , OP(GuardToBigInt) ID(0) OP(BigIntToIntPtr) ID(0) ID(1) OP(BigIntPtrNot) ID(1) ID(2) OP(IntPtrToBigIntResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5200828597209498575 b/js/src/ics/IC-5200828597209498575 new file mode 100644 index 0000000000000..1d237835defea --- /dev/null +++ b/js/src/ics/IC-5200828597209498575 @@ -0,0 +1 @@ +Call, 1, 7, 13, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(10) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(AtomicsSubResult) ID(2) ID(4) ID(6) SCALARTYPE(Int8) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5203330381890490451 b/js/src/ics/IC-5203330381890490451 new file mode 100644 index 0000000000000..10cbc5989872d --- /dev/null +++ b/js/src/ics/IC-5203330381890490451 @@ -0,0 +1 @@ +HasOwn, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(1) OP(GuardToInt32) ID(0) OP(GuardShape) ID(1) OFFSET(0) OP(LoadDenseElementHoleExistsResult) ID(1) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5214159996564928378 b/js/src/ics/IC-5214159996564928378 new file mode 100644 index 0000000000000..bdee4754a97e1 --- /dev/null +++ b/js/src/ics/IC-5214159996564928378 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(5) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardIsNumber) ID(2) OP(GuardIsNumber) ID(3) OP(LoadArgumentFixedSlot) ID(4) BYTE(1) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardIsNumber) ID(4) OP(GuardIsNumber) ID(5) OP(MathHypot4NumberResult) ID(2) ID(3) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5229682133416320795 b/js/src/ics/IC-5229682133416320795 new file mode 100644 index 0000000000000..b2457af32e023 --- /dev/null +++ b/js/src/ics/IC-5229682133416320795 @@ -0,0 +1 @@ +Call, 1, 6, 15, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(13) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(UnmappedArguments) OP(GuardArgumentsObjectFlags) ID(3) BYTE(21) OP(LoadArgumentFixedSlot) ID(4) BYTE(0) OP(GuardToInt32) ID(4) OP(LoadArgumentsObjectLength) ID(3) ID(5) OP(ArgumentsSliceResult) OFFSET(4) ID(3) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5292473895363177205 b/js/src/ics/IC-5292473895363177205 new file mode 100644 index 0000000000000..1312e71dc4b8b --- /dev/null +++ b/js/src/ics/IC-5292473895363177205 @@ -0,0 +1 @@ +GetElem, 2, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(1) , OP(GuardToObject) ID(0) OP(MegamorphicLoadSlotByValueResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5298416090638667837 b/js/src/ics/IC-5298416090638667837 new file mode 100644 index 0000000000000..de0c3d6eb1c2c --- /dev/null +++ b/js/src/ics/IC-5298416090638667837 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasNoJitEntry) ID(1) OP(GuardNotClassConstructor) ID(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(0) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5314653691660087053 b/js/src/ics/IC-5314653691660087053 new file mode 100644 index 0000000000000..ad376819eb209 --- /dev/null +++ b/js/src/ics/IC-5314653691660087053 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(9) LASTUSED(9) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(2) ID(3) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(97) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5316601505449798967 b/js/src/ics/IC-5316601505449798967 new file mode 100644 index 0000000000000..1454c21bf5a80 --- /dev/null +++ b/js/src/ics/IC-5316601505449798967 @@ -0,0 +1 @@ +GetElem, 2, 3, 9, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(7) LASTUSED(7) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardClass) ID(0) GUARDCLASSKIND(UnmappedArguments) OP(GuardProto) ID(0) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(GuardNoDenseElements) ID(2) OP(LoadArgumentsObjectArgHoleResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5325110385863222471 b/js/src/ics/IC-5325110385863222471 new file mode 100644 index 0000000000000..a600d1059a74e --- /dev/null +++ b/js/src/ics/IC-5325110385863222471 @@ -0,0 +1 @@ +BindName, 1, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(LoadObjectResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5325479602864963535 b/js/src/ics/IC-5325479602864963535 new file mode 100644 index 0000000000000..41a0cf1e34ee2 --- /dev/null +++ b/js/src/ics/IC-5325479602864963535 @@ -0,0 +1 @@ +SetElem, 3, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(ProxySetByValue) ID(0) ID(1) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5356911276060368919 b/js/src/ics/IC-5356911276060368919 new file mode 100644 index 0000000000000..b11d8baea093e --- /dev/null +++ b/js/src/ics/IC-5356911276060368919 @@ -0,0 +1 @@ +Compare, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(CompareInt32Result) JSOP(Gt) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5360274303237669571 b/js/src/ics/IC-5360274303237669571 new file mode 100644 index 0000000000000..91df9f5746c2e --- /dev/null +++ b/js/src/ics/IC-5360274303237669571 @@ -0,0 +1 @@ +Compare, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(CompareInt32Result) JSOP(Le) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5366859542488836052 b/js/src/ics/IC-5366859542488836052 new file mode 100644 index 0000000000000..aa987a5bb97e6 --- /dev/null +++ b/js/src/ics/IC-5366859542488836052 @@ -0,0 +1 @@ +Call, 1, 7, 16, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(6) LASTUSED(4) LASTUSED(7) LASTUSED(9) LASTUSED(14) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(LoadFixedSlot) ID(4) ID(1) OFFSET(0) OP(GuardSpecificFunction) ID(3) OFFSET(1) OFFSET(2) OP(GuardToObject) ID(4) OP(GuardSpecificFunction) ID(4) OFFSET(3) OFFSET(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToObject) ID(5) OP(GuardClass) ID(5) GUARDCLASSKIND(Map) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(MapHasResult) ID(5) ID(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-537262894942906764 b/js/src/ics/IC-537262894942906764 new file mode 100644 index 0000000000000..303161003bd03 --- /dev/null +++ b/js/src/ics/IC-537262894942906764 @@ -0,0 +1 @@ +Call, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(IsArrayResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5414419622920062469 b/js/src/ics/IC-5414419622920062469 new file mode 100644 index 0000000000000..81864e497ada1 --- /dev/null +++ b/js/src/ics/IC-5414419622920062469 @@ -0,0 +1 @@ +Call, 1, 7, 15, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardIsNumber) ID(5) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(GuardToBoolean) ID(6) OP(StoreDataViewValueResult) ID(2) ID(4) ID(5) ID(6) SCALARTYPE(Float16) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5430422129922568042 b/js/src/ics/IC-5430422129922568042 new file mode 100644 index 0000000000000..b0672a1629a9e --- /dev/null +++ b/js/src/ics/IC-5430422129922568042 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32URightShiftResult) ID(2) ID(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5431138521638409901 b/js/src/ics/IC-5431138521638409901 new file mode 100644 index 0000000000000..f3f689a6c384a --- /dev/null +++ b/js/src/ics/IC-5431138521638409901 @@ -0,0 +1 @@ +GetElemSuper, 3, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIndexIsNotDenseElement) ID(0) ID(1) OP(CallNativeGetElementSuperResult) ID(0) ID(1) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5440563467445612687 b/js/src/ics/IC-5440563467445612687 new file mode 100644 index 0000000000000..2d5d47e48d2d9 --- /dev/null +++ b/js/src/ics/IC-5440563467445612687 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Double) STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardIsNull) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardIsUndefined) ID(1) OP(LoadDoubleConstant) OFFSET(1) ID(3) OP(CompareDoubleResult) JSOP(Le) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5451562074139472869 b/js/src/ics/IC-5451562074139472869 new file mode 100644 index 0000000000000..3fdbe355b3afd --- /dev/null +++ b/js/src/ics/IC-5451562074139472869 @@ -0,0 +1 @@ +GetElem, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadDenseElementResult) ID(0) ID(1) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5453413639121254243 b/js/src/ics/IC-5453413639121254243 new file mode 100644 index 0000000000000..7f5743870ea9e --- /dev/null +++ b/js/src/ics/IC-5453413639121254243 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(4) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5453706424808110088 b/js/src/ics/IC-5453706424808110088 new file mode 100644 index 0000000000000..ff9d4b3ffa512 --- /dev/null +++ b/js/src/ics/IC-5453706424808110088 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasNoJitEntry) ID(1) OP(GuardNotClassConstructor) ID(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5475933309292952269 b/js/src/ics/IC-5475933309292952269 new file mode 100644 index 0000000000000..b8d9e7c79567a --- /dev/null +++ b/js/src/ics/IC-5475933309292952269 @@ -0,0 +1 @@ +GetElem, 2, 4, 9, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(2) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadFixedSlot) ID(2) ID(0) OFFSET(2) OP(LoadGetterSetterFunction) ID(2) BOOL(1) BOOL(0) ID(3) OP(GuardFunctionScript) ID(3) OFFSET(3) OFFSET(4) OP(CallScriptedGetterResult) ID(0) ID(3) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-548882788670680882 b/js/src/ics/IC-548882788670680882 new file mode 100644 index 0000000000000..e80949e242142 --- /dev/null +++ b/js/src/ics/IC-548882788670680882 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(97) UINT32(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5498468084005282890 b/js/src/ics/IC-5498468084005282890 new file mode 100644 index 0000000000000..0417871902411 --- /dev/null +++ b/js/src/ics/IC-5498468084005282890 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(RawPointer) STUBFIELD(RawPointer) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardAnyClass) ID(1) OFFSET(0) OP(CallClassHook) ID(1) ID(0) CALLFLAGS(33) UINT32(0) OFFSET(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5503857666127213563 b/js/src/ics/IC-5503857666127213563 new file mode 100644 index 0000000000000..6e64b00c9c4ca --- /dev/null +++ b/js/src/ics/IC-5503857666127213563 @@ -0,0 +1 @@ +UnaryArith, 1, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(GuardBooleanToInt32) ID(0) ID(1) OP(Int32NegationResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-551759920627692530 b/js/src/ics/IC-551759920627692530 new file mode 100644 index 0000000000000..86f6daccd3ed6 --- /dev/null +++ b/js/src/ics/IC-551759920627692530 @@ -0,0 +1 @@ +In, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(1) OP(GuardToString) ID(0) OP(GuardStringToIndex) ID(0) ID(2) OP(GuardShape) ID(1) OFFSET(0) OP(LoadDenseElementExistsResult) ID(1) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5532241740121324706 b/js/src/ics/IC-5532241740121324706 new file mode 100644 index 0000000000000..942680b16d541 --- /dev/null +++ b/js/src/ics/IC-5532241740121324706 @@ -0,0 +1 @@ +Call, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawPointer) , LASTUSED(0) LASTUSED(2) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(HasClassResult) ID(1) OFFSET(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5535867792675904524 b/js/src/ics/IC-5535867792675904524 new file mode 100644 index 0000000000000..e2e0daf95eb9c --- /dev/null +++ b/js/src/ics/IC-5535867792675904524 @@ -0,0 +1 @@ +CloseIter, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(2) LASTUSED(4) LASTUSED(6) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(1) OFFSET(1) ID(0) OP(GuardShape) ID(1) OFFSET(2) OP(LoadProtoObject) ID(2) OFFSET(3) ID(0) OP(GuardShape) ID(2) OFFSET(4) OP(LoadProtoObject) ID(3) OFFSET(5) ID(0) OP(GuardShape) ID(3) OFFSET(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5557600775286138031 b/js/src/ics/IC-5557600775286138031 new file mode 100644 index 0000000000000..1a2af4e1ca49e --- /dev/null +++ b/js/src/ics/IC-5557600775286138031 @@ -0,0 +1 @@ +GetProp, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 72, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(3) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(0) OP(LoadObject) ID(2) OFFSET(7) OP(CallScriptedGetterResult) ID(0) ID(2) BOOL(1) OFFSET(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5577207826876614659 b/js/src/ics/IC-5577207826876614659 new file mode 100644 index 0000000000000..b5df43a3cc4c5 --- /dev/null +++ b/js/src/ics/IC-5577207826876614659 @@ -0,0 +1 @@ +GetElem, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardToInt32Index) ID(1) ID(2) OP(GuardShape) ID(0) OFFSET(0) OP(LoadDenseElementResult) ID(0) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5621344425638133163 b/js/src/ics/IC-5621344425638133163 new file mode 100644 index 0000000000000..525490d00b00e --- /dev/null +++ b/js/src/ics/IC-5621344425638133163 @@ -0,0 +1 @@ +Call, 1, 7, 17, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(6) LASTUSED(4) LASTUSED(7) LASTUSED(9) LASTUSED(15) LASTUSED(15) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(LoadFixedSlot) ID(4) ID(1) OFFSET(0) OP(GuardSpecificFunction) ID(3) OFFSET(1) OFFSET(2) OP(GuardToObject) ID(4) OP(GuardSpecificFunction) ID(4) OFFSET(3) OFFSET(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToObject) ID(5) OP(GuardShape) ID(5) OFFSET(5) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(GuardToObject) ID(6) OP(MapHasObjectResult) ID(5) ID(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5622365618808743691 b/js/src/ics/IC-5622365618808743691 new file mode 100644 index 0000000000000..33cdee26d89a3 --- /dev/null +++ b/js/src/ics/IC-5622365618808743691 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathSqrtNumberResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5626904542189522402 b/js/src/ics/IC-5626904542189522402 new file mode 100644 index 0000000000000..fb6c502f49033 --- /dev/null +++ b/js/src/ics/IC-5626904542189522402 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToBigInt) ID(0) OP(GuardToBigInt) ID(1) OP(CompareBigIntResult) JSOP(Ne) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5641070235743673050 b/js/src/ics/IC-5641070235743673050 new file mode 100644 index 0000000000000..7872410ab4734 --- /dev/null +++ b/js/src/ics/IC-5641070235743673050 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardShape) ID(3) OFFSET(4) OP(RegExpFlagResult) ID(3) INT32(16) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5655558484629346613 b/js/src/ics/IC-5655558484629346613 new file mode 100644 index 0000000000000..931af9ef6b92f --- /dev/null +++ b/js/src/ics/IC-5655558484629346613 @@ -0,0 +1 @@ +Call, 1, 3, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(8) LASTUSED(2) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardNotClassConstructor) ID(2) OP(GuardFunctionHasJitEntry) ID(2) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(3) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5666456393611175420 b/js/src/ics/IC-5666456393611175420 new file mode 100644 index 0000000000000..ca796698d88e7 --- /dev/null +++ b/js/src/ics/IC-5666456393611175420 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(0) LASTUSED(3) LASTUSED(4) LASTUSED(4) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardToBoolean) ID(1) OP(BooleanToNumber) ID(1) ID(3) OP(CompareDoubleResult) JSOP(Lt) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5671110871170019000 b/js/src/ics/IC-5671110871170019000 new file mode 100644 index 0000000000000..47f7a0d2b74e1 --- /dev/null +++ b/js/src/ics/IC-5671110871170019000 @@ -0,0 +1 @@ +GetElem, 2, 2, 7, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(String) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(Value) , LASTUSED(4) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(0) OFFSET(1) OP(GuardObjectFuseProperty) ID(0) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(LoadValueResult) OFFSET(7) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5678260749392815029 b/js/src/ics/IC-5678260749392815029 new file mode 100644 index 0000000000000..a376fbb4296b9 --- /dev/null +++ b/js/src/ics/IC-5678260749392815029 @@ -0,0 +1 @@ +SetProp, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) STUBFIELD(RawInt32) , LASTUSED(2) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(AllocateAndStoreDynamicSlot) ID(0) OFFSET(1) ID(1) OFFSET(2) OFFSET(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5718826192652598978 b/js/src/ics/IC-5718826192652598978 new file mode 100644 index 0000000000000..0acd7cf260c5a --- /dev/null +++ b/js/src/ics/IC-5718826192652598978 @@ -0,0 +1 @@ +Call, 1, 8, 15, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(10) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Int16) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5727692861382456992 b/js/src/ics/IC-5727692861382456992 new file mode 100644 index 0000000000000..ce3aedcf69f87 --- /dev/null +++ b/js/src/ics/IC-5727692861382456992 @@ -0,0 +1 @@ +GetElem, 2, 4, 10, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(2) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(0) OP(GuardShape) ID(2) OFFSET(3) OP(LoadProtoObject) ID(3) OFFSET(4) ID(0) OP(GuardShape) ID(3) OFFSET(5) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5733502973680379365 b/js/src/ics/IC-5733502973680379365 new file mode 100644 index 0000000000000..bd28efed1c69e --- /dev/null +++ b/js/src/ics/IC-5733502973680379365 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToString) ID(2) OP(StringTrimResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5756273448623453072 b/js/src/ics/IC-5756273448623453072 new file mode 100644 index 0000000000000..fb6c87f274294 --- /dev/null +++ b/js/src/ics/IC-5756273448623453072 @@ -0,0 +1 @@ +UnaryArith, 1, 1, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) , OP(GuardToBigInt) ID(0) OP(BigIntNotResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5775164289335658528 b/js/src/ics/IC-5775164289335658528 new file mode 100644 index 0000000000000..863818fa8418c --- /dev/null +++ b/js/src/ics/IC-5775164289335658528 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathCeilToInt32Result) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5786249113263803994 b/js/src/ics/IC-5786249113263803994 new file mode 100644 index 0000000000000..3be299be82c39 --- /dev/null +++ b/js/src/ics/IC-5786249113263803994 @@ -0,0 +1 @@ +SetProp, 2, 4, 8, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(6) LASTUSED(4) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(GuardFixedSlotValue) ID(2) OFFSET(3) OFFSET(4) OP(LoadObject) ID(3) OFFSET(5) OP(CallScriptedSetter) ID(0) ID(3) ID(1) BOOL(1) OFFSET(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-579257625803382067 b/js/src/ics/IC-579257625803382067 new file mode 100644 index 0000000000000..52f8ef32c3541 --- /dev/null +++ b/js/src/ics/IC-579257625803382067 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(GuardIsNotProxy) ID(1) OP(GuardIsNonResizableTypedArray) ID(1) OP(LoadArrayBufferViewLengthDoubleResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5813034366357900449 b/js/src/ics/IC-5813034366357900449 new file mode 100644 index 0000000000000..90ac9dc504715 --- /dev/null +++ b/js/src/ics/IC-5813034366357900449 @@ -0,0 +1 @@ +GetElem, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(String) STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadInt32ArrayLengthResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5819847375259697467 b/js/src/ics/IC-5819847375259697467 new file mode 100644 index 0000000000000..d32c2154411be --- /dev/null +++ b/js/src/ics/IC-5819847375259697467 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(8) LASTUSED(8) LASTUSED(4) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(1) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(3) OFFSET(0) OFFSET(1) OP(CallBoundScriptedFunction) ID(1) ID(3) ID(0) CALLFLAGS(65) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5835529469182302568 b/js/src/ics/IC-5835529469182302568 new file mode 100644 index 0000000000000..316ae2bc14833 --- /dev/null +++ b/js/src/ics/IC-5835529469182302568 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(DateFillLocalTimeSlots) ID(2) OP(LoadFixedSlot) ID(3) ID(2) OFFSET(3) OP(DateHoursFromSecondsIntoYearResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5846323929830966129 b/js/src/ics/IC-5846323929830966129 new file mode 100644 index 0000000000000..21a16f7052516 --- /dev/null +++ b/js/src/ics/IC-5846323929830966129 @@ -0,0 +1 @@ +GetElem, 2, 2, 8, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(String) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(5) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(0) OFFSET(1) OP(GuardObjectFuseProperty) ID(0) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(CheckWeakValueResultForFixedSlot) ID(0) OFFSET(7) OFFSET(8) OP(UncheckedLoadWeakObjectResult) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5849615840270306761 b/js/src/ics/IC-5849615840270306761 new file mode 100644 index 0000000000000..97be688721b45 --- /dev/null +++ b/js/src/ics/IC-5849615840270306761 @@ -0,0 +1 @@ +CloseIter, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(5) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadFixedSlot) ID(1) ID(0) OFFSET(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(2) OFFSET(3) OP(CloseIterScriptedResult) ID(0) ID(1) COMPLETIONKIND(Throw) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5855891115550373556 b/js/src/ics/IC-5855891115550373556 new file mode 100644 index 0000000000000..a6b422546c500 --- /dev/null +++ b/js/src/ics/IC-5855891115550373556 @@ -0,0 +1 @@ +SetProp, 2, 4, 9, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(7) LASTUSED(4) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardFunctionIsNonBuiltinCtor) ID(0) OP(LoadProtoObject) ID(2) OFFSET(1) ID(0) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(0) OP(GuardShape) ID(3) OFFSET(4) OP(AllocateAndStoreDynamicSlot) ID(0) OFFSET(5) ID(1) OFFSET(6) OFFSET(7) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5869987350935109062 b/js/src/ics/IC-5869987350935109062 new file mode 100644 index 0000000000000..2ffe2d8a31701 --- /dev/null +++ b/js/src/ics/IC-5869987350935109062 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToString) ID(0) OP(GuardToString) ID(1) OP(CompareStringResult) JSOP(Ne) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5872242747911214759 b/js/src/ics/IC-5872242747911214759 new file mode 100644 index 0000000000000..4b03c7e8e631a --- /dev/null +++ b/js/src/ics/IC-5872242747911214759 @@ -0,0 +1 @@ +GetImport, 0, 1, 3, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(1) , OP(LoadObject) ID(0) OFFSET(0) OP(LoadFixedSlotResult) ID(0) OFFSET(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5874239926455863724 b/js/src/ics/IC-5874239926455863724 new file mode 100644 index 0000000000000..c485b6075473d --- /dev/null +++ b/js/src/ics/IC-5874239926455863724 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(2) UINT32(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-587714778299262616 b/js/src/ics/IC-587714778299262616 new file mode 100644 index 0000000000000..b1a2b211a3874 --- /dev/null +++ b/js/src/ics/IC-587714778299262616 @@ -0,0 +1 @@ +GetIterator, 1, 1, 2, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) , OP(ValueToIteratorResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-588384615805920198 b/js/src/ics/IC-588384615805920198 new file mode 100644 index 0000000000000..0b917e440215a --- /dev/null +++ b/js/src/ics/IC-588384615805920198 @@ -0,0 +1 @@ +In, 2, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(3) LASTUSED(5) , OP(GuardToObject) ID(1) OP(GuardToSymbol) ID(0) OP(GuardSpecificSymbol) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardShape) ID(2) OFFSET(3) OP(LoadBooleanResult) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5912250539169622605 b/js/src/ics/IC-5912250539169622605 new file mode 100644 index 0000000000000..f36510dfac234 --- /dev/null +++ b/js/src/ics/IC-5912250539169622605 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasNoJitEntry) ID(1) OP(GuardNotClassConstructor) ID(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5912323616554975669 b/js/src/ics/IC-5912323616554975669 new file mode 100644 index 0000000000000..531d7c892276d --- /dev/null +++ b/js/src/ics/IC-5912323616554975669 @@ -0,0 +1 @@ +OptimizeGetIterator, 1, 1, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardArrayIsPacked) ID(0) OP(GuardFuse) REALMFUSE(0) OP(LoadBooleanResult) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5913967622441221915 b/js/src/ics/IC-5913967622441221915 new file mode 100644 index 0000000000000..c4f074f116be7 --- /dev/null +++ b/js/src/ics/IC-5913967622441221915 @@ -0,0 +1 @@ +GetElem, 2, 4, 9, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(2) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadDynamicSlot) ID(2) ID(0) OFFSET(2) OP(LoadGetterSetterFunction) ID(2) BOOL(1) BOOL(0) ID(3) OP(GuardFunctionScript) ID(3) OFFSET(3) OFFSET(4) OP(CallScriptedGetterResult) ID(0) ID(3) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5920990077679333046 b/js/src/ics/IC-5920990077679333046 new file mode 100644 index 0000000000000..54ea316028b22 --- /dev/null +++ b/js/src/ics/IC-5920990077679333046 @@ -0,0 +1 @@ +Call, 1, 7, 13, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(10) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(AtomicsSubResult) ID(2) ID(4) ID(6) SCALARTYPE(Int8) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5979933657154175813 b/js/src/ics/IC-5979933657154175813 new file mode 100644 index 0000000000000..8aaae72ef55f5 --- /dev/null +++ b/js/src/ics/IC-5979933657154175813 @@ -0,0 +1 @@ +Call, 1, 8, 15, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(10) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Int16) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5981087199954198415 b/js/src/ics/IC-5981087199954198415 new file mode 100644 index 0000000000000..2223b5be6225c --- /dev/null +++ b/js/src/ics/IC-5981087199954198415 @@ -0,0 +1 @@ +GetElem, 2, 4, 8, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(Value) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(1) LASTUSED(4) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardSpecificValue) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadFixedSlot) ID(2) ID(0) OFFSET(2) OP(LoadGetterSetterFunction) ID(2) BOOL(1) BOOL(0) ID(3) OP(GuardFunctionScript) ID(3) OFFSET(3) OFFSET(4) OP(CallScriptedGetterResult) ID(0) ID(3) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5981532190828677479 b/js/src/ics/IC-5981532190828677479 new file mode 100644 index 0000000000000..3dd83fea00fef --- /dev/null +++ b/js/src/ics/IC-5981532190828677479 @@ -0,0 +1 @@ +GetElemSuper, 3, 4, 8, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(GuardFixedSlotValue) ID(0) OFFSET(2) OFFSET(3) OP(LoadObject) ID(3) OFFSET(4) OP(CallScriptedGetterResult) ID(2) ID(3) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5982182292180846915 b/js/src/ics/IC-5982182292180846915 new file mode 100644 index 0000000000000..c05710194ad98 --- /dev/null +++ b/js/src/ics/IC-5982182292180846915 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardStringToIndex) ID(1) ID(2) OP(GuardShape) ID(0) OFFSET(0) OP(LoadDenseElementResult) ID(0) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5991742124680723496 b/js/src/ics/IC-5991742124680723496 new file mode 100644 index 0000000000000..d03bdb5369ccb --- /dev/null +++ b/js/src/ics/IC-5991742124680723496 @@ -0,0 +1 @@ +BinaryArith, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(4) LASTUSED(2) LASTUSED(3) LASTUSED(4) , OP(GuardToInt32) ID(0) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(2) OP(TruncateDoubleToUInt32) ID(2) ID(3) OP(Int32BitOrResult) ID(0) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-5999742380082135166 b/js/src/ics/IC-5999742380082135166 new file mode 100644 index 0000000000000..dc623f169ea08 --- /dev/null +++ b/js/src/ics/IC-5999742380082135166 @@ -0,0 +1 @@ +Call, 1, 7, 15, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToBigInt) ID(5) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(GuardToBoolean) ID(6) OP(StoreDataViewValueResult) ID(2) ID(4) ID(5) ID(6) SCALARTYPE(BigInt64) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-600504079898778130 b/js/src/ics/IC-600504079898778130 new file mode 100644 index 0000000000000..4d06912816cc3 --- /dev/null +++ b/js/src/ics/IC-600504079898778130 @@ -0,0 +1 @@ +Call, 1, 7, 13, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) LASTUSED(10) LASTUSED(10) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardIsNumber) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardIsNumber) ID(3) OP(NumberMinMax) BOOL(0) ID(2) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardIsNumber) ID(5) OP(NumberMinMax) BOOL(0) ID(4) ID(5) ID(6) OP(LoadDoubleResult) ID(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6009444823097086357 b/js/src/ics/IC-6009444823097086357 new file mode 100644 index 0000000000000..d4afcde6e5fb4 --- /dev/null +++ b/js/src/ics/IC-6009444823097086357 @@ -0,0 +1 @@ +Call, 1, 7, 13, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardHasAttachedArrayBuffer) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32ModUint32) ID(3) ID(4) OP(LoadInt32AsIntPtrConstant) OFFSET(3) ID(5) OP(LoadArrayBufferViewLength) ID(2) ID(6) OP(TypedArrayFillResult) ID(2) ID(4) ID(5) ID(6) SCALARTYPE(Int8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6019576791496131862 b/js/src/ics/IC-6019576791496131862 new file mode 100644 index 0000000000000..ec4b2b7ce0f3f --- /dev/null +++ b/js/src/ics/IC-6019576791496131862 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Float16) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6061207598748454306 b/js/src/ics/IC-6061207598748454306 new file mode 100644 index 0000000000000..bd88e9751a8ac --- /dev/null +++ b/js/src/ics/IC-6061207598748454306 @@ -0,0 +1 @@ +Call, 1, 5, 14, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(12) LASTUSED(12) LASTUSED(4) LASTUSED(7) LASTUSED(12) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardObjectIdentity) ID(3) ID(1) OP(LoadBoundFunctionTarget) ID(1) ID(4) OP(GuardClass) ID(4) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasJitEntry) ID(4) OP(GuardFunctionIsConstructor) ID(4) OP(CallBoundScriptedFunction) ID(1) ID(4) ID(0) CALLFLAGS(33) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6082115889906159497 b/js/src/ics/IC-6082115889906159497 new file mode 100644 index 0000000000000..9a1a4b38d0ba6 --- /dev/null +++ b/js/src/ics/IC-6082115889906159497 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToUint8Clamped) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint8Clamped) ID(4) ID(3) BOOL(1) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6087499400459459326 b/js/src/ics/IC-6087499400459459326 new file mode 100644 index 0000000000000..975793b5f0152 --- /dev/null +++ b/js/src/ics/IC-6087499400459459326 @@ -0,0 +1 @@ +GetElem, 2, 2, 7, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(GuardDynamicSlotValue) ID(0) OFFSET(2) OFFSET(3) OP(CallNativeGetterResult) ID(0) OFFSET(4) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6098254129790034277 b/js/src/ics/IC-6098254129790034277 new file mode 100644 index 0000000000000..b16b7a7d9dfd7 --- /dev/null +++ b/js/src/ics/IC-6098254129790034277 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToString) ID(3) OP(ArrayJoinResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6101894920461306288 b/js/src/ics/IC-6101894920461306288 new file mode 100644 index 0000000000000..a740ba8ce667b --- /dev/null +++ b/js/src/ics/IC-6101894920461306288 @@ -0,0 +1 @@ +SetElem, 3, 3, 6, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(AddAndStoreDynamicSlot) ID(0) OFFSET(2) ID(2) OFFSET(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-610213485237308342 b/js/src/ics/IC-610213485237308342 new file mode 100644 index 0000000000000..106ed8227a190 --- /dev/null +++ b/js/src/ics/IC-610213485237308342 @@ -0,0 +1 @@ +SetElem, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(5) LASTUSED(3) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToString) ID(2) OP(GuardStringToNumber) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float16) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6105652248863429548 b/js/src/ics/IC-6105652248863429548 new file mode 100644 index 0000000000000..4b242f029ce3b --- /dev/null +++ b/js/src/ics/IC-6105652248863429548 @@ -0,0 +1 @@ +GetProp, 1, 1, 6, JSVAL_TYPE_UNKNOWN, 72, STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardSpecificObject) ID(0) OFFSET(0) OP(GuardObjectFuseProperty) ID(0) OFFSET(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(0) OFFSET(6) OFFSET(7) OP(UncheckedLoadWeakObjectResult) OFFSET(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6127367941508481067 b/js/src/ics/IC-6127367941508481067 new file mode 100644 index 0000000000000..c0c30082c2c9a --- /dev/null +++ b/js/src/ics/IC-6127367941508481067 @@ -0,0 +1 @@ +SetProp, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(CallNativeSetter) ID(0) OFFSET(3) ID(1) BOOL(1) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6135345967831715705 b/js/src/ics/IC-6135345967831715705 new file mode 100644 index 0000000000000..d810bead18ae5 --- /dev/null +++ b/js/src/ics/IC-6135345967831715705 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(Array) OP(GuardArrayIsPacked) ID(3) OP(NumberMinMaxArrayResult) ID(3) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6143375524470104030 b/js/src/ics/IC-6143375524470104030 new file mode 100644 index 0000000000000..f9347f860c0e1 --- /dev/null +++ b/js/src/ics/IC-6143375524470104030 @@ -0,0 +1 @@ +CloseIter, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(1) LASTUSED(2) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(1) OFFSET(1) ID(0) OP(GuardShape) ID(1) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6146020855536251424 b/js/src/ics/IC-6146020855536251424 new file mode 100644 index 0000000000000..680949bb8ad5a --- /dev/null +++ b/js/src/ics/IC-6146020855536251424 @@ -0,0 +1 @@ +SetElem, 3, 3, 6, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(AllocateAndStoreDynamicSlot) ID(0) OFFSET(2) ID(2) OFFSET(3) OFFSET(4) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6146325095462273887 b/js/src/ics/IC-6146325095462273887 new file mode 100644 index 0000000000000..7c3238868c6eb --- /dev/null +++ b/js/src/ics/IC-6146325095462273887 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int8) ID(4) ID(3) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-615433728494893218 b/js/src/ics/IC-615433728494893218 new file mode 100644 index 0000000000000..eb222d8fc2c0e --- /dev/null +++ b/js/src/ics/IC-615433728494893218 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardBooleanToInt32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint32) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6158212624399616553 b/js/src/ics/IC-6158212624399616553 new file mode 100644 index 0000000000000..aa94380562a5a --- /dev/null +++ b/js/src/ics/IC-6158212624399616553 @@ -0,0 +1 @@ +Call, 1, 3, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(8) LASTUSED(2) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardNotClassConstructor) ID(2) OP(GuardFunctionHasNoJitEntry) ID(2) OP(CallNativeFunction) ID(2) ID(0) CALLFLAGS(3) UINT32(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6159868938875897971 b/js/src/ics/IC-6159868938875897971 new file mode 100644 index 0000000000000..0dee27bcb1fdd --- /dev/null +++ b/js/src/ics/IC-6159868938875897971 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(34) UINT32(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6183110164745970583 b/js/src/ics/IC-6183110164745970583 new file mode 100644 index 0000000000000..45044abdc2d33 --- /dev/null +++ b/js/src/ics/IC-6183110164745970583 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathTruncToInt32Result) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6210440649435489795 b/js/src/ics/IC-6210440649435489795 new file mode 100644 index 0000000000000..03223b88f5f8c --- /dev/null +++ b/js/src/ics/IC-6210440649435489795 @@ -0,0 +1 @@ +Call, 1, 5, 13, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(11) LASTUSED(11) LASTUSED(4) LASTUSED(7) LASTUSED(11) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(1) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardObjectIdentity) ID(3) ID(1) OP(LoadBoundFunctionTarget) ID(1) ID(4) OP(GuardClass) ID(4) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(4) OFFSET(0) OFFSET(1) OP(CallBoundScriptedFunction) ID(1) ID(4) ID(0) CALLFLAGS(225) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6212775784017808964 b/js/src/ics/IC-6212775784017808964 new file mode 100644 index 0000000000000..d0fa2944c8dc0 --- /dev/null +++ b/js/src/ics/IC-6212775784017808964 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6235677804899620724 b/js/src/ics/IC-6235677804899620724 new file mode 100644 index 0000000000000..554905cb160fb --- /dev/null +++ b/js/src/ics/IC-6235677804899620724 @@ -0,0 +1 @@ +Call, 1, 7, 13, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(10) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(AtomicsAddResult) ID(2) ID(4) ID(6) SCALARTYPE(Int8) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6240639567071266349 b/js/src/ics/IC-6240639567071266349 new file mode 100644 index 0000000000000..746225ebf1d89 --- /dev/null +++ b/js/src/ics/IC-6240639567071266349 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint16) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6245643355357745767 b/js/src/ics/IC-6245643355357745767 new file mode 100644 index 0000000000000..b3183179c122d --- /dev/null +++ b/js/src/ics/IC-6245643355357745767 @@ -0,0 +1 @@ +SetProp, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardFixedSlotValue) ID(0) OFFSET(1) OFFSET(2) OP(LoadObject) ID(2) OFFSET(3) OP(CallScriptedSetter) ID(0) ID(2) ID(1) BOOL(1) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-625074041988396194 b/js/src/ics/IC-625074041988396194 new file mode 100644 index 0000000000000..8471715d7ade7 --- /dev/null +++ b/js/src/ics/IC-625074041988396194 @@ -0,0 +1 @@ +Compare, 2, 4, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardBooleanToInt32) ID(1) ID(3) OP(CompareInt32Result) JSOP(Gt) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6261712165203039516 b/js/src/ics/IC-6261712165203039516 new file mode 100644 index 0000000000000..2852fe52b26da --- /dev/null +++ b/js/src/ics/IC-6261712165203039516 @@ -0,0 +1 @@ +BindName, 1, 6, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(1) LASTUSED(2) LASTUSED(4) LASTUSED(8) LASTUSED(7) , OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(LoadEnclosingEnvironment) ID(2) ID(3) OP(GuardShape) ID(3) OFFSET(0) OP(LoadEnclosingEnvironment) ID(3) ID(4) OP(GuardShape) ID(4) OFFSET(1) OP(LoadDynamicSlot) ID(5) ID(4) OFFSET(2) OP(GuardIsNotUninitializedLexical) ID(5) OP(LoadObjectResult) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6292702835226523330 b/js/src/ics/IC-6292702835226523330 new file mode 100644 index 0000000000000..bf3a478f1a4e1 --- /dev/null +++ b/js/src/ics/IC-6292702835226523330 @@ -0,0 +1 @@ +GetElem, 2, 3, 9, JSVAL_TYPE_UNKNOWN, 88, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(3) LASTUSED(2) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardObjectFuseProperty) ID(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(2) OFFSET(8) OFFSET(9) OP(UncheckedLoadWeakObjectResult) OFFSET(10) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6327522087412591704 b/js/src/ics/IC-6327522087412591704 new file mode 100644 index 0000000000000..c7566c2aa9b1f --- /dev/null +++ b/js/src/ics/IC-6327522087412591704 @@ -0,0 +1 @@ +SetProp, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardSpecificObject) ID(0) OFFSET(0) OP(GuardObjectFuseProperty) ID(0) OFFSET(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) BOOL(1) OP(LoadObject) ID(2) OFFSET(6) OP(CallScriptedSetter) ID(0) ID(2) ID(1) BOOL(1) OFFSET(7) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6330274544238710646 b/js/src/ics/IC-6330274544238710646 new file mode 100644 index 0000000000000..a2fd91cc43175 --- /dev/null +++ b/js/src/ics/IC-6330274544238710646 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToBoolean) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(BigUint64) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6340399081515649191 b/js/src/ics/IC-6340399081515649191 new file mode 100644 index 0000000000000..80d6398f3023d --- /dev/null +++ b/js/src/ics/IC-6340399081515649191 @@ -0,0 +1 @@ +HasOwn, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(1) OP(GuardToInt32) ID(0) OP(GuardClass) ID(1) GUARDCLASSKIND(MappedArguments) OP(LoadArgumentsObjectArgExistsResult) ID(1) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6341944345095833427 b/js/src/ics/IC-6341944345095833427 new file mode 100644 index 0000000000000..78df0b425099d --- /dev/null +++ b/js/src/ics/IC-6341944345095833427 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int16) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6360555972558397887 b/js/src/ics/IC-6360555972558397887 new file mode 100644 index 0000000000000..19abcd15f8602 --- /dev/null +++ b/js/src/ics/IC-6360555972558397887 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardStringToIndex) ID(1) ID(2) OP(GuardClass) ID(0) GUARDCLASSKIND(UnmappedArguments) OP(LoadArgumentsObjectArgResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-636392079608777021 b/js/src/ics/IC-636392079608777021 new file mode 100644 index 0000000000000..d4f2c8bca7e9f --- /dev/null +++ b/js/src/ics/IC-636392079608777021 @@ -0,0 +1 @@ +SetProp, 2, 4, 7, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(5) LASTUSED(3) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(LoadObject) ID(3) OFFSET(3) OP(CallScriptedSetter) ID(0) ID(3) ID(1) BOOL(1) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6400233992713918968 b/js/src/ics/IC-6400233992713918968 new file mode 100644 index 0000000000000..31b3d910b1d13 --- /dev/null +++ b/js/src/ics/IC-6400233992713918968 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Float64) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6449820065704212551 b/js/src/ics/IC-6449820065704212551 new file mode 100644 index 0000000000000..32db45aca7388 --- /dev/null +++ b/js/src/ics/IC-6449820065704212551 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(10) LASTUSED(2) LASTUSED(10) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(Array) OP(GuardArrayIsPacked) ID(3) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallNativeFunction) ID(2) ID(0) CALLFLAGS(69) UINT32(5) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-647091038417072018 b/js/src/ics/IC-647091038417072018 new file mode 100644 index 0000000000000..d373eb8a071dd --- /dev/null +++ b/js/src/ics/IC-647091038417072018 @@ -0,0 +1 @@ +Call, 1, 5, 14, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(12) LASTUSED(12) LASTUSED(4) LASTUSED(7) LASTUSED(12) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(1) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardObjectIdentity) ID(3) ID(1) OP(LoadBoundFunctionTarget) ID(1) ID(4) OP(GuardClass) ID(4) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasJitEntry) ID(4) OP(GuardFunctionIsConstructor) ID(4) OP(CallBoundScriptedFunction) ID(1) ID(4) ID(0) CALLFLAGS(33) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6472000057917485609 b/js/src/ics/IC-6472000057917485609 new file mode 100644 index 0000000000000..64ba575e0a191 --- /dev/null +++ b/js/src/ics/IC-6472000057917485609 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallNativeFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6514508776943165331 b/js/src/ics/IC-6514508776943165331 new file mode 100644 index 0000000000000..1e151441dedfa --- /dev/null +++ b/js/src/ics/IC-6514508776943165331 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6515912138002560906 b/js/src/ics/IC-6515912138002560906 new file mode 100644 index 0000000000000..c759772e59ba5 --- /dev/null +++ b/js/src/ics/IC-6515912138002560906 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallNativeFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(5) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6516656865559158023 b/js/src/ics/IC-6516656865559158023 new file mode 100644 index 0000000000000..a6d776375d6f6 --- /dev/null +++ b/js/src/ics/IC-6516656865559158023 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToString) ID(2) OP(StringTrimEndResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6519158448193854731 b/js/src/ics/IC-6519158448193854731 new file mode 100644 index 0000000000000..04db958c04367 --- /dev/null +++ b/js/src/ics/IC-6519158448193854731 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Int8) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6536480825513853421 b/js/src/ics/IC-6536480825513853421 new file mode 100644 index 0000000000000..7c1c81564837c --- /dev/null +++ b/js/src/ics/IC-6536480825513853421 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToString) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(LoadStringCodePointResult) ID(2) ID(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-654735065054311339 b/js/src/ics/IC-654735065054311339 new file mode 100644 index 0000000000000..1a94d34ec4592 --- /dev/null +++ b/js/src/ics/IC-654735065054311339 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(33) UINT32(0) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6596086071328775033 b/js/src/ics/IC-6596086071328775033 new file mode 100644 index 0000000000000..0a65b317eb8bb --- /dev/null +++ b/js/src/ics/IC-6596086071328775033 @@ -0,0 +1 @@ +GetProp, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(Value) , LASTUSED(1) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(LoadValueResult) OFFSET(7) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6632537767881657296 b/js/src/ics/IC-6632537767881657296 new file mode 100644 index 0000000000000..ac8c79f28af61 --- /dev/null +++ b/js/src/ics/IC-6632537767881657296 @@ -0,0 +1 @@ +GetElemSuper, 3, 4, 8, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(GuardDynamicSlotValue) ID(0) OFFSET(2) OFFSET(3) OP(LoadObject) ID(3) OFFSET(4) OP(CallScriptedGetterResult) ID(2) ID(3) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6634032363341560936 b/js/src/ics/IC-6634032363341560936 new file mode 100644 index 0000000000000..a5617fe185b27 --- /dev/null +++ b/js/src/ics/IC-6634032363341560936 @@ -0,0 +1 @@ +GetElem, 2, 4, 9, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(1) LASTUSED(4) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardIsNull) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(2) OFFSET(1) ID(0) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(0) OP(GuardShape) ID(3) OFFSET(4) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6648431281659226653 b/js/src/ics/IC-6648431281659226653 new file mode 100644 index 0000000000000..0d675e2c263b4 --- /dev/null +++ b/js/src/ics/IC-6648431281659226653 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(AllocSite) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToInt32) ID(2) OP(NewArrayFromLengthResult) OFFSET(2) ID(2) OFFSET(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6655497693124912829 b/js/src/ics/IC-6655497693124912829 new file mode 100644 index 0000000000000..9e5801e479129 --- /dev/null +++ b/js/src/ics/IC-6655497693124912829 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(4) LASTUSED(4) , OP(GuardToBoolean) ID(0) OP(BooleanToNumber) ID(0) ID(2) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(3) OP(CompareDoubleResult) JSOP(Eq) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6673320317353405836 b/js/src/ics/IC-6673320317353405836 new file mode 100644 index 0000000000000..1552346bb108f --- /dev/null +++ b/js/src/ics/IC-6673320317353405836 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNumber) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float16) ID(3) ID(2) BOOL(1) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6676114981265147186 b/js/src/ics/IC-6676114981265147186 new file mode 100644 index 0000000000000..3f036a4d9c026 --- /dev/null +++ b/js/src/ics/IC-6676114981265147186 @@ -0,0 +1 @@ +SetElem, 3, 3, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(1) LASTUSED(1) , OP(GuardToObject) ID(0) OP(MegamorphicSetElement) ID(0) ID(1) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6705368495046246180 b/js/src/ics/IC-6705368495046246180 new file mode 100644 index 0000000000000..04d1116614c57 --- /dev/null +++ b/js/src/ics/IC-6705368495046246180 @@ -0,0 +1 @@ +GetElem, 2, 4, 9, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(1) LASTUSED(4) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardIsUndefined) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(2) OFFSET(1) ID(0) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(0) OP(GuardShape) ID(3) OFFSET(4) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6715353510766004631 b/js/src/ics/IC-6715353510766004631 new file mode 100644 index 0000000000000..486580d245e05 --- /dev/null +++ b/js/src/ics/IC-6715353510766004631 @@ -0,0 +1 @@ +BinaryArith, 2, 5, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(3) LASTUSED(4) LASTUSED(4) LASTUSED(5) , OP(GuardToBigInt) ID(0) OP(GuardToBigInt) ID(1) OP(BigIntToIntPtr) ID(0) ID(2) OP(BigIntToIntPtr) ID(1) ID(3) OP(BigIntPtrBitXor) ID(2) ID(3) ID(4) OP(IntPtrToBigIntResult) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6721597167480484729 b/js/src/ics/IC-6721597167480484729 new file mode 100644 index 0000000000000..4356ce0bfe8bf --- /dev/null +++ b/js/src/ics/IC-6721597167480484729 @@ -0,0 +1 @@ +GetProp, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(3) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardShape) ID(1) OFFSET(2) OP(LoadObject) ID(2) OFFSET(3) OP(CallScriptedGetterResult) ID(0) ID(2) BOOL(1) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6721693850971571311 b/js/src/ics/IC-6721693850971571311 new file mode 100644 index 0000000000000..fd48ecb802746 --- /dev/null +++ b/js/src/ics/IC-6721693850971571311 @@ -0,0 +1 @@ +SetProp, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(CallSetArrayLength) ID(0) BOOL(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6721824873076198479 b/js/src/ics/IC-6721824873076198479 new file mode 100644 index 0000000000000..8a17135d8a8fe --- /dev/null +++ b/js/src/ics/IC-6721824873076198479 @@ -0,0 +1 @@ +Call, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(IsTypedArrayConstructorResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6752409692062461485 b/js/src/ics/IC-6752409692062461485 new file mode 100644 index 0000000000000..77b423a9b1d26 --- /dev/null +++ b/js/src/ics/IC-6752409692062461485 @@ -0,0 +1 @@ +GetProp, 1, 1, 6, JSVAL_TYPE_UNKNOWN, 72, STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakValue) , LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardSpecificObject) ID(0) OFFSET(0) OP(GuardObjectFuseProperty) ID(0) OFFSET(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(0) OFFSET(6) OFFSET(7) OP(UncheckedLoadWeakValueResult) OFFSET(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-677106290285116179 b/js/src/ics/IC-677106290285116179 new file mode 100644 index 0000000000000..96bc54a05fda4 --- /dev/null +++ b/js/src/ics/IC-677106290285116179 @@ -0,0 +1 @@ +GetElem, 2, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(1) , OP(GuardToObject) ID(0) OP(MegamorphicLoadSlotByValuePermissiveResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6797217433273716714 b/js/src/ics/IC-6797217433273716714 new file mode 100644 index 0000000000000..79625bcc4b0a1 --- /dev/null +++ b/js/src/ics/IC-6797217433273716714 @@ -0,0 +1 @@ +Compare, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(1) LASTUSED(2) , OP(GuardToInt32) ID(0) OP(GuardBooleanToInt32) ID(1) ID(2) OP(CompareInt32Result) JSOP(Gt) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6816786854972243760 b/js/src/ics/IC-6816786854972243760 new file mode 100644 index 0000000000000..03b86a292e5c5 --- /dev/null +++ b/js/src/ics/IC-6816786854972243760 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint8) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6818829038527474643 b/js/src/ics/IC-6818829038527474643 new file mode 100644 index 0000000000000..c814ab3bea3f9 --- /dev/null +++ b/js/src/ics/IC-6818829038527474643 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToBigInt) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(BigInt64) ID(3) ID(2) BOOL(1) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6824775793783396742 b/js/src/ics/IC-6824775793783396742 new file mode 100644 index 0000000000000..2c55d4af90fab --- /dev/null +++ b/js/src/ics/IC-6824775793783396742 @@ -0,0 +1 @@ +GetIterator, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) , OP(GuardIsNullOrUndefined) ID(0) OP(LoadObject) ID(1) OFFSET(0) OP(LoadObjectResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6827892447804868454 b/js/src/ics/IC-6827892447804868454 new file mode 100644 index 0000000000000..df79d1cb80418 --- /dev/null +++ b/js/src/ics/IC-6827892447804868454 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToBoolean) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Int8) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6831699885929882581 b/js/src/ics/IC-6831699885929882581 new file mode 100644 index 0000000000000..d0270d69b295a --- /dev/null +++ b/js/src/ics/IC-6831699885929882581 @@ -0,0 +1 @@ +GetProp, 1, 2, 8, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(7) OP(RegExpFlagResult) ID(0) INT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6845756836940205003 b/js/src/ics/IC-6845756836940205003 new file mode 100644 index 0000000000000..bf395e45424d2 --- /dev/null +++ b/js/src/ics/IC-6845756836940205003 @@ -0,0 +1 @@ +In, 2, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(4) LASTUSED(5) , OP(GuardToObject) ID(1) OP(GuardToSymbol) ID(0) OP(GuardSpecificSymbol) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(1) OP(GuardShape) ID(2) OFFSET(3) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-684607117327143518 b/js/src/ics/IC-684607117327143518 new file mode 100644 index 0000000000000..ae472d6a72c9d --- /dev/null +++ b/js/src/ics/IC-684607117327143518 @@ -0,0 +1 @@ +GetElem, 2, 2, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(String) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardClass) ID(0) GUARDCLASSKIND(MappedArguments) OP(GuardArgumentsObjectFlags) ID(0) BYTE(8) OP(LoadFixedSlotResult) ID(0) OFFSET(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6855513314369875080 b/js/src/ics/IC-6855513314369875080 new file mode 100644 index 0000000000000..9b1dddb11c631 --- /dev/null +++ b/js/src/ics/IC-6855513314369875080 @@ -0,0 +1 @@ +SetElem, 3, 4, 11, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(9) LASTUSED(9) LASTUSED(9) LASTUSED(8) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardClass) ID(0) GUARDCLASSKIND(PlainObject) OP(GuardIndexIsNotDenseElement) ID(0) ID(1) OP(GuardIsExtensible) ID(0) OP(GuardInt32IsNonNegative) ID(1) OP(GuardProto) ID(0) OFFSET(0) OP(LoadProtoObject) ID(3) OFFSET(1) ID(0) OP(GuardShape) ID(3) OFFSET(2) OP(CallAddOrUpdateSparseElementHelper) ID(0) ID(1) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6858616511397494805 b/js/src/ics/IC-6858616511397494805 new file mode 100644 index 0000000000000..816f7f9fc3393 --- /dev/null +++ b/js/src/ics/IC-6858616511397494805 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(1) LASTUSED(2) , OP(GuardToInt32) ID(0) OP(GuardBooleanToInt32) ID(1) ID(2) OP(Int32BitXorResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6859461870347346752 b/js/src/ics/IC-6859461870347346752 new file mode 100644 index 0000000000000..33f1e922e75c3 --- /dev/null +++ b/js/src/ics/IC-6859461870347346752 @@ -0,0 +1 @@ +GetElemSuper, 3, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(String) , LASTUSED(4) LASTUSED(2) LASTUSED(0) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardClass) ID(0) GUARDCLASSKIND(Array) OP(LoadInt32ArrayLengthResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6865598851008758714 b/js/src/ics/IC-6865598851008758714 new file mode 100644 index 0000000000000..2f10f26c32112 --- /dev/null +++ b/js/src/ics/IC-6865598851008758714 @@ -0,0 +1 @@ +Compare, 2, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(0) , OP(GuardIsUndefined) ID(1) OP(CompareNullUndefinedResult) JSOP(Ne) BOOL(1) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6868447145767669823 b/js/src/ics/IC-6868447145767669823 new file mode 100644 index 0000000000000..16a65a87954f8 --- /dev/null +++ b/js/src/ics/IC-6868447145767669823 @@ -0,0 +1 @@ +UnaryArith, 1, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(2) LASTUSED(3) , OP(GuardToBigInt) ID(0) OP(BigIntToIntPtr) ID(0) ID(1) OP(BigIntPtrInc) ID(1) ID(2) OP(IntPtrToBigIntResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6870789570020117766 b/js/src/ics/IC-6870789570020117766 new file mode 100644 index 0000000000000..e61ab7b7ed811 --- /dev/null +++ b/js/src/ics/IC-6870789570020117766 @@ -0,0 +1 @@ +Call, 1, 5, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardIsNumber) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardIsNumber) ID(3) OP(NumberMinMax) BOOL(0) ID(2) ID(3) ID(4) OP(LoadDoubleResult) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6887264002064944094 b/js/src/ics/IC-6887264002064944094 new file mode 100644 index 0000000000000..313217fbbefbc --- /dev/null +++ b/js/src/ics/IC-6887264002064944094 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(String) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(Array) OP(LoadConstantString) OFFSET(2) ID(3) OP(ArrayJoinResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6938079888860718492 b/js/src/ics/IC-6938079888860718492 new file mode 100644 index 0000000000000..c86754ca8191e --- /dev/null +++ b/js/src/ics/IC-6938079888860718492 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(97) UINT32(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6978157832134484043 b/js/src/ics/IC-6978157832134484043 new file mode 100644 index 0000000000000..4491015183560 --- /dev/null +++ b/js/src/ics/IC-6978157832134484043 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(GuardIsUndefined) ID(1) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(CompareDoubleResult) JSOP(Ge) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6980487891696488724 b/js/src/ics/IC-6980487891696488724 new file mode 100644 index 0000000000000..466137a947e29 --- /dev/null +++ b/js/src/ics/IC-6980487891696488724 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(Log) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6982304726945942578 b/js/src/ics/IC-6982304726945942578 new file mode 100644 index 0000000000000..d9435729301f7 --- /dev/null +++ b/js/src/ics/IC-6982304726945942578 @@ -0,0 +1 @@ +GetElem, 2, 3, 9, JSVAL_TYPE_UNKNOWN, 88, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakValue) , LASTUSED(3) LASTUSED(2) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardObjectFuseProperty) ID(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(2) OFFSET(8) OFFSET(9) OP(UncheckedLoadWeakValueResult) OFFSET(10) OP(ReturnFromIC) diff --git a/js/src/ics/IC-698368224462398174 b/js/src/ics/IC-698368224462398174 new file mode 100644 index 0000000000000..17a785450bd9b --- /dev/null +++ b/js/src/ics/IC-698368224462398174 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardToInt32) ID(0) OP(GuardIsNullOrUndefined) ID(1) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(Int32LeftShiftResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6985684912028731373 b/js/src/ics/IC-6985684912028731373 new file mode 100644 index 0000000000000..f18456e6b8b88 --- /dev/null +++ b/js/src/ics/IC-6985684912028731373 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToNonGCThing) ID(3) OP(MapGetNonGCThingResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-699245192487902193 b/js/src/ics/IC-699245192487902193 new file mode 100644 index 0000000000000..e2a8ed74d2464 --- /dev/null +++ b/js/src/ics/IC-699245192487902193 @@ -0,0 +1 @@ +Call, 1, 7, 15, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardIsNumber) ID(5) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(GuardToBoolean) ID(6) OP(StoreDataViewValueResult) ID(2) ID(4) ID(5) ID(6) SCALARTYPE(Float32) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6998649725787362515 b/js/src/ics/IC-6998649725787362515 new file mode 100644 index 0000000000000..a85098f06230b --- /dev/null +++ b/js/src/ics/IC-6998649725787362515 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathCeilNumberResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-6999334146529986366 b/js/src/ics/IC-6999334146529986366 new file mode 100644 index 0000000000000..ab26ac9e9a6c1 --- /dev/null +++ b/js/src/ics/IC-6999334146529986366 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Float32) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7005290164786924814 b/js/src/ics/IC-7005290164786924814 new file mode 100644 index 0000000000000..ff5b6b3c6ef30 --- /dev/null +++ b/js/src/ics/IC-7005290164786924814 @@ -0,0 +1 @@ +UnaryArith, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(2) , OP(GuardToBoolean) ID(0) OP(BooleanToNumber) ID(0) ID(1) OP(DoubleNegationResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7006336842200308514 b/js/src/ics/IC-7006336842200308514 new file mode 100644 index 0000000000000..f0595f5375f1d --- /dev/null +++ b/js/src/ics/IC-7006336842200308514 @@ -0,0 +1 @@ +SetProp, 2, 6, 12, JSVAL_TYPE_UNKNOWN, 96, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) STUBFIELD(RawInt32) , LASTUSED(10) LASTUSED(10) LASTUSED(3) LASTUSED(5) LASTUSED(7) LASTUSED(9) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(2) OFFSET(1) ID(0) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(0) OP(GuardShape) ID(3) OFFSET(4) OP(LoadProtoObject) ID(4) OFFSET(5) ID(0) OP(GuardShape) ID(4) OFFSET(6) OP(LoadProtoObject) ID(5) OFFSET(7) ID(0) OP(GuardShape) ID(5) OFFSET(8) OP(AllocateAndStoreDynamicSlot) ID(0) OFFSET(9) ID(1) OFFSET(10) OFFSET(11) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-700786831797247594 b/js/src/ics/IC-700786831797247594 new file mode 100644 index 0000000000000..1722d124f73d4 --- /dev/null +++ b/js/src/ics/IC-700786831797247594 @@ -0,0 +1 @@ +Call, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToBoolean) ID(2) OP(BooleanToString) ID(2) ID(3) OP(LoadStringResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7024210860932854393 b/js/src/ics/IC-7024210860932854393 new file mode 100644 index 0000000000000..b8c070b29eb82 --- /dev/null +++ b/js/src/ics/IC-7024210860932854393 @@ -0,0 +1 @@ +SetElem, 3, 5, 9, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(7) LASTUSED(7) LASTUSED(7) LASTUSED(4) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(3) OFFSET(1) ID(0) OP(GuardShape) ID(3) OFFSET(2) OP(LoadProtoObject) ID(4) OFFSET(3) ID(0) OP(GuardShape) ID(4) OFFSET(4) OP(StoreDenseElementHole) ID(0) ID(1) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7026816496132132923 b/js/src/ics/IC-7026816496132132923 new file mode 100644 index 0000000000000..f7278e9317a5f --- /dev/null +++ b/js/src/ics/IC-7026816496132132923 @@ -0,0 +1 @@ +Call, 1, 7, 17, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(6) LASTUSED(4) LASTUSED(7) LASTUSED(9) LASTUSED(15) LASTUSED(15) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(LoadFixedSlot) ID(4) ID(1) OFFSET(0) OP(GuardSpecificFunction) ID(3) OFFSET(1) OFFSET(2) OP(GuardToObject) ID(4) OP(GuardSpecificFunction) ID(4) OFFSET(3) OFFSET(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToObject) ID(5) OP(GuardShape) ID(5) OFFSET(5) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(GuardToObject) ID(6) OP(MapGetObjectResult) ID(5) ID(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-70272839060919129 b/js/src/ics/IC-70272839060919129 new file mode 100644 index 0000000000000..f228af977ce54 --- /dev/null +++ b/js/src/ics/IC-70272839060919129 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(2) LASTUSED(3) , OP(GuardToInt32) ID(0) OP(GuardIsNumber) ID(1) OP(TruncateDoubleToUInt32) ID(1) ID(2) OP(Int32LeftShiftResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7061950734640137756 b/js/src/ics/IC-7061950734640137756 new file mode 100644 index 0000000000000..9c6e2d4fae5f9 --- /dev/null +++ b/js/src/ics/IC-7061950734640137756 @@ -0,0 +1 @@ +In, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(1) OP(GuardToInt32) ID(0) OP(GuardShape) ID(1) OFFSET(0) OP(LoadDenseElementExistsResult) ID(1) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7084355145539501606 b/js/src/ics/IC-7084355145539501606 new file mode 100644 index 0000000000000..89690584b54cb --- /dev/null +++ b/js/src/ics/IC-7084355145539501606 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(WeakSet) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(WeakSetHasObjectResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7110280990772449778 b/js/src/ics/IC-7110280990772449778 new file mode 100644 index 0000000000000..6b897ed1363dc --- /dev/null +++ b/js/src/ics/IC-7110280990772449778 @@ -0,0 +1 @@ +SetElem, 3, 5, 14, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(12) LASTUSED(12) LASTUSED(12) LASTUSED(8) LASTUSED(10) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardClass) ID(0) GUARDCLASSKIND(Array) OP(GuardIndexIsNotDenseElement) ID(0) ID(1) OP(GuardIsExtensible) ID(0) OP(GuardInt32IsNonNegative) ID(1) OP(GuardProto) ID(0) OFFSET(0) OP(LoadProtoObject) ID(3) OFFSET(1) ID(0) OP(GuardShape) ID(3) OFFSET(2) OP(LoadProtoObject) ID(4) OFFSET(3) ID(0) OP(GuardShape) ID(4) OFFSET(4) OP(GuardIndexIsValidUpdateOrAdd) ID(0) ID(1) OP(CallAddOrUpdateSparseElementHelper) ID(0) ID(1) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7117088071630770506 b/js/src/ics/IC-7117088071630770506 new file mode 100644 index 0000000000000..840bc6ecc0591 --- /dev/null +++ b/js/src/ics/IC-7117088071630770506 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallNativeFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(4) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7133664460836359581 b/js/src/ics/IC-7133664460836359581 new file mode 100644 index 0000000000000..48884962f067b --- /dev/null +++ b/js/src/ics/IC-7133664460836359581 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7167465578550532482 b/js/src/ics/IC-7167465578550532482 new file mode 100644 index 0000000000000..dbf203fe2ece6 --- /dev/null +++ b/js/src/ics/IC-7167465578550532482 @@ -0,0 +1 @@ +SetProp, 2, 2, 3, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(1) , OP(GuardToObject) ID(0) OP(StoreDynamicSlot) ID(0) OFFSET(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7173802388303836688 b/js/src/ics/IC-7173802388303836688 new file mode 100644 index 0000000000000..0c135b835c28d --- /dev/null +++ b/js/src/ics/IC-7173802388303836688 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(9) LASTUSED(9) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(2) ID(3) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(97) UINT32(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7202736064201176555 b/js/src/ics/IC-7202736064201176555 new file mode 100644 index 0000000000000..bf0680cd34be2 --- /dev/null +++ b/js/src/ics/IC-7202736064201176555 @@ -0,0 +1 @@ +Call, 1, 3, 10, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(8) LASTUSED(8) LASTUSED(6) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardDynamicSlotIsNotObject) ID(2) OFFSET(3) OP(MetaScriptedThisShape) OFFSET(4) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(97) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7220026805480361100 b/js/src/ics/IC-7220026805480361100 new file mode 100644 index 0000000000000..2a196b0e56780 --- /dev/null +++ b/js/src/ics/IC-7220026805480361100 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int32) ID(4) ID(3) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7235661149420205537 b/js/src/ics/IC-7235661149420205537 new file mode 100644 index 0000000000000..e8b7d145fd494 --- /dev/null +++ b/js/src/ics/IC-7235661149420205537 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(3) , OP(GuardToString) ID(0) OP(GuardStringToNumber) ID(0) ID(2) OP(GuardIsNumber) ID(1) OP(CompareDoubleResult) JSOP(Le) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7250684370862830639 b/js/src/ics/IC-7250684370862830639 new file mode 100644 index 0000000000000..f02d0997df847 --- /dev/null +++ b/js/src/ics/IC-7250684370862830639 @@ -0,0 +1 @@ +GetElem, 2, 3, 7, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(1) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardIsUndefined) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(2) OFFSET(1) ID(0) OP(GuardShape) ID(2) OFFSET(2) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-726275027529054686 b/js/src/ics/IC-726275027529054686 new file mode 100644 index 0000000000000..1ddefc704d685 --- /dev/null +++ b/js/src/ics/IC-726275027529054686 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7267775787848262760 b/js/src/ics/IC-7267775787848262760 new file mode 100644 index 0000000000000..c9fe3bc70586c --- /dev/null +++ b/js/src/ics/IC-7267775787848262760 @@ -0,0 +1 @@ +Call, 1, 8, 15, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(10) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Int32) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7276738268032779131 b/js/src/ics/IC-7276738268032779131 new file mode 100644 index 0000000000000..025ff1e4cbf4b --- /dev/null +++ b/js/src/ics/IC-7276738268032779131 @@ -0,0 +1 @@ +GetElem, 2, 3, 9, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(String) STUBFIELD(WeakObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardClass) ID(0) GUARDCLASSKIND(WindowProxy) OP(LoadWrapperTarget) ID(0) ID(2) BOOL(0) OP(GuardSpecificObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(LoadDynamicSlotResult) ID(2) OFFSET(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-731101809626422680 b/js/src/ics/IC-731101809626422680 new file mode 100644 index 0000000000000..6cb465ba22fd0 --- /dev/null +++ b/js/src/ics/IC-731101809626422680 @@ -0,0 +1 @@ +In, 2, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(4) LASTUSED(5) , OP(GuardToObject) ID(1) OP(GuardToString) ID(0) OP(GuardSpecificAtom) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(1) OP(GuardShape) ID(2) OFFSET(3) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7314986533314100677 b/js/src/ics/IC-7314986533314100677 new file mode 100644 index 0000000000000..bac7f9e76ed20 --- /dev/null +++ b/js/src/ics/IC-7314986533314100677 @@ -0,0 +1 @@ +SetElem, 3, 5, 10, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(8) LASTUSED(2) LASTUSED(8) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(0) OP(GuardShape) ID(3) OFFSET(3) OP(LoadProtoObject) ID(4) OFFSET(4) ID(0) OP(GuardShape) ID(4) OFFSET(5) OP(AddAndStoreDynamicSlot) ID(0) OFFSET(6) ID(2) OFFSET(7) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7324892400700704689 b/js/src/ics/IC-7324892400700704689 new file mode 100644 index 0000000000000..46dc82147b0e1 --- /dev/null +++ b/js/src/ics/IC-7324892400700704689 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardShape) ID(3) OFFSET(4) OP(RegExpFlagResult) ID(3) INT32(32) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7324956736683671941 b/js/src/ics/IC-7324956736683671941 new file mode 100644 index 0000000000000..cde51ad2ed77c --- /dev/null +++ b/js/src/ics/IC-7324956736683671941 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Double) STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardIsNull) ID(1) OP(LoadDoubleConstant) OFFSET(1) ID(3) OP(CompareDoubleResult) JSOP(Ge) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7339472814877822799 b/js/src/ics/IC-7339472814877822799 new file mode 100644 index 0000000000000..ca1df132dd13a --- /dev/null +++ b/js/src/ics/IC-7339472814877822799 @@ -0,0 +1 @@ +SetElem, 3, 5, 9, JSVAL_TYPE_UNKNOWN, 72, STUBFIELD(Value) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(1) LASTUSED(7) LASTUSED(4) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardSpecificValue) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(0) OP(GuardShape) ID(3) OFFSET(3) OP(LoadProtoObject) ID(4) OFFSET(4) ID(0) OP(GuardShape) ID(4) OFFSET(5) OP(AllocateAndStoreDynamicSlot) ID(0) OFFSET(6) ID(2) OFFSET(7) OFFSET(8) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7350554386930401733 b/js/src/ics/IC-7350554386930401733 new file mode 100644 index 0000000000000..e4f4d481a56df --- /dev/null +++ b/js/src/ics/IC-7350554386930401733 @@ -0,0 +1 @@ +BinaryArith, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToBigInt) ID(0) OP(GuardToBigInt) ID(1) OP(BigIntRightShiftResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7360746468769580882 b/js/src/ics/IC-7360746468769580882 new file mode 100644 index 0000000000000..42a734079050b --- /dev/null +++ b/js/src/ics/IC-7360746468769580882 @@ -0,0 +1 @@ +Compare, 2, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(GuardIsNull) ID(0) OP(CompareNullUndefinedResult) JSOP(Ne) BOOL(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7362853432073309735 b/js/src/ics/IC-7362853432073309735 new file mode 100644 index 0000000000000..f0c6e9a0e9dc8 --- /dev/null +++ b/js/src/ics/IC-7362853432073309735 @@ -0,0 +1 @@ +Call, 1, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(CallIsSuspendedGeneratorResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-736676615944560765 b/js/src/ics/IC-736676615944560765 new file mode 100644 index 0000000000000..5a946341b68de --- /dev/null +++ b/js/src/ics/IC-736676615944560765 @@ -0,0 +1 @@ +BinaryArith, 2, 5, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(3) LASTUSED(4) LASTUSED(4) LASTUSED(5) , OP(GuardToBigInt) ID(0) OP(GuardToBigInt) ID(1) OP(BigIntToIntPtr) ID(0) ID(2) OP(BigIntToIntPtr) ID(1) ID(3) OP(BigIntPtrBitOr) ID(2) ID(3) ID(4) OP(IntPtrToBigIntResult) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7404248840167653361 b/js/src/ics/IC-7404248840167653361 new file mode 100644 index 0000000000000..f5e4219338cf7 --- /dev/null +++ b/js/src/ics/IC-7404248840167653361 @@ -0,0 +1 @@ +Call, 1, 3, 11, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardFunctionScript) ID(2) OFFSET(3) OFFSET(4) OP(GuardFixedSlotValue) ID(2) OFFSET(5) OFFSET(6) OP(GuardFixedSlotValue) ID(2) OFFSET(7) OFFSET(8) OP(SpecializedBindFunctionResult) ID(2) UINT32(1) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7408088356929918646 b/js/src/ics/IC-7408088356929918646 new file mode 100644 index 0000000000000..44f530196baef --- /dev/null +++ b/js/src/ics/IC-7408088356929918646 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint16) ID(4) ID(3) BOOL(1) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7409538886074621816 b/js/src/ics/IC-7409538886074621816 new file mode 100644 index 0000000000000..50c3e852d6b0c --- /dev/null +++ b/js/src/ics/IC-7409538886074621816 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardShape) ID(3) OFFSET(4) OP(GuardArrayIsPacked) ID(3) OP(NumberMinMaxArrayResult) ID(3) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7425475827528203933 b/js/src/ics/IC-7425475827528203933 new file mode 100644 index 0000000000000..4fe4f2f81e00e --- /dev/null +++ b/js/src/ics/IC-7425475827528203933 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7434900830251242148 b/js/src/ics/IC-7434900830251242148 new file mode 100644 index 0000000000000..b9630ade62c97 --- /dev/null +++ b/js/src/ics/IC-7434900830251242148 @@ -0,0 +1 @@ +GetProp, 1, 2, 8, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(7) OP(RegExpFlagResult) ID(0) INT32(64) OP(ReturnFromIC) diff --git a/js/src/ics/IC-745904529816712807 b/js/src/ics/IC-745904529816712807 new file mode 100644 index 0000000000000..4b159672e1368 --- /dev/null +++ b/js/src/ics/IC-745904529816712807 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasJitEntry) ID(1) OP(GuardNotClassConstructor) ID(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7486529677653082600 b/js/src/ics/IC-7486529677653082600 new file mode 100644 index 0000000000000..9cf2b5ba3ed0c --- /dev/null +++ b/js/src/ics/IC-7486529677653082600 @@ -0,0 +1 @@ +GetElem, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardIsNativeObject) ID(0) OP(LoadDenseElementResult) ID(0) ID(1) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-749116032814679234 b/js/src/ics/IC-749116032814679234 new file mode 100644 index 0000000000000..c763a0f41c0d3 --- /dev/null +++ b/js/src/ics/IC-749116032814679234 @@ -0,0 +1 @@ +GetProp, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 72, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(CallNativeGetterResult) ID(0) OFFSET(7) BOOL(0) OFFSET(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7492639846094803244 b/js/src/ics/IC-7492639846094803244 new file mode 100644 index 0000000000000..7234fe757c03d --- /dev/null +++ b/js/src/ics/IC-7492639846094803244 @@ -0,0 +1 @@ +GetElem, 2, 5, 12, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(8) LASTUSED(2) LASTUSED(5) LASTUSED(7) LASTUSED(9) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(0) OP(GuardShape) ID(2) OFFSET(3) OP(LoadProtoObject) ID(3) OFFSET(4) ID(0) OP(GuardShape) ID(3) OFFSET(5) OP(LoadProtoObject) ID(4) OFFSET(6) ID(0) OP(GuardShape) ID(4) OFFSET(7) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7499173717495355685 b/js/src/ics/IC-7499173717495355685 new file mode 100644 index 0000000000000..7b34b75f9b1df --- /dev/null +++ b/js/src/ics/IC-7499173717495355685 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(AllocSite) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadInt32Constant) OFFSET(4) ID(3) OP(NewArrayFromLengthResult) OFFSET(5) ID(3) OFFSET(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7503353916431455277 b/js/src/ics/IC-7503353916431455277 new file mode 100644 index 0000000000000..a082dc77838ab --- /dev/null +++ b/js/src/ics/IC-7503353916431455277 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasJitEntry) ID(1) OP(GuardNotClassConstructor) ID(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-751687832949406719 b/js/src/ics/IC-751687832949406719 new file mode 100644 index 0000000000000..d61ba9f4b5c2f --- /dev/null +++ b/js/src/ics/IC-751687832949406719 @@ -0,0 +1 @@ +SetProp, 2, 6, 12, JSVAL_TYPE_UNKNOWN, 88, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(10) LASTUSED(10) LASTUSED(3) LASTUSED(5) LASTUSED(7) LASTUSED(9) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(2) OFFSET(1) ID(0) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(0) OP(GuardShape) ID(3) OFFSET(4) OP(LoadProtoObject) ID(4) OFFSET(5) ID(0) OP(GuardShape) ID(4) OFFSET(6) OP(LoadProtoObject) ID(5) OFFSET(7) ID(0) OP(GuardShape) ID(5) OFFSET(8) OP(AddAndStoreDynamicSlot) ID(0) OFFSET(9) ID(1) OFFSET(10) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7558157803468401724 b/js/src/ics/IC-7558157803468401724 new file mode 100644 index 0000000000000..7b4845bdfb46c --- /dev/null +++ b/js/src/ics/IC-7558157803468401724 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardToInt32) ID(0) OP(GuardIsNullOrUndefined) ID(1) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(Int32BitAndResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7564196606949402877 b/js/src/ics/IC-7564196606949402877 new file mode 100644 index 0000000000000..f85bc022a973e --- /dev/null +++ b/js/src/ics/IC-7564196606949402877 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Double) STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) LASTUSED(4) LASTUSED(4) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardIsNull) ID(1) OP(LoadDoubleConstant) OFFSET(1) ID(3) OP(CompareDoubleResult) JSOP(Lt) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7567606418741977363 b/js/src/ics/IC-7567606418741977363 new file mode 100644 index 0000000000000..ebf1871bbfc0b --- /dev/null +++ b/js/src/ics/IC-7567606418741977363 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(Log2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7568466058094061231 b/js/src/ics/IC-7568466058094061231 new file mode 100644 index 0000000000000..daae1aa3a65a5 --- /dev/null +++ b/js/src/ics/IC-7568466058094061231 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(10) LASTUSED(2) LASTUSED(10) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(Array) OP(GuardArrayIsPacked) ID(3) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(69) UINT32(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7581138345160930295 b/js/src/ics/IC-7581138345160930295 new file mode 100644 index 0000000000000..e5f2722da5d09 --- /dev/null +++ b/js/src/ics/IC-7581138345160930295 @@ -0,0 +1 @@ +HasOwn, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(4) LASTUSED(4) , OP(GuardToObject) ID(1) OP(GuardIsNonResizableTypedArray) ID(1) OP(GuardToInt32) ID(0) OP(Int32ToIntPtr) ID(0) ID(2) OP(LoadTypedArrayElementExistsResult) ID(1) ID(2) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7584402331764181517 b/js/src/ics/IC-7584402331764181517 new file mode 100644 index 0000000000000..f09e5fe494c72 --- /dev/null +++ b/js/src/ics/IC-7584402331764181517 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Float64) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-758837353040836026 b/js/src/ics/IC-758837353040836026 new file mode 100644 index 0000000000000..5515ae4236b52 --- /dev/null +++ b/js/src/ics/IC-758837353040836026 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(0) LASTUSED(3) LASTUSED(4) LASTUSED(4) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(3) OP(CompareDoubleResult) JSOP(Le) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7626298430772506162 b/js/src/ics/IC-7626298430772506162 new file mode 100644 index 0000000000000..1891fe74bc2e9 --- /dev/null +++ b/js/src/ics/IC-7626298430772506162 @@ -0,0 +1 @@ +BindName, 1, 6, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(1) LASTUSED(2) LASTUSED(4) LASTUSED(6) LASTUSED(7) , OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(LoadEnclosingEnvironment) ID(2) ID(3) OP(GuardShape) ID(3) OFFSET(0) OP(LoadEnclosingEnvironment) ID(3) ID(4) OP(GuardShape) ID(4) OFFSET(1) OP(LoadEnclosingEnvironment) ID(4) ID(5) OP(LoadObjectResult) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7639062178051447962 b/js/src/ics/IC-7639062178051447962 new file mode 100644 index 0000000000000..d3ce54c3f2c1f --- /dev/null +++ b/js/src/ics/IC-7639062178051447962 @@ -0,0 +1 @@ +In, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(String) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(3) , OP(GuardToObject) ID(1) OP(GuardToString) ID(0) OP(GuardSpecificAtom) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7645375823311335156 b/js/src/ics/IC-7645375823311335156 new file mode 100644 index 0000000000000..e9ded3dccb02d --- /dev/null +++ b/js/src/ics/IC-7645375823311335156 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNumber) ID(1) OP(GuardNumberToIntPtrIndex) ID(1) BOOL(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Float32) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7649343913925262713 b/js/src/ics/IC-7649343913925262713 new file mode 100644 index 0000000000000..8def90ff1c193 --- /dev/null +++ b/js/src/ics/IC-7649343913925262713 @@ -0,0 +1 @@ +Call, 1, 5, 11, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(5) LASTUSED(4) LASTUSED(6) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(GuardSpecificFunction) ID(3) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(4) BYTE(0) OP(GuardIsNumber) ID(4) OP(MathFunctionNumberResult) ID(4) UNARYMATHFUNC(Log) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7684497546958413653 b/js/src/ics/IC-7684497546958413653 new file mode 100644 index 0000000000000..2704bdf3c6b32 --- /dev/null +++ b/js/src/ics/IC-7684497546958413653 @@ -0,0 +1 @@ +GetElem, 2, 3, 7, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(Value) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(5) LASTUSED(1) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardSpecificValue) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(GuardFixedSlotValue) ID(0) OFFSET(2) OFFSET(3) OP(LoadObject) ID(2) OFFSET(4) OP(CallScriptedGetterResult) ID(0) ID(2) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-769874876471461951 b/js/src/ics/IC-769874876471461951 new file mode 100644 index 0000000000000..c4e184f44fc68 --- /dev/null +++ b/js/src/ics/IC-769874876471461951 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7708211997325567179 b/js/src/ics/IC-7708211997325567179 new file mode 100644 index 0000000000000..fc8779a00a51b --- /dev/null +++ b/js/src/ics/IC-7708211997325567179 @@ -0,0 +1 @@ +CloseIter, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadFixedSlot) ID(1) ID(0) OFFSET(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(2) OFFSET(3) OP(CloseIterScriptedResult) ID(0) ID(1) COMPLETIONKIND(Throw) UINT32(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7719784825117209774 b/js/src/ics/IC-7719784825117209774 new file mode 100644 index 0000000000000..c13303fdd5a6e --- /dev/null +++ b/js/src/ics/IC-7719784825117209774 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasJitEntry) ID(1) OP(GuardNotClassConstructor) ID(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(2) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7757860598185740927 b/js/src/ics/IC-7757860598185740927 new file mode 100644 index 0000000000000..b1fcff6d0efec --- /dev/null +++ b/js/src/ics/IC-7757860598185740927 @@ -0,0 +1 @@ +GetElem, 2, 3, 8, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardObjectFuseProperty) ID(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(1) OP(CallNativeGetterResult) ID(0) OFFSET(8) BOOL(1) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7768433527213643412 b/js/src/ics/IC-7768433527213643412 new file mode 100644 index 0000000000000..bfbf6a577e04c --- /dev/null +++ b/js/src/ics/IC-7768433527213643412 @@ -0,0 +1 @@ +Call, 1, 1, 2, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) , OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7791800684512152753 b/js/src/ics/IC-7791800684512152753 new file mode 100644 index 0000000000000..f1efb6a7ab058 --- /dev/null +++ b/js/src/ics/IC-7791800684512152753 @@ -0,0 +1 @@ +SetElem, 3, 5, 9, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(7) LASTUSED(7) LASTUSED(7) LASTUSED(4) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(3) OFFSET(1) ID(0) OP(GuardShape) ID(3) OFFSET(2) OP(LoadProtoObject) ID(4) OFFSET(3) ID(0) OP(GuardShape) ID(4) OFFSET(4) OP(StoreDenseElementHole) ID(0) ID(1) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7804041312612862365 b/js/src/ics/IC-7804041312612862365 new file mode 100644 index 0000000000000..f1ec5c9d937e5 --- /dev/null +++ b/js/src/ics/IC-7804041312612862365 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int8) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7866166923509172853 b/js/src/ics/IC-7866166923509172853 new file mode 100644 index 0000000000000..b08448c2ada9c --- /dev/null +++ b/js/src/ics/IC-7866166923509172853 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(98) UINT32(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7869157210104551129 b/js/src/ics/IC-7869157210104551129 new file mode 100644 index 0000000000000..f67f8b71267ee --- /dev/null +++ b/js/src/ics/IC-7869157210104551129 @@ -0,0 +1 @@ +Call, 1, 7, 13, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(10) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(AtomicsOrResult) ID(2) ID(4) ID(6) SCALARTYPE(Int8) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7870884289306445919 b/js/src/ics/IC-7870884289306445919 new file mode 100644 index 0000000000000..befc330908db8 --- /dev/null +++ b/js/src/ics/IC-7870884289306445919 @@ -0,0 +1 @@ +GetProp, 1, 4, 13, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(Id) , LASTUSED(11) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadScriptedProxyHandler) ID(1) ID(0) OP(LoadWrapperTarget) ID(0) ID(2) BOOL(1) OP(GuardIsNativeObject) ID(2) OP(GuardShape) ID(1) OFFSET(1) OP(LoadFixedSlot) ID(3) ID(1) OFFSET(2) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(3) OFFSET(3) OFFSET(4) OP(CallScriptedProxyGetResult) ID(2) ID(0) ID(1) ID(3) OFFSET(5) UINT32(262178) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7895134038915974605 b/js/src/ics/IC-7895134038915974605 new file mode 100644 index 0000000000000..2ff3c528b2d92 --- /dev/null +++ b/js/src/ics/IC-7895134038915974605 @@ -0,0 +1 @@ +HasOwn, 2, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(1) , OP(GuardToObject) ID(1) OP(MegamorphicHasPropResult) ID(1) ID(0) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7909848207463708484 b/js/src/ics/IC-7909848207463708484 new file mode 100644 index 0000000000000..ef9a947b87b42 --- /dev/null +++ b/js/src/ics/IC-7909848207463708484 @@ -0,0 +1 @@ +GetProp, 1, 1, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) , OP(GuardToString) ID(0) OP(LoadStringLengthResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7917106339670149229 b/js/src/ics/IC-7917106339670149229 new file mode 100644 index 0000000000000..30b030ce68b40 --- /dev/null +++ b/js/src/ics/IC-7917106339670149229 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(10) LASTUSED(2) LASTUSED(10) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(MappedArguments) OP(GuardArgumentsObjectFlags) ID(3) BYTE(20) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallNativeFunction) ID(2) ID(0) CALLFLAGS(68) UINT32(5) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7930724512359688784 b/js/src/ics/IC-7930724512359688784 new file mode 100644 index 0000000000000..daf6e8d679701 --- /dev/null +++ b/js/src/ics/IC-7930724512359688784 @@ -0,0 +1 @@ +CloseIter, 1, 3, 9, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(3) LASTUSED(7) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardShape) ID(1) OFFSET(2) OP(LoadDynamicSlot) ID(2) ID(1) OFFSET(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(2) OFFSET(4) OFFSET(5) OP(CloseIterScriptedResult) ID(0) ID(2) COMPLETIONKIND(Normal) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7940724580282964946 b/js/src/ics/IC-7940724580282964946 new file mode 100644 index 0000000000000..f2dfed3b9e2a5 --- /dev/null +++ b/js/src/ics/IC-7940724580282964946 @@ -0,0 +1 @@ +GetName, 1, 6, 10, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(3) LASTUSED(5) LASTUSED(7) LASTUSED(8) , OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(0) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(LoadEnclosingEnvironment) ID(2) ID(3) OP(GuardShape) ID(3) OFFSET(1) OP(LoadEnclosingEnvironment) ID(3) ID(4) OP(GuardShape) ID(4) OFFSET(2) OP(LoadDynamicSlot) ID(5) ID(4) OFFSET(3) OP(LoadOperandResult) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7948263610858036054 b/js/src/ics/IC-7948263610858036054 new file mode 100644 index 0000000000000..a6f9b6fd12f50 --- /dev/null +++ b/js/src/ics/IC-7948263610858036054 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(66) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7951837257564624315 b/js/src/ics/IC-7951837257564624315 new file mode 100644 index 0000000000000..f40c669044298 --- /dev/null +++ b/js/src/ics/IC-7951837257564624315 @@ -0,0 +1 @@ +SetElem, 3, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Symbol) STUBFIELD(Id) , LASTUSED(5) LASTUSED(4) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardIsNotDOMProxy) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(ProxySet) ID(0) OFFSET(1) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7952192849644477208 b/js/src/ics/IC-7952192849644477208 new file mode 100644 index 0000000000000..dcd6a3941ef88 --- /dev/null +++ b/js/src/ics/IC-7952192849644477208 @@ -0,0 +1 @@ +GetProp, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(0) LASTUSED(4) , OP(GuardNonDoubleType) ID(0) VALUETYPE(JSVAL_TYPE_BIGINT) OP(LoadObject) ID(1) OFFSET(0) OP(GuardSpecificObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(CheckWeakValueResultForDynamicSlot) ID(1) OFFSET(7) OFFSET(8) OP(UncheckedLoadWeakObjectResult) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-7972057111904247804 b/js/src/ics/IC-7972057111904247804 new file mode 100644 index 0000000000000..4c7e0fff38efd --- /dev/null +++ b/js/src/ics/IC-7972057111904247804 @@ -0,0 +1 @@ +Call, 1, 3, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(8) LASTUSED(2) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardNotClassConstructor) ID(2) OP(GuardFunctionHasJitEntry) ID(2) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(3) UINT32(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8001703547456055322 b/js/src/ics/IC-8001703547456055322 new file mode 100644 index 0000000000000..73f35f4816967 --- /dev/null +++ b/js/src/ics/IC-8001703547456055322 @@ -0,0 +1 @@ +UnaryArith, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(2) , OP(GuardIsNumber) ID(0) OP(TruncateDoubleToUInt32) ID(0) ID(1) OP(Int32NotResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8009553409671560982 b/js/src/ics/IC-8009553409671560982 new file mode 100644 index 0000000000000..7bd117ce97249 --- /dev/null +++ b/js/src/ics/IC-8009553409671560982 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(BigInt64) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-802216659212149853 b/js/src/ics/IC-802216659212149853 new file mode 100644 index 0000000000000..390ce4bbc8880 --- /dev/null +++ b/js/src/ics/IC-802216659212149853 @@ -0,0 +1 @@ +SetProp, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(2) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(AddAndStoreDynamicSlot) ID(0) OFFSET(1) ID(1) OFFSET(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8068678896796315186 b/js/src/ics/IC-8068678896796315186 new file mode 100644 index 0000000000000..283e306646271 --- /dev/null +++ b/js/src/ics/IC-8068678896796315186 @@ -0,0 +1 @@ +GetName, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(4) , OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(0) OP(LoadFixedSlot) ID(2) ID(1) OFFSET(1) OP(GuardIsNotUninitializedLexical) ID(2) OP(LoadOperandResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-807303826890643662 b/js/src/ics/IC-807303826890643662 new file mode 100644 index 0000000000000..d60dea686e220 --- /dev/null +++ b/js/src/ics/IC-807303826890643662 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(7) LASTUSED(4) LASTUSED(7) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(1) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(GuardSpecificFunction) ID(3) OFFSET(0) OFFSET(1) OP(CallBoundScriptedFunction) ID(1) ID(3) ID(0) CALLFLAGS(65) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8075975975025262858 b/js/src/ics/IC-8075975975025262858 new file mode 100644 index 0000000000000..b91f7122ba9e1 --- /dev/null +++ b/js/src/ics/IC-8075975975025262858 @@ -0,0 +1 @@ +GetElem, 2, 3, 8, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(2) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(2) OFFSET(2) OP(GuardShape) ID(2) OFFSET(3) OP(LoadDynamicSlotResult) ID(2) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8085671503585936599 b/js/src/ics/IC-8085671503585936599 new file mode 100644 index 0000000000000..25244b0770177 --- /dev/null +++ b/js/src/ics/IC-8085671503585936599 @@ -0,0 +1 @@ +Call, 1, 5, 11, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(9) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToObject) ID(3) OP(LoadArgumentFixedSlot) ID(4) BYTE(0) OP(LoadInstanceOfObjectResult) ID(4) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8101078221050368849 b/js/src/ics/IC-8101078221050368849 new file mode 100644 index 0000000000000..e5a39244d10f1 --- /dev/null +++ b/js/src/ics/IC-8101078221050368849 @@ -0,0 +1 @@ +Call, 1, 1, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) , OP(GuardFuse) REALMFUSE(1) OP(LoadBooleanResult) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8108183892012730001 b/js/src/ics/IC-8108183892012730001 new file mode 100644 index 0000000000000..f8a23d5b4f68b --- /dev/null +++ b/js/src/ics/IC-8108183892012730001 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNumber) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float32) ID(3) ID(2) BOOL(1) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8111883778987399440 b/js/src/ics/IC-8111883778987399440 new file mode 100644 index 0000000000000..3ba733b5e4850 --- /dev/null +++ b/js/src/ics/IC-8111883778987399440 @@ -0,0 +1 @@ +Call, 1, 8, 15, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(10) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Uint32) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8131647849764614667 b/js/src/ics/IC-8131647849764614667 new file mode 100644 index 0000000000000..ac42c7c02ade3 --- /dev/null +++ b/js/src/ics/IC-8131647849764614667 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(3) , OP(GuardToBoolean) ID(0) OP(BooleanToNumber) ID(0) ID(2) OP(GuardIsNumber) ID(1) OP(CompareDoubleResult) JSOP(Ne) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8137744976260600065 b/js/src/ics/IC-8137744976260600065 new file mode 100644 index 0000000000000..476626461f62b --- /dev/null +++ b/js/src/ics/IC-8137744976260600065 @@ -0,0 +1 @@ +GetProp, 1, 3, 9, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(5) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardClass) ID(0) GUARDCLASSKIND(WindowProxy) OP(LoadWrapperTarget) ID(0) ID(1) BOOL(0) OP(GuardSpecificObject) ID(1) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(1) OP(GuardShape) ID(2) OFFSET(3) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8142046115317896438 b/js/src/ics/IC-8142046115317896438 new file mode 100644 index 0000000000000..1d2e17747f4f1 --- /dev/null +++ b/js/src/ics/IC-8142046115317896438 @@ -0,0 +1 @@ +Compare, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(1) LASTUSED(2) , OP(GuardToInt32) ID(0) OP(GuardBooleanToInt32) ID(1) ID(2) OP(CompareInt32Result) JSOP(Lt) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8142965712298942684 b/js/src/ics/IC-8142965712298942684 new file mode 100644 index 0000000000000..d6150a7416b00 --- /dev/null +++ b/js/src/ics/IC-8142965712298942684 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(GuardHasAttachedArrayBuffer) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToBigInt) ID(3) OP(LoadInt32AsIntPtrConstant) OFFSET(3) ID(4) OP(LoadArrayBufferViewLength) ID(2) ID(5) OP(TypedArrayFillResult) ID(2) ID(3) ID(4) ID(5) SCALARTYPE(BigInt64) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8155132706777070304 b/js/src/ics/IC-8155132706777070304 new file mode 100644 index 0000000000000..36158448336e2 --- /dev/null +++ b/js/src/ics/IC-8155132706777070304 @@ -0,0 +1 @@ +GetProp, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadProtoObject) ID(1) OFFSET(1) ID(0) OP(GuardShape) ID(1) OFFSET(2) OP(LoadProtoObject) ID(2) OFFSET(3) ID(0) OP(GuardShape) ID(2) OFFSET(4) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8180528644816477753 b/js/src/ics/IC-8180528644816477753 new file mode 100644 index 0000000000000..29c2f1b81ad89 --- /dev/null +++ b/js/src/ics/IC-8180528644816477753 @@ -0,0 +1 @@ +GetElem, 2, 4, 10, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(2) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(0) OP(GuardShape) ID(2) OFFSET(3) OP(LoadProtoObject) ID(3) OFFSET(4) ID(0) OP(GuardShape) ID(3) OFFSET(5) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8182823701706162214 b/js/src/ics/IC-8182823701706162214 new file mode 100644 index 0000000000000..8c997062acc18 --- /dev/null +++ b/js/src/ics/IC-8182823701706162214 @@ -0,0 +1 @@ +GetElem, 2, 3, 8, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(GuardFixedSlotValue) ID(0) OFFSET(2) OFFSET(3) OP(LoadObject) ID(2) OFFSET(4) OP(CallScriptedGetterResult) ID(0) ID(2) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8193213348312547492 b/js/src/ics/IC-8193213348312547492 new file mode 100644 index 0000000000000..6607bb7840f01 --- /dev/null +++ b/js/src/ics/IC-8193213348312547492 @@ -0,0 +1 @@ +GetPropSuper, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(2) LASTUSED(0) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadFixedSlotResult) ID(0) OFFSET(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8199823677791083428 b/js/src/ics/IC-8199823677791083428 new file mode 100644 index 0000000000000..4d99b3c058878 --- /dev/null +++ b/js/src/ics/IC-8199823677791083428 @@ -0,0 +1 @@ +Call, 1, 8, 15, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(10) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToInt32ModUint32) ID(5) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Uint16) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8215484261361241131 b/js/src/ics/IC-8215484261361241131 new file mode 100644 index 0000000000000..d6afa646661ec --- /dev/null +++ b/js/src/ics/IC-8215484261361241131 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Int8) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8216349263939615631 b/js/src/ics/IC-8216349263939615631 new file mode 100644 index 0000000000000..7ed869f00cef0 --- /dev/null +++ b/js/src/ics/IC-8216349263939615631 @@ -0,0 +1 @@ +GetProp, 1, 1, 6, JSVAL_TYPE_UNKNOWN, 72, STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakValue) STUBFIELD(WeakObject) , LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardSpecificObject) ID(0) OFFSET(0) OP(GuardObjectFuseProperty) ID(0) OFFSET(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) BOOL(0) OP(CheckWeakValueResultForDynamicSlot) ID(0) OFFSET(6) OFFSET(7) OP(UncheckedLoadWeakObjectResult) OFFSET(8) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8230559266677649540 b/js/src/ics/IC-8230559266677649540 new file mode 100644 index 0000000000000..7c64ceae4ac7d --- /dev/null +++ b/js/src/ics/IC-8230559266677649540 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(3) , OP(GuardIsNull) ID(0) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(GuardToInt32) ID(1) OP(CompareInt32Result) JSOP(Lt) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8233321740058095794 b/js/src/ics/IC-8233321740058095794 new file mode 100644 index 0000000000000..31a7fa379ff1c --- /dev/null +++ b/js/src/ics/IC-8233321740058095794 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(2) LASTUSED(6) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(67) UINT32(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8236049176462706622 b/js/src/ics/IC-8236049176462706622 new file mode 100644 index 0000000000000..1112eee82fda3 --- /dev/null +++ b/js/src/ics/IC-8236049176462706622 @@ -0,0 +1 @@ +BinaryArith, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToBigInt) ID(0) OP(GuardToBigInt) ID(1) OP(BigIntBitAndResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8244482935373369685 b/js/src/ics/IC-8244482935373369685 new file mode 100644 index 0000000000000..ece06b8809490 --- /dev/null +++ b/js/src/ics/IC-8244482935373369685 @@ -0,0 +1 @@ +GetName, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(3) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadDynamicSlot) ID(1) ID(0) OFFSET(1) OP(GuardIsNotUninitializedLexical) ID(1) OP(LoadOperandResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8244631324132828388 b/js/src/ics/IC-8244631324132828388 new file mode 100644 index 0000000000000..a914c6281649e --- /dev/null +++ b/js/src/ics/IC-8244631324132828388 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNumber) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float64) ID(3) ID(2) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8254164986441511102 b/js/src/ics/IC-8254164986441511102 new file mode 100644 index 0000000000000..9f0a8b1a0f963 --- /dev/null +++ b/js/src/ics/IC-8254164986441511102 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(0) LASTUSED(3) LASTUSED(4) LASTUSED(4) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardToBoolean) ID(1) OP(BooleanToNumber) ID(1) ID(3) OP(CompareDoubleResult) JSOP(Le) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8254418371745474891 b/js/src/ics/IC-8254418371745474891 new file mode 100644 index 0000000000000..bf9b239e62e99 --- /dev/null +++ b/js/src/ics/IC-8254418371745474891 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToBigInt) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(BigUint64) ID(3) ID(2) BOOL(1) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8295071825394113903 b/js/src/ics/IC-8295071825394113903 new file mode 100644 index 0000000000000..ff59fb4b6767d --- /dev/null +++ b/js/src/ics/IC-8295071825394113903 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Int32) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8304559682286002846 b/js/src/ics/IC-8304559682286002846 new file mode 100644 index 0000000000000..8554558a31370 --- /dev/null +++ b/js/src/ics/IC-8304559682286002846 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallNativeFunction) ID(1) ID(0) CALLFLAGS(66) UINT32(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8315217340573356278 b/js/src/ics/IC-8315217340573356278 new file mode 100644 index 0000000000000..ed9ec672266e7 --- /dev/null +++ b/js/src/ics/IC-8315217340573356278 @@ -0,0 +1 @@ +Call, 1, 6, 11, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(8) LASTUSED(9) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardIsNumber) ID(2) OP(GuardIsNumber) ID(3) OP(TruncateDoubleToUInt32) ID(2) ID(4) OP(TruncateDoubleToUInt32) ID(3) ID(5) OP(MathImulResult) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8317733766362443569 b/js/src/ics/IC-8317733766362443569 new file mode 100644 index 0000000000000..dced1f7de543b --- /dev/null +++ b/js/src/ics/IC-8317733766362443569 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardToInt32) ID(0) OP(GuardIsNull) ID(1) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(CompareInt32Result) JSOP(Gt) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8322473950258781440 b/js/src/ics/IC-8322473950258781440 new file mode 100644 index 0000000000000..0c41e1ab9c207 --- /dev/null +++ b/js/src/ics/IC-8322473950258781440 @@ -0,0 +1 @@ +Call, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(AssertRecoveredOnBailoutResult) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-832278648520639690 b/js/src/ics/IC-832278648520639690 new file mode 100644 index 0000000000000..cd4d8e2b019c5 --- /dev/null +++ b/js/src/ics/IC-832278648520639690 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(MathFunctionNumberResult) ID(2) UNARYMATHFUNC(TanH) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8326071184532710890 b/js/src/ics/IC-8326071184532710890 new file mode 100644 index 0000000000000..99f5c7f6f1ba9 --- /dev/null +++ b/js/src/ics/IC-8326071184532710890 @@ -0,0 +1 @@ +Call, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(LoadFixedSlotTypedResult) ID(1) OFFSET(0) VALUETYPE(JSVAL_TYPE_OBJECT) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8355419085300232965 b/js/src/ics/IC-8355419085300232965 new file mode 100644 index 0000000000000..364257af29e3e --- /dev/null +++ b/js/src/ics/IC-8355419085300232965 @@ -0,0 +1 @@ +Call, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificObject) ID(2) OFFSET(2) OP(ObjectCreateResult) OFFSET(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8360592877849122155 b/js/src/ics/IC-8360592877849122155 new file mode 100644 index 0000000000000..4e6e6763dced7 --- /dev/null +++ b/js/src/ics/IC-8360592877849122155 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardIsNumber) ID(1) OP(GuardNumberToIntPtrIndex) ID(1) BOOL(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int32) ID(4) ID(3) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8363578138225385166 b/js/src/ics/IC-8363578138225385166 new file mode 100644 index 0000000000000..e01dce0e2d73c --- /dev/null +++ b/js/src/ics/IC-8363578138225385166 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(1) UINT32(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8403239149345319813 b/js/src/ics/IC-8403239149345319813 new file mode 100644 index 0000000000000..14a2ddccc5158 --- /dev/null +++ b/js/src/ics/IC-8403239149345319813 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Uint8Clamped) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8413322494742765965 b/js/src/ics/IC-8413322494742765965 new file mode 100644 index 0000000000000..5ac48d53b74e9 --- /dev/null +++ b/js/src/ics/IC-8413322494742765965 @@ -0,0 +1 @@ +Call, 1, 1, 2, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(JSObject) , LASTUSED(0) , OP(NewArrayIteratorResult) OFFSET(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8420671501376903345 b/js/src/ics/IC-8420671501376903345 new file mode 100644 index 0000000000000..cbd0575cddc4c --- /dev/null +++ b/js/src/ics/IC-8420671501376903345 @@ -0,0 +1 @@ +Call, 1, 4, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(4) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(StringFromCharCodeResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8429088277321985112 b/js/src/ics/IC-8429088277321985112 new file mode 100644 index 0000000000000..f43c9bd8c5364 --- /dev/null +++ b/js/src/ics/IC-8429088277321985112 @@ -0,0 +1 @@ +HasOwn, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(String) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(3) , OP(GuardToObject) ID(1) OP(GuardToString) ID(0) OP(GuardSpecificAtom) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadBooleanResult) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8441206218065884468 b/js/src/ics/IC-8441206218065884468 new file mode 100644 index 0000000000000..9156b070cd891 --- /dev/null +++ b/js/src/ics/IC-8441206218065884468 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(2) OP(GuardToObject) ID(3) OP(CompareObjectResult) JSOP(StrictEq) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8442127857693820938 b/js/src/ics/IC-8442127857693820938 new file mode 100644 index 0000000000000..cae3e7e3f4269 --- /dev/null +++ b/js/src/ics/IC-8442127857693820938 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Int8) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8442598027497994034 b/js/src/ics/IC-8442598027497994034 new file mode 100644 index 0000000000000..39b0bd211b1bb --- /dev/null +++ b/js/src/ics/IC-8442598027497994034 @@ -0,0 +1 @@ +SetElem, 3, 4, 8, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(6) LASTUSED(2) LASTUSED(6) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(0) OP(GuardShape) ID(3) OFFSET(3) OP(AddAndStoreDynamicSlot) ID(0) OFFSET(4) ID(2) OFFSET(5) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8443741239559716080 b/js/src/ics/IC-8443741239559716080 new file mode 100644 index 0000000000000..d7e1c54d0044a --- /dev/null +++ b/js/src/ics/IC-8443741239559716080 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToInt32) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToStringWithBaseResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8445141178915289773 b/js/src/ics/IC-8445141178915289773 new file mode 100644 index 0000000000000..247ff13664488 --- /dev/null +++ b/js/src/ics/IC-8445141178915289773 @@ -0,0 +1 @@ +GetProp, 1, 1, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Id) , LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardIsNotDOMProxy) ID(0) OP(ProxyGetResult) ID(0) OFFSET(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-847530939114946120 b/js/src/ics/IC-847530939114946120 new file mode 100644 index 0000000000000..054c1fa5c579b --- /dev/null +++ b/js/src/ics/IC-847530939114946120 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(10) LASTUSED(10) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(2) ID(3) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(97) UINT32(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8476731158983138059 b/js/src/ics/IC-8476731158983138059 new file mode 100644 index 0000000000000..10d79be03a76f --- /dev/null +++ b/js/src/ics/IC-8476731158983138059 @@ -0,0 +1 @@ +GetElem, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadFixedSlotResult) ID(0) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8481490251351291794 b/js/src/ics/IC-8481490251351291794 new file mode 100644 index 0000000000000..b6484661beb0e --- /dev/null +++ b/js/src/ics/IC-8481490251351291794 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(2) LASTUSED(3) , OP(GuardToInt32) ID(0) OP(GuardIsNumber) ID(1) OP(TruncateDoubleToUInt32) ID(1) ID(2) OP(Int32BitXorResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8501101688775670023 b/js/src/ics/IC-8501101688775670023 new file mode 100644 index 0000000000000..a98ea278218e8 --- /dev/null +++ b/js/src/ics/IC-8501101688775670023 @@ -0,0 +1 @@ +Call, 1, 2, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(IsObjectResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-850629062811003910 b/js/src/ics/IC-850629062811003910 new file mode 100644 index 0000000000000..33e456017f56c --- /dev/null +++ b/js/src/ics/IC-850629062811003910 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToBigInt) ID(0) OP(GuardToBigInt) ID(1) OP(CompareBigIntResult) JSOP(Lt) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8518561424476582843 b/js/src/ics/IC-8518561424476582843 new file mode 100644 index 0000000000000..9613f4486442c --- /dev/null +++ b/js/src/ics/IC-8518561424476582843 @@ -0,0 +1 @@ +CloseIter, 1, 3, 8, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(3) LASTUSED(6) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardShape) ID(1) OFFSET(2) OP(LoadDynamicSlot) ID(2) ID(1) OFFSET(3) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(4) OFFSET(5) OP(CloseIterScriptedResult) ID(0) ID(2) COMPLETIONKIND(Normal) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-852149399956264048 b/js/src/ics/IC-852149399956264048 new file mode 100644 index 0000000000000..364532567b3ef --- /dev/null +++ b/js/src/ics/IC-852149399956264048 @@ -0,0 +1 @@ +GetElemSuper, 3, 4, 8, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(2) LASTUSED(0) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(3) OFFSET(2) OP(GuardShape) ID(3) OFFSET(3) OP(LoadDynamicSlotResult) ID(3) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8534257520509712648 b/js/src/ics/IC-8534257520509712648 new file mode 100644 index 0000000000000..92b196508427c --- /dev/null +++ b/js/src/ics/IC-8534257520509712648 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasJitEntry) ID(1) OP(GuardFunctionIsConstructor) ID(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(33) UINT32(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8540470795437792712 b/js/src/ics/IC-8540470795437792712 new file mode 100644 index 0000000000000..101f2e134aec1 --- /dev/null +++ b/js/src/ics/IC-8540470795437792712 @@ -0,0 +1 @@ +BindName, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(WeakShape) , LASTUSED(1) LASTUSED(3) LASTUSED(4) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(GuardShape) ID(1) OFFSET(1) OP(LoadEnclosingEnvironment) ID(1) ID(2) OP(LoadObjectResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8558874767732896280 b/js/src/ics/IC-8558874767732896280 new file mode 100644 index 0000000000000..d6868824dfaa6 --- /dev/null +++ b/js/src/ics/IC-8558874767732896280 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardIsNumber) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float64) ID(3) ID(2) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8559109891190089019 b/js/src/ics/IC-8559109891190089019 new file mode 100644 index 0000000000000..162defcb72acd --- /dev/null +++ b/js/src/ics/IC-8559109891190089019 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Int8) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8585837622815890575 b/js/src/ics/IC-8585837622815890575 new file mode 100644 index 0000000000000..4af1ebec367ae --- /dev/null +++ b/js/src/ics/IC-8585837622815890575 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(10) LASTUSED(2) LASTUSED(10) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(MappedArguments) OP(GuardArgumentsObjectFlags) ID(3) BYTE(20) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(68) UINT32(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8601040439805555324 b/js/src/ics/IC-8601040439805555324 new file mode 100644 index 0000000000000..29fdc7f3a36ef --- /dev/null +++ b/js/src/ics/IC-8601040439805555324 @@ -0,0 +1 @@ +GetProp, 1, 2, 8, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(6) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(0) OP(GuardClass) ID(0) GUARDCLASSKIND(Set) OP(SetSizeResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8605376481005836786 b/js/src/ics/IC-8605376481005836786 new file mode 100644 index 0000000000000..42b8a2228c7b8 --- /dev/null +++ b/js/src/ics/IC-8605376481005836786 @@ -0,0 +1 @@ +OptimizeSpreadCall, 1, 1, 2, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) , OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8610836031911855894 b/js/src/ics/IC-8610836031911855894 new file mode 100644 index 0000000000000..52972ca30ca5d --- /dev/null +++ b/js/src/ics/IC-8610836031911855894 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(MapGetObjectResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8616612317712480790 b/js/src/ics/IC-8616612317712480790 new file mode 100644 index 0000000000000..a18f4f19b1117 --- /dev/null +++ b/js/src/ics/IC-8616612317712480790 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(BigUint64) BOOL(1) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8618671683994336078 b/js/src/ics/IC-8618671683994336078 new file mode 100644 index 0000000000000..8b44d7bafc12e --- /dev/null +++ b/js/src/ics/IC-8618671683994336078 @@ -0,0 +1 @@ +SetProp, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Id) , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardIsNotDOMProxy) ID(0) OP(ProxySet) ID(0) OFFSET(0) ID(1) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8622514010011455349 b/js/src/ics/IC-8622514010011455349 new file mode 100644 index 0000000000000..ef85793835481 --- /dev/null +++ b/js/src/ics/IC-8622514010011455349 @@ -0,0 +1 @@ +GetProp, 1, 1, 5, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardSpecificObject) ID(0) OFFSET(0) OP(GuardObjectFuseProperty) ID(0) OFFSET(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) BOOL(1) OP(CallNativeGetterResult) ID(0) OFFSET(6) BOOL(1) OFFSET(7) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8630183055865625216 b/js/src/ics/IC-8630183055865625216 new file mode 100644 index 0000000000000..82a90795185de --- /dev/null +++ b/js/src/ics/IC-8630183055865625216 @@ -0,0 +1 @@ +UnaryArith, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(0) LASTUSED(2) , OP(GuardIsNull) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(1) OP(DoubleNegationResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8648689368816333021 b/js/src/ics/IC-8648689368816333021 new file mode 100644 index 0000000000000..edd87b3e180dd --- /dev/null +++ b/js/src/ics/IC-8648689368816333021 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(RawPointer) STUBFIELD(RawPointer) , LASTUSED(3) LASTUSED(3) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardAnyClass) ID(1) OFFSET(0) OP(CallClassHook) ID(1) ID(0) CALLFLAGS(1) UINT32(2) OFFSET(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8674212790026628899 b/js/src/ics/IC-8674212790026628899 new file mode 100644 index 0000000000000..27c38af65e679 --- /dev/null +++ b/js/src/ics/IC-8674212790026628899 @@ -0,0 +1 @@ +SetElem, 3, 3, 6, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(StoreDynamicSlot) ID(0) OFFSET(2) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8708623109992990057 b/js/src/ics/IC-8708623109992990057 new file mode 100644 index 0000000000000..9d2fc4bc40cd0 --- /dev/null +++ b/js/src/ics/IC-8708623109992990057 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(65) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8714373314762342458 b/js/src/ics/IC-8714373314762342458 new file mode 100644 index 0000000000000..f446df308581d --- /dev/null +++ b/js/src/ics/IC-8714373314762342458 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(FixedLengthArrayBuffer) OP(LoadArgumentFixedSlot) ID(4) BYTE(1) OP(LoadUndefined) ID(5) OP(NewTypedArrayFromArrayBufferResult) OFFSET(4) ID(3) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8717527894172818884 b/js/src/ics/IC-8717527894172818884 new file mode 100644 index 0000000000000..d4bfc640cef9c --- /dev/null +++ b/js/src/ics/IC-8717527894172818884 @@ -0,0 +1 @@ +Call, 1, 7, 15, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(13) LASTUSED(8) LASTUSED(13) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(5) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardToBigInt) ID(5) OP(LoadArgumentFixedSlot) ID(6) BYTE(0) OP(GuardToBigInt) ID(6) OP(AtomicsCompareExchangeResult) ID(2) ID(4) ID(5) ID(6) SCALARTYPE(BigInt64) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8720531975905999486 b/js/src/ics/IC-8720531975905999486 new file mode 100644 index 0000000000000..52fdc5cba7ddc --- /dev/null +++ b/js/src/ics/IC-8720531975905999486 @@ -0,0 +1 @@ +HasOwn, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Symbol) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(3) , OP(GuardToObject) ID(1) OP(GuardToSymbol) ID(0) OP(GuardSpecificSymbol) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadBooleanResult) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8722343896312957455 b/js/src/ics/IC-8722343896312957455 new file mode 100644 index 0000000000000..52f9d88ca46de --- /dev/null +++ b/js/src/ics/IC-8722343896312957455 @@ -0,0 +1 @@ +GetElem, 2, 4, 8, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(1) LASTUSED(4) LASTUSED(5) , OP(GuardNonDoubleType) ID(0) VALUETYPE(JSVAL_TYPE_STRING) OP(GuardSpecificValue) ID(1) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(LoadProtoObject) ID(3) OFFSET(3) ID(2) OP(GuardShape) ID(3) OFFSET(4) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8726193584855817371 b/js/src/ics/IC-8726193584855817371 new file mode 100644 index 0000000000000..91bed4a9a3e1a --- /dev/null +++ b/js/src/ics/IC-8726193584855817371 @@ -0,0 +1 @@ +SetProp, 2, 2, 3, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Id) , LASTUSED(1) LASTUSED(1) , OP(GuardToObject) ID(0) OP(MegamorphicStoreSlot) ID(0) OFFSET(0) ID(1) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8726371440541008632 b/js/src/ics/IC-8726371440541008632 new file mode 100644 index 0000000000000..31725d321c952 --- /dev/null +++ b/js/src/ics/IC-8726371440541008632 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(2) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(2) OP(CompareDoubleResult) JSOP(Gt) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8736858826767240875 b/js/src/ics/IC-8736858826767240875 new file mode 100644 index 0000000000000..f67428757ec74 --- /dev/null +++ b/js/src/ics/IC-8736858826767240875 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToString) ID(0) OP(GuardToString) ID(1) OP(CompareStringResult) JSOP(Eq) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8743022270375700073 b/js/src/ics/IC-8743022270375700073 new file mode 100644 index 0000000000000..495214515a83a --- /dev/null +++ b/js/src/ics/IC-8743022270375700073 @@ -0,0 +1 @@ +SetElem, 3, 5, 9, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(2) LASTUSED(7) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadObject) ID(3) OFFSET(2) OP(GuardObjectFuseProperty) ID(3) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) OFFSET(7) BOOL(1) OP(LoadObject) ID(4) OFFSET(8) OP(CallScriptedSetter) ID(0) ID(4) ID(2) BOOL(1) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8784848970440649925 b/js/src/ics/IC-8784848970440649925 new file mode 100644 index 0000000000000..c63fdfcec77d4 --- /dev/null +++ b/js/src/ics/IC-8784848970440649925 @@ -0,0 +1 @@ +Call, 1, 5, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(Map) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(LoadArgumentFixedSlot) ID(4) BYTE(0) OP(MapSetResult) ID(2) ID(3) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8792325727821224946 b/js/src/ics/IC-8792325727821224946 new file mode 100644 index 0000000000000..0eab41328fc8d --- /dev/null +++ b/js/src/ics/IC-8792325727821224946 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToObject) ID(1) OP(CompareObjectResult) JSOP(Ne) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8798666721954004916 b/js/src/ics/IC-8798666721954004916 new file mode 100644 index 0000000000000..2ebdb30b6618a --- /dev/null +++ b/js/src/ics/IC-8798666721954004916 @@ -0,0 +1 @@ +Call, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToInt32) ID(2) OP(CallInt32ToString) ID(2) ID(3) OP(LoadStringResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8823236652876382714 b/js/src/ics/IC-8823236652876382714 new file mode 100644 index 0000000000000..798e58688883f --- /dev/null +++ b/js/src/ics/IC-8823236652876382714 @@ -0,0 +1 @@ +Call, 1, 6, 15, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(13) LASTUSED(13) LASTUSED(13) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(MappedArguments) OP(GuardArgumentsObjectFlags) ID(3) BYTE(21) OP(LoadArgumentFixedSlot) ID(4) BYTE(0) OP(GuardToInt32) ID(4) OP(LoadArgumentsObjectLength) ID(3) ID(5) OP(ArgumentsSliceResult) OFFSET(4) ID(3) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8823597251267430225 b/js/src/ics/IC-8823597251267430225 new file mode 100644 index 0000000000000..7af4f04910a8e --- /dev/null +++ b/js/src/ics/IC-8823597251267430225 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToBigInt) ID(0) OP(GuardToBigInt) ID(1) OP(CompareBigIntResult) JSOP(Le) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-884268059723707606 b/js/src/ics/IC-884268059723707606 new file mode 100644 index 0000000000000..72e3fc66ff1a4 --- /dev/null +++ b/js/src/ics/IC-884268059723707606 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardStringToIndex) ID(1) ID(2) OP(GuardIsNativeObject) ID(0) OP(LoadDenseElementResult) ID(0) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8849974549760789440 b/js/src/ics/IC-8849974549760789440 new file mode 100644 index 0000000000000..4d9d92287f701 --- /dev/null +++ b/js/src/ics/IC-8849974549760789440 @@ -0,0 +1 @@ +SetElem, 3, 4, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToBigInt) ID(2) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(3) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(BigInt64) ID(3) ID(2) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8850589965328179479 b/js/src/ics/IC-8850589965328179479 new file mode 100644 index 0000000000000..14cf3c1654fa9 --- /dev/null +++ b/js/src/ics/IC-8850589965328179479 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32ModUint32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint8) ID(4) ID(3) BOOL(1) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8851692584952403385 b/js/src/ics/IC-8851692584952403385 new file mode 100644 index 0000000000000..e60a195898d3e --- /dev/null +++ b/js/src/ics/IC-8851692584952403385 @@ -0,0 +1 @@ +Call, 1, 6, 16, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(3) LASTUSED(5) LASTUSED(14) LASTUSED(14) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(UnmappedArguments) OP(GuardArgumentsObjectFlags) ID(3) BYTE(21) OP(LoadArgumentFixedSlot) ID(4) BYTE(1) OP(GuardToInt32) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToInt32) ID(5) OP(ArgumentsSliceResult) OFFSET(4) ID(3) ID(4) ID(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8853423124788182920 b/js/src/ics/IC-8853423124788182920 new file mode 100644 index 0000000000000..59273d0ce9c0f --- /dev/null +++ b/js/src/ics/IC-8853423124788182920 @@ -0,0 +1 @@ +GetElemSuper, 3, 5, 9, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) LASTUSED(7) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadFixedSlot) ID(3) ID(0) OFFSET(2) OP(LoadGetterSetterFunction) ID(3) BOOL(1) BOOL(0) ID(4) OP(GuardFunctionScript) ID(4) OFFSET(3) OFFSET(4) OP(CallScriptedGetterResult) ID(2) ID(4) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8854506138512858772 b/js/src/ics/IC-8854506138512858772 new file mode 100644 index 0000000000000..4c8d9e6f36dd1 --- /dev/null +++ b/js/src/ics/IC-8854506138512858772 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(NewMapObjectFromIterableResult) OFFSET(4) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8875849149003083422 b/js/src/ics/IC-8875849149003083422 new file mode 100644 index 0000000000000..66d09e03159db --- /dev/null +++ b/js/src/ics/IC-8875849149003083422 @@ -0,0 +1 @@ +Call, 1, 5, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToInt32) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32MinMax) BOOL(1) ID(2) ID(3) ID(4) OP(LoadInt32Result) ID(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8877294232782861220 b/js/src/ics/IC-8877294232782861220 new file mode 100644 index 0000000000000..37659ba4db53e --- /dev/null +++ b/js/src/ics/IC-8877294232782861220 @@ -0,0 +1 @@ +UnaryArith, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(2) , OP(GuardToString) ID(0) OP(GuardStringToNumber) ID(0) ID(1) OP(DoubleNegationResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8883504650163102320 b/js/src/ics/IC-8883504650163102320 new file mode 100644 index 0000000000000..8d08939783fcd --- /dev/null +++ b/js/src/ics/IC-8883504650163102320 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(8) LASTUSED(8) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToNonGCThing) ID(3) OP(SetHasNonGCThingResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8885076315408518481 b/js/src/ics/IC-8885076315408518481 new file mode 100644 index 0000000000000..ad0dd371869b7 --- /dev/null +++ b/js/src/ics/IC-8885076315408518481 @@ -0,0 +1 @@ +GetProp, 1, 3, 9, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(7) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardClass) ID(0) GUARDCLASSKIND(WindowProxy) OP(LoadWrapperTarget) ID(0) ID(1) BOOL(0) OP(GuardSpecificObject) ID(1) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(GuardDynamicSlotValue) ID(1) OFFSET(2) OFFSET(3) OP(LoadObject) ID(2) OFFSET(4) OP(CallScriptedGetterResult) ID(0) ID(2) BOOL(1) OFFSET(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8906228050932337182 b/js/src/ics/IC-8906228050932337182 new file mode 100644 index 0000000000000..8faf57671e90c --- /dev/null +++ b/js/src/ics/IC-8906228050932337182 @@ -0,0 +1 @@ +Call, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(4) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GetNextMapSetEntryForIteratorResult) ID(1) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-8948583931810245738 b/js/src/ics/IC-8948583931810245738 new file mode 100644 index 0000000000000..c16fe2bcab654 --- /dev/null +++ b/js/src/ics/IC-8948583931810245738 @@ -0,0 +1 @@ +GetProp, 1, 2, 8, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(7) OP(ResizableTypedArrayLengthInt32Result) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-89948756699479799 b/js/src/ics/IC-89948756699479799 new file mode 100644 index 0000000000000..b3b2ff0ae54e1 --- /dev/null +++ b/js/src/ics/IC-89948756699479799 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(161) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9001279303262868808 b/js/src/ics/IC-9001279303262868808 new file mode 100644 index 0000000000000..49c29212d372b --- /dev/null +++ b/js/src/ics/IC-9001279303262868808 @@ -0,0 +1 @@ +Call, 1, 8, 16, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(14) LASTUSED(8) LASTUSED(14) LASTUSED(10) LASTUSED(14) LASTUSED(14) , OP(LoadArgumentFixedSlot) ID(1) BYTE(4) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(3) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(2) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(1) OP(GuardIsNullOrUndefined) ID(5) OP(LoadInt32Constant) OFFSET(2) ID(6) OP(LoadArgumentFixedSlot) ID(7) BYTE(0) OP(GuardToBoolean) ID(7) OP(StoreDataViewValueResult) ID(2) ID(4) ID(6) ID(7) SCALARTYPE(Uint32) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9016572976303657578 b/js/src/ics/IC-9016572976303657578 new file mode 100644 index 0000000000000..101face04b645 --- /dev/null +++ b/js/src/ics/IC-9016572976303657578 @@ -0,0 +1 @@ +Call, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(1) OFFSET(0) OFFSET(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(226) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9024129248431175636 b/js/src/ics/IC-9024129248431175636 new file mode 100644 index 0000000000000..ae82627479b39 --- /dev/null +++ b/js/src/ics/IC-9024129248431175636 @@ -0,0 +1 @@ +Call, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(4) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GetNextMapSetEntryForIteratorResult) ID(1) ID(2) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9024603486414797067 b/js/src/ics/IC-9024603486414797067 new file mode 100644 index 0000000000000..d46b110a9c37b --- /dev/null +++ b/js/src/ics/IC-9024603486414797067 @@ -0,0 +1 @@ +Call, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNumber) ID(2) OP(CallNumberToString) ID(2) ID(3) OP(LoadStringResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9068370305687006223 b/js/src/ics/IC-9068370305687006223 new file mode 100644 index 0000000000000..d7fd5faded5a7 --- /dev/null +++ b/js/src/ics/IC-9068370305687006223 @@ -0,0 +1 @@ +GetElem, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToString) ID(0) OP(GuardToInt32) ID(1) OP(LoadStringCharResult) ID(0) ID(1) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-907219630550004812 b/js/src/ics/IC-907219630550004812 new file mode 100644 index 0000000000000..09463146e93f0 --- /dev/null +++ b/js/src/ics/IC-907219630550004812 @@ -0,0 +1 @@ +BindName, 1, 3, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(4) LASTUSED(3) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadEnclosingEnvironment) ID(0) ID(1) OP(LoadFixedSlot) ID(2) ID(1) OFFSET(1) OP(GuardIsNotUninitializedLexical) ID(2) OP(LoadObjectResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-908139079542668886 b/js/src/ics/IC-908139079542668886 new file mode 100644 index 0000000000000..8c278b597a936 --- /dev/null +++ b/js/src/ics/IC-908139079542668886 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(3) LASTUSED(1) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(GuardIsUndefined) ID(1) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(CompareDoubleResult) JSOP(Lt) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9101669341400883942 b/js/src/ics/IC-9101669341400883942 new file mode 100644 index 0000000000000..afbd59fc13b87 --- /dev/null +++ b/js/src/ics/IC-9101669341400883942 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(1) , OP(GuardToString) ID(0) OP(GuardToSymbol) ID(1) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9131463022250286799 b/js/src/ics/IC-9131463022250286799 new file mode 100644 index 0000000000000..5a2a5f2fb5f3d --- /dev/null +++ b/js/src/ics/IC-9131463022250286799 @@ -0,0 +1 @@ +GetProp, 1, 1, 5, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Value) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardFixedSlotValue) ID(0) OFFSET(1) OFFSET(2) OP(CallNativeGetterResult) ID(0) OFFSET(3) BOOL(1) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-914618578567048327 b/js/src/ics/IC-914618578567048327 new file mode 100644 index 0000000000000..5459d8cab3054 --- /dev/null +++ b/js/src/ics/IC-914618578567048327 @@ -0,0 +1 @@ +Call, 1, 1, 2, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) , OP(RegExpSearcherLastLimitResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9150792826415987483 b/js/src/ics/IC-9150792826415987483 new file mode 100644 index 0000000000000..97f242fc90432 --- /dev/null +++ b/js/src/ics/IC-9150792826415987483 @@ -0,0 +1 @@ +GetProp, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(2) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardClass) ID(0) GUARDCLASSKIND(WindowProxy) OP(LoadWrapperTarget) ID(0) ID(1) BOOL(0) OP(GuardSpecificObject) ID(1) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadDynamicSlotResult) ID(1) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9151989501444644471 b/js/src/ics/IC-9151989501444644471 new file mode 100644 index 0000000000000..9e57ba14d23b4 --- /dev/null +++ b/js/src/ics/IC-9151989501444644471 @@ -0,0 +1 @@ +SetElem, 3, 3, 6, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(String) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardToString) ID(1) OP(GuardSpecificAtom) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(StoreFixedSlot) ID(0) OFFSET(2) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9174168230444628686 b/js/src/ics/IC-9174168230444628686 new file mode 100644 index 0000000000000..ee60b4eb0f468 --- /dev/null +++ b/js/src/ics/IC-9174168230444628686 @@ -0,0 +1 @@ +UnaryArith, 1, 1, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) , OP(GuardToBigInt) ID(0) OP(BigIntNegationResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9204215648363835601 b/js/src/ics/IC-9204215648363835601 new file mode 100644 index 0000000000000..1c9dd68d974e5 --- /dev/null +++ b/js/src/ics/IC-9204215648363835601 @@ -0,0 +1 @@ +Call, 1, 6, 12, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(10) LASTUSED(8) LASTUSED(10) LASTUSED(10) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadBooleanConstant) BOOL(0) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(Int8) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9207945744466625582 b/js/src/ics/IC-9207945744466625582 new file mode 100644 index 0000000000000..301dbae39a208 --- /dev/null +++ b/js/src/ics/IC-9207945744466625582 @@ -0,0 +1 @@ +GetElem, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Symbol) STUBFIELD(WeakShape) , LASTUSED(3) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9227137605983198345 b/js/src/ics/IC-9227137605983198345 new file mode 100644 index 0000000000000..5e722ead96eab --- /dev/null +++ b/js/src/ics/IC-9227137605983198345 @@ -0,0 +1 @@ +SetElem, 3, 5, 7, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(5) LASTUSED(4) LASTUSED(2) LASTUSED(5) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToUint8Clamped) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Uint8Clamped) ID(4) ID(3) BOOL(1) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9232985867061065700 b/js/src/ics/IC-9232985867061065700 new file mode 100644 index 0000000000000..e8b556f3334de --- /dev/null +++ b/js/src/ics/IC-9232985867061065700 @@ -0,0 +1 @@ +SetProp, 2, 5, 8, JSVAL_TYPE_UNKNOWN, 80, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(JSObject) STUBFIELD(JSObject) STUBFIELD(RawInt32) , LASTUSED(1) LASTUSED(6) LASTUSED(3) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardObjectFuseProperty) ID(2) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(LoadObject) ID(3) OFFSET(7) OP(LoadObject) ID(4) OFFSET(8) OP(CallScriptedSetter) ID(3) ID(4) ID(1) BOOL(1) OFFSET(9) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9237484516049187040 b/js/src/ics/IC-9237484516049187040 new file mode 100644 index 0000000000000..d64c58878d582 --- /dev/null +++ b/js/src/ics/IC-9237484516049187040 @@ -0,0 +1 @@ +GetProp, 1, 4, 13, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(Id) , LASTUSED(11) LASTUSED(11) LASTUSED(11) LASTUSED(11) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadScriptedProxyHandler) ID(1) ID(0) OP(LoadWrapperTarget) ID(0) ID(2) BOOL(1) OP(GuardIsNativeObject) ID(2) OP(GuardShape) ID(1) OFFSET(1) OP(LoadFixedSlot) ID(3) ID(1) OFFSET(2) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(3) OFFSET(3) OFFSET(4) OP(CallScriptedProxyGetResult) ID(2) ID(0) ID(1) ID(3) OFFSET(5) UINT32(133920) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9237928901674183252 b/js/src/ics/IC-9237928901674183252 new file mode 100644 index 0000000000000..566740dc6631c --- /dev/null +++ b/js/src/ics/IC-9237928901674183252 @@ -0,0 +1 @@ +UnaryArith, 1, 1, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) , OP(GuardToBigInt) ID(0) OP(BigIntIncResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9241680487677976030 b/js/src/ics/IC-9241680487677976030 new file mode 100644 index 0000000000000..8ddd534fe5150 --- /dev/null +++ b/js/src/ics/IC-9241680487677976030 @@ -0,0 +1 @@ +GetElem, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(ProxyGetByValueResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9259202069011985421 b/js/src/ics/IC-9259202069011985421 new file mode 100644 index 0000000000000..a3a1dc2dcb1c4 --- /dev/null +++ b/js/src/ics/IC-9259202069011985421 @@ -0,0 +1 @@ +Call, 1, 4, 10, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(8) LASTUSED(8) LASTUSED(4) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(0) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(3) OFFSET(0) OFFSET(1) OP(CallBoundScriptedFunction) ID(1) ID(3) ID(0) CALLFLAGS(1) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9269862329904473956 b/js/src/ics/IC-9269862329904473956 new file mode 100644 index 0000000000000..95665e3dba921 --- /dev/null +++ b/js/src/ics/IC-9269862329904473956 @@ -0,0 +1 @@ +GetProp, 1, 2, 8, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(7) OP(RegExpFlagResult) ID(0) INT32(16) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9277230435407334463 b/js/src/ics/IC-9277230435407334463 new file mode 100644 index 0000000000000..d6741d9e0d34f --- /dev/null +++ b/js/src/ics/IC-9277230435407334463 @@ -0,0 +1 @@ +GetProp, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(3) LASTUSED(4) , OP(GuardNonDoubleType) ID(0) VALUETYPE(JSVAL_TYPE_STRING) OP(LoadObject) ID(1) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(1) OP(GuardShape) ID(2) OFFSET(3) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9277645843586731829 b/js/src/ics/IC-9277645843586731829 new file mode 100644 index 0000000000000..42280c5d053c9 --- /dev/null +++ b/js/src/ics/IC-9277645843586731829 @@ -0,0 +1 @@ +ToPropertyKey, 1, 1, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) , OP(GuardToString) ID(0) OP(LoadStringResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9286654478851807920 b/js/src/ics/IC-9286654478851807920 new file mode 100644 index 0000000000000..43c0410c8b242 --- /dev/null +++ b/js/src/ics/IC-9286654478851807920 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(9) LASTUSED(9) LASTUSED(4) LASTUSED(9) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(BoundFunction) OP(LoadBoundFunctionNumArgs) ID(1) ID(2) OP(GuardSpecificInt32) ID(2) INT32(2) OP(LoadBoundFunctionTarget) ID(1) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasJitEntry) ID(3) OP(GuardNotClassConstructor) ID(3) OP(CallBoundScriptedFunction) ID(1) ID(3) ID(0) CALLFLAGS(1) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9288392477050382459 b/js/src/ics/IC-9288392477050382459 new file mode 100644 index 0000000000000..2699ecaff4c03 --- /dev/null +++ b/js/src/ics/IC-9288392477050382459 @@ -0,0 +1 @@ +Call, 1, 4, 12, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(10) LASTUSED(2) LASTUSED(10) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardShape) ID(3) OFFSET(2) OP(GuardArrayIsPacked) ID(3) OP(GuardSpecificFunction) ID(2) OFFSET(3) OFFSET(4) OP(CallNativeFunction) ID(2) ID(0) CALLFLAGS(69) UINT32(5) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9292709240371023995 b/js/src/ics/IC-9292709240371023995 new file mode 100644 index 0000000000000..81c00721b405f --- /dev/null +++ b/js/src/ics/IC-9292709240371023995 @@ -0,0 +1 @@ +Call, 1, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToInt32) ID(1) OP(LoadInt32Result) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9295154719658582522 b/js/src/ics/IC-9295154719658582522 new file mode 100644 index 0000000000000..dc1775fc50045 --- /dev/null +++ b/js/src/ics/IC-9295154719658582522 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(3) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(TruncateDoubleToUInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32BitXorResult) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9295303214710262444 b/js/src/ics/IC-9295303214710262444 new file mode 100644 index 0000000000000..593befebf87cd --- /dev/null +++ b/js/src/ics/IC-9295303214710262444 @@ -0,0 +1 @@ +Compare, 2, 2, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(2) , OP(GuardToBigInt) ID(0) OP(GuardToBigInt) ID(1) OP(CompareBigIntResult) JSOP(Ge) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9315883869159875436 b/js/src/ics/IC-9315883869159875436 new file mode 100644 index 0000000000000..eb2a9a47db2cb --- /dev/null +++ b/js/src/ics/IC-9315883869159875436 @@ -0,0 +1 @@ +Call, 1, 6, 13, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(11) LASTUSED(8) LASTUSED(11) LASTUSED(11) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(2) OP(GuardToObject) ID(2) OP(GuardClass) ID(2) GUARDCLASSKIND(FixedLengthDataView) OP(LoadArgumentFixedSlot) ID(3) BYTE(1) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(LoadArgumentFixedSlot) ID(5) BYTE(0) OP(GuardToBoolean) ID(5) OP(LoadDataViewValueResult) ID(2) ID(4) ID(5) SCALARTYPE(BigInt64) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9342121970605574416 b/js/src/ics/IC-9342121970605574416 new file mode 100644 index 0000000000000..2bb2f296f5cf1 --- /dev/null +++ b/js/src/ics/IC-9342121970605574416 @@ -0,0 +1 @@ +SetElem, 3, 5, 10, JSVAL_TYPE_UNKNOWN, 72, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(Shape) STUBFIELD(RawInt32) , LASTUSED(8) LASTUSED(2) LASTUSED(8) LASTUSED(5) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(0) OP(GuardShape) ID(3) OFFSET(3) OP(LoadProtoObject) ID(4) OFFSET(4) ID(0) OP(GuardShape) ID(4) OFFSET(5) OP(AllocateAndStoreDynamicSlot) ID(0) OFFSET(6) ID(2) OFFSET(7) OFFSET(8) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9345518466920727586 b/js/src/ics/IC-9345518466920727586 new file mode 100644 index 0000000000000..2c8d66be0c1fb --- /dev/null +++ b/js/src/ics/IC-9345518466920727586 @@ -0,0 +1 @@ +Call, 1, 4, 13, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(11) LASTUSED(2) LASTUSED(11) LASTUSED(8) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentDynamicSlot) ID(2) ID(0) BYTE(0) OP(GuardToObject) ID(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToObject) ID(3) OP(GuardClass) ID(3) GUARDCLASSKIND(UnmappedArguments) OP(GuardArgumentsObjectFlags) ID(3) BYTE(20) OP(GuardClass) ID(2) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(2) OFFSET(2) OFFSET(3) OP(CallScriptedFunction) ID(2) ID(0) CALLFLAGS(68) UINT32(5) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9346103948563292422 b/js/src/ics/IC-9346103948563292422 new file mode 100644 index 0000000000000..d7e3d7a82c9a2 --- /dev/null +++ b/js/src/ics/IC-9346103948563292422 @@ -0,0 +1 @@ +Call, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(3) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(GuardToArrayBuffer) ID(1) OP(LoadObjectResult) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9362119496493489065 b/js/src/ics/IC-9362119496493489065 new file mode 100644 index 0000000000000..7158266e6ea92 --- /dev/null +++ b/js/src/ics/IC-9362119496493489065 @@ -0,0 +1 @@ +GetProp, 1, 2, 8, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakObject) STUBFIELD(RawPointer) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(1) OFFSET(1) OP(GuardObjectFuseProperty) ID(1) OFFSET(2) OFFSET(3) OFFSET(4) OFFSET(5) OFFSET(6) BOOL(1) OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(7) OP(TypedArrayByteLengthInt32Result) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9367473185132767844 b/js/src/ics/IC-9367473185132767844 new file mode 100644 index 0000000000000..c23b78f03303a --- /dev/null +++ b/js/src/ics/IC-9367473185132767844 @@ -0,0 +1 @@ +Call, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToInt32) ID(2) OP(Int32ToIntPtr) ID(2) ID(3) OP(IntPtrToBigIntResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9389242458480391583 b/js/src/ics/IC-9389242458480391583 new file mode 100644 index 0000000000000..3836be0c60c48 --- /dev/null +++ b/js/src/ics/IC-9389242458480391583 @@ -0,0 +1 @@ +In, 2, 2, 6, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(Symbol) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(3) , OP(GuardToObject) ID(1) OP(GuardToSymbol) ID(0) OP(GuardSpecificSymbol) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadBooleanResult) BOOL(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9392012973422799465 b/js/src/ics/IC-9392012973422799465 new file mode 100644 index 0000000000000..d7c158ae7adad --- /dev/null +++ b/js/src/ics/IC-9392012973422799465 @@ -0,0 +1 @@ +GetProp, 1, 2, 5, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) , OP(GuardNonDoubleType) ID(0) VALUETYPE(JSVAL_TYPE_BIGINT) OP(LoadObject) ID(1) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadDynamicSlotResult) ID(1) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9393358715217716730 b/js/src/ics/IC-9393358715217716730 new file mode 100644 index 0000000000000..db8423a23d931 --- /dev/null +++ b/js/src/ics/IC-9393358715217716730 @@ -0,0 +1 @@ +Call, 1, 4, 11, JSVAL_TYPE_UNKNOWN, 48, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(RawInt32) STUBFIELD(Shape) , LASTUSED(9) LASTUSED(9) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadObject) ID(3) OFFSET(3) OP(GuardDynamicSlotIsSpecificObject) ID(2) ID(3) OFFSET(4) OP(MetaScriptedThisShape) OFFSET(5) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(98) UINT32(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9398310652853512136 b/js/src/ics/IC-9398310652853512136 new file mode 100644 index 0000000000000..e73a4e21b8620 --- /dev/null +++ b/js/src/ics/IC-9398310652853512136 @@ -0,0 +1 @@ +In, 2, 3, 9, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(7) LASTUSED(7) LASTUSED(6) , OP(GuardToObject) ID(1) OP(GuardToInt32) ID(0) OP(GuardIsNativeObject) ID(1) OP(GuardProto) ID(1) OFFSET(0) OP(LoadObject) ID(2) OFFSET(1) OP(GuardShape) ID(2) OFFSET(2) OP(GuardNoDenseElements) ID(2) OP(CallObjectHasSparseElementResult) ID(1) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-942975193168022395 b/js/src/ics/IC-942975193168022395 new file mode 100644 index 0000000000000..f8756d62b6cac --- /dev/null +++ b/js/src/ics/IC-942975193168022395 @@ -0,0 +1 @@ +Compare, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(2) LASTUSED(2) , OP(GuardBooleanToInt32) ID(0) ID(2) OP(GuardToInt32) ID(1) OP(CompareInt32Result) JSOP(Ne) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9452175063057999653 b/js/src/ics/IC-9452175063057999653 new file mode 100644 index 0000000000000..e7e1a682e163a --- /dev/null +++ b/js/src/ics/IC-9452175063057999653 @@ -0,0 +1 @@ +CloseIter, 1, 2, 6, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(4) LASTUSED(4) , OP(GuardShape) ID(0) OFFSET(0) OP(LoadFixedSlot) ID(1) ID(0) OFFSET(1) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(2) OFFSET(3) OP(CloseIterScriptedResult) ID(0) ID(1) COMPLETIONKIND(Normal) UINT32(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9491230334521679912 b/js/src/ics/IC-9491230334521679912 new file mode 100644 index 0000000000000..50554cf3f3dd2 --- /dev/null +++ b/js/src/ics/IC-9491230334521679912 @@ -0,0 +1 @@ +UnaryArith, 1, 1, 3, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) , OP(GuardToBigInt) ID(0) OP(BigIntDecResult) ID(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9533267757058197559 b/js/src/ics/IC-9533267757058197559 new file mode 100644 index 0000000000000..863a035eb6a00 --- /dev/null +++ b/js/src/ics/IC-9533267757058197559 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(0) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(0) OP(GuardToObject) ID(1) OP(GuardIsNotProxy) ID(1) OP(GuardIsResizableTypedArray) ID(1) OP(GuardResizableArrayBufferViewInBoundsOrDetached) ID(1) OP(ResizableTypedArrayLengthInt32Result) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9573953316357395344 b/js/src/ics/IC-9573953316357395344 new file mode 100644 index 0000000000000..ffe879ceeec4d --- /dev/null +++ b/js/src/ics/IC-9573953316357395344 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(JSObject) , LASTUSED(0) LASTUSED(2) LASTUSED(4) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardIsNull) ID(2) OP(ObjectCreateResult) OFFSET(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9585383870753227774 b/js/src/ics/IC-9585383870753227774 new file mode 100644 index 0000000000000..0a34cd7d97bd9 --- /dev/null +++ b/js/src/ics/IC-9585383870753227774 @@ -0,0 +1 @@ +Call, 1, 2, 7, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(5) LASTUSED(5) , OP(LoadArgumentDynamicSlot) ID(1) ID(0) BYTE(2) OP(GuardToObject) ID(1) OP(GuardClass) ID(1) GUARDCLASSKIND(JSFunction) OP(GuardFunctionHasJitEntry) ID(1) OP(GuardFunctionIsConstructor) ID(1) OP(CallScriptedFunction) ID(1) ID(0) CALLFLAGS(33) UINT32(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9587117297918663607 b/js/src/ics/IC-9587117297918663607 new file mode 100644 index 0000000000000..893129d1dfa21 --- /dev/null +++ b/js/src/ics/IC-9587117297918663607 @@ -0,0 +1 @@ +SetElem, 3, 5, 8, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(5) LASTUSED(3) LASTUSED(6) LASTUSED(6) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToBoolean) ID(2) OP(BooleanToNumber) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(4) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Float32) ID(4) ID(3) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-959124955268769284 b/js/src/ics/IC-959124955268769284 new file mode 100644 index 0000000000000..d859a305d7ed4 --- /dev/null +++ b/js/src/ics/IC-959124955268769284 @@ -0,0 +1 @@ +In, 2, 5, 12, JSVAL_TYPE_UNKNOWN, 64, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(2) LASTUSED(8) LASTUSED(5) LASTUSED(7) LASTUSED(9) , OP(GuardToObject) ID(1) OP(GuardToSymbol) ID(0) OP(GuardSpecificSymbol) ID(0) OFFSET(0) OP(GuardShape) ID(1) OFFSET(1) OP(LoadProtoObject) ID(2) OFFSET(2) ID(1) OP(GuardShape) ID(2) OFFSET(3) OP(LoadProtoObject) ID(3) OFFSET(4) ID(1) OP(GuardShape) ID(3) OFFSET(5) OP(LoadProtoObject) ID(4) OFFSET(6) ID(1) OP(GuardShape) ID(4) OFFSET(7) OP(LoadBooleanResult) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9603353749932629576 b/js/src/ics/IC-9603353749932629576 new file mode 100644 index 0000000000000..860939de745dd --- /dev/null +++ b/js/src/ics/IC-9603353749932629576 @@ -0,0 +1 @@ +Call, 1, 5, 11, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakShape) , LASTUSED(0) LASTUSED(2) LASTUSED(9) LASTUSED(8) LASTUSED(9) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(GuardToObject) ID(2) OP(GuardShape) ID(2) OFFSET(2) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardToInt32) ID(3) OP(Int32ToIntPtr) ID(3) ID(4) OP(AtomicsLoadResult) ID(2) ID(4) SCALARTYPE(BigInt64) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9658388761974449119 b/js/src/ics/IC-9658388761974449119 new file mode 100644 index 0000000000000..a95f4cda80a8a --- /dev/null +++ b/js/src/ics/IC-9658388761974449119 @@ -0,0 +1 @@ +BinaryArith, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(4) LASTUSED(2) LASTUSED(4) , OP(GuardToString) ID(0) OP(GuardStringToNumber) ID(0) ID(2) OP(TruncateDoubleToUInt32) ID(2) ID(3) OP(GuardToInt32) ID(1) OP(Int32BitAndResult) ID(3) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9671460492835606492 b/js/src/ics/IC-9671460492835606492 new file mode 100644 index 0000000000000..2c9c00a4abb7c --- /dev/null +++ b/js/src/ics/IC-9671460492835606492 @@ -0,0 +1 @@ +Call, 1, 4, 8, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) LASTUSED(6) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToInt32) ID(2) OP(CallInt32ToString) ID(2) ID(3) OP(LoadStringResult) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9683159600389630575 b/js/src/ics/IC-9683159600389630575 new file mode 100644 index 0000000000000..976bead04edfb --- /dev/null +++ b/js/src/ics/IC-9683159600389630575 @@ -0,0 +1 @@ +Compare, 2, 4, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(Double) , LASTUSED(0) LASTUSED(3) LASTUSED(4) LASTUSED(4) , OP(GuardIsUndefined) ID(0) OP(LoadDoubleConstant) OFFSET(0) ID(2) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(3) OP(CompareDoubleResult) JSOP(Ge) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9729795167523645589 b/js/src/ics/IC-9729795167523645589 new file mode 100644 index 0000000000000..5778c52eb8672 --- /dev/null +++ b/js/src/ics/IC-9729795167523645589 @@ -0,0 +1 @@ +GetElemSuper, 3, 4, 8, JSVAL_TYPE_UNKNOWN, 32, STUBFIELD(Symbol) STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(2) LASTUSED(0) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToSymbol) ID(1) OP(GuardSpecificSymbol) ID(1) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(LoadProtoObject) ID(3) OFFSET(2) ID(0) OP(GuardShape) ID(3) OFFSET(3) OP(LoadUndefinedResult) OP(ReturnFromIC) diff --git a/js/src/ics/IC-973618382294854402 b/js/src/ics/IC-973618382294854402 new file mode 100644 index 0000000000000..c8a790d513758 --- /dev/null +++ b/js/src/ics/IC-973618382294854402 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(1) LASTUSED(2) , OP(GuardToInt32) ID(0) OP(GuardBooleanToInt32) ID(1) ID(2) OP(Int32URightShiftResult) ID(0) ID(2) BOOL(0) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9778741650967686308 b/js/src/ics/IC-9778741650967686308 new file mode 100644 index 0000000000000..83fb512f0266d --- /dev/null +++ b/js/src/ics/IC-9778741650967686308 @@ -0,0 +1 @@ +GetElemSuper, 3, 4, 8, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakShape) STUBFIELD(JSObject) STUBFIELD(WeakShape) , LASTUSED(6) LASTUSED(6) LASTUSED(0) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardToInt32) ID(1) OP(GuardShape) ID(0) OFFSET(0) OP(LoadObject) ID(3) OFFSET(1) OP(GuardShape) ID(3) OFFSET(2) OP(GuardNoDenseElements) ID(3) OP(LoadDenseElementHoleResult) ID(0) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9841770053655394962 b/js/src/ics/IC-9841770053655394962 new file mode 100644 index 0000000000000..cdc6f564f6318 --- /dev/null +++ b/js/src/ics/IC-9841770053655394962 @@ -0,0 +1 @@ +Call, 1, 3, 9, JSVAL_TYPE_UNKNOWN, 56, STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(WeakObject) STUBFIELD(RawInt32) STUBFIELD(RawPointer) STUBFIELD(Shape) STUBFIELD(AllocSite) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToObject) ID(2) OP(GuardSpecificFunction) ID(2) OFFSET(2) OFFSET(3) OP(GuardNoAllocationMetadataBuilder) OFFSET(4) OP(NewPlainObjectResult) UINT32(0) UINT32(0) ALLOCKIND(OBJECT4) OFFSET(5) OFFSET(6) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9843527680704020017 b/js/src/ics/IC-9843527680704020017 new file mode 100644 index 0000000000000..cbb1c921da436 --- /dev/null +++ b/js/src/ics/IC-9843527680704020017 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(3) LASTUSED(3) , OP(GuardIsNullOrUndefined) ID(0) OP(LoadInt32Constant) OFFSET(0) ID(2) OP(GuardToInt32) ID(1) OP(Int32LeftShiftResult) ID(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9861241337687476640 b/js/src/ics/IC-9861241337687476640 new file mode 100644 index 0000000000000..d34becbf3732b --- /dev/null +++ b/js/src/ics/IC-9861241337687476640 @@ -0,0 +1 @@ +Compare, 2, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(3) LASTUSED(2) LASTUSED(3) , OP(GuardIsNumber) ID(0) OP(GuardToString) ID(1) OP(GuardStringToNumber) ID(1) ID(2) OP(CompareDoubleResult) JSOP(Eq) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9864679896375120796 b/js/src/ics/IC-9864679896375120796 new file mode 100644 index 0000000000000..a4a355afc8029 --- /dev/null +++ b/js/src/ics/IC-9864679896375120796 @@ -0,0 +1 @@ +Call, 1, 3, 7, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(5) , OP(LoadArgumentFixedSlot) ID(1) BYTE(2) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(0) OP(GuardToInt32) ID(2) OP(StringFromCharCodeResult) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9884033488871678626 b/js/src/ics/IC-9884033488871678626 new file mode 100644 index 0000000000000..23eb3344ada77 --- /dev/null +++ b/js/src/ics/IC-9884033488871678626 @@ -0,0 +1 @@ +Call, 1, 4, 9, JSVAL_TYPE_UNKNOWN, 16, STUBFIELD(WeakObject) STUBFIELD(RawInt32) , LASTUSED(0) LASTUSED(2) LASTUSED(7) LASTUSED(7) , OP(LoadArgumentFixedSlot) ID(1) BYTE(3) OP(GuardToObject) ID(1) OP(GuardSpecificFunction) ID(1) OFFSET(0) OFFSET(1) OP(LoadArgumentFixedSlot) ID(2) BYTE(1) OP(LoadArgumentFixedSlot) ID(3) BYTE(0) OP(GuardIsNumber) ID(2) OP(GuardIsNumber) ID(3) OP(DoublePowResult) ID(2) ID(3) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9945672477509952136 b/js/src/ics/IC-9945672477509952136 new file mode 100644 index 0000000000000..8c0efba445632 --- /dev/null +++ b/js/src/ics/IC-9945672477509952136 @@ -0,0 +1 @@ +SetElem, 3, 6, 9, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(7) LASTUSED(6) LASTUSED(3) LASTUSED(4) LASTUSED(7) LASTUSED(7) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToString) ID(2) OP(GuardStringToNumber) ID(2) ID(3) OP(TruncateDoubleToUInt32) ID(3) ID(4) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(5) OP(StoreTypedArrayElement) ID(0) SCALARTYPE(Int8) ID(5) ID(4) BOOL(0) ARRAYBUFFERVIEWKIND(FixedLength) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9958937109052491671 b/js/src/ics/IC-9958937109052491671 new file mode 100644 index 0000000000000..75c50f75da67a --- /dev/null +++ b/js/src/ics/IC-9958937109052491671 @@ -0,0 +1 @@ +BinaryArith, 2, 3, 4, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(2) LASTUSED(1) LASTUSED(2) , OP(GuardToInt32) ID(0) OP(GuardBooleanToInt32) ID(1) ID(2) OP(Int32LeftShiftResult) ID(0) ID(2) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9973119692938145424 b/js/src/ics/IC-9973119692938145424 new file mode 100644 index 0000000000000..537405196b26a --- /dev/null +++ b/js/src/ics/IC-9973119692938145424 @@ -0,0 +1 @@ +SetProp, 2, 2, 5, JSVAL_TYPE_UNKNOWN, 24, STUBFIELD(WeakObject) STUBFIELD(WeakShape) STUBFIELD(RawInt32) , LASTUSED(3) LASTUSED(3) , OP(GuardToObject) ID(0) OP(GuardSpecificObject) ID(0) OFFSET(0) OP(GuardShape) ID(0) OFFSET(1) OP(StoreFixedSlot) ID(0) OFFSET(2) ID(1) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9978339837634607339 b/js/src/ics/IC-9978339837634607339 new file mode 100644 index 0000000000000..3aa3bde6f345e --- /dev/null +++ b/js/src/ics/IC-9978339837634607339 @@ -0,0 +1 @@ +GetElem, 2, 3, 6, JSVAL_TYPE_UNKNOWN, 8, STUBFIELD(WeakShape) , LASTUSED(4) LASTUSED(3) LASTUSED(4) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(GuardToInt32) ID(1) OP(Int32ToIntPtr) ID(1) ID(2) OP(LoadTypedArrayElementResult) ID(0) ID(2) SCALARTYPE(Float16) BOOL(0) BOOL(0) ARRAYBUFFERVIEWKIND(Resizable) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9980784582763935427 b/js/src/ics/IC-9980784582763935427 new file mode 100644 index 0000000000000..4ec76e0964796 --- /dev/null +++ b/js/src/ics/IC-9980784582763935427 @@ -0,0 +1 @@ +GetPropSuper, 2, 4, 7, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) STUBFIELD(RawInt32) , LASTUSED(2) LASTUSED(5) LASTUSED(3) LASTUSED(5) , OP(GuardToObject) ID(0) OP(GuardShape) ID(0) OFFSET(0) OP(LoadDynamicSlot) ID(2) ID(0) OFFSET(1) OP(LoadGetterSetterFunction) ID(2) BOOL(1) BOOL(0) ID(3) OP(GuardFunctionScript) ID(3) OFFSET(2) OFFSET(3) OP(CallScriptedGetterResult) ID(1) ID(3) BOOL(1) OFFSET(4) OP(ReturnFromIC) diff --git a/js/src/ics/IC-9988742469133872172 b/js/src/ics/IC-9988742469133872172 new file mode 100644 index 0000000000000..764d1ed61723f --- /dev/null +++ b/js/src/ics/IC-9988742469133872172 @@ -0,0 +1 @@ +GetElem, 2, 6, 14, JSVAL_TYPE_UNKNOWN, 40, STUBFIELD(RawPointer) STUBFIELD(WeakShape) STUBFIELD(RawInt32) STUBFIELD(WeakBaseScript) STUBFIELD(RawInt32) , LASTUSED(12) LASTUSED(11) LASTUSED(12) LASTUSED(12) LASTUSED(12) LASTUSED(12) , OP(GuardToObject) ID(0) OP(GuardIsProxy) ID(0) OP(GuardHasProxyHandler) ID(0) OFFSET(0) OP(LoadScriptedProxyHandler) ID(2) ID(0) OP(LoadWrapperTarget) ID(0) ID(3) BOOL(1) OP(GuardIsNativeObject) ID(3) OP(GuardShape) ID(2) OFFSET(1) OP(LoadFixedSlot) ID(4) ID(2) OFFSET(2) OP(GuardToObject) ID(4) OP(GuardClass) ID(4) GUARDCLASSKIND(JSFunction) OP(GuardFunctionScript) ID(4) OFFSET(3) OFFSET(4) OP(IdToStringOrSymbol) ID(5) ID(1) OP(CallScriptedProxyGetByValueResult) ID(3) ID(0) ID(2) ID(5) ID(4) UINT32(196642) OP(ReturnFromIC) diff --git a/js/src/ics/IC-999481620998529653 b/js/src/ics/IC-999481620998529653 new file mode 100644 index 0000000000000..a7529c0e12a42 --- /dev/null +++ b/js/src/ics/IC-999481620998529653 @@ -0,0 +1 @@ +UnaryArith, 1, 3, 5, JSVAL_TYPE_UNKNOWN, 0, , LASTUSED(1) LASTUSED(2) LASTUSED(3) , OP(GuardToString) ID(0) OP(GuardStringToNumber) ID(0) ID(1) OP(TruncateDoubleToUInt32) ID(1) ID(2) OP(Int32NotResult) ID(2) OP(ReturnFromIC) From 51f3b7ed17e9d7480795d669d21eaa2234387048 Mon Sep 17 00:00:00 2001 From: Tomasz Andrzejak Date: Tue, 24 Feb 2026 14:18:35 +0100 Subject: [PATCH 10/10] Add pbl testing workflows --- .github/workflows/main.yml | 4 ++-- .github/workflows/mozconfig-aot-ics-release | 13 +++++++++++++ .github/workflows/mozconfig-pbl-debug | 10 ++++++++++ .github/workflows/mozconfig-pbl-release | 10 ++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/mozconfig-aot-ics-release create mode 100644 .github/workflows/mozconfig-pbl-debug create mode 100644 .github/workflows/mozconfig-pbl-release diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e7616d430e55f..0840e00500ec4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: test: [jstests, jit-test] - mozconfig: [ debug, release ] + mozconfig: [ debug, pbl-debug, pbl-release, release, aot-ics-release ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -22,4 +22,4 @@ jobs: submodules: true - run: ./mach --no-interactive bootstrap --application-choice=js - run: MOZCONFIG=.github/workflows/mozconfig-${{ matrix.mozconfig }} ./mach build - - run: MOZCONFIG=.github/workflows/mozconfig-${{ matrix.mozconfig }} ./mach ${{ matrix.test }} + - run: MOZCONFIG=.github/workflows/mozconfig-${{ matrix.mozconfig }} ./mach ${{ matrix.test }} ${{ matrix.test == 'jit-test' && '--exclude wasm/atomicity.js' || '' }} diff --git a/.github/workflows/mozconfig-aot-ics-release b/.github/workflows/mozconfig-aot-ics-release new file mode 100644 index 0000000000000..4e2fb9f5e5c6c --- /dev/null +++ b/.github/workflows/mozconfig-aot-ics-release @@ -0,0 +1,13 @@ +ac_add_options --enable-project=js +ac_add_options --enable-application=js +ac_add_options --enable-jitspew +ac_add_options --enable-optimize=-O3 +ac_add_options --enable-js-streams +ac_add_options --disable-stdcxx-compat +ac_add_options --enable-portable-baseline-interp +ac_add_options --enable-portable-baseline-interp-force +ac_add_options --enable-aot-ics +ac_add_options --enable-aot-ics-force +ac_add_options --enable-aot-ics-enforce + +ac_add_options --disable-debug diff --git a/.github/workflows/mozconfig-pbl-debug b/.github/workflows/mozconfig-pbl-debug new file mode 100644 index 0000000000000..f7cc8907a8420 --- /dev/null +++ b/.github/workflows/mozconfig-pbl-debug @@ -0,0 +1,10 @@ +ac_add_options --enable-project=js +ac_add_options --enable-application=js +ac_add_options --enable-jitspew +ac_add_options --enable-optimize=-O3 +ac_add_options --enable-js-streams +ac_add_options --disable-stdcxx-compat + +ac_add_options --enable-debug +ac_add_options --enable-portable-baseline-interp +ac_add_options --enable-portable-baseline-interp-force diff --git a/.github/workflows/mozconfig-pbl-release b/.github/workflows/mozconfig-pbl-release new file mode 100644 index 0000000000000..14ac7721dbadf --- /dev/null +++ b/.github/workflows/mozconfig-pbl-release @@ -0,0 +1,10 @@ +ac_add_options --enable-project=js +ac_add_options --enable-application=js +ac_add_options --enable-jitspew +ac_add_options --enable-optimize=-O3 +ac_add_options --enable-js-streams +ac_add_options --disable-stdcxx-compat + +ac_add_options --disable-debug +ac_add_options --enable-portable-baseline-interp +ac_add_options --enable-portable-baseline-interp-force