Changeset View
Changeset View
Standalone View
Standalone View
source/scriptinterface/ScriptStats.cpp
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | |||||
CStr CScriptStatsTable::GetCellText(size_t row, size_t col) | CStr CScriptStatsTable::GetCellText(size_t row, size_t col) | ||||
{ | { | ||||
switch(row) | switch(row) | ||||
{ | { | ||||
case Row_MaxBytes: | case Row_MaxBytes: | ||||
{ | { | ||||
if (col == 0) | if (col == 0) | ||||
return "max nominal heap bytes"; | return "max nominal heap bytes"; | ||||
uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetJSRuntime(), JSGC_MAX_BYTES); | uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetGeneralJSContext(), JSGC_MAX_BYTES); | ||||
return CStr::FromUInt(n); | return CStr::FromUInt(n); | ||||
} | } | ||||
case Row_MaxMallocBytes: | case Row_MaxMallocBytes: | ||||
{ | { | ||||
if (col == 0) | if (col == 0) | ||||
return "max JS_malloc bytes"; | return "max JS_malloc bytes"; | ||||
uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetJSRuntime(), JSGC_MAX_MALLOC_BYTES); | uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetGeneralJSContext(), JSGC_MAX_MALLOC_BYTES); | ||||
return CStr::FromUInt(n); | return CStr::FromUInt(n); | ||||
} | } | ||||
case Row_Bytes: | case Row_Bytes: | ||||
{ | { | ||||
if (col == 0) | if (col == 0) | ||||
return "allocated bytes"; | return "allocated bytes"; | ||||
uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetJSRuntime(), JSGC_BYTES); | uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetGeneralJSContext(), JSGC_BYTES); | ||||
return CStr::FromUInt(n); | return CStr::FromUInt(n); | ||||
} | } | ||||
case Row_NumberGC: | case Row_NumberGC: | ||||
{ | { | ||||
if (col == 0) | if (col == 0) | ||||
return "number of GCs"; | return "number of GCs"; | ||||
uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetJSRuntime(), JSGC_NUMBER); | uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetGeneralJSContext(), JSGC_NUMBER); | ||||
return CStr::FromUInt(n); | return CStr::FromUInt(n); | ||||
} | } | ||||
default: | default: | ||||
return "???"; | return "???"; | ||||
} | } | ||||
} | } | ||||
AbstractProfileTable* CScriptStatsTable::GetChild(size_t UNUSED(row)) | AbstractProfileTable* CScriptStatsTable::GetChild(size_t UNUSED(row)) | ||||
{ | { | ||||
return 0; | return 0; | ||||
} | } |
Wildfire Games · Phabricator