GCTrace.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2. * This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef gc_GCTrace_h
  6. #define gc_GCTrace_h
  7. #include "gc/Heap.h"
  8. namespace js {
  9. class ObjectGroup;
  10. namespace gc {
  11. #ifdef JS_GC_TRACE
  12. extern MOZ_MUST_USE bool InitTrace(GCRuntime& gc);
  13. extern void FinishTrace();
  14. extern bool TraceEnabled();
  15. extern void TraceNurseryAlloc(Cell* thing, size_t size);
  16. extern void TraceTenuredAlloc(Cell* thing, AllocKind kind);
  17. extern void TraceCreateObject(JSObject* object);
  18. extern void TraceMinorGCStart();
  19. extern void TracePromoteToTenured(Cell* src, Cell* dst);
  20. extern void TraceMinorGCEnd();
  21. extern void TraceMajorGCStart();
  22. extern void TraceTenuredFinalize(Cell* thing);
  23. extern void TraceMajorGCEnd();
  24. extern void TraceTypeNewScript(js::ObjectGroup* group);
  25. #else
  26. inline MOZ_MUST_USE bool InitTrace(GCRuntime& gc) { return true; }
  27. inline void FinishTrace() {}
  28. inline bool TraceEnabled() { return false; }
  29. inline void TraceNurseryAlloc(Cell* thing, size_t size) {}
  30. inline void TraceTenuredAlloc(Cell* thing, AllocKind kind) {}
  31. inline void TraceCreateObject(JSObject* object) {}
  32. inline void TraceMinorGCStart() {}
  33. inline void TracePromoteToTenured(Cell* src, Cell* dst) {}
  34. inline void TraceMinorGCEnd() {}
  35. inline void TraceMajorGCStart() {}
  36. inline void TraceTenuredFinalize(Cell* thing) {}
  37. inline void TraceMajorGCEnd() {}
  38. inline void TraceTypeNewScript(js::ObjectGroup* group) {}
  39. #endif
  40. } /* namespace gc */
  41. } /* namespace js */
  42. #endif