Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
Context.cpp File Reference
#include "precompiled.h"
#include "Context.h"
#include "js/Modules.h"
#include "js/friend/PerformanceHint.h"
#include "lib/alignment.h"
#include "lib/debug.h"
#include "ps/Profile.h"
#include "ps/Profiler2.h"
#include "ps/ThreadUtil.h"
#include "scriptinterface/ModuleLoader.h"
#include "scriptinterface/Promises.h"
#include "scriptinterface/Engine.h"
#include <js/Context.h>
#include <js/GCAPI.h>
#include <js/Initialization.h>
#include <js/Promise.h>
#include <js/SliceBudget.h>
#include <js/Stack.h>
#include <jsapi.h>
#include <jsfriendapi.h>
Include dependency graph for Context.cpp:

Namespaces

namespace  JS
 
namespace  Script
 Abstraction around a SpiderMonkey JSContext.
 

Macros

#define GC_DEBUG_PRINT   0
 

Functions

void GCSliceCallbackHook (JSContext *, JS::GCProgress progress, const JS::GCDescription &)
 

Macro Definition Documentation

◆ GC_DEBUG_PRINT

#define GC_DEBUG_PRINT   0

Function Documentation

◆ GCSliceCallbackHook()

void GCSliceCallbackHook ( JSContext *  ,
JS::GCProgress  progress,
const JS::GCDescription &   
)

From the GCAPI.h file:

‍During GC, the GC is bracketed by GC_CYCLE_BEGIN/END callbacks. Each slice between those (whether an incremental or the sole non-incremental slice) is bracketed by GC_SLICE_BEGIN/GC_SLICE_END.

Thus, to safely monitor GCs, we need to profile SLICE_X calls.