Update our V8
authorKent Hansen <kent.hansen@nokia.com>
Tue, 30 Aug 2011 11:36:52 +0000 (13:36 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 2 Sep 2011 12:11:41 +0000 (14:11 +0200)
Change-Id: I8925815c068d697999955c45de9f0736ad31ed56
Reviewed-on: http://codereview.qt.nokia.com/3880
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
17 files changed:
src/3rdparty/v8
src/v8/0001-Add-hashing-and-comparison-methods-to-v8-String.patch
src/v8/0002-Add-a-bit-field-3-to-Map.patch
src/v8/0003-Add-a-fallback-mode-for-named-property-interceptors.patch
src/v8/0004-Generalize-external-object-resources.patch
src/v8/0005-Introduce-a-QML-compilation-mode.patch
src/v8/0006-Allow-access-to-the-calling-script-data.patch
src/v8/0007-Fix-warnings.patch
src/v8/0008-Add-custom-object-compare-callback.patch
src/v8/0009-Add-CallAsFunction-method-to-the-Object-class-in-the.patch
src/v8/0010-Implement-CallAsConstructor-method-for-Object-in-the.patch
src/v8/0011-QtScript-V8-Add-new-v8-api-to-check-if-a-value-is-an.patch
src/v8/0012-Add-IsCallable-method-for-Object-in-the-API.patch
src/v8/0013-Remove-execute-flag-from-v8-debug.h.patch
src/v8/0014-Fix-build-error-suggest-parentheses-around-within.patch [new file with mode: 0644]
src/v8/0015-Fix-source-compatibility-where-the-String-Equals-ove.patch [new file with mode: 0644]
src/v8/0016-Fix-deprecated-Python-code.patch [new file with mode: 0644]

index dc2cad4..97cb46d 160000 (submodule)
@@ -1 +1 @@
-Subproject commit dc2cad4f8fc88c52fcea09b8d0262d35cd32dc44
+Subproject commit 97cb46d421faebd2b139570bcf9aaf2d5eadc333
index 54a35fd..4ec44e3 100644 (file)
@@ -1,7 +1,7 @@
 From e13ce09287a56c920d5ffdc5d4662d49f1838f16 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 01/13] Add hashing and comparison methods to v8::String
+Subject: [PATCH 01/16] Add hashing and comparison methods to v8::String
 
 This allows us to more rapidly search for a v8::String inside
 a hash of QStrings.
@@ -339,5 +339,5 @@ index e966b3d..6e26f57 100644
 
    // Maximal memory usage for a single sequential two-byte string.
 --
-1.7.2.3
+1.7.6
 
index dda9fa0..4b21317 100644 (file)
@@ -1,7 +1,7 @@
 From 7c9cfff80b7864d5687432d424074e51712c4a07 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 02/13] Add a bit field 3 to Map
+Subject: [PATCH 02/16] Add a bit field 3 to Map
 
 Bit field 3 will be used to add QML specific map flags.
 ---
@@ -114,5 +114,5 @@ index 6e26f57..07e1089 100644
    static const int kCodeCacheEntrySize = 2;
    static const int kCodeCacheEntryNameOffset = 0;
 --
-1.7.2.3
+1.7.6
 
index 50f97c7..27529ff 100644 (file)
@@ -1,7 +1,7 @@
 From ae8688b53d67044f2c9b0cce25fc282b078610c1 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 03/13] Add a "fallback" mode for named property interceptors
+Subject: [PATCH 03/16] Add a "fallback" mode for named property interceptors
 
 By default interceptors are called before the normal property
 resolution on objects.  When an interceptor is installed as a
@@ -360,5 +360,5 @@ index 7335da8..660352c 100644
    return isolate->heap()->undefined_value();
  }
 --
-1.7.2.3
+1.7.6
 
index f44e7b2..a05aad0 100644 (file)
@@ -1,7 +1,7 @@
 From 4827116b12c50f6662794017c5a662b5dbb2da0b 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 04/13] Generalize external object resources
