diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-03 12:40:07 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-11 13:01:44 +0200 |
commit | 1986cf68d09fcd6cb586286bb21d8d9b7d405ce8 (patch) | |
tree | 4dc50920eeb124a893253eec7afe911747960020 /src/qml/jsruntime/qv4engine.cpp | |
parent | 87063772e329a8423d92a4eb8a8c29cff2fd9d18 (diff) |
Create a stack for JS values and use it in the interpreter
First step towards being able to do an exact GC.
Create a stack for JS Values that is separate from the C++
stack.
Use the stack for generated methods (masm and moth).
Change-Id: I80ac0e5b5d86439dda5e9ea2b21fa0c57d8aef22
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index e20baf7fe3..f854f191a6 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -84,6 +84,7 @@ ExecutionEngine::ExecutionEngine(QQmlJS::EvalISelFactory *factory) , executableAllocator(new QV4::ExecutableAllocator) , regExpAllocator(new QV4::ExecutableAllocator) , bumperPointerAllocator(new WTF::BumpPointerAllocator) + , jsStack(new WTF::PageAllocation) , debugger(0) , globalObject(0) , globalCode(0) @@ -110,6 +111,11 @@ ExecutionEngine::ExecutionEngine(QQmlJS::EvalISelFactory *factory) memoryManager->setExecutionEngine(this); + // reserve 8MB for the JS stack + *jsStack = WTF::PageAllocation::allocate(8*1024*1024, WTF::OSAllocator::JSVMStackPages, true); + jsStackBase = (Value *)jsStack->base(); + jsStackTop = jsStackBase; + identifierTable = new IdentifierTable(this); emptyClass = new (classPool.allocate(sizeof(InternalClass))) InternalClass(this); @@ -296,6 +302,8 @@ ExecutionEngine::~ExecutionEngine() delete regExpCache; delete regExpAllocator; delete executableAllocator; + jsStack->deallocate(); + delete jsStack; } void ExecutionEngine::enableDebugger() |