diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-06-14 16:16:40 +1000 |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-06-14 16:16:40 +1000 |
commit | 7456055c2df733dbbe2ca5967f512c2555ca31d4 (patch) | |
tree | 1dcf54df0f83f7f9a57be0ea2c7ec4f5845ecec2 /src | |
parent | db9d54749f134495bd862ee901dd141d41fac291 (diff) |
Update V8
Diffstat (limited to 'src')
m--------- | src/3rdparty/v8 | 0 | ||||
-rw-r--r-- | src/v8/0001-Add-hashing-and-comparison-methods-to-v8-String.patch | 85 | ||||
-rw-r--r-- | src/v8/0002-Add-a-bit-field-3-to-Map.patch | 6 | ||||
-rw-r--r-- | src/v8/0003-Add-a-fallback-mode-for-named-property-interceptors.patch | 18 | ||||
-rw-r--r-- | src/v8/0004-Generalize-external-object-resources.patch | 26 | ||||
-rw-r--r-- | src/v8/0005-Introduce-a-QML-compilation-mode.patch | 118 | ||||
-rw-r--r-- | src/v8/0006-Allow-access-to-the-calling-script-data.patch | 10 | ||||
-rw-r--r-- | src/v8/0007-Fix-warnings.patch | 8 |
8 files changed, 215 insertions, 56 deletions
diff --git a/src/3rdparty/v8 b/src/3rdparty/v8 -Subproject 7258018df1653609e007a0bdcd8ff6126f5b62a +Subproject b16d11e3e614470004b1f80b25c55a8926c9e15 diff --git a/src/v8/0001-Add-hashing-and-comparison-methods-to-v8-String.patch b/src/v8/0001-Add-hashing-and-comparison-methods-to-v8-String.patch index 9f4abbc5e5..57a0ae8bd3 100644 --- a/src/v8/0001-Add-hashing-and-comparison-methods-to-v8-String.patch +++ b/src/v8/0001-Add-hashing-and-comparison-methods-to-v8-String.patch @@ -1,4 +1,4 @@ -From be15626304572957f432160bb0fa35af5e6663b2 Mon Sep 17 00:00:00 2001 +From b828611412fae2c423b6e02d3fb266400492c4c0 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy <aaron.kennedy@nokia.com> Date: Mon, 23 May 2011 15:47:20 +1000 Subject: [PATCH 1/7] Add hashing and comparison methods to v8::String @@ -6,17 +6,17 @@ Subject: [PATCH 1/7] Add hashing and comparison methods to v8::String This allows us to more rapidly search for a v8::String inside a hash of QStrings. --- - include/v8.h | 17 +++++++++++++++++ - src/api.cc | 15 +++++++++++++++ - src/objects.cc | 29 +++++++++++++++++++++++++++++ - src/objects.h | 2 ++ - 4 files changed, 63 insertions(+), 0 deletions(-) + include/v8.h | 20 ++++++++++++++++++ + src/api.cc | 28 ++++++++++++++++++++++++++ + src/objects.cc | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/objects.h | 3 ++ + 4 files changed, 111 insertions(+), 0 deletions(-) diff --git a/include/v8.h b/include/v8.h -index d15d024..ac3c062 100644 +index d15d024..bd48503 100644 --- a/include/v8.h +++ b/include/v8.h -@@ -994,6 +994,23 @@ class String : public Primitive { +@@ -994,6 +994,24 @@ class String : public Primitive { V8EXPORT int Utf8Length() const; /** @@ -35,16 +35,26 @@ index d15d024..ac3c062 100644 + * string data provided. + */ + V8EXPORT bool Equals(uint16_t *string, int length); ++ V8EXPORT bool Equals(char *string, int length); + + /** * Write the contents of the string to an external buffer. * If no arguments are given, expects the buffer to be large * enough to hold the entire string and NULL terminator. Copies +@@ -1023,6 +1041,8 @@ class String : public Primitive { + HINT_MANY_WRITES_EXPECTED = 1 + }; + ++ V8EXPORT uint16_t GetCharacter(int index); ++ + V8EXPORT int Write(uint16_t* buffer, + int start = 0, + int length = -1, diff --git a/src/api.cc b/src/api.cc -index a2373cd..09b6b93 100644 +index a2373cd..f509673 100644 --- a/src/api.cc +++ b/src/api.cc -@@ -3284,6 +3284,21 @@ int String::Utf8Length() const { +@@ -3284,6 +3284,34 @@ int String::Utf8Length() const { return str->Utf8Length(); } @@ -58,19 +68,32 @@ index a2373cd..09b6b93 100644 + return i::HashSequentialString<i::uc16>(string, length) >> i::String::kHashShift; +} + ++uint16_t String::GetCharacter(int index) ++{ ++ i::Handle<i::String> str = Utils::OpenHandle(this); ++ return str->Get(index); ++} ++ +bool String::Equals(uint16_t *string, int length) { + i::Handle<i::String> str = Utils::OpenHandle(this); + if (IsDeadCheck(str->GetIsolate(), "v8::String::Equals()")) return 0; + return str->SlowEqualsExternal(string, length); +} ++ ++bool String::Equals(char *string, int length) ++{ ++ i::Handle<i::String> str = Utils::OpenHandle(this); ++ if (IsDeadCheck(str->GetIsolate(), "v8::String::Equals()")) return 0; ++ return str->SlowEqualsExternal(string, length); ++} int String::WriteUtf8(char* buffer, int capacity, diff --git a/src/objects.cc b/src/objects.cc -index df61956..bbdb37b 100644 +index df61956..5bd7f95 100644 --- a/src/objects.cc +++ b/src/objects.cc -@@ -5346,6 +5346,35 @@ static inline bool CompareStringContentsPartial(Isolate* isolate, +@@ -5346,6 +5346,66 @@ static inline bool CompareStringContentsPartial(Isolate* isolate, } } @@ -85,7 +108,6 @@ index df61956..bbdb37b 100644 + + String* lhs = this->TryFlattenGetString(); + -+ Isolate* isolate = GetIsolate(); + if (lhs->IsFlat()) { + if (lhs->IsAsciiRepresentation()) { + Vector<const char> vec1 = lhs->ToAsciiVector(); @@ -98,23 +120,56 @@ index df61956..bbdb37b 100644 + return CompareRawStringContents(vec1, vec2); + } + } else { ++ Isolate* isolate = GetIsolate(); + isolate->objects_string_compare_buffer_a()->Reset(0, lhs); + VectorIterator<uc16> ib(string, length); + return CompareStringContents(isolate->objects_string_compare_buffer_a(), &ib); + } +} ++ ++bool String::SlowEqualsExternal(char *string, int length) ++{ ++ int len = this->length(); ++ if (len != length) return false; ++ if (len == 0) return true; ++ ++ // We know the strings are both non-empty. Compare the first chars ++ // before we try to flatten the strings. ++ if (this->Get(0) != string[0]) return false; ++ ++ String* lhs = this->TryFlattenGetString(); ++ ++ if (StringShape(lhs).IsSequentialAscii()) { ++ const char* str1 = SeqAsciiString::cast(lhs)->GetChars(); ++ return CompareRawStringContents(Vector<const char>(str1, len), ++ Vector<const char>(string, len)); ++ } ++ ++ if (lhs->IsFlat()) { ++ Vector<const uc16> vec1 = lhs->ToUC16Vector(); ++ VectorIterator<const uc16> buf1(vec1); ++ VectorIterator<char> buf2(string, length); ++ return CompareStringContents(&buf1, &buf2); ++ } else { ++ Isolate* isolate = GetIsolate(); ++ isolate->objects_string_compare_buffer_a()->Reset(0, lhs); ++ VectorIterator<char> ib(string, length); ++ return CompareStringContents(isolate->objects_string_compare_buffer_a(), &ib); ++ } ++} bool String::SlowEquals(String* other) { // Fast check: negative check with lengths. diff --git a/src/objects.h b/src/objects.h -index e966b3d..cd11c88 100644 +index e966b3d..f4c27d2 100644 --- a/src/objects.h +++ b/src/objects.h -@@ -5359,6 +5359,8 @@ class String: public HeapObject { +@@ -5359,6 +5359,9 @@ class String: public HeapObject { bool IsAsciiEqualTo(Vector<const char> str); bool IsTwoByteEqualTo(Vector<const uc16> str); + bool SlowEqualsExternal(uc16 *string, int length); ++ bool SlowEqualsExternal(char *string, int length); + // Return a UTF8 representation of the string. The string is null // terminated but may optionally contain nulls. Length is returned diff --git a/src/v8/0002-Add-a-bit-field-3-to-Map.patch b/src/v8/0002-Add-a-bit-field-3-to-Map.patch index 537c3aaafb..86820d7127 100644 --- a/src/v8/0002-Add-a-bit-field-3-to-Map.patch +++ b/src/v8/0002-Add-a-bit-field-3-to-Map.patch @@ -1,4 +1,4 @@ -From edf12cdcd4ec04bc6de8c031c0b9c13a664ba7a9 Mon Sep 17 00:00:00 2001 +From f2d11bae75512a1173da7b9f9edfaeeb1a1e73ce Mon Sep 17 00:00:00 2001 From: Aaron Kennedy <aaron.kennedy@nokia.com> Date: Mon, 23 May 2011 15:55:26 +1000 Subject: [PATCH 2/7] Add a bit field 3 to Map @@ -53,7 +53,7 @@ index 65aec5d..bbe05f6 100644 if (value) { set_bit_field(bit_field() | (1 << kHasNonInstancePrototype)); diff --git a/src/objects.cc b/src/objects.cc -index bbdb37b..fcde7eb 100644 +index 5bd7f95..92ab958 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -3614,6 +3614,7 @@ MaybeObject* Map::CopyDropDescriptors() { @@ -73,7 +73,7 @@ index bbdb37b..fcde7eb 100644 Map::cast(result)->set_is_shared(sharing == SHARED_NORMALIZED_MAP); diff --git a/src/objects.h b/src/objects.h -index cd11c88..124c353 100644 +index f4c27d2..a61733e 100644 --- a/src/objects.h +++ b/src/objects.h @@ -3597,6 +3597,10 @@ class Map: public HeapObject { diff --git a/src/v8/0003-Add-a-fallback-mode-for-named-property-interceptors.patch b/src/v8/0003-Add-a-fallback-mode-for-named-property-interceptors.patch index 2792df32b7..cef7012cfb 100644 --- a/src/v8/0003-Add-a-fallback-mode-for-named-property-interceptors.patch +++ b/src/v8/0003-Add-a-fallback-mode-for-named-property-interceptors.patch @@ -1,4 +1,4 @@ -From 001373a7856d8a6f4620552c62ae87866c4194c0 Mon Sep 17 00:00:00 2001 +From 7ccd4af88f3323405ef834acabee15e1e6748474 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy <aaron.kennedy@nokia.com> Date: Mon, 23 May 2011 16:21:02 +1000 Subject: [PATCH 3/7] Add a "fallback" mode for named property interceptors @@ -24,10 +24,10 @@ declarations. 9 files changed, 99 insertions(+), 18 deletions(-) diff --git a/include/v8.h b/include/v8.h -index ac3c062..beaaca4 100644 +index bd48503..94da79c 100644 --- a/include/v8.h +++ b/include/v8.h -@@ -2142,6 +2142,7 @@ class V8EXPORT FunctionTemplate : public Template { +@@ -2145,6 +2145,7 @@ class V8EXPORT FunctionTemplate : public Template { NamedPropertyQuery query, NamedPropertyDeleter remover, NamedPropertyEnumerator enumerator, @@ -35,7 +35,7 @@ index ac3c062..beaaca4 100644 Handle<Value> data); void SetIndexedInstancePropertyHandler(IndexedPropertyGetter getter, IndexedPropertySetter setter, -@@ -2226,6 +2227,13 @@ class V8EXPORT ObjectTemplate : public Template { +@@ -2229,6 +2230,13 @@ class V8EXPORT ObjectTemplate : public Template { NamedPropertyEnumerator enumerator = 0, Handle<Value> data = Handle<Value>()); @@ -50,7 +50,7 @@ index ac3c062..beaaca4 100644 * Sets an indexed property handler on the object template. * diff --git a/src/api.cc b/src/api.cc -index 09b6b93..ebca4f9 100644 +index f509673..2ac4395 100644 --- a/src/api.cc +++ b/src/api.cc @@ -981,6 +981,7 @@ void FunctionTemplate::SetNamedInstancePropertyHandler( @@ -185,7 +185,7 @@ index bbe05f6..0c09e84 100644 ACCESSORS(CallHandlerInfo, callback, Object, kCallbackOffset) ACCESSORS(CallHandlerInfo, data, Object, kDataOffset) diff --git a/src/objects.cc b/src/objects.cc -index fcde7eb..d72e30b 100644 +index 92ab958..08d130e 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -1712,9 +1712,10 @@ MaybeObject* JSObject::SetPropertyWithInterceptor( @@ -246,7 +246,7 @@ index fcde7eb..d72e30b 100644 } result->NotFound(); diff --git a/src/objects.h b/src/objects.h -index 124c353..4389456 100644 +index a61733e..3fdc69f 100644 --- a/src/objects.h +++ b/src/objects.h @@ -1405,7 +1405,8 @@ class JSObject: public HeapObject { @@ -291,7 +291,7 @@ index 124c353..4389456 100644 // Layout of the default cache. It holds alternating name and code objects. static const int kCodeCacheEntrySize = 2; -@@ -6267,6 +6275,7 @@ class InterceptorInfo: public Struct { +@@ -6268,6 +6276,7 @@ class InterceptorInfo: public Struct { DECL_ACCESSORS(deleter, Object) DECL_ACCESSORS(enumerator, Object) DECL_ACCESSORS(data, Object) @@ -299,7 +299,7 @@ index 124c353..4389456 100644 static inline InterceptorInfo* cast(Object* obj); -@@ -6286,7 +6295,8 @@ class InterceptorInfo: public Struct { +@@ -6287,7 +6296,8 @@ class InterceptorInfo: public Struct { static const int kDeleterOffset = kQueryOffset + kPointerSize; static const int kEnumeratorOffset = kDeleterOffset + kPointerSize; static const int kDataOffset = kEnumeratorOffset + kPointerSize; diff --git a/src/v8/0004-Generalize-external-object-resources.patch b/src/v8/0004-Generalize-external-object-resources.patch index 56b1a46342..9c30763994 100644 --- a/src/v8/0004-Generalize-external-object-resources.patch +++ b/src/v8/0004-Generalize-external-object-resources.patch @@ -1,4 +1,4 @@ -From d5dbc0acceb9cc848dfd994b2f54bc37c624fe98 Mon Sep 17 00:00:00 2001 +From a9108d655fcd8ffa45a32257160cc10eaf0256ee Mon Sep 17 00:00:00 2001 From: Aaron Kennedy <aaron.kennedy@nokia.com> Date: Mon, 23 May 2011 16:55:35 +1000 Subject: [PATCH 4/7] Generalize external object resources @@ -31,10 +31,10 @@ object space. 11 files changed, 280 insertions(+), 115 deletions(-) diff --git a/include/v8.h b/include/v8.h -index beaaca4..eaa0ec4 100644 +index 94da79c..b377c53 100644 --- a/include/v8.h +++ b/include/v8.h -@@ -1603,6 +1603,25 @@ class Object : public Value { +@@ -1606,6 +1606,25 @@ class Object : public Value { /** Sets a native pointer in an internal field. */ V8EXPORT void SetPointerInInternalField(int index, void* value); @@ -60,7 +60,7 @@ index beaaca4..eaa0ec4 100644 // Testers for local properties. V8EXPORT bool HasRealNamedProperty(Handle<String> key); V8EXPORT bool HasRealIndexedProperty(uint32_t index); -@@ -2304,6 +2323,12 @@ class V8EXPORT ObjectTemplate : public Template { +@@ -2307,6 +2326,12 @@ class V8EXPORT ObjectTemplate : public Template { */ void SetInternalFieldCount(int value); @@ -74,7 +74,7 @@ index beaaca4..eaa0ec4 100644 ObjectTemplate(); static Local<ObjectTemplate> New(Handle<FunctionTemplate> constructor); diff --git a/src/api.cc b/src/api.cc -index ebca4f9..f62c5a0 100644 +index 2ac4395..3137d6c 100644 --- a/src/api.cc +++ b/src/api.cc @@ -1294,6 +1294,34 @@ void ObjectTemplate::SetInternalFieldCount(int value) { @@ -112,7 +112,7 @@ index ebca4f9..f62c5a0 100644 // --- S c r i p t D a t a --- -@@ -3624,6 +3652,34 @@ void v8::Object::SetPointerInInternalField(int index, void* value) { +@@ -3637,6 +3665,34 @@ void v8::Object::SetPointerInInternalField(int index, void* value) { } @@ -147,7 +147,7 @@ index ebca4f9..f62c5a0 100644 // --- E n v i r o n m e n t --- -@@ -4116,7 +4172,7 @@ Local<String> v8::String::NewExternal( +@@ -4129,7 +4185,7 @@ Local<String> v8::String::NewExternal( LOG_API(isolate, "String::NewExternal"); ENTER_V8(isolate); i::Handle<i::String> result = NewExternalStringHandle(isolate, resource); @@ -156,7 +156,7 @@ index ebca4f9..f62c5a0 100644 return Utils::ToLocal(result); } -@@ -4134,7 +4190,7 @@ bool v8::String::MakeExternal(v8::String::ExternalStringResource* resource) { +@@ -4147,7 +4203,7 @@ bool v8::String::MakeExternal(v8::String::ExternalStringResource* resource) { } bool result = obj->MakeExternal(resource); if (result && !obj->IsSymbol()) { @@ -165,7 +165,7 @@ index ebca4f9..f62c5a0 100644 } return result; } -@@ -4147,7 +4203,7 @@ Local<String> v8::String::NewExternal( +@@ -4160,7 +4216,7 @@ Local<String> v8::String::NewExternal( LOG_API(isolate, "String::NewExternal"); ENTER_V8(isolate); i::Handle<i::String> result = NewExternalAsciiStringHandle(isolate, resource); @@ -174,7 +174,7 @@ index ebca4f9..f62c5a0 100644 return Utils::ToLocal(result); } -@@ -4166,7 +4222,7 @@ bool v8::String::MakeExternal( +@@ -4179,7 +4235,7 @@ bool v8::String::MakeExternal( } bool result = obj->MakeExternal(resource); if (result && !obj->IsSymbol()) { @@ -837,7 +837,7 @@ index 0c09e84..a205f02 100644 ACCESSORS(SignatureInfo, receiver, Object, kReceiverOffset) ACCESSORS(SignatureInfo, args, Object, kArgsOffset) diff --git a/src/objects.h b/src/objects.h -index 4389456..61685cc 100644 +index 3fdc69f..439ad1e 100644 --- a/src/objects.h +++ b/src/objects.h @@ -1636,6 +1636,9 @@ class JSObject: public HeapObject { @@ -871,7 +871,7 @@ index 4389456..61685cc 100644 // Layout of the default cache. It holds alternating name and code objects. static const int kCodeCacheEntrySize = 2; -@@ -6417,6 +6427,7 @@ class ObjectTemplateInfo: public TemplateInfo { +@@ -6418,6 +6428,7 @@ class ObjectTemplateInfo: public TemplateInfo { public: DECL_ACCESSORS(constructor, Object) DECL_ACCESSORS(internal_field_count, Object) @@ -879,7 +879,7 @@ index 4389456..61685cc 100644 static inline ObjectTemplateInfo* cast(Object* obj); -@@ -6433,7 +6444,8 @@ class ObjectTemplateInfo: public TemplateInfo { +@@ -6434,7 +6445,8 @@ class ObjectTemplateInfo: public TemplateInfo { static const int kConstructorOffset = TemplateInfo::kHeaderSize; static const int kInternalFieldCountOffset = kConstructorOffset + kPointerSize; diff --git a/src/v8/0005-Introduce-a-QML-compilation-mode.patch b/src/v8/0005-Introduce-a-QML-compilation-mode.patch index 2b49648337..ffaacb6558 100644 --- a/src/v8/0005-Introduce-a-QML-compilation-mode.patch +++ b/src/v8/0005-Introduce-a-QML-compilation-mode.patch @@ -1,4 +1,4 @@ -From 6311077b6acd840a5b877e293fdc8eda3f83701e Mon Sep 17 00:00:00 2001 +From 980411965c51c0b2c80803d96ac55c498bb1b2c9 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy <aaron.kennedy@nokia.com> Date: Mon, 23 May 2011 18:26:19 +1000 Subject: [PATCH 5/7] Introduce a QML compilation mode @@ -17,6 +17,9 @@ runs. --- include/v8.h | 18 ++++++++-- src/api.cc | 46 +++++++++++++++++++++----- + src/arm/code-stubs-arm.cc | 4 ++ + src/arm/full-codegen-arm.cc | 21 +++++++----- + src/arm/macro-assembler-arm.h | 5 +++ src/ast-inl.h | 5 +++ src/ast.h | 1 + src/compiler.cc | 15 +++++++- @@ -45,10 +48,10 @@ runs. src/x64/code-stubs-x64.cc | 4 ++ src/x64/full-codegen-x64.cc | 21 +++++++----- src/x64/macro-assembler-x64.h | 5 +++ - 30 files changed, 320 insertions(+), 77 deletions(-) + 33 files changed, 341 insertions(+), 86 deletions(-) diff --git a/include/v8.h b/include/v8.h -index eaa0ec4..62715ec 100644 +index b377c53..a67feb2 100644 --- a/include/v8.h +++ b/include/v8.h @@ -577,6 +577,10 @@ class ScriptOrigin { @@ -110,7 +113,7 @@ index eaa0ec4..62715ec 100644 /** * Returns the script id value. -@@ -3299,6 +3308,7 @@ class V8EXPORT Context { +@@ -3302,6 +3311,7 @@ class V8EXPORT Context { * JavaScript frames an empty handle is returned. */ static Local<Context> GetCalling(); @@ -119,7 +122,7 @@ index eaa0ec4..62715ec 100644 /** * Sets the security token for the context. To access an object in diff --git a/src/api.cc b/src/api.cc -index f62c5a0..e2efcaa 100644 +index 3137d6c..2f5898c 100644 --- a/src/api.cc +++ b/src/api.cc @@ -1372,7 +1372,8 @@ ScriptData* ScriptData::New(const char* data, int length) { @@ -204,7 +207,7 @@ index f62c5a0..e2efcaa 100644 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>()); raw_result = *result; } -@@ -3915,6 +3925,24 @@ v8::Local<v8::Context> Context::GetCalling() { +@@ -3928,6 +3938,24 @@ v8::Local<v8::Context> Context::GetCalling() { } @@ -229,6 +232,107 @@ index f62c5a0..e2efcaa 100644 v8::Local<v8::Object> Context::Global() { if (IsDeadCheck(i::Isolate::Current(), "v8::Context::Global()")) { return Local<v8::Object>(); +diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc +index 8c147f9..a2626bf 100644 +--- a/src/arm/code-stubs-arm.cc ++++ b/src/arm/code-stubs-arm.cc +@@ -166,6 +166,10 @@ void FastNewContextStub::Generate(MacroAssembler* masm) { + __ ldr(r1, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); + __ str(r1, MemOperand(r0, Context::SlotOffset(Context::GLOBAL_INDEX))); + ++ // Copy the qml global object from the surrounding context. ++ __ ldr(r1, MemOperand(cp, Context::SlotOffset(Context::QML_GLOBAL_INDEX))); ++ __ str(r1, MemOperand(r0, Context::SlotOffset(Context::QML_GLOBAL_INDEX))); ++ + // Initialize the rest of the slots to undefined. + __ LoadRoot(r1, Heap::kUndefinedValueRootIndex); + for (int i = Context::MIN_CONTEXT_SLOTS; i < length; i++) { +diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc +index 871b453..f132de6 100644 +--- a/src/arm/full-codegen-arm.cc ++++ b/src/arm/full-codegen-arm.cc +@@ -1247,9 +1247,9 @@ void FullCodeGenerator::EmitLoadGlobalSlotCheckExtensions( + __ bind(&fast); + } + +- __ ldr(r0, GlobalObjectOperand()); ++ __ ldr(r0, slot->var()->is_qml_global()?QmlGlobalObjectOperand():GlobalObjectOperand()); + __ mov(r2, Operand(slot->var()->name())); +- RelocInfo::Mode mode = (typeof_state == INSIDE_TYPEOF) ++ RelocInfo::Mode mode = (typeof_state == INSIDE_TYPEOF || slot->var()->is_qml_global()) + ? RelocInfo::CODE_TARGET + : RelocInfo::CODE_TARGET_CONTEXT; + Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); +@@ -1268,10 +1268,10 @@ void FullCodeGenerator::EmitVariableLoad(Variable* var) { + Comment cmnt(masm_, "Global variable"); + // Use inline caching. Variable name is passed in r2 and the global + // object (receiver) in r0. +- __ ldr(r0, GlobalObjectOperand()); ++ __ ldr(r0, var->is_qml_global()?QmlGlobalObjectOperand():GlobalObjectOperand()); + __ mov(r2, Operand(var->name())); + Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); +- EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT); ++ EmitCallIC(ic, var->is_qml_global()?RelocInfo::CODE_TARGET:RelocInfo::CODE_TARGET_CONTEXT); + context()->Plug(r0); + + } else if (slot != NULL && slot->type() == Slot::LOOKUP) { +@@ -1893,11 +1893,11 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, + // assignment. Right-hand-side value is passed in r0, variable name in + // r2, and the global object in r1. + __ mov(r2, Operand(var->name())); +- __ ldr(r1, GlobalObjectOperand()); ++ __ ldr(r1, var->is_qml_global()?QmlGlobalObjectOperand():GlobalObjectOperand()); + Handle<Code> ic = is_strict_mode() + ? isolate()->builtins()->StoreIC_Initialize_Strict() + : isolate()->builtins()->StoreIC_Initialize(); +- EmitCallIC(ic, RelocInfo::CODE_TARGET_CONTEXT); ++ EmitCallIC(ic, var->is_qml_global()?RelocInfo::CODE_TARGET:RelocInfo::CODE_TARGET_CONTEXT); + + } else if (op == Token::INIT_CONST) { + // Like var declarations, const declarations are hoisted to function +@@ -2184,10 +2184,13 @@ void FullCodeGenerator::EmitResolvePossiblyDirectEval(ResolveEvalFlag flag, + // Push the strict mode flag. + __ mov(r1, Operand(Smi::FromInt(strict_mode_flag()))); + __ push(r1); ++ // Push the qml mode flag. ++ __ mov(r1, Operand(Smi::FromInt(is_qml_mode()))); ++ __ push(r1); + + __ CallRuntime(flag == SKIP_CONTEXT_LOOKUP + ? Runtime::kResolvePossiblyDirectEvalNoLookup +- : Runtime::kResolvePossiblyDirectEval, 4); ++ : Runtime::kResolvePossiblyDirectEval, 5); + } + + +@@ -2263,9 +2266,9 @@ void FullCodeGenerator::VisitCall(Call* expr) { + context()->DropAndPlug(1, r0); + } else if (var != NULL && !var->is_this() && var->is_global()) { + // Push global object as receiver for the call IC. +- __ ldr(r0, GlobalObjectOperand()); ++ __ ldr(r0, var->is_qml_global()?QmlGlobalObjectOperand():GlobalObjectOperand()); + __ push(r0); +- EmitCallWithIC(expr, var->name(), RelocInfo::CODE_TARGET_CONTEXT); ++ EmitCallWithIC(expr, var->name(), var->is_qml_global()?RelocInfo::CODE_TARGET:RelocInfo::CODE_TARGET_CONTEXT); + } else if (var != NULL && var->AsSlot() != NULL && + var->AsSlot()->type() == Slot::LOOKUP) { + // Call to a lookup slot (dynamically introduced variable). +diff --git a/src/arm/macro-assembler-arm.h b/src/arm/macro-assembler-arm.h +index ab5efb0..d40cdbc 100644 +--- a/src/arm/macro-assembler-arm.h ++++ b/src/arm/macro-assembler-arm.h +@@ -1056,6 +1056,11 @@ static inline MemOperand GlobalObjectOperand() { + } + + ++static inline MemOperand QmlGlobalObjectOperand() { ++ return ContextOperand(cp, Context::QML_GLOBAL_INDEX); ++} ++ ++ + #ifdef GENERATED_CODE_COVERAGE + #define CODE_COVERAGE_STRINGIFY(x) #x + #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) diff --git a/src/ast-inl.h b/src/ast-inl.h index d80684a..adc5a1f 100644 --- a/src/ast-inl.h @@ -733,7 +837,7 @@ index a205f02..8c0c2d0 100644 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset) diff --git a/src/objects.h b/src/objects.h -index 61685cc..f6549be 100644 +index 439ad1e..918ab61 100644 --- a/src/objects.h +++ b/src/objects.h @@ -4331,6 +4331,10 @@ class SharedFunctionInfo: public HeapObject { diff --git a/src/v8/0006-Allow-access-to-the-calling-script-data.patch b/src/v8/0006-Allow-access-to-the-calling-script-data.patch index 5ce64b779e..7bc2046521 100644 --- a/src/v8/0006-Allow-access-to-the-calling-script-data.patch +++ b/src/v8/0006-Allow-access-to-the-calling-script-data.patch @@ -1,4 +1,4 @@ -From b14d06d5999113a9a546bf045878d6f1a24b9c69 Mon Sep 17 00:00:00 2001 +From 4dc4b08826e198360776eeb3ff40e0ddd811c14b Mon Sep 17 00:00:00 2001 From: Aaron Kennedy <aaron.kennedy@nokia.com> Date: Wed, 25 May 2011 10:36:13 +1000 Subject: [PATCH 6/7] Allow access to the calling script data @@ -9,10 +9,10 @@ Subject: [PATCH 6/7] Allow access to the calling script data 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/include/v8.h b/include/v8.h -index 62715ec..42ddbd9 100644 +index a67feb2..6577a30 100644 --- a/include/v8.h +++ b/include/v8.h -@@ -3309,6 +3309,7 @@ class V8EXPORT Context { +@@ -3312,6 +3312,7 @@ class V8EXPORT Context { */ static Local<Context> GetCalling(); static Local<Object> GetCallingQmlGlobal(); @@ -21,10 +21,10 @@ index 62715ec..42ddbd9 100644 /** * Sets the security token for the context. To access an object in diff --git a/src/api.cc b/src/api.cc -index e2efcaa..4c3c013 100644 +index 2f5898c..ee15573 100644 --- a/src/api.cc +++ b/src/api.cc -@@ -3942,6 +3942,18 @@ v8::Local<v8::Object> Context::GetCallingQmlGlobal() { +@@ -3955,6 +3955,18 @@ v8::Local<v8::Object> Context::GetCallingQmlGlobal() { } } diff --git a/src/v8/0007-Fix-warnings.patch b/src/v8/0007-Fix-warnings.patch index b337e7f727..4f05a0740d 100644 --- a/src/v8/0007-Fix-warnings.patch +++ b/src/v8/0007-Fix-warnings.patch @@ -1,4 +1,4 @@ -From 15eb9c6a9444307a867a854c742505c15bd8b867 Mon Sep 17 00:00:00 2001 +From b16d11e3e614470004b1f80b25c55a8926c9e15e Mon Sep 17 00:00:00 2001 From: Aaron Kennedy <aaron.kennedy@nokia.com> Date: Fri, 27 May 2011 13:04:15 +1000 Subject: [PATCH 7/7] Fix warnings @@ -8,10 +8,10 @@ Subject: [PATCH 7/7] Fix warnings 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/v8.h b/include/v8.h -index 42ddbd9..bc229f9 100644 +index 6577a30..3e1f520 100644 --- a/include/v8.h +++ b/include/v8.h -@@ -2388,7 +2388,7 @@ class V8EXPORT Extension { // NOLINT +@@ -2391,7 +2391,7 @@ class V8EXPORT Extension { // NOLINT const char** deps = 0); virtual ~Extension() { } virtual v8::Handle<v8::FunctionTemplate> @@ -20,7 +20,7 @@ index 42ddbd9..bc229f9 100644 return v8::Handle<v8::FunctionTemplate>(); } -@@ -3694,13 +3694,13 @@ class Internals { +@@ -3697,13 +3697,13 @@ class Internals { return *reinterpret_cast<T*>(addr); } |