+Subject: [PATCH 04/16] Generalize external object resources
 
 V8 was already able to manage and finalize an external string
 resource.  This change generalizes that mechanism to handle a
@@ -890,5 +890,5 @@ index a209cd0..1bdb5c7 100644
 
 
 --
-1.7.2.3
+1.7.6
 
index b464e61..3c1cab2 100644 (file)
@@ -1,7 +1,7 @@
 From fd7d475e298e5b63cd6383c78cc900635c82aa38 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 05/13] Introduce a QML compilation mode
+Subject: [PATCH 05/16] 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
@@ -1773,5 +1773,5 @@ index 4c17720..aa284ed 100644
  static inline Operand StackSpaceOperand(int index) {
  #ifdef _WIN64
 --
-1.7.2.3
+1.7.6
 
index d4acdf7..50529d6 100644 (file)
@@ -1,7 +1,7 @@
 From f890f0d1a1e5bd62711815489c87755a4f382436 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 06/13] Allow access to the calling script data
+Subject: [PATCH 06/16] Allow access to the calling script data
 
 ---
  include/v8.h |    1 +
@@ -44,5 +44,5 @@ index 39767f4..ff74efb 100644
  v8::Local<v8::Object> Context::Global() {
    if (IsDeadCheck(i::Isolate::Current(), "v8::Context::Global()")) {
 --
-1.7.2.3
+1.7.6
 
index 26141c8..fe6fa59 100644 (file)
@@ -1,7 +1,7 @@
 From dac5d9db84cf20564621c679937ca7b9c6a8e880 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 07/13] Fix warnings
+Subject: [PATCH 07/16] Fix warnings
 
 ---
  include/v8.h |   16 ++++++++--------
@@ -42,5 +42,5 @@ index 9aba4a8..8891dab 100644
 
  }  // namespace internal
 --
-1.7.2.3
+1.7.6
 
index d7ef5c4..a697396 100644 (file)
@@ -1,7 +1,7 @@
 From bec11b8b7f89d135e7d9a823ac4fe98c70d017cf Mon Sep 17 00:00:00 2001
 From: Aaron Kennedy <aaron.kennedy@nokia.com>
 Date: Mon, 27 Jun 2011 14:57:28 +1000
-Subject: [PATCH 08/13] Add custom object compare callback
+Subject: [PATCH 08/16] Add custom object compare callback
 
 A global custom object comparison callback can be set with:
     V8::SetUserObjectComparisonCallbackFunction()
@@ -485,5 +485,5 @@ index d923494..10b9b56 100644
    ASSERT(GetCondition() == equal);
    __ subq(rax, rdx);
 --
-1.7.2.3
+1.7.6
 
index d197ac9..2421613 100644 (file)
@@ -1,7 +1,8 @@
 From 4183b973ed3bd603784c798dfa63ba48f6b68003 Mon Sep 17 00:00:00 2001
-From: ager@chromium.org <ager@chromium.org>
+From: "ager@chromium.org" <ager@chromium.org>
 Date: Wed, 4 May 2011 13:03:08 +0000
-Subject: [PATCH 09/13] Add CallAsFunction method to the Object class in the API
+Subject: [PATCH 09/16] Add CallAsFunction method to the Object class in the
+ API
 
 Patch by Peter Varga.
 
@@ -282,5 +283,5 @@ index d7621d1..693d51e 100644
 
 
 --
-1.7.2.3
+1.7.6
 
index cb4dd18..ea3802b 100644 (file)
@@ -1,7 +1,8 @@
 From 3d6d4249878f7960eac4c9c94e0f2529f9a58c4a Mon Sep 17 00:00:00 2001
-From: ager@chromium.org <ager@chromium.org>
+From: "ager@chromium.org" <ager@chromium.org>
 Date: Fri, 6 May 2011 11:07:52 +0000
-Subject: [PATCH 10/13] Implement CallAsConstructor method for Object in the API
+Subject: [PATCH 10/16] Implement CallAsConstructor method for Object in the
+ API
 
 Patch by Peter Varga.
 
