Commit Graph

57 Commits

Author SHA1 Message Date
Simon Hausmann c13a95361a Add missing license headers
Change-Id: I59d602a0f2c1fefb03994ed32a3d697b176791ff
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-12 10:51:06 +02:00
Simon Hausmann f9b181e4ea Clean up arithmetic operation calls
Don't repeat calls to generateFunctionCall but use a helper macro to
get the name.

Change-Id: I394b1980cbd67f3ca94fc41402de2d5b99c45016
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-12 09:49:24 +02:00
Lars Knoll 67c0513d25 Store booleans as 32 bit integers
The old code was giving valgrind warnings, because
we loaded the boolean (1 byte) as a 32 bit integer.
Instead simply store all booleans as 32 bit ints
to avoid the warnings.

Change-Id: I46c7f9fc9d8dfe52afd9bab2dbab8923aaa630f8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2012-10-12 09:20:01 +02:00
Lars Knoll f17248441d Send all debug output to stderr
qDebug() was used for part of the logging, which
uses stderr. Send everything else there as well.

Change-Id: I363dff3d2e4dd6f95bf0347f1df589ae2528fd32
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2012-10-12 09:18:43 +02:00
Lars Knoll bd0ff1b50d Remove almost all uses of __qmljs_init_string
Change-Id: I88130ec39958c75b70d898a352423908ac2ef1d4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2012-10-12 09:17:40 +02:00
Simon Hausmann 54fb3b7af1 Fix stack corruption on ia32
On ia32 sizeof(void*) < sizeof(Value), so we need to subtract
sizeof(Value) instead of sizeof(void*) before reaching the first
temp.

Added comments to explain the offsets.

Change-Id: Iefbb1dc762fdf36d73002c52dc9c471ec15ff403
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-12 09:00:35 +02:00
Simon Hausmann 993eedc43e Initial build fixes for arm 2012-10-11 10:56:03 +02:00
Simon Hausmann ca56a7a163 Implement copyValue using a single load/store pair in the common case of copying temps 2012-10-10 21:56:07 +02:00
Simon Hausmann a13f5069a9 Simplify boolean conditional jumps
* Expect the boolean value to be in Gpr0, which means after the __qmljs_to_boolean
  call the move(ReturnValueRegister, Gpr0) becomes a noop
* Instead of loading the true/1 into a register, use it as immediate value in the cmp
2012-10-10 21:56:07 +02:00
Simon Hausmann a1e4d16244 Make conditional jumps more readable 2012-10-10 21:56:07 +02:00
Lars Knoll a9ed16acf3 Fix stack corruption
The position of temporaries on the stack was
off by 1, leading to us overwriting other r14, that gets
pushed to the stack after we have allocated space for temps.
2012-10-10 21:15:43 +02:00
Lars Knoll 7a9ece649e Emit code for copying values
Remove __qmljs_copy in the process.
2012-10-10 13:49:35 +02:00
Simon Hausmann 85dc29103f Work around gcc bug on amd64 with function pointer assignment 2012-10-10 13:22:47 +02:00
Lars Knoll dcfb63f566 Make it really work for 64 bit.
crypto.js passes now :)
2012-10-10 13:10:07 +02:00
Simon Hausmann 91fe97626d Fix rethrow 2012-10-10 10:30:07 +02:00
Simon Hausmann d4d1b00f8b Centralize value copying 2012-10-09 10:05:58 +02:00
Simon Hausmann 1f28ba475e Save and restore context register before calls 2012-10-09 09:59:02 +02:00
Simon Hausmann 115d570a86 More debug info 2012-10-09 09:06:12 +02:00
Simon Hausmann a084733c14 First shot at more readable call instructions in output 2012-10-09 08:17:47 +02:00
Simon Hausmann ea408f812e Fix array subscript write: add missing context pointer argument to qmljs_set_element call 2012-10-08 21:58:24 +02:00
Simon Hausmann 183d1c4e39 Add missing return 2012-10-07 22:14:01 +02:00
Simon Hausmann 9047b986ea Implement missing movs 2012-10-07 22:10:27 +02:00
Simon Hausmann 33d90f1ed0 implement visitExp 2012-10-07 22:02:41 +02:00
Simon Hausmann 8f87666256 Implement construct property/value 2012-10-07 22:02:06 +02:00
Simon Hausmann a4d038e965 Implement call value and property 2012-10-07 21:57:10 +02:00
Simon Hausmann 17c0f2df08 Port remaining code to better function call mechanism 2012-10-07 21:43:29 +02:00
Simon Hausmann 8235683a6b Fix closure init 2012-10-07 19:45:40 +02:00
Simon Hausmann a08a3220b1 Simplify more function calls 2012-10-05 11:53:06 +02:00
Simon Hausmann 0c6fd16edb further call simplification 2012-10-05 11:35:46 +02:00
Simon Hausmann 392cf477a1 Simpler approach to function calls 2012-10-05 11:13:54 +02:00
Simon Hausmann a97b4212b9 Simplify passing temps as method arguments 2012-10-05 11:02:54 +02:00
Simon Hausmann 3bda6fb418 A bit more inplace assignment implemented 2012-10-05 08:09:12 +02:00
Simon Hausmann ee9c4b976b Generate the code for copying the argments earlier, to avoid register clobbering between __qmljs_copy calls 2012-10-05 07:55:05 +02:00
Simon Hausmann 1a1ea8b7a3 Implement constructActivationProperty 2012-10-04 23:23:50 +02:00
Simon Hausmann 674a64ef76 Implement mov unop 2012-10-04 22:50:01 +02:00
Simon Hausmann d29a5f9f9f Implement binop mov 2012-10-04 22:46:42 +02:00
Simon Hausmann fb654f9eea Implement mov as string 2012-10-04 22:13:34 +02:00
Simon Hausmann fa0f7c85b3 Sprinkle a few more notImplemented() 2012-10-04 22:08:22 +02:00
Simon Hausmann cddf3a4ab1 Implement more of cjump 2012-10-04 22:02:43 +02:00
Simon Hausmann 50bd54fd53 Add missing returns 2012-10-04 21:48:38 +02:00
Simon Hausmann fa690200df Fix argument addressing to be in the right order 2012-10-04 21:40:33 +02:00
Simon Hausmann 2c62348148 Fix move temp -> temp 2012-10-04 21:40:17 +02:00
Simon Hausmann 8b64f6e68d Implemented part of visitCJump 2012-10-04 19:24:22 +02:00
Simon Hausmann f0167b4c17 Implement callActivationProperty, mov with target as name and closure init 2012-10-02 08:55:18 +02:00
Simon Hausmann 011f4878ea Fix stupid off-by-one in address calculation of temporaries on the stack 2012-10-02 08:52:38 +02:00
Simon Hausmann 59f6f4d1be Simplified function call helpers 2012-10-02 07:21:38 +02:00
Simon Hausmann b21875c0d5 Prospective jump support 2012-10-02 06:49:49 +02:00
Simon Hausmann 1c80510fc5 Implement basic name lookup 2012-10-01 22:52:05 +02:00
Simon Hausmann aabf1f6370 Implement simple value storage 2012-10-01 22:35:53 +02:00
Simon Hausmann 0c0e548171 Fix ret argumet passing 2012-10-01 22:03:59 +02:00