aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4mm_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Move memory management related functionality into it's own folderLars Knoll2015-03-021-187/+0
| | | | | | | | | Start moving the memory related functionality into it's own folder. This will simplify refactoring of the GC related functionality later on. Change-Id: I70ec6f512af7a7897625afb84d914c17572b0ccd Reviewed-by: Simon Hausmann <[email protected]>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <[email protected]>
* Move vtable out of internalClassLars Knoll2015-01-201-8/+10
| | | | | | | | | | | | | | | | We can move the internalClass to Object later on, and such save having the internalClass on lots of Heap objects. This commit basically adds and starts making use of a new vtable pointer in Heap::Base. In addition, the construction methods in the memory manager now automatically setup the correct vtable. Removing the vtable code from InternalClass and moving it into Object will come in a separate commit Change-Id: If49e8d73c769bf65bf47fe4dbf8b9546c8019dbc Reviewed-by: Simon Hausmann <[email protected]>
* Refactor persistent valuesLars Knoll2015-01-161-6/+4
| | | | | | | | | | Use a page wise allocation mechanism for persistent values. This significantly reduces memory consumption of persistent values and also improves their performance a lot. Change-Id: I8499d2ca5bdd871e029f643ae605a94544558bb5 Reviewed-by: Simon Hausmann <[email protected]>
* Release the VM of unused heap chunksJocelyn Turcotte2014-12-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | This changes the way that available items are linked together to allow releasing chunks not containing any inUse item after being swept. Instead of putting a freed item at the top of the stack and make it link to the item previously at the top, relink all items !inUse to point to the previously visited unused item during sweeping. This allows any chunk to be released in the process while making sure that no previous or next item will link to an address in that chunk. The performance penality of relinking the list has been measured to be ~0.6% with v8-bench.js tst_QJSEngine::largeSweep. In exchange, this helps keeping the amount of chunks to sweep lower after peaks of heap allocation, even though that ability will be restrained by heap fragmentation in long running applications. Task-number: QTBUG-41099 Change-Id: I81a70f0a930b679a1bef47e630b23dab5f6d1218 Reviewed-by: Simon Hausmann <[email protected]>
* Let the memory manager operate on Heap::Base objects, not ManagedLars Knoll2014-11-211-9/+9
| | | | | Change-Id: Ib5c9b51dbf9c69abeda088094e6348dd545bf3c8 Reviewed-by: Simon Hausmann <[email protected]>
* Use the engine instead of the context where it makes senseLars Knoll2014-11-151-3/+0
| | | | | Change-Id: I17a3b6f4b3c076107dc9a8de667ac526566ea6e3 Reviewed-by: Simon Hausmann <[email protected]>
* Changed MemoryManager::alloc<T> to return Heap::T* instead of T*Simon Hausmann2014-11-151-12/+12
| | | | | Change-Id: Iede1ba624d1313fbe2f8e5e979e936f1f32efdc9 Reviewed-by: Lars Knoll <[email protected]>
* Cleanup header file dependenciesLars Knoll2014-11-041-3/+1
| | | | | Change-Id: Ibb4658576a98b53de2eac2474ce4d5b9eb83b6ae Reviewed-by: Simon Hausmann <[email protected]>
* Changed Value to store Managed::Data pointers directlySimon Hausmann2014-11-041-18/+25
| | | | | | | | This is a step towards storing direct heap object pointers for the values on the JS stack, to avoid the costly indirection for data access. Change-Id: Ibb57ed6cf52a7088bbc95ee04ae3a4cb25b8c045 Reviewed-by: Simon Hausmann <[email protected]>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <[email protected]>
* Change the object allocation schemeSimon Hausmann2014-07-221-2/+50
| | | | | | | | | Instead of allocating the data directly, centralize the object and its ::Data allocation in one place in the memory manager. This is in preparation for additional pointer indirection later. Change-Id: I7880e1e7354b3258b6a8965be378cd09c9467d25 Reviewed-by: Lars Knoll <[email protected]>
* v4: Manually inline the access to the execution engineHolger Hans Peter Freyther2014-07-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | Executing an allocation heavy testcase of JavaScriptCore on my i7 Sandy Bridge notebook 6.85% is spent inside the ::engine() call as gcc 4.8.2 of Debian didn't inline the call. Inline the call sites by hand. I removed the protected ::engine() as it is now unused. $ time qmljs JavaScriptCore/tests/perf/bench-allocate-nonretained.js before (best run of three) real 0m2.234s user 0m2.228s sys 0m0.008s after (worse run of three) real 0m2.097s user 0m2.088s sys 0m0.008s Change-Id: I20b73b3b3dac630eb1d5e7d66bcb50c839630567 Reviewed-by: Simon Hausmann <[email protected]>
* Properly initialize heap profiler when starting profilingUlf Hermann2014-06-121-1/+4
| | | | | Change-Id: Ia994464b2150dc9a9185280ae0e2f8c615393310 Reviewed-by: Simon Hausmann <[email protected]>
* Get rid of collectDeletablesLars Knoll2014-03-271-1/+3
| | | | | | | | | The method is only required for the QObjectWrapper, but there we can instead simply register the deletable in the destroy method. Change-Id: I944319d327859cce33ac31a174e8d56fc4babfc1 Reviewed-by: Simon Hausmann <[email protected]>
* Optional reporting of GC statistics to stdoutLars Knoll2014-03-251-0/+1
| | | | | | | | Use QV4_MM_STATS to get some statistics about each GC run written to stderr. Change-Id: Idc30c06e1c3ca8353a2f16615cb26df13a8f23ed Reviewed-by: Simon Hausmann <[email protected]>
* Remove unused methodLars Knoll2014-03-251-1/+0
| | | | | Change-Id: Ia7df68e78ac105fe5519cb4f80a64561310d3324 Reviewed-by: Simon Hausmann <[email protected]>
* Remove code for conservative GCLars Knoll2014-03-251-1/+0
| | | | | | | | | | This was meant as a debugging help after we took the exact GC into use. Turns out it doesn't help debug any issues, aggressive garbage collection is much more helpful in finding GC issues. Change-Id: Idfff26d3a4a15e570615009c1e57921bca6297ca Reviewed-by: Simon Hausmann <[email protected]>
* Fix some typosSergio Ahumada2014-03-031-1/+1
| | | | | Change-Id: Iea540b768232ea423ea7f04e41655198931cf36d Reviewed-by: Jerome Pasion <[email protected]>
* Rename some filesLars Knoll2014-01-311-1/+1
| | | | | | | | | | | | Rename qv4value_def_p.h -> qv4value_p.h and qv4value_p.h to qv4value_inl_p.h. It makes more sense to have the class definition in the file that is named after the class and move the inline methods into a _inl file. Doing this now, as I expect we'll be needing a few more _inl files soon. Change-Id: Ib59e9380e9e976254c6b4369574157f39b1b5f51 Reviewed-by: Simon Hausmann <[email protected]>
* Turn execution contexts into Managed objectsLars Knoll2013-11-221-12/+0
| | | | | | | | | | This finally gives proper memory management for ExecutionContexts. So far they had been garbage collected but where still allocated using standard malloc/free(). This allows us to collect the contexts faster and speed up context creation. Change-Id: I02e642391d55eaa59ab3f4c2720a2ac71259caf4 Reviewed-by: Simon Hausmann <[email protected]>
* Refactor marking GC'ed objectsLars Knoll2013-11-051-3/+0
| | | | | | | | | | | Don't use recursive function calls anymore. Instead, push marked objects onto the JS stack, and then pop them off when their children are being marked. Should reduce stack memory usage, and improves performance by ~5%. Change-Id: I2d37d97579144fcba87ec8e9fd545dd220c01fbb Reviewed-by: Simon Hausmann <[email protected]>
* Some minor optimizationsLars Knoll2013-10-191-2/+2
| | | | | Change-Id: Ib2e08e7c89ca59a48f8fd52b30981e5d7e60803b Reviewed-by: Simon Hausmann <[email protected]>
* Add ValueRef classe and use it to make things GC safeLars Knoll2013-09-111-0/+1
| | | | | | | | | | | | The ValueRef class holds a reference to a Value that is already known to the GC. ValueRef's should be used to pass Value arguments to methods. As a first step us the class to make unary operations GC safe Change-Id: Ie13e332ed95b2908df9a201a3f757db864c05ca9 Reviewed-by: Simon Hausmann <[email protected]>
* Create a stack for JS values and use it in the interpreterLars Knoll2013-09-111-0/+1
| | | | | | | | | | | | 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 <[email protected]>
* Restructure source codeLars Knoll2013-08-081-0/+157
Move the v4 engine classes from a subdir of qml/qml into two subdirs (compiler and jsruntime) of the qml module Remove an unsued qv4syntaxchecker class, and move the moth code directly into compiler. Change-Id: I6929bede1f25098e6cb2e68087e779fac16b0c68 Reviewed-by: Simon Hausmann <[email protected]>