summaryrefslogtreecommitdiffstats
path: root/Source/JavaScriptCore/interpreter/RegisterFile.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/interpreter/RegisterFile.h')
-rw-r--r--Source/JavaScriptCore/interpreter/RegisterFile.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/JavaScriptCore/interpreter/RegisterFile.h b/Source/JavaScriptCore/interpreter/RegisterFile.h
index e9c6df1..bb42902 100644
--- a/Source/JavaScriptCore/interpreter/RegisterFile.h
+++ b/Source/JavaScriptCore/interpreter/RegisterFile.h
@@ -112,7 +112,7 @@ namespace JSC {
// Allow 8k of excess registers before we start trying to reap the registerfile
static const ptrdiff_t maxExcessCapacity = 8 * 1024;
- RegisterFile(size_t capacity = defaultCapacity, size_t maxGlobals = defaultMaxGlobals);
+ RegisterFile(JSGlobalData&, size_t capacity = defaultCapacity, size_t maxGlobals = defaultMaxGlobals);
~RegisterFile();
Register* start() const { return m_start; }
@@ -120,7 +120,6 @@ namespace JSC {
size_t size() const { return m_end - m_start; }
void setGlobalObject(JSGlobalObject*);
- bool clearGlobalObject(JSGlobalObject*);
JSGlobalObject* globalObject();
bool grow(Register* newEnd);
@@ -135,6 +134,8 @@ namespace JSC {
static size_t committedByteCount();
static void initializeThreading();
+ static Finalizer* globalObjectCollectedNotifier();
+
private:
void releaseExcessCapacity();
void addToCommittedByteCount(long);
@@ -150,16 +151,16 @@ namespace JSC {
WeakGCPtr<JSGlobalObject> m_globalObject; // The global object whose vars are currently stored in the register file.
};
- inline RegisterFile::RegisterFile(size_t capacity, size_t maxGlobals)
+ inline RegisterFile::RegisterFile(JSGlobalData& globalData, size_t capacity, size_t maxGlobals)
: m_numGlobals(0)
, m_maxGlobals(maxGlobals)
, m_start(0)
, m_end(0)
, m_max(0)
+ , m_globalObject(globalData, RegisterFile::globalObjectCollectedNotifier())
{
ASSERT(maxGlobals && isPageAligned(maxGlobals));
ASSERT(capacity && isPageAligned(capacity));
-
size_t bufferLength = (capacity + maxGlobals) * sizeof(Register);
m_reservation = PageReservation::reserve(roundUpAllocationSize(bufferLength, commitSize), OSAllocator::JSVMStackPages);
void* base = m_reservation.base();