aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine_p.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Fold the inUse flag into the internalClass pointerLars Knoll2015-01-121-1/+1
| | | | | | | | Revert the flag (ie. flag == 0 means the item is used), and fold it into the second lowest bit of the internalClass/nextFree field. Change-Id: I7b690fdce00d16aa538fa70a269a755511477c5c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup variant conversion codeLars Knoll2015-01-091-16/+5
| | | | | | | | Make public methods proper members of the ExecutionEngine, and move private methods into the .cpp file only. Change-Id: I3ca49e39bb1c4e559a2c63346e6ae6cfa446147d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the variant conversion methods from qv8engine to qv4::ExecutionEngineLars Knoll2015-01-091-0/+20
| | | | | Change-Id: Ibd529ae5cc3ba06f46152e9daa9119a4e7a2561c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of more uses of QV8EngineLars Knoll2015-01-081-0/+2
| | | | | Change-Id: I763728b1685e8e68bcf815dda4dd8e5757f59dd2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add a direct accessor to retrieve the JS engine from the ExecutionEngineLars Knoll2015-01-021-0/+2
| | | | | Change-Id: I2617143e39f354657e12541f3796a583e9934118 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make Managed inherit ValueLars Knoll2014-12-201-2/+2
| | | | | | | | This completes the first milestone towards being able to move objects across the GC heap. Change-Id: I8e6ce90254ea767188a31f0dc85b133534c87eb0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use a Heap::FunctionObject to store the thrower functionLars Knoll2014-12-201-1/+1
| | | | | Change-Id: I6b3f03080f35e39d14b377363f7546a9f7260029 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Store a Heap::EvalFunction pointer in the engineLars Knoll2014-12-201-1/+1
| | | | | Change-Id: I002eb8f94e168c9faf1ee3521170dfaf442af1a3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Return Heap::ExecutionContext for globalContext()Lars Knoll2014-12-191-3/+3
| | | | | Change-Id: Ide7c81735be4662ff45bf268cfe750ff1f784453 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Return Heap::ExecutionContext for currentContext()Lars Knoll2014-12-191-14/+12
| | | | | Change-Id: I155ab996e24d7f36761d2ea62a04774e16469b34 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup code that modifies the JS stackLars Knoll2014-12-191-9/+0
| | | | | Change-Id: Ic043e256c3df984bb06c9a16b86573b0173b19a1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make ExecutionContextSaver GC safeLars Knoll2014-12-191-16/+0
| | | | | Change-Id: I29f00366d24c770afe4ba4579106d81a8c9043df Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add default parameter value for ExecutionEngine::newString()Oleg Shparber2014-12-121-1/+1
| | | | | Change-Id: I8efbfb07ea61e2c6d03eeb79671006d209e4d48e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move prototype back from the vtable into ObjectLars Knoll2014-12-111-4/+24
| | | | | | | | This is the only way we can support a GC that moves objects around in memory. Change-Id: I1d168fae4aa9f575b730e469e762bc5b5549b886 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Better encapsulate access to the global objectLars Knoll2014-12-111-1/+2
| | | | | Change-Id: I8a76112d821cb3fc172ba0d16ee8410d39b4422a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Encapsulate accesses to the root contextLars Knoll2014-12-111-1/+2
| | | | | Change-Id: I668cef1363a5c1a5c5b9a7e138f3bd0338712eea Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup header inclusion orderLars Knoll2014-12-111-0/+50
| | | | | Change-Id: I6f7973370c4468e7d1686a147efca66bfbfdd5b1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix run-time string handling with regards to the new heapSimon Hausmann2014-11-211-1/+1
| | | | | | | | | | | | | | | | | Changed runtimeStrings to be an array of Heap::String pointers instead of indirect String pointers. Later that member along with other GC related members will go into a managed subclass. Meanwhile the generated code no more loads String pointers directly but just passes the index into the run-time strings to the run-time functions, which in turn will load the heap string into a scoped string. Also replaced the template<T> Value::operator=(T *m) with a non-template overload that takes a Managed *, in order to help the compiler choose the non-template operator=(Heap::Base *) overload. This allows removing a bunch of Value::fromHeapObject calls. Change-Id: I20415c0549d33cca6813441a2495976b66d4c00e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Cleanup qv4executionengine headerLars Knoll2014-11-151-46/+0
| | | | | Change-Id: I7312005a8d8e301ab4d8960c5f7579ace0a19a73 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup exception catching codeLars Knoll2014-11-151-2/+2
| | | | | Change-Id: I85afd5758f72e19c280dc196601ee145f0c25f01 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Ported ExecutionEngine::newString and newIdentifier to Heap::StringSimon Hausmann2014-11-121-2/+3
| | | | | | | | | | Avoid the use of Returned<String> for newString and changed the identifier table to use Heap::String. This required moving some code back into Heap::String, but that's code that doesn't call back into the GC, so allocations and therefore future object moves aren't possible. Change-Id: I1dca3e9c12a9c56f09419af8cc8cba39fe04f720 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Ported most ExecutionEnginew::new* factory methods away from Returned<T>Simon Hausmann2014-11-121-24/+24
| | | | | | | | We don't need Returned<T> anymore with the QV4:: vs. Heap:: separation. Eliminating Returned<T> simplifies also some code. Change-Id: Ic2a9cd3c1a94f2ea37b539d3984d63997121c2b9 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change signature or runtime methods to take an engine pointerLars Knoll2014-11-121-1/+1
| | | | | | | | | This makes a lot more sense in the long term and is the more maintainable solution, once the GC starts moving objects around in memory Change-Id: I8f327c0f5b5b0af38c5fe1a217852ee8c4a5c2fc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move data of more Qml related objects into Heap namespace.Lars Knoll2014-11-101-3/+0
| | | | | Change-Id: Ifb3a7093351474d6feb2f64498b531c36fdf669b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Refactor ExecutionContextsLars Knoll2014-11-081-0/+1
| | | | | | | Move the Data class out into the Heap namespace. Change-Id: I2b798deb53812a08155c92a0e6ef2dcd2ea137b8 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Begin moving the data out of Managed objectsLars Knoll2014-11-081-3/+3
| | | | | | | | | | | We need to move the Data objects out of the Managed objects, to avoid lots of trouble because inner classes can't be forward declared in C++. Instead move them all into a Heap namespace. Change-Id: I736af60702b68a1759f4643aa16d64108693dea2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of Members and directly store MemberData::Data pointersLars Knoll2014-11-071-1/+0
| | | | | | | And do the same change for ArrayData. Change-Id: Ia1ae56bd0ff586c9b987e15af7a53f395a37054a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Let markObjects() operate directly on HeapObjectsLars Knoll2014-11-041-4/+16
| | | | | | | | | This decouples things a bit better and helps moving over to directly store heapobject pointers in other objects. Change-Id: I798f922e018b0a3ca6f8768e4a810187f34d82f6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the throw methods from ExecutionContext to ExecutionEngineLars Knoll2014-11-041-2/+14
| | | | | | | | The methods don't require a context, and thus shouldn't be implemented there. Change-Id: If058e0c5067093a4161f2275ac4288aa2bc500f3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup header file dependenciesLars Knoll2014-11-041-3/+2
| | | | | Change-Id: Ibb4658576a98b53de2eac2474ce4d5b9eb83b6ae Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Basic support for typed arraysLars Knoll2014-10-291-0/+3
| | | | | | | | | | | | | | | This implements most of the spec required for the Khronos typed array specification. It tries to follow ECMAScript 6 as closely as possible, but currently only implements a subset of the ECMAScript 6 specification. Addes a test script in tests/manual/v4 to test our implementation. Change-Id: I8ec63869500358e088b73240e1f37120ae3cf59a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Implement DataViewLars Knoll2014-10-291-0/+4
| | | | | | | | The second class that is required for typed array support. Change-Id: Idc2dcec7c1eee541f76dc5ab1aea6057ba03cb93 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Implement ArrayBufferLars Knoll2014-10-291-0/+4
| | | | | | | | This is the first class required to support typed arrays in our JS engine. Change-Id: I0fe1e1ca430769c171912dda207cfae772e9b9db Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* 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 <jani.heikkinen@digia.com>
* Change the object allocation schemeSimon Hausmann2014-07-221-1/+0
| | | | | | | | | 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 <lars.knoll@digia.com>
* Convert FunctionObject derived classes to new construction schemeLars Knoll2014-07-221-3/+0
| | | | | Change-Id: I0d43a79ed531a9d651bd00866d73113c05d95a09 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert regexpsLars Knoll2014-07-221-1/+1
| | | | | Change-Id: I5b62a265a7ce363a16b1e14ae93cadbb1ab0cb5b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of all uses of ObjectRefLars Knoll2014-07-221-1/+1
| | | | | Change-Id: I705e2362dcda542f56826dadec6b0a6f15848788 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove the less often used Ref classesLars Knoll2014-07-221-2/+2
| | | | | Change-Id: I9ee531c903317a0f324671d98af1f967b684915c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of StringRefLars Knoll2014-07-221-1/+1
| | | | | | | | Remove the Ref classes, as they won't be required anymore once Managed and Managed::Data are separated. Change-Id: Ic6bec2d5b4ecf2595ce129dbb45bbf6a385138a5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Rename Managed::managedData() to d() to be consistentLars Knoll2014-07-221-1/+1
| | | | | | | | No need to differentiate in the name anymore, as the data structures all inherit from each other now. Change-Id: Ia41f50ce4e521f9626d874311ceb57e0e194888b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move VariantObject over to new storage layoutLars Knoll2014-07-221-1/+1
| | | | | Change-Id: I96a4ce5d3a3e4fdd29ba0aac1bd3361588457580 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move Managed data into it's own subclassLars Knoll2014-07-221-3/+3
| | | | | | | | | This prepares for moving over to a d pointer scheme, where Managed subclasses don't hold any data directly. This is required to be able to move over to a modern GC. Change-Id: I3f59633ac07a7da461bd2d4f0f9f3a8e3b0baf02 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use Members for storing the bound arguments in BoundFunctionLars Knoll2014-07-221-1/+2
| | | | | | | | Cleans up the code, and allows us to remove the destructor for bound function objects. Change-Id: Id32ac69171f7975ec7679d07d25c0eb6b4ca6fb5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix marking of prototype objects in internal class poolSimon Hausmann2014-04-281-1/+2
| | | | | | | | | | As per reported bug, we have to protect ourselves against potential loops and can mark the internal classes much simpler by just walking through the memory pool they were allocated in. Task-number: QTBUG-38299 Change-Id: I3ae96e8082e76d06f4321c5aa6d2e9645d2830a0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Garbage collect member dataLars Knoll2014-04-041-0/+1
| | | | | | | | Move the allocated member data into the garbage collected area, so that we can avoid using malloc/free for it. Change-Id: I20625efa67ecd60238568742b74854b0c8cb2e3e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Optimize construct callsLars Knoll2014-03-271-0/+1
| | | | | | | | Optimize construction of the internalClass for the object being constructed. Change-Id: Id5fc02c291664ec01c3595ae0acbb6895cc5b147 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Optimize construction of SimpleArrayDataLars Knoll2014-03-191-0/+1
| | | | | Change-Id: I7f8a0ac8a368af23534378e8c31d820b3b9f1f4c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Small optimization to RegExpLars Knoll2014-03-181-0/+1
| | | | | | | | | Also add markObjects() calls to all the identifiers we keep around in the engine. It's probably pure luck this hasn't caused any issues until now. Change-Id: Ie31d19793efa53867e4e240ba548070dcde32ec1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix copying of Property'sLars Knoll2014-03-101-1/+2
| | | | | | | | | | Data properties don't contain valid data in the set field if they are being stored in Objects. Thus we should never access that field unless we are dealing with accessor properties. Change-Id: I19dcbaee7ebd042ae24387f92a93571d75ca578a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>