aboutsummaryrefslogtreecommitdiffstats
path: root/qmljs_engine.h
Commit message (Collapse)AuthorAgeFilesLines
* Clean up memory manager ownershipSimon Hausmann2013-01-031-1/+1
| | | | | | | | Since we have now only one memory manager, we might as well let the ExecutionEngine create and own it. Change-Id: I908adadf64da59e0b8f4c09d4d9502785399cb99 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Micro optimization of StringPoolJędrzej Nowacki2012-12-141-1/+1
| | | | | | | | | | In destructor we do not need to create a copy off all pointers. By hiding StringPool::strings in class private section we reduce risk of it being accidentally copied. Change-Id: I1b9df6bf9e49bd6926e84b8eac6b3d904277e50a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove ExecutionEngine::identifiers.Jędrzej Nowacki2012-12-141-2/+0
| | | | | | | | The member was a duplicate of stringPool, there is no point in caching a cache. Change-Id: If34c80ee120dfaff1dd94326625b02d8014806dc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use a smart pointer for ExecutionEngine::stringPoolJędrzej Nowacki2012-12-131-1/+1
| | | | | Change-Id: I5434fbd146e9d8dcc0000327c5a5b953bc744b83 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Properly set the prototype for regexp objectsLars Knoll2012-12-121-1/+2
| | | | | | | | Clean up the code, so that regexp's get instantiated by the ExecutionEngine Change-Id: Iacc8d9fee0427342156747d6e8814d7660bdbb1a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove IR::Function from the runtime.Erik Verbruggen2012-12-111-1/+5
| | | | | | | | | | This fixes potential leaks of IR::Functions, lowers the memory usage of the functions that the VM needs (because the IR fields are not present in the VM::Function), and makes both managed by the module respectively the ExecutionEngine. Change-Id: I6748ad98b062f994eae9dd14f1919aec5aa7c0b0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Return the this object if we ask for itLars Knoll2012-12-101-0/+1
| | | | | | | | This makes expressions such as typeof(this) work correctly. Change-Id: I44270f877fdee648e69ae44089ffc8fb57243401 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Implement Object.create/defineProperty/definePropertiesLars Knoll2012-12-081-0/+6
| | | | | Change-Id: I3a71597d012b5fb7d7a2f482f4a16431c71c1c22 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add a MemoryManager, which does GC for the interpreter.Erik Verbruggen2012-12-081-1/+3
| | | | | | | | | Todo: - stack walking for MASM - fix all TODOs/FIXMEs and hidden treasures (bugs). Change-Id: I36f8cdc3a545df7287ce1df17b3570a9c017865e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Get rid of the ActivationObjectLars Knoll2012-12-051-2/+1
| | | | | | | | Also implement __qmljs_xxx_activation_property in a more correct way. Change-Id: I60c330bccca21fad99930987ed78153114a80c7d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Throw proper type and reference errorsLars Knoll2012-12-041-0/+3
| | | | | Change-Id: I898017f3e63ada72fc2e50abfa1880f9fd7ffe37 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix another memory leak.Erik Verbruggen2012-12-041-0/+1
| | | | | | | | | Now we should only leak objects that are VM::Values, and directly related objects like the PropertyTable. The directly related ones will disappear through destructor calls when the VM::Values are GC-ed. Change-Id: Id221ac62a22671d86bbc6ac9beea49d2bd5b330d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove the DeclarativeEnvironment class againLars Knoll2012-12-021-2/+2
| | | | | | | | | The class is a specification detail that we can implement in a more performant way. ExecutionContext now contains everything needed again. Change-Id: Ideb5f04eeeecaf2b8543676c626e3943e4d6d7a1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add some debugging infrastructure to the interpreter.Erik Verbruggen2012-11-291-1/+7
| | | | | | | | | This currently mainly intended to be useful in a C++ debugger. The infrastructure makes it a lot easier to access (parent) contexts, find function names, etc. Change-Id: I0493d3a3bd4bf5c3a03379c1a2b545ed76862cd5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Set the name of a function in more (most?) cases.Erik Verbruggen2012-11-291-1/+1
| | | | | Change-Id: I1c2b9d61b6d97e3c2a8cb976fb6be8b68d51ae28 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Implement Object.keys and obj.proto.propertyIsEnumerableLars Knoll2012-11-291-2/+2
| | | | | Change-Id: I30df135ad95f24246e43553b2711ad1008319d56 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Introduce a simple string pool to speed up lookups.Erik Verbruggen2012-11-281-0/+2
| | | | | | | | This change uniques string pointers, so the String::isEqualTo will more often succeed in the pointer-equality case. Change-Id: I1d4f1a70147c48bc75359642a56a0446b5fbf199 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Throw a SyntaxError instead of printing an error message.Erik Verbruggen2012-11-281-0/+1
| | | | | Change-Id: I94ef8a4f2bea80bc3689b104e381a9dc134439fa Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Support for the with statementLars Knoll2012-11-251-0/+1
| | | | | | | | | | | | Add the with object (list) to the environment, and check properties there if it's available. Generate IR statements implementing with() support. Add two new builtin methods to enter and leave a with scope. Implement support for the builtin's in masm. Make sure exception handling works across with scopes. Change-Id: I8257a16cfccc91a1acedfd740ade711b016b33fd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Keep the EvalISelFactory in the ExecutionEngine.Erik Verbruggen2012-11-211-1/+2
| | | | | | | Also corrected the class name cApiTaliSatiOn. Change-Id: I131566e904c8ee575686a469f16d098dd512d865 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Use an isel factory instead of MASM in FunctionCTor.Erik Verbruggen2012-11-201-1/+0
| | | | | Change-Id: I070f056411f16d837ff5eac191fac11cd0bd3c47 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Move the exception variable into the engineLars Knoll2012-11-201-0/+1
| | | | | | | | It's easier to store this in the engine then in the execution context. Change-Id: I01ff447602a7d785165e774bdf6e1735c073be2d Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* return results directly instead of using the contextLars Knoll2012-11-201-1/+1
| | | | | | | | | The result variable in the context is not really required, as we can return results directly in the return value register. Change-Id: I12554c228500aa24625ef82e31fd7f72989a71bb Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Fix isel for eval and a whole bunch of other warnings.Erik Verbruggen2012-11-191-2/+3
| | | | | | | A factory is now passed along to do the codegen for eval(). Change-Id: If15b1f28c9c0a8f8b6d18b56d6e7bc5d942927e5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Better handling of contexts and environmentsLars Knoll2012-11-191-1/+4
| | | | | | | | | | Make the ExecutionContext standard compliant. Move most of it's members into a new DeclarativeEnvironment data structure that contains locals and arguments. Change-Id: I094f559168810dbd3717d677fe28750076015976 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the engine and context classes into their own filesLars Knoll2012-11-191-0/+182
Change-Id: Ie20138990908a921ca3d7475618275ed82d9cb5c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>