diff options
author | Richard Dale <richard.dale@codethink.co.uk> | 2013-07-04 09:56:42 +0100 |
---|---|---|
committer | Richard Dale <richard.dale@codethink.co.uk> | 2013-07-04 09:56:42 +0100 |
commit | c6978bf56f599a3da8c03b1a7e58102aa84223e7 (patch) | |
tree | 400d769941e13d9814f58d79e9253e941e48ddd6 | |
parent | 704211043d373aba98aa0507bd58c32aed1857c5 (diff) | |
parent | ca1ac7634f00b845ded92b5fabfa0d1c53197b01 (diff) | |
download | qtjsbackend-baserock/morph.tar.gz |
Merge v5.1.0 releasebaserock/morph
-rw-r--r-- | src/3rdparty/v8/src/ast.cc | 2 | ||||
-rw-r--r-- | src/3rdparty/v8/src/platform-win32.cc | 7 | ||||
-rw-r--r-- | tests/auto/v8/tst_v8.cpp | 6 | ||||
-rw-r--r-- | tests/auto/v8/v8main.cpp | 1 | ||||
-rw-r--r-- | tests/auto/v8/v8test.cpp | 34 | ||||
-rw-r--r-- | tests/auto/v8/v8test.h | 1 |
6 files changed, 48 insertions, 3 deletions
diff --git a/src/3rdparty/v8/src/ast.cc b/src/3rdparty/v8/src/ast.cc index 3015b1e..5d7baf2 100644 --- a/src/3rdparty/v8/src/ast.cc +++ b/src/3rdparty/v8/src/ast.cc @@ -566,7 +566,7 @@ void Call::RecordTypeFeedback(TypeFeedbackOracle* oracle, Property* property = expression()->AsProperty(); if (property == NULL) { if (VariableProxy *proxy = expression()->AsVariableProxy()) { - if (proxy->var()->is_qml_global()) + if (proxy->var()->IsUnallocated() && proxy->var()->is_qml_global()) return; } diff --git a/src/3rdparty/v8/src/platform-win32.cc b/src/3rdparty/v8/src/platform-win32.cc index 76e35f5..ae9ab2a 100644 --- a/src/3rdparty/v8/src/platform-win32.cc +++ b/src/3rdparty/v8/src/platform-win32.cc @@ -1523,9 +1523,12 @@ double OS::nan_value() { int OS::ActivationFrameAlignment() { #ifdef _WIN64 return 16; // Windows 64-bit ABI requires the stack to be 16-byte aligned. -#else - return 8; // Floating-point math runs faster with 8-byte alignment. +#elif defined(__MINGW32__) + // With gcc 4.4 the tree vectorization optimizer can generate code + // that requires 16 byte alignment such as movdqa on x86. + return 16; #endif + return 8; // Floating-point math runs faster with 8-byte alignment. } diff --git a/tests/auto/v8/tst_v8.cpp b/tests/auto/v8/tst_v8.cpp index 7461ce3..d4193e4 100644 --- a/tests/auto/v8/tst_v8.cpp +++ b/tests/auto/v8/tst_v8.cpp @@ -69,6 +69,7 @@ private slots: void completehash(); void stringhashcomparison(); void qmlmodevariables(); + void qmlmodeinlinelocal(); }; void tst_v8::eval() @@ -146,6 +147,11 @@ void tst_v8::qmlmodevariables() QVERIFY(v8test_qmlmodevariables()); } +void tst_v8::qmlmodeinlinelocal() +{ + QVERIFY(v8test_qmlmodeinlinelocal()); +} + int main(int argc, char *argv[]) { V8::SetFlagsFromCommandLine(&argc, argv, true); diff --git a/tests/auto/v8/v8main.cpp b/tests/auto/v8/v8main.cpp index 5ec41ad..21440fd 100644 --- a/tests/auto/v8/v8main.cpp +++ b/tests/auto/v8/v8main.cpp @@ -75,6 +75,7 @@ int main(int argc, char *argv[]) RUN_TEST(fallbackpropertyhandler_nonempty); RUN_TEST(completehash); RUN_TEST(qmlmodevariables); + RUN_TEST(qmlmodeinlinelocal); return exit_status; } diff --git a/tests/auto/v8/v8test.cpp b/tests/auto/v8/v8test.cpp index 6621846..6429cd7 100644 --- a/tests/auto/v8/v8test.cpp +++ b/tests/auto/v8/v8test.cpp @@ -1210,3 +1210,37 @@ cleanup: ENDTEST(); } + +// test for https://bugreports.qt-project.org/browse/QTBUG-31366 +// assert/crash when inlining local functions in qml mode +bool v8test_qmlmodeinlinelocal() +{ + BEGINTEST(); + + HandleScope handle_scope; + Persistent<Context> context = Context::New(); + Context::Scope context_scope(context); + + Local<Object> qmlglobal = Object::New(); + + Local<String> source = String::New( + "function func() {" + "function local_function () {" + "}" + // high enough to get it to opt; 10000 seems to be too low + "for (var i = 0; i < 100000; ++i) local_function();" + "}" + "func();" + ); + + Local<Script> script = Script::Compile(source, NULL, NULL, Handle<String>(), Script::QmlMode); + + TryCatch tc; + script->Run(qmlglobal); + VERIFY(!tc.HasCaught()); + +cleanup: + context.Dispose(); + + ENDTEST(); +} diff --git a/tests/auto/v8/v8test.h b/tests/auto/v8/v8test.h index 2db655c..e9fc8f6 100644 --- a/tests/auto/v8/v8test.h +++ b/tests/auto/v8/v8test.h @@ -63,6 +63,7 @@ bool v8test_fallbackpropertyhandler_nonempty(); bool v8test_completehash(); bool v8test_stringhashcomparison(); bool v8test_qmlmodevariables(); +bool v8test_qmlmodeinlinelocal(); #endif // V8TEST_H |