diff --git a/build/premake/extern_libs4.lua b/build/premake/extern_libs4.lua index ad5111fda5..899d289f88 100644 --- a/build/premake/extern_libs4.lua +++ b/build/premake/extern_libs4.lua @@ -611,7 +611,6 @@ extern_lib_defs = { if not _OPTIONS["android"] then pkgconfig_cflags("mozjs-31") end - defines { "WITH_SYSTEM_MOZJS31" } else if os.is("windows") then include_dir = "include-win32" diff --git a/source/scriptinterface/ScriptInterface.cpp b/source/scriptinterface/ScriptInterface.cpp index 62851b4f6b..5dad7f8795 100644 --- a/source/scriptinterface/ScriptInterface.cpp +++ b/source/scriptinterface/ScriptInterface.cpp @@ -1102,16 +1102,6 @@ void* ScriptInterface::GetPrivate(JS::HandleObject obj) return JS_GetPrivate(obj); } -void ScriptInterface::DumpHeap() -{ -#if MOZJS_DEBUG_ABI - JS_DumpHeap(GetJSRuntime(), stderr, NULL, JSTRACE_OBJECT, NULL, (size_t)-1, NULL); -#endif - fprintf(stderr, "# Bytes allocated: %u\n", JS_GetGCParameter(GetJSRuntime(), JSGC_BYTES)); - JS_GC(GetJSRuntime()); - fprintf(stderr, "# Bytes allocated after GC: %u\n", JS_GetGCParameter(GetJSRuntime(), JSGC_BYTES)); -} - void ScriptInterface::MaybeGC() { JS_MaybeGC(m->m_cx); diff --git a/source/scriptinterface/ScriptInterface.h b/source/scriptinterface/ScriptInterface.h index d2c216816f..f925307237 100644 --- a/source/scriptinterface/ScriptInterface.h +++ b/source/scriptinterface/ScriptInterface.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2016 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -313,11 +313,6 @@ public: */ template static void ToJSVal(JSContext* cx, JS::MutableHandleValue ret, T const& val); - /** - * Dump some memory heap debugging information to stderr. - */ - void DumpHeap(); - /** * MaybeGC tries to determine whether garbage collection in cx's runtime would free up enough memory to be worth the amount of time it would take. * This calls JS_MaybeGC directly, which does not do incremental GC. Usually you should prefer MaybeIncrementalRuntimeGC. diff --git a/source/scriptinterface/ScriptTypes.h b/source/scriptinterface/ScriptTypes.h index 95c589fb3f..82e6a42ddc 100644 --- a/source/scriptinterface/ScriptTypes.h +++ b/source/scriptinterface/ScriptTypes.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 Wildfire Games. +/* Copyright (C) 2016 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -28,14 +28,6 @@ # endif #endif -// Guess whether the library was compiled with the release-mode or debug-mode ABI -// (for JS_DumpHeap etc) -#if defined(DEBUG) && !defined(WITH_SYSTEM_MOZJS31) -# define MOZJS_DEBUG_ABI 1 -#else -# define MOZJS_DEBUG_ABI 0 -#endif - // Ignore some harmless warnings #if GCC_VERSION # pragma GCC diagnostic push diff --git a/source/simulation2/Simulation2.cpp b/source/simulation2/Simulation2.cpp index f868dc9ae6..9ce2138135 100644 --- a/source/simulation2/Simulation2.cpp +++ b/source/simulation2/Simulation2.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2016 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -444,9 +444,6 @@ void CSimulation2Impl::Update(int turnLength, const std::vectorRegisterFunction("PostCommand"); m_ScriptInterface->RegisterFunction("IncludeModule"); - m_ScriptInterface->RegisterFunction("DumpHeap"); m_ScriptInterface->RegisterFunction("ForceGC"); m_ScriptInterface->RegisterFunction("ComputePath"); @@ -333,11 +332,6 @@ public: return retVal; } - // The next two ought to be implmeneted someday but for now as it returns "null" it can't - static void DumpHeap(ScriptInterface::CxPrivate* pCxPrivate) - { - pCxPrivate->pScriptInterface->DumpHeap(); - } static void ForceGC(ScriptInterface::CxPrivate* pCxPrivate) { PROFILE3("AI compute GC");