@@ -393,5 +394,5 @@ index 693d51e..1334f63 100644
    }
  }
 --
-1.7.2.3
+1.7.6
 
index 9c0e683..aefcae5 100644 (file)
@@ -1,7 +1,8 @@
 From f22d0312faeb93ced8747d9aae8c6d77e11b4aba Mon Sep 17 00:00:00 2001
 From: Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
 Date: Tue, 7 Dec 2010 11:56:42 +0100
-Subject: [PATCH 11/13] QtScript/V8: Add new v8 api to check if a value is an error.
+Subject: [PATCH 11/16] QtScript/V8: Add new v8 api to check if a value is an
+ error.
 
 New function v8::Value::IsError was created.
 
@@ -59,5 +60,5 @@ index 8cbf378..db90bb9 100644
    V(to_string_symbol, "toString")                                        \
    V(char_at_symbol, "CharAt")                                            \
 --
-1.7.2.3
+1.7.6
 
index 77589c8..426458d 100644 (file)
@@ -1,7 +1,8 @@
 From 472c04c9e7a64e8734c76d2cf97a7cc5b773b788 Mon Sep 17 00:00:00 2001
-From: ager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
+From: "ager@chromium.org"
+ <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
 Date: Mon, 9 May 2011 15:24:48 +0000
-Subject: [PATCH 12/13] Add IsCallable method for Object in the API
+Subject: [PATCH 12/16] Add IsCallable method for Object in the API
 
 Patch by Peter Varga.
 
@@ -112,5 +113,5 @@ index 1334f63..45db5a1 100644
    return v8::HandleScope::NumberOfHandles();
  }
 --
-1.7.2.3
+1.7.6
 
index 6bad561..f73785d 100644 (file)
@@ -1,7 +1,7 @@
 From dc2cad4f8fc88c52fcea09b8d0262d35cd32dc44 Mon Sep 17 00:00:00 2001
 From: Aaron Kennedy <aaron.kennedy@nokia.com>
 Date: Thu, 25 Aug 2011 11:09:58 +1000
-Subject: [PATCH 13/13] Remove execute flag from v8-debug.h
+Subject: [PATCH 13/16] Remove execute flag from v8-debug.h
 
 ---
  0 files changed, 0 insertions(+), 0 deletions(-)
@@ -11,5 +11,5 @@ diff --git a/include/v8-debug.h b/include/v8-debug.h
 old mode 100755
 new mode 100644
 --
-1.7.2.3
+1.7.6
 
