aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Initial import of Test262 test suiteSimon Hausmann2013-01-043-0/+461
| | | | | | | | This also includes a copy of the test262.py script to run all the tests, which we are going to modify to suit our needs. Change-Id: I15fd7d0278e39c7076d4e45650fbcf786f7a483f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix break without identifier in labelled loopSimon Hausmann2013-01-041-0/+1
| | | | | | | | | | Make sure to do leaveLoop() after enterLoop() when processing labelled statements. Fixes hang in ch12/12.8/S12.8_A3 Change-Id: Iee96ea515524e9ea879f7528dc43e552b1343020 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Produce a syntax error when a break appears outside of an iterationSimon Hausmann2013-01-041-1/+3
| | | | | | | Fixes expected failure of ch12/12.8/S12.8_A1_T2 and others Change-Id: I261d649f6a29bbd6debfca35e7ccaf1a0a7006b9 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix hang in do-while loops with continue statement in the bodySimon Hausmann2013-01-041-1/+7
| | | | | | | | | | | | | | | | | | | | The construct do { ... continue; } while (condition) Would result in the body basic block ending with a jump to the loop body, causing an infinite loop. Instead we have to place the condition into an extra block and set that one as the target for continue. This is also covered by ch12/12.14/S12.14_A9_T2, which uses such a loop. Change-Id: If06de112b338b74b9a49e3d6b51078463645196d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Set data properties using __defineOwnProperties__Lars Knoll2013-01-046-14/+65
| | | | | | | | | | | | Properties in object literals are defined using defineOwnProperty, so that they get set even if the object prototype contains a non writable property with the same name. This fixes all remaining test cases for 11.1.5 Change-Id: I3928a144d09c51c5bf20a25bcb1c6c3c243975ee Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Throw syntax errors with duplicated values in Object literalsLars Knoll2013-01-041-25/+41
| | | | | | | | | Object literals can only contain duplicated values for data properties in non strict mode. In all other cases throw a syntax error. Change-Id: Icb06ba1c343daffdb6a0532a08f7b9ae027e4e45 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add fast conversion of a string to an array indexLars Knoll2013-01-042-0/+20
| | | | | | | | This will be required later on when Array gets fixed properly. Change-Id: I37eccf94b202c9a003aab30b078ee24c422359a1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Correctly size arrays with trailing elisionsLars Knoll2013-01-041-2/+5
| | | | | Change-Id: Iae09ec815e3307615299bf97741716b3671c9560 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Implement { get/set ... }Lars Knoll2013-01-036-2/+76
| | | | | | | | Implement support for defining accessor properties through { ... }. Implementation for moth is pending. Change-Id: I558b6811bc5656dc0fae78c49e23155043ce9cb1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Replace WTF::Vector with a tiny std::vector wrapperSimon Hausmann2013-01-035-1361/+68
| | | | | Change-Id: Ieb371c42790b19ee1f12b3622041ac139e1e03c2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Get rid of unused FastMalloc definitionsSimon Hausmann2013-01-035-709/+94
| | | | | | | | We don't ship the implementation and we only need a really simple stub to compile the code we _really_ want to keep. Change-Id: I36bd0f836b963ed38feb10b970326a4dcd5cbc12 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix remaining number-to-string failures in chapter 9Simon Hausmann2013-01-0322-2/+6010
| | | | | | | | ...by using the double-conversion code from http://code.google.com/p/double-conversion/ Change-Id: I4cfc17b65c811b7c20a856d1d38961bec78d85a2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix compilation with clang on Mac OS XSimon Hausmann2013-01-033-2/+13
| | | | | | | | | Add missing friend declarations for required access to private fields and moved operator< into namespace so that the compiler can find it when calling qSort(). Change-Id: I6c94b6fc79c5039903e62ce08b0a6b273133e104 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Clean up memory manager ownershipSimon Hausmann2013-01-033-6/+6
| | | | | | | | 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>
* Get rid of wtf/StackBoundsSimon Hausmann2013-01-034-396/+16
| | | | | | | All we need is the starting address of the stack, not the entire class. Change-Id: I447482f6900afa0a66efce2dcc32239828b64f8e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Save some memoryLars Knoll2013-01-032-14/+13
| | | | | | | | | Move some boolean flags from Object and FunctionObject into the Managed class and reduce the size of these Objects. Change-Id: Iee9ab09407ec44b447f9597a9b1d55e9092e7ad5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the mark and inUse bits into the Managed classLars Knoll2013-01-034-110/+67
| | | | | | | | This simplifies the memory manager further, and removes some book-keeping overhead. Change-Id: I969c092cee822f7f0ab89e09d76b5c68c6bd50d2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Simplify and fix memory managementLars Knoll2013-01-032-122/+91
| | | | | | | | | | | The old code could lead to crashes because we didn't correctly check the alignment of objects in the managed heaps. A bogus pointer on the stack (which can easily happen), can then point into the middle of an object in the heap and cause memory corruption. Change-Id: I741401d278a7926a549810707ca46435bdaf7cc9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove unused memory manager classesLars Knoll2013-01-033-40/+5
| | | | | | | | Unify the base class with the GC memory manager and remove the memory manager that didn't manage ;-) Change-Id: I8579bc80b66688e98203448afc645a231c97fede Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the Managed class into it's own fileLars Knoll2013-01-035-48/+152
| | | | | | | Preparations for some further cleanups. Change-Id: Id9fa3a8541748ee70085bc84985ac508f989e1d3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Another fix to the temp compression.Erik Verbruggen2012-12-201-15/+17
| | | | | | | Pin all temps that escape BBs, not only the return value. Change-Id: Idf21d117bfd12224cbff4cef35766c454189a5fa Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change the interpreter's stack frame to be allocated with alloca.Erik Verbruggen2012-12-195-153/+7
| | | | | Change-Id: Ia02ad1af3bb0f429a6078029bf7aaee5a17f3413 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Changed GC heap chunks to be allocated from separate page allocationsSimon Hausmann2012-12-181-13/+16
| | | | | | | | | Use page allocations instead of the regular libc heap for the chunks of the memory manager. This will allow for easier return of the memory to the operation system in the future. Change-Id: Ie370e54042251b17335e94b497933f06ab62ecc3 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Updated wtf and masm from upstream (r137997)Simon Hausmann2012-12-1849-379/+2876
| | | | | | | This also brings in the page allocation code from WTF Change-Id: If6f9fdb4fb2d10530f06e3e9524c95ff5876d084 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Debugging fixes.Erik Verbruggen2012-12-183-5/+13
| | | | | Change-Id: I53b7301c28314210f96acc358744ff7e2a65546d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Set the argumentCount in the Context to the length of arguments.Erik Verbruggen2012-12-181-0/+1
| | | | | Change-Id: I2bc0c6130248dfca6764222bcc95a4d2e6f82233 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix temp compression, and actually add var decl instructions.Erik Verbruggen2012-12-181-0/+7
| | | | | Change-Id: Ic73a8e4284fd7644e37251498a659e107e49f0d8 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix liveness analyses for hidden exception handling TEMPs.Erik Verbruggen2012-12-182-7/+19
| | | | | | | | | By passing the inCatch/hasException temps to builtin_delete_exception_handler, the TEMPs are marked as alive all through the exception handling block. Change-Id: Ib0f17059e04c03ca98d264759bb2a7e4786ed9be Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix instruction tracing.Erik Verbruggen2012-12-182-5/+5
| | | | | Change-Id: Ie2ff005e2914bc372e4c6d08dd28d34efdde8da3 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix moth isel for typeof.Erik Verbruggen2012-12-183-13/+72
| | | | | Change-Id: If5b5a91a69d6b6bf0fd3eaf4c21a42c575839be2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove unused variableSimon Hausmann2012-12-181-2/+1
| | | | | | | | | While the name may suggest that the blah variable is a very performance critical piece of the stack traversal algorithm, it turns out to be of little relevance :) Change-Id: Ia12eaf5f169a6eae64f005364da7452e1ef86daf Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* More compilation fixes.Erik Verbruggen2012-12-182-0/+7
| | | | | Change-Id: I5940e0b1e72c06420ae95ff3adfd78572888c886 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Added check for formal parameter names in strict mode.Erik Verbruggen2012-12-181-31/+57
| | | | | | | Also fixed up other error messages. Change-Id: I26bfab761ab6a8ced3755a8e3dfbc42d428194e3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix compilation after changes in the QML parser.Erik Verbruggen2012-12-182-2/+16
| | | | | Change-Id: I5c6903446a252139fde4ce180f6c01a5eff85406 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Allow to run tests in parallel.Jędrzej Nowacki2012-12-181-24/+37
| | | | | | | | | The test_interpreter script waste a lot of time in the kernel process, that should be fixed. For know magic '-j' option allows to speedup test execution a bit. Change-Id: Ib1f0cbecc2053e434eb8df4e2e1edb22bc3e7846 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* ensure correct initialization order for local variablesLars Knoll2012-12-182-41/+70
| | | | | | | | | | | | | | | section 10.5 requires that function definitions get initialized at the beginning of the method. variable declarations do not override the function definitions. assignments to variables happen when they appear in the source code. Also remove a duplicated intializations of variables to undefined. This is already being done by initCallContext or builtin_declare_vars, so no need to do it in the generated code again. Change-Id: I63805b97017f8676d57e0662073689e852b6ac23 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* For the JIT enable the memory manager that traverses the native stack for ↵Simon Hausmann2012-12-171-1/+1
| | | | | | | references to managed objects Change-Id: Ie4a26ddc75abd1382af29b966915437ad485a041 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix native stack traversalSimon Hausmann2012-12-172-8/+34
| | | | | | | | | | | | | | | | | | | | | | * For the traversal range, don't take the top of the stack but one value pointer below, as the top is actually the end of the stack and we can't read beyond it. For the bottom go one pointer beyond a locally declared (and thus aligned) value. This ensure sane and aligned boundaries for the traversal. * For quick elimination of pointer values on the stack that do not actually point into one of our managed objects, implement Lars' idea: Take the heap chunk beginning and end pointers and do a lower bound search. An even index indicates that the pointer is before the start of a chunk, thus out of range. An odd index indicates that it is before a chunk end and therefore in range. * For obscure reasons we also seem to sometimes hit "dangling" pointers into otherwise already dealloc'ed objects (as debug output in dealloc() indicates), so protect ourselves against that. Change-Id: Ic3337932777871bec370a3441581801273d53bd4 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix a bug in catch{}finally{} and simplify codeLars Knoll2012-12-179-42/+38
| | | | | | | | | | | There was a bug in the implementation of unwindException(), that caused failures when called twice from one catch statement. Also refactor and simplify the TryStatement code further by introducing a rethrow builtin. Change-Id: I77bf37f1707042f402488ef2dfaf4e59bf8dc82a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Resolve argument names from right to leftLars Knoll2012-12-172-21/+23
| | | | | | | | | Duplicated names for arguments are allowed in JS, later ones shadow previous ones. So we need to iterate from back to front to resolve the names correctly. Change-Id: If427ce9d11ac561457c24e41f79c11263fa0a8dc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Avoid lookup of locals and formals when possibleLars Knoll2012-12-171-16/+22
| | | | | | | | | | If we do not have a Function or the function doesn't need activation, we directly generate code to get and set formals and locals, so there's no need to look these up from the execution context. Change-Id: I888fc65fd2527f9102fab7cae2822600f87f9edc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Allow the compiler to inlineLars Knoll2012-12-173-12/+12
| | | | | | | | use String::isEqualTo instead of qmljs_string_equal to allow for inlining. Change-Id: I55d41ab34f1e04cb0f752d8018e3ce9b11a90d1d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Smaller cleanups and code simplificationsLars Knoll2012-12-171-9/+10
| | | | | Change-Id: I1634ce8b105ee0d22b67fafa45962fe7c22b9f3a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup constructor handlingLars Knoll2012-12-174-84/+31
| | | | | | | | Simplify the code and unify the generic part of object construction in FunctionObject::construct. Change-Id: Ie430458bedaa211efba37c8283e26a9b84e6764a Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Fix return value corruption in masm codegenerationLars Knoll2012-12-171-2/+2
| | | | | | | | | | | In some cases, the first argument for runtime calls and the return value where being placed in the same location on the stack leading to corrupted return values. This mainly happens when no local variable are defined, but other functions are being called. Change-Id: I93f1e518ce2998f62fb9f38c538dd718f41e522d Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Fix delete operator on local variable and argumentsLars Knoll2012-12-141-0/+10
| | | | | | | | throw in strict mode, and ignore delete operations on arguments otherwise. Change-Id: Icd55f1c99dc5e5c35b3fea1ce5fdf46d5295dbaf Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix a bug in the construct method of Function objectsLars Knoll2012-12-141-3/+11
| | | | | | | | | Function objects when called as a contructor should return the return value of the called function if the return value is an object (see 13.2.2) Change-Id: I9d9e52859935d62b7f949fff46cb00d257bad90f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix a bug in the Object contructorLars Knoll2012-12-141-1/+4
| | | | | | | | new Object(x) should convert x to an object and return it if x is not null or undefined Change-Id: Icb5547a23df83018757901bfecb5f024610e7c68 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Micro optimization of StringPoolJędrzej Nowacki2012-12-144-5/+8
| | | | | | | | | | 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-142-6/+1
| | | | | | | | 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>