From 2df5be48c08803b6bafafe9c69959a4076022293 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 27 Oct 2011 13:34:16 +0100 Subject: [V8] Introduce a QML compilation mode In QML mode, there is a second global object - known as the QML global object. During property resolution, if a property is not present on the JS global object, it is resolved on the QML global object. This global object behavior is only enabled if a script is being compiled in QML mode. The object to use as the QML global object is passed as a parameter to the Script::Run() method. Any function closures etc. created during the run will retain a reference to this object, so different objects can be passed in different script runs. Change-Id: I86851683200d02208379744c887dfebc010a7ccc Reviewed-by: Kent Hansen --- src/3rdparty/v8/include/v8.h | 19 +++++-- src/3rdparty/v8/src/api.cc | 47 +++++++++++++--- src/3rdparty/v8/src/arm/code-stubs-arm.cc | 8 +++ src/3rdparty/v8/src/arm/full-codegen-arm.cc | 26 ++++++--- src/3rdparty/v8/src/arm/lithium-arm.cc | 4 +- src/3rdparty/v8/src/arm/lithium-arm.h | 12 +++- src/3rdparty/v8/src/arm/lithium-codegen-arm.cc | 7 ++- src/3rdparty/v8/src/arm/macro-assembler-arm.h | 5 ++ src/3rdparty/v8/src/ast.cc | 10 ++++ src/3rdparty/v8/src/ast.h | 2 + src/3rdparty/v8/src/bootstrapper.cc | 2 + src/3rdparty/v8/src/code-stubs.h | 4 +- src/3rdparty/v8/src/compiler.cc | 15 ++++- src/3rdparty/v8/src/compiler.h | 16 +++++- src/3rdparty/v8/src/contexts.cc | 35 ++++++++++++ src/3rdparty/v8/src/contexts.h | 4 ++ src/3rdparty/v8/src/execution.cc | 31 +++++++++-- src/3rdparty/v8/src/execution.h | 8 +++ src/3rdparty/v8/src/full-codegen.h | 1 + src/3rdparty/v8/src/globals.h | 6 ++ src/3rdparty/v8/src/heap.cc | 4 ++ src/3rdparty/v8/src/hydrogen-instructions.cc | 5 ++ src/3rdparty/v8/src/hydrogen-instructions.h | 21 ++++++- src/3rdparty/v8/src/hydrogen.cc | 6 ++ src/3rdparty/v8/src/ia32/code-stubs-ia32.cc | 9 +++ src/3rdparty/v8/src/ia32/full-codegen-ia32.cc | 25 ++++++--- src/3rdparty/v8/src/ia32/lithium-codegen-ia32.cc | 7 ++- src/3rdparty/v8/src/ia32/lithium-ia32.cc | 4 +- src/3rdparty/v8/src/ia32/lithium-ia32.h | 12 +++- src/3rdparty/v8/src/ia32/macro-assembler-ia32.h | 3 + src/3rdparty/v8/src/ic.cc | 2 +- src/3rdparty/v8/src/ic.h | 8 ++- src/3rdparty/v8/src/mips/code-stubs-mips.cc | 9 +++ src/3rdparty/v8/src/mips/full-codegen-mips.cc | 26 ++++++--- src/3rdparty/v8/src/mips/lithium-codegen-mips.cc | 7 ++- src/3rdparty/v8/src/mips/lithium-mips.cc | 4 +- src/3rdparty/v8/src/mips/lithium-mips.h | 12 +++- src/3rdparty/v8/src/mips/macro-assembler-mips.h | 5 ++ src/3rdparty/v8/src/objects-inl.h | 2 + src/3rdparty/v8/src/objects.h | 14 ++++- src/3rdparty/v8/src/parser.cc | 16 ++++++ src/3rdparty/v8/src/prettyprinter.cc | 3 + src/3rdparty/v8/src/runtime.cc | 67 +++++++++++++++-------- src/3rdparty/v8/src/runtime.h | 6 +- src/3rdparty/v8/src/scopeinfo.cc | 12 +++- src/3rdparty/v8/src/scopes.cc | 63 +++++++++++++++++++++ src/3rdparty/v8/src/scopes.h | 11 ++++ src/3rdparty/v8/src/stub-cache.cc | 13 +++-- src/3rdparty/v8/src/stub-cache.h | 5 +- src/3rdparty/v8/src/variables.cc | 3 +- src/3rdparty/v8/src/variables.h | 6 ++ src/3rdparty/v8/src/x64/code-stubs-x64.cc | 8 +++ src/3rdparty/v8/src/x64/full-codegen-x64.cc | 25 ++++++--- src/3rdparty/v8/src/x64/lithium-codegen-x64.cc | 7 ++- src/3rdparty/v8/src/x64/lithium-x64.cc | 4 +- src/3rdparty/v8/src/x64/lithium-x64.h | 12 ++++ src/3rdparty/v8/src/x64/macro-assembler-x64.h | 5 ++ src/3rdparty/v8/test/cctest/test-api.cc | 13 +++-- src/3rdparty/v8/test/cctest/test-heap-profiler.cc | 40 ++++++++++---- src/3rdparty/v8/test/cctest/test-heap.cc | 21 ++++--- 60 files changed, 634 insertions(+), 153 deletions(-) (limited to 'src') diff --git a/src/3rdparty/v8/include/v8.h b/src/3rdparty/v8/include/v8.h index 5cc8e6f..7e614d0 100644 --- a/src/3rdparty/v8/include/v8.h +++ b/src/3rdparty/v8/include/v8.h @@ -590,6 +590,11 @@ class ScriptOrigin { */ class V8EXPORT Script { public: + enum CompileFlags { + Default = 0x00, + QmlMode = 0x01 + }; + /** * Compiles the specified script (context-independent). * @@ -608,7 +613,8 @@ class V8EXPORT Script { static Local