diff --git a/src/v8/0014-Fix-build-error-suggest-parentheses-around-within.patch b/src/v8/0014-Fix-build-error-suggest-parentheses-around-within.patch
new file mode 100644 (file)
index 0000000..bb26b14
--- /dev/null
@@ -0,0 +1,25 @@
+From d7e876decc00c611d327185bf890a7efecb2cf7e Mon Sep 17 00:00:00 2001
+From: Kent Hansen <kent.hansen@nokia.com>
+Date: Mon, 29 Aug 2011 13:26:13 +0200
+Subject: [PATCH 14/16] Fix build error: "suggest parentheses around '&&'
+ within '||'"
+
+---
+ src/mark-compact.cc |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/mark-compact.cc b/src/mark-compact.cc
+index 1b1e361..775f787 100644
+--- a/src/mark-compact.cc
++++ b/src/mark-compact.cc
+@@ -1020,7 +1020,7 @@ class SymbolTableCleaner : public ObjectVisitor {
+         // Since no objects have yet been moved we can safely access the map of
+         // the object.
+         if ((*p)->IsExternalString() ||
+-            (*p)->IsHeapObject() && HeapObject::cast(*p)->map()->has_external_resource()) {
++            ((*p)->IsHeapObject() && HeapObject::cast(*p)->map()->has_external_resource())) {
+           heap_->FinalizeExternalString(HeapObject::cast(*p));
+         }
+         // Set the entry to null_value (as deleted).
+--
+1.7.6
diff --git a/src/v8/0015-Fix-source-compatibility-where-the-String-Equals-ove.patch b/src/v8/0015-Fix-source-compatibility-where-the-String-Equals-ove.patch
new file mode 100644 (file)
index 0000000..003c430
--- /dev/null
@@ -0,0 +1,25 @@
+From 0af1e15a3d6b28923c262a02a5ace35812c8f5d6 Mon Sep 17 00:00:00 2001
+From: Simon Hausmann <simon.hausmann@nokia.com>
+Date: Thu, 4 Aug 2011 21:28:38 +0200
+Subject: [PATCH 15/16] Fix source compatibility where the String::Equals
+ overloads would shadow the Value::Equals function,
+ breaking the build.
+
+---
+ include/v8.h |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/include/v8.h b/include/v8.h
+index 4194d4a..5e1ce50 100644
+--- a/include/v8.h
++++ b/include/v8.h
+@@ -1048,6 +1048,7 @@ class String : public Primitive {
+    */
+   V8EXPORT bool Equals(uint16_t *string, int length);
+   V8EXPORT bool Equals(char *string, int length);
++  inline bool Equals(Handle<Value> that) const { return v8::Value::Equals(that); }
+
+   /**
+    * Write the contents of the string to an external buffer.
+--
+1.7.6
diff --git a/src/v8/0016-Fix-deprecated-Python-code.patch b/src/v8/0016-Fix-deprecated-Python-code.patch
new file mode 100644 (file)
index 0000000..4ecf8d7
--- /dev/null
@@ -0,0 +1,50 @@
+From 97cb46d421faebd2b139570bcf9aaf2d5eadc333 Mon Sep 17 00:00:00 2001
+From: Kent Hansen <kent.hansen@nokia.com>
+Date: Fri, 2 Sep 2011 12:03:09 +0200
+Subject: [PATCH 16/16] Fix deprecated Python code
+
+Needed to make the scripts run on Python 3, which is the
+default python interpreter on some newer distros.
+
+Patch from http://code.google.com/p/v8/issues/detail?id=1391
+---
+ tools/js2c.py  |    4 ++--
+ tools/jsmin.py |    2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tools/js2c.py b/tools/js2c.py
+index 2da132f..d13d53d 100755
+--- a/tools/js2c.py
++++ b/tools/js2c.py
+@@ -187,14 +187,14 @@ def ReadMacros(lines):
+       macro_match = MACRO_PATTERN.match(line)
+       if macro_match:
+         name = macro_match.group(1)
+-        args = map(string.strip, macro_match.group(2).split(','))
++        args = args = [match.strip() for match in macro_match.group(2).split(',')]
+         body = macro_match.group(3).strip()
+         macros.append((re.compile("\\b%s\\(" % name), TextMacro(args, body)))
+       else:
+         python_match = PYTHON_MACRO_PATTERN.match(line)
+         if python_match:
+           name = python_match.group(1)
+-          args = map(string.strip, python_match.group(2).split(','))
++          args = [match.strip() for match in python_match.group(2).split(',')]
+           body = python_match.group(3).strip()
+           fun = eval("lambda " + ",".join(args) + ': ' + body)
+           macros.append((re.compile("\\b%s\\(" % name), PythonMacro(args, fun)))
+diff --git a/tools/jsmin.py b/tools/jsmin.py
+index 646bf14..395441b 100644
+--- a/tools/jsmin.py
++++ b/tools/jsmin.py
+@@ -154,7 +154,7 @@ class JavaScriptMinifier(object):
+       return var_name
+     while True:
+       identifier_first_char = self.identifier_counter % 52
+-      identifier_second_char = self.identifier_counter / 52
++      identifier_second_char = self.identifier_counter // 52
+       new_identifier = self.CharFromNumber(identifier_first_char)
+       if identifier_second_char != 0:
+         new_identifier = (
+--
+1.7.6