arai-a / smoosh-sync

Automation to make jsparagus and SpiderMonkey bytecode in sync
2 stars 0 forks source link

/js/src/frontend/CompilationStencil.h and 2 more files have been updated (43bb1992) #307

Closed github-actions[bot] closed 1 year ago

github-actions[bot] commented 1 year ago

Files

Changesets

Diffs

/js/src/frontend/CompilationStencil.h

--- f2457a464d0333448b4f53e5b768653a83d9701a/js/src/frontend/CompilationStencil.h
+++ 43bb19928205e02d5fd0dae30111b8701bdf4ce4/js/src/frontend/CompilationStencil.h
@@ -985,18 +985,17 @@ struct SharedDataContainer {
                                        size_t allScriptCount);
   [[nodiscard]] bool cloneFrom(FrontendContext* fc,
                                const SharedDataContainer& other);

   // Returns index-th script's shared data, or nullptr if it doesn't have.
   js::SharedImmutableScriptData* get(ScriptIndex index) const;

   // Add data for index-th script and share it with VM.
-  [[nodiscard]] bool addAndShare(JSContext* cx, FrontendContext* fc,
-                                 ScriptIndex index,
+  [[nodiscard]] bool addAndShare(FrontendContext* fc, ScriptIndex index,
                                  js::SharedImmutableScriptData* data);

   // Add data for index-th script without sharing it with VM.
   // The data should already be shared with VM.
   //
   // The data is supposed to be added from delazification.
   [[nodiscard]] bool addExtraWithoutShare(FrontendContext* fc,
                                           ScriptIndex index,
@@ -1455,17 +1454,17 @@ struct MOZ_RAII CompilationState : publi
   // Those functions exist only for lazy parsing.
   // Mark them "ghost", so that they don't affect other parts.
   //
   // See GHOST_FUNCTION in FunctionFlags.h for more details.
   void markGhost(const CompilationStatePosition& pos);

   // Allocate space for `length` gcthings, and return the address of the
   // first element to `cursor` to initialize on the caller.
-  bool allocateGCThingsUninitialized(JSContext* cx, FrontendContext* fc,
+  bool allocateGCThingsUninitialized(FrontendContext* fc,
                                      ScriptIndex scriptIndex, size_t length,
                                      TaggedScriptThingIndex** cursor);

   bool appendScriptStencilAndData(FrontendContext* fc);

   bool appendGCThings(FrontendContext* fc, ScriptIndex scriptIndex,
                       mozilla::Span<const TaggedScriptThingIndex> things);
 };

/js/src/frontend/Stencil.cpp

--- f2457a464d0333448b4f53e5b768653a83d9701a/js/src/frontend/Stencil.cpp
+++ 43bb19928205e02d5fd0dae30111b8701bdf4ce4/js/src/frontend/Stencil.cpp
@@ -2965,45 +2965,44 @@ bool SharedDataContainer::convertFromSin
     ReportOutOfMemory(fc);
     return false;
   }

   std::swap(data_, other.data_);
   return true;
 }

-bool SharedDataContainer::addAndShare(JSContext* cx, FrontendContext* fc,
-                                      ScriptIndex index,
+bool SharedDataContainer::addAndShare(FrontendContext* fc, ScriptIndex index,
                                       js::SharedImmutableScriptData* data) {
   MOZ_ASSERT(!isBorrow());

   if (isSingle()) {
     MOZ_ASSERT(index == CompilationStencil::TopLevelIndex);
     RefPtr<SharedImmutableScriptData> ref(data);
-    if (!SharedImmutableScriptData::shareScriptData(cx, fc, ref)) {
+    if (!SharedImmutableScriptData::shareScriptData(fc, ref)) {
       return false;
     }
     setSingle(ref.forget());
     return true;
   }

   if (isVector()) {
     auto& vec = *asVector();
     // Resized by SharedDataContainer::prepareStorageFor.
     vec[index] = data;
-    return SharedImmutableScriptData::shareScriptData(cx, fc, vec[index]);
+    return SharedImmutableScriptData::shareScriptData(fc, vec[index]);
   }

   MOZ_ASSERT(isMap());
   auto& map = *asMap();
   // Reserved by SharedDataContainer::prepareStorageFor.
   map.putNewInfallible(index, data);
   auto p = map.lookup(index);
   MOZ_ASSERT(p);
-  return SharedImmutableScriptData::shareScriptData(cx, fc, p->value());
+  return SharedImmutableScriptData::shareScriptData(fc, p->value());
 }

 bool SharedDataContainer::addExtraWithoutShare(
     FrontendContext* fc, ScriptIndex index,
     js::SharedImmutableScriptData* data) {
   MOZ_ASSERT(!isEmpty());

   if (isSingle()) {
@@ -4688,17 +4687,17 @@ void CompilationAtomCache::stealBuffer(A
   atoms_.clear();
 }

 void CompilationAtomCache::releaseBuffer(AtomCacheVector& atoms) {
   atoms = std::move(atoms_);
 }

 bool CompilationState::allocateGCThingsUninitialized(
-    JSContext* cx, FrontendContext* fc, ScriptIndex scriptIndex, size_t length,
+    FrontendContext* fc, ScriptIndex scriptIndex, size_t length,
     TaggedScriptThingIndex** cursor) {
   MOZ_ASSERT(gcThingData.length() <= UINT32_MAX);

   auto gcThingsOffset = CompilationGCThingIndex(gcThingData.length());

   if (length > INDEX_LIMIT) {
     ReportAllocationOverflow(fc);
     return false;

/js/src/vm/SharedStencil.h

--- f2457a464d0333448b4f53e5b768653a83d9701a/js/src/vm/SharedStencil.h
+++ b08446bfcd74acd3221ea43ce71e56ef8b0e1637/js/src/vm/SharedStencil.h
@@ -695,17 +695,17 @@ class SharedImmutableScriptData {
     return mallocSizeOf(this) + isdSize;
   }

   // SharedImmutableScriptData has trailing data so isn't copyable or movable.
   SharedImmutableScriptData(const SharedImmutableScriptData&) = delete;
   SharedImmutableScriptData& operator=(const SharedImmutableScriptData&) =
       delete;

-  static bool shareScriptData(JSContext* cx, FrontendContext* fc,
+  static bool shareScriptData(FrontendContext* fc,
                               RefPtr<SharedImmutableScriptData>& sisd);

   size_t immutableDataLength() const { return isd_->immutableData().Length(); }
   uint32_t nfixed() const { return isd_->nfixed; }

   ImmutableScriptData* get() { return isd_; }

   void setOwn(js::UniquePtr<ImmutableScriptData>&& isd) {