Commit Graph

20 Commits

Author SHA1 Message Date
Sérgio Martins d2c958199f Initialize variables before using them.
Change-Id: I7cd5a17259814b3f2405b63d7f4d2a0fd30cae4d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-11-06 16:55:09 +01:00
Andrew Knight eeabbf5548 Fix build on WinRT
Disable JIT and avoid unsupported functions under WinRT.
Also add MSVC's ARM flag to the double conversion white list.

Change-Id: I22ec340a20b113fdeefb802ac61812f78a527895
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-11-06 09:07:08 +01:00
Lars Knoll cb7948caec Don't run the GC too often
Some test cases were badly trashing the GC, running it
way too often. Fix this by only running the GC after
we allocated more than 50% of the amount of available
items.

Change-Id: Icfe6d0730552ef2298963de706213ebc9e3e342c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-11-05 22:23:25 +01:00
Lars Knoll 025365f1dc Refactor marking GC'ed objects
Don't use recursive function calls anymore. Instead, push marked
objects onto the JS stack, and then pop them off when their children
are being marked.

Should reduce stack memory usage, and improves performance by ~5%.

Change-Id: I2d37d97579144fcba87ec8e9fd545dd220c01fbb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-11-05 18:54:51 +01:00
Lars Knoll f0eaaef4ae Some minor optimizations
Change-Id: Ib2e08e7c89ca59a48f8fd52b30981e5d7e60803b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-10-19 14:59:02 +02:00
Lars Knoll ad7f91c59a Turn on exact garbage collection by default
Keep conservative GC as a fallback for testing
Enable all tests again that were skipped due to
GC issues.

Change-Id: I8e0fa728207bdd39a96d0acf95e27841157d8402
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-10-16 06:36:47 +02:00
Lars Knoll e20253ed7a Remove debug output
The output messes up some auto tests

Change-Id: I9b9b2b4fdf023bc9953939b814872e860c84f484
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-10-15 20:57:37 +02:00
Lars Knoll 40db24351b Smaller cleanups
Change-Id: I0a7eee96ef7c92ad4a3c5963010e3ac66fe6ed3a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-10-11 08:56:26 +02:00
Kai Koehne e34477bfaf Use common prefix for environment variable
Change-Id: Idbbdcad42106d30451000fc6593428a0bac4bc04
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-10-09 15:11:11 +02:00
Lars Knoll ac8afca822 Remove some more uses of QV4::Value
All remaining uses should be GC safe now.

Change-Id: I05c962de6ab896f108f70caa1bf937a24e67bfe1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-10-02 16:07:33 +02:00
Lars Knoll cf2a253f2f Move Value::fromBool, ... to a new Primitive class
This will simplify finding the remaining direct usages of
QV4::Value that need fixing.

Change-Id: I223099727436d5748027c84c53d9dfc4028e38ed
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-28 13:33:24 +02:00
Lars Knoll 74807c0725 Move more API over to use ValueRef
Change-Id: I372f1f3e3e78d45912a913f437e622e0acfc9646
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-26 09:05:32 +02:00
Sérgio Martins 6bb0b40083 wince: Build fix, NtCurrentTeb() is not available in this platform.
This was copied from qtscript's:
src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp

Change-Id: Iaa5549e6915aa4aa4bf532fbe7c9117a0858ff02
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 13:18:33 +02:00
Lars Knoll 47bf40dd49 Prevent objects from being collected while in their constructor
While objects are being constructed, we don't have a reference to them
on the JS stack yet. So the constructor needs to protect itself against
being collected by putting the this object onto the JS stack.

Added an environment switch MM_EXACT_GC to test exact garbage
collection.

Change-Id: Ie37665a954de800359c272ffbebbe1488e7a8ace
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-22 01:06:20 +02:00
Lars Knoll e441692b0b Further work towards an exact GC
Add some more convenience in the helper classes
in qscopedvalue_p.h
Make accesses to CallData safer, and change
ExecutionEngine::newObject() to return a safe
pointer.

Change-Id: I980909754ce9681cf6faa1355bab3a1e5d6dd186
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-22 01:06:20 +02:00
Giuseppe D'Angelo 13e7ffd5c2 Remove qLowerBound usages from declarative
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I85df32525af0c5706c631555a06b66ef3484d797
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-13 01:10:51 +02:00
Giuseppe D'Angelo 4df73e62a7 Remove qSort usages from declarative
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I8fa7d0186cc8f0ba562695974829e37f1eb87f2f
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-13 01:10:37 +02:00
Lars Knoll 1986cf68d0 Create a stack for JS values and use it in the interpreter
First step towards being able to do an exact GC.

Create a stack for JS Values that is separate from the C++
stack.

Use the stack for generated methods (masm and moth).

Change-Id: I80ac0e5b5d86439dda5e9ea2b21fa0c57d8aef22
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-11 13:01:44 +02:00
Simon Hausmann e04cadca4a Fix compilation with MSVC 2008 (and prospective Windows CE build fix)
* Only 2010 and newer ship stdint.h, so for 2008 we have to provide a little
stdint.h compat header, for some of the third-party code we import. Our own
Qt code this patch changes to use quint* types instead.

* Include math.h and float.h for some math functions.

* disable the JIT on Windows CE for now.

* Change use of intptr_t to qintptr in Qt code. intptr_t is in inttypes.h,
  except that with VS 2008 it is indirectly available through stdio.h. Let's
  avoid the mess and just use the qt type, that's always available.

Change-Id: I19055edd89e0a6b147d9edbb3b711798ed3c05a5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-08-22 04:24:00 +02:00
Lars Knoll 3288b87e2f Restructure source code
Move the v4 engine classes from a subdir of qml/qml into
two subdirs (compiler and jsruntime) of the qml module
Remove an unsued qv4syntaxchecker class, and move
the moth code directly into compiler.

Change-Id: I6929bede1f25098e6cb2e68087e779fac16b0c68
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-08-08 12:22:30 +02:00