summaryrefslogtreecommitdiff
path: root/src/3rdparty/v8/src/mips/code-stubs-mips.cc
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-10-27 13:34:16 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-09 13:06:01 +0100
commit194da71eed49e4d5e904e8c28cb510fb85b95912 (patch)
tree4bb40c02292e8fe51c1e975b09727b710748668c /src/3rdparty/v8/src/mips/code-stubs-mips.cc
parent504ef4cafdbc0c927d9f86ef21d9e7db757fd110 (diff)
downloadqtjsbackend-194da71eed49e4d5e904e8c28cb510fb85b95912.tar.gz
[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: I75d6f8173260e0d4933fd33ad16a277542048f09 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/3rdparty/v8/src/mips/code-stubs-mips.cc')
-rw-r--r--src/3rdparty/v8/src/mips/code-stubs-mips.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/3rdparty/v8/src/mips/code-stubs-mips.cc b/src/3rdparty/v8/src/mips/code-stubs-mips.cc
index 7f7d70e..f122d14 100644
--- a/src/3rdparty/v8/src/mips/code-stubs-mips.cc
+++ b/src/3rdparty/v8/src/mips/code-stubs-mips.cc
@@ -251,6 +251,11 @@ void FastNewContextStub::Generate(MacroAssembler* masm) {
__ sw(a1, MemOperand(v0, Context::SlotOffset(Context::EXTENSION_INDEX)));
__ sw(a2, MemOperand(v0, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
+ // Copy the qml global object from the surrounding context.
+ __ lw(a1, MemOperand(cp, Context::SlotOffset(Context::QML_GLOBAL_OBJECT_INDEX)));
+ __ sw(a1, MemOperand(v0, Context::SlotOffset(Context::QML_GLOBAL_OBJECT_INDEX)));
+
+
// Initialize the rest of the slots to undefined.
__ LoadRoot(a1, Heap::kUndefinedValueRootIndex);
for (int i = Context::MIN_CONTEXT_SLOTS; i < length; i++) {
@@ -313,6 +318,10 @@ void FastNewBlockContextStub::Generate(MacroAssembler* masm) {
__ sw(a1, ContextOperand(v0, Context::EXTENSION_INDEX));
__ sw(a2, ContextOperand(v0, Context::GLOBAL_OBJECT_INDEX));
+ // Copy the qml global object from the surrounding context.
+ __ lw(a1, ContextOperand(cp, Context::QML_GLOBAL_OBJECT_INDEX));
+ __ sw(a1, ContextOperand(v0, Context::QML_GLOBAL_OBJECT_INDEX));
+
// Initialize the rest of the slots to the hole value.
__ LoadRoot(a1, Heap::kTheHoleValueRootIndex);
for (int i = 0; i < slots_; i++) {