1
0
forked from mirrors/0ad

Removes g_ScriptingHost and implements global to compartment 1 to 1 relation.

Each GUI Page gets its own compartment and all ScriptInterfaces in the
same thread should now use the same JS Runtime.
This is required for the SpiderMonkey upgrade.
Check the ticket for details.

Closes #2241
Refs #1886
Refs #1966

This was SVN commit r14496.
This commit is contained in:
Yves
2014-01-04 10:14:53 +00:00
parent 743644f5ce
commit 4b1297b328
99 changed files with 1733 additions and 2313 deletions
+4 -4
View File
@@ -86,28 +86,28 @@ CStr CScriptStatsTable::GetCellText(size_t row, size_t col)
{
if (col == 0)
return "max nominal heap bytes";
uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetRuntime(), JSGC_MAX_BYTES);
uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetJSRuntime(), JSGC_MAX_BYTES);
return CStr::FromUInt(n);
}
case Row_MaxMallocBytes:
{
if (col == 0)
return "max JS_malloc bytes";
uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetRuntime(), JSGC_MAX_MALLOC_BYTES);
uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetJSRuntime(), JSGC_MAX_MALLOC_BYTES);
return CStr::FromUInt(n);
}
case Row_Bytes:
{
if (col == 0)
return "allocated bytes";
uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetRuntime(), JSGC_BYTES);
uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetJSRuntime(), JSGC_BYTES);
return CStr::FromUInt(n);
}
case Row_NumberGC:
{
if (col == 0)
return "number of GCs";
uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetRuntime(), JSGC_NUMBER);
uint32_t n = JS_GetGCParameter(m_ScriptInterfaces.at(col-1).first->GetJSRuntime(), JSGC_NUMBER);
return CStr::FromUInt(n);
}
default: