Commit Graph

29 Commits

Author SHA1 Message Date
Lars Knoll ab62ad8830 Convert the remaining builtin methods to use the SimpleCallContext
Change-Id: Ib01bd0c15578b93829abd6fcf8df22cac12daf14
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-04-06 23:34:35 +02:00
Lars Knoll f2971f053f Introduce a SimpleCallContext for simple functions
Use it for most builtin methods. Gives ~10% speed
improvement on the V8 benchmark.

Change-Id: I0039f102e561c0adbe1a9b070150ad32142a33e8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-04-06 23:34:21 +02:00
Lars Knoll 3b73dd08e0 Move arguments out of ExecutionContext and into CallContext
Change-Id: Ic826e3e71eac9171fa113dec79db7c69982f2386
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-04-05 20:39:09 +02:00
Lars Knoll fa0344bfe6 Clean up the property lookup code
Also look a bit deeper into the proto chain. This speeds up
the deltablue benchmark by 10%

Change-Id: Id3f5de58f336d7ca74c7c32e6c30564410baf1e4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-04-05 11:04:21 +02:00
Lars Knoll 2ec09791eb Rename qmljs_runtime to qv4runtime
Change-Id: I46ba9b2621be72116d94bee249ad5b798e951c88
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-03-14 22:15:02 +01:00
Lars Knoll a7da91cd21 Rename qmljs_engine.* to qv4engine.*
Change-Id: I452fc11972c802acc14e0a3358d8c408b6dbded8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-03-14 21:13:46 +01:00
Lars Knoll 1a9689d315 Rename qmljs_environment.* to qv4context.*
Change-Id: I6fe62b501803422f78b47a87c55e4278820725aa
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-03-14 21:12:59 +01:00
Simon Hausmann 52cadfedb3 Add support for ARM exception unwinding
This is used only on Linux/ARM. iOS uses setjmp/longjmp.

Change-Id: I06f907ce702c1b8e06a50ac31b5486d11ef392ec
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-12 01:50:01 +01:00
Simon Hausmann b5181ea199 Fix name lookup for named function expressions
Change-Id: Ia36b2b5c5b40475450fe369c7d6cb5e3965a4488
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-08 17:04:41 +01:00
Simon Hausmann b83696f989 Fix slowness in unwind table registration
__register_frame and __deregister_frame are very slow when called
with many functions many times, like in some of the tests that use
a lot of eval(). Change the approach to interposing a function symbol
that is called in libgcc whenever a PC -> FDE lookup is required.

This also changes the code to create the unwind info on-demand.

Change-Id: I99dfcc921b087831ad00f79bad9e7bcfb0cc8c33
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-06 22:19:41 +01:00
Simon Hausmann 03b0e23cce Cleanup unwind handler
Store the platform specific unwind info (CIE/FDE on Linux/Mac x86/x86-64) directly
inside the VM::Function and therefore make all the functions of UnwindHelper static.

Also calculate the function size correctly.

Change-Id: If6a6b92a250044c6799218ef3506f34d630674c7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-05 08:41:22 +01:00
Lars Knoll c586479abe Minor cleanup
Change-Id: I8c3fea7c6b330c3e32b10c945f6e7b96a06daa8e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-16 17:44:43 +01:00
Lars Knoll e962832eb6 Retain the proper nesting structure in the VM:Function objects
Change-Id: I83c0889be7fe354f96fca68f786ca2a05121bb56
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-16 00:47:11 +01:00
Lars Knoll da5ac2aabd Move the destructor into the new vtable.
This makes all runtime structures fully non virtual.

Change-Id: I804568ca9bc33d4be0324ed542df8eab5892c0eb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-14 15:05:47 +01:00
Lars Knoll 1056456cb5 Move call/construct over into the new vtable.
Change-Id: I4f58a1fac25440695bdc62a49adb51a887616a5c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-14 14:57:00 +01:00
Lars Knoll bed14ea268 Remove another virtual and de-inline a call method
Change-Id: Ia7cc0bf9f4024a65020fef75666ae13d3691bc54
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-14 14:51:15 +01:00
Simon Hausmann b09bb08d74 Convert run-time functions that take a Value * for arguments to use a Value reference
This keeps the C++ implementation code simpler while still providing the same
(pointer based) calling convention.

Change-Id: Ib72acf1dfdf4638f6d109a0771fdafc921a544d2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-02-14 12:33:02 +01:00
Lars Knoll 2ce17e2aa9 Remove the virtual call(ctx) method
This is better handled in ScriptFunction and BuiltinFunctionOld.

Change-Id: Id896b1ddac47a9ce52e86abff901c87b7e627271
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-14 12:04:35 +01:00
Lars Knoll 03026421af Move the generic construct() implementation into ScriptFunction
This is the only place we really need it, as the generic
construct method defined by the spec mainly applies to
functions defined in script.

Change-Id: I4fe4219715a4a9393900db6a2532e42fafaea2db
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-14 12:03:37 +01:00
Lars Knoll 2b59eda830 Remove the virtual contruct(ctx) method
The more general and faster construct method taking
more arguments is now used in all cases.

Change-Id: I183e4279526e5a937938a72d494a537faf4bc825
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-14 12:02:33 +01:00
Lars Knoll 6a23171e04 Use faster call/construct methods
Change-Id: I3e3c2ab42f20d9d5f38d3f9681d05de9487d80bd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-14 12:01:07 +01:00
Lars Knoll 9c1e46ee67 Implement hasInstance through the new 'vtable'
Change-Id: I59aea0f64e7ac955c3f1243936d77f2c12103621
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-14 11:57:33 +01:00
Lars Knoll afb743d72a Add a C style vtable to Managed and use it for markObjects
We need to replace the C++ vtable with a home made one for additional
flexibility. This will help us deal properly with primitive this
values, and allow us to enable certain optimisations where we can
change behavior at runtime (e.g. use optimised lookups as long as
we don't have any accessor properties defined).

Change-Id: I6a3852692bdc5c4f0bde05f6ff2b296013ba47e5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-14 10:44:15 +01:00
Lars Knoll beda28a856 Also lookup properties in the prototype by index
We can only do this when getting properties, as setting
values will always happen on the main object.

Change-Id: I0336dd393bf78144d54ed8b6008011a7046e325d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-12 22:49:40 +01:00
Lars Knoll 4be3e75734 Implement a first iteration of the fast property lookup scheme
Fast lookups still require a function call, and will only work
for properties defined on the object itself. Properties of the
prototype will still be slow.

Change-Id: I07c601998d312b1bd8e9977708d3375bf72df3e3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-12 22:48:19 +01:00
Lars Knoll b5333bdcf1 Use internal classes to store the layout of members
Add an internal class structure to Object that will allow
us to do much more efficient property lookups in the future.

Change-Id: I9ee72f6d73113a489f00ad7a31a20e91fbba18ed
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-12 14:54:16 +01:00
Lars Knoll b18b6ecbfd Rename qv4array.* to qv4sparsearray.*
Change-Id: I2c5a683145a4a8e4b243a7f2fe4274dfe2b5abe4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-04 15:48:06 +01:00
Jędrzej Nowacki ea553dc9fa Cleanup namespaces.
QT_BEGIN_NAMESPACE and QT_END_NAMESPACE was added in header
files. Namespace coding convention got unified.

Change-Id: I971c9a9179d5cd512f8214457609f40992a8ca66
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-31 10:36:00 +01:00
Jędrzej Nowacki 74fba4d806 Say hello to QtV4 module.
Change-Id: I507cd5707b7d7223a0d901cf939896fb2649b684
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-30 13:20:40 +01:00