Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/src/jit/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  InvalidationScriptSet.h

  Sprache: C
 

/* 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 jit_InvalidationScriptSet_h
#define jit_InvalidationScriptSet_h

#include "mozilla/MemoryReporting.h"

#include "gc/Barrier.h"
#include "jit/Invalidation.h"
#include "jit/IonTypes.h"
#include "js/AllocPolicy.h"
#include "js/GCVector.h"
#include "js/SweepingAPI.h"

namespace js::jit {

// A set of Ion scripts that will be invalidated simultaneously.
//
// When using this class, make sure the traceWeak method is called by the GC to
// sweep dead scripts.
class DependentIonScriptSet {
  IonScriptKeyVector ionScripts_;

  // To avoid keeping a lot of stale entries for invalidated IonScripts between
  // GCs, we compact the vector when it grows too large.
  size_t lengthAfterLastCompaction_ = 0;

 public:
  [[nodiscard]] bool addToSet(const IonScriptKey& ionScript);
  void invalidateAndClear(JSContext* cx, const char* reason);

  bool empty() const { return ionScripts_.empty(); }

  bool traceWeak(JSTracer* trc) {
    bool res = ionScripts_.traceWeak(trc);
    lengthAfterLastCompaction_ = ionScripts_.length();
    return res;
  }

  size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {
    return ionScripts_.sizeOfExcludingThis(mallocSizeOf);
  }
};

}  // namespace js::jit

#endif /* jit_InvalidationScriptSet_h */

Messung V0.5 in Prozent
C=82 H=100 G=91

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.