summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/jsc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/jsc.cpp')
-rw-r--r--Source/JavaScriptCore/jsc.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/JavaScriptCore/jsc.cpp b/Source/JavaScriptCore/jsc.cpp
index e5e891e04..06dad2701 100644
--- a/Source/JavaScriptCore/jsc.cpp
+++ b/Source/JavaScriptCore/jsc.cpp
@@ -27,12 +27,14 @@
#include "Completion.h"
#include "CopiedSpaceInlineMethods.h"
#include "ExceptionHelpers.h"
+#include "HeapStatistics.h"
#include "InitializeThreading.h"
#include "Interpreter.h"
#include "JSArray.h"
#include "JSCTypedArrayStubs.h"
#include "JSFunction.h"
#include "JSLock.h"
+#include "JSProxy.h"
#include "JSString.h"
#include "SamplingTool.h"
#include <math.h>
@@ -176,9 +178,13 @@ public:
{
GlobalObject* object = new (NotNull, allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure);
object->finishCreation(globalData, arguments);
+ globalData.heap.addFinalizer(object, destroy);
+ object->setGlobalThis(globalData, JSProxy::create(globalData, JSProxy::createStructure(globalData, object, object->prototype()), object));
return object;
}
+ static const bool needsDestruction = false;
+
static const ClassInfo s_info;
static const GlobalObjectMethodTable s_globalObjectMethodTable;
@@ -243,8 +249,8 @@ protected:
putDirect(globalData, identifier, JSFunction::create(globalExec(), this, arguments, identifier.string(), function, NoIntrinsic, function));
}
};
+
COMPILE_ASSERT(!IsInteger<GlobalObject>::value, WTF_IsInteger_GlobalObject_false);
-ASSERT_CLASS_FITS_IN_CELL(GlobalObject);
const ClassInfo GlobalObject::s_info = { "global", &JSGlobalObject::s_info, 0, ExecState::globalObjectTable, CREATE_METHOD_TABLE(GlobalObject) };
const GlobalObjectMethodTable GlobalObject::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptExperimentsEnabled };
@@ -522,6 +528,8 @@ int main(int argc, char** argv)
TRY
res = jscmain(argc, argv);
EXCEPT(res = 3)
+ if (Options::logHeapStatisticsAtExit())
+ HeapStatistics::reportSuccess();
return res;
}