patches/webkit-23-name-union.diff
author jurikm
Sun, 12 Feb 2012 14:04:10 +0000
changeset 8245 383896da4129
parent 2664 7c14eb67b3de
permissions -rw-r--r--
SFEsauerbraten.spec: add IPS package name
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2650
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
     1
diff -r 3bdbc1d2a0a3 JavaScriptCore/runtime/JSString.h
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
     2
--- a/JavaScriptCore/runtime/JSString.h	Tue Mar 23 16:41:06 2010 +0800
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
     3
+++ b/JavaScriptCore/runtime/JSString.h	Tue Mar 23 18:49:11 2010 +0800
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
     4
@@ -139,7 +139,7 @@
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
     5
             , m_length(rope->length())
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
     6
             , m_fiberCount(1)
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
     7
         {
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
     8
-            m_other.m_fibers[0] = rope.releaseRef();
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
     9
+            m_other.m_union.m_fibers[0] = rope.releaseRef();
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    10
         }
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    11
         // This constructor constructs a new string by concatenating s1 & s2.
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    12
         // This should only be called with fiberCount <= 3.
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    13
@@ -203,8 +203,8 @@
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    14
             , m_fiberCount(0)
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    15
         {
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    16
             // nasty hack because we can't union non-POD types
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    17
-            m_other.m_finalizerCallback = finalizer;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    18
-            m_other.m_finalizerContext = context;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    19
+            m_other.m_union.m_struct.m_finalizerCallback = finalizer;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    20
+            m_other.m_union.m_struct.m_finalizerContext = context;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    21
             Heap::heap(this)->reportExtraMemoryCost(value.cost());
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    22
         }
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    23
 
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    24
@@ -212,10 +212,10 @@
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    25
         {
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    26
             ASSERT(vptr() == JSGlobalData::jsStringVPtr);
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    27
             for (unsigned i = 0; i < m_fiberCount; ++i)
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    28
-                m_other.m_fibers[i]->deref();
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    29
+                m_other.m_union.m_fibers[i]->deref();
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    30
 
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    31
-            if (!m_fiberCount && m_other.m_finalizerCallback)
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    32
-                m_other.m_finalizerCallback(this, m_other.m_finalizerContext);
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    33
+            if (!m_fiberCount && m_other.m_union.m_struct.m_finalizerCallback)
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    34
+                m_other.m_union.m_struct.m_finalizerCallback(this, m_other.m_union.m_struct.m_finalizerContext);
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    35
         }
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    36
 
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    37
         const UString& value(ExecState* exec) const
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    38
@@ -256,16 +256,16 @@
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    39
         {
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    40
             UStringImpl* impl = string.rep();
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    41
             impl->ref();
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    42
-            m_other.m_fibers[index++] = impl;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    43
+            m_other.m_union.m_fibers[index++] = impl;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    44
         }
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    45
 
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    46
         void appendStringInConstruct(unsigned& index, JSString* jsString)
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    47
         {
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    48
             if (jsString->isRope()) {
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    49
                 for (unsigned i = 0; i < jsString->m_fiberCount; ++i) {
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    50
-                    Rope::Fiber fiber = jsString->m_other.m_fibers[i];
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    51
+                    Rope::Fiber fiber = jsString->m_other.m_union.m_fibers[i];
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    52
                     fiber->ref();
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    53
-                    m_other.m_fibers[index++] = fiber;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    54
+                    m_other.m_union.m_fibers[index++] = fiber;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    55
                 }
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    56
             } else
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    57
                 appendStringInConstruct(index, jsString->string());
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    58
@@ -283,7 +283,7 @@
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    59
                 UString u(v.toString(exec));
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    60
                 UStringImpl* impl = u.rep();
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    61
                 impl->ref();
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    62
-                m_other.m_fibers[index++] = impl;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    63
+                m_other.m_union.m_fibers[index++] = impl;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    64
                 m_length += u.size();
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    65
             }
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    66
         }
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    67
@@ -312,14 +312,14 @@
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    68
         mutable unsigned m_fiberCount;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    69
         // This structure exists to support a temporary workaround for a GC issue.
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    70
         struct JSStringFinalizerStruct {
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    71
-            JSStringFinalizerStruct() : m_finalizerCallback(0) {}
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    72
+            //JSStringFinalizerStruct() : JSStringFinalizerStructUnion::JSStringFinalizerStructInner::m_finalizerCallback(0) {}
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    73
             union {
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    74
                 mutable Rope::Fiber m_fibers[s_maxInternalRopeLength];
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    75
                 struct {
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    76
                     JSStringFinalizerCallback m_finalizerCallback;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    77
                     void* m_finalizerContext;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    78
-                };
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    79
-            };
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    80
+                } m_struct;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    81
+            } m_union;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    82
         } m_other;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    83
 
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    84
         bool isRope() const { return m_fiberCount; }
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    85
diff -r d743efab4cb5 JavaScriptCore/runtime/JSString.cpp
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    86
--- a/JavaScriptCore/runtime/JSString.cpp	Wed Mar 24 18:16:39 2010 +0800
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    87
+++ b/JavaScriptCore/runtime/JSString.cpp	Wed Mar 24 20:26:23 2010 +0800
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    88
@@ -51,8 +51,8 @@
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    89
         m_value = newImpl;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    90
     else {
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    91
         for (unsigned i = 0; i < m_fiberCount; ++i) {
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    92
-            m_other.m_fibers[i]->deref();
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    93
-            m_other.m_fibers[i] = 0;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    94
+            m_other.m_union.m_fibers[i]->deref();
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    95
+            m_other.m_union.m_fibers[i] = 0;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    96
         }
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    97
         m_fiberCount = 0;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    98
         ASSERT(!isRope());
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
    99
@@ -66,8 +66,8 @@
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   100
     Vector<Rope::Fiber, 32> workQueue;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   101
     Rope::Fiber currentFiber;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   102
     for (unsigned i = 0; i < (m_fiberCount - 1); ++i)
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   103
-        workQueue.append(m_other.m_fibers[i]);
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   104
-    currentFiber = m_other.m_fibers[m_fiberCount - 1];
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   105
+        workQueue.append(m_other.m_union.m_fibers[i]);
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   106
+    currentFiber = m_other.m_union.m_fibers[m_fiberCount - 1];
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   107
     while (true) {
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   108
         if (currentFiber->isRope()) {
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   109
             Rope* rope = static_cast<URopeImpl*>(currentFiber);
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   110
@@ -88,8 +88,8 @@
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   111
                 // Create a string from the UChar buffer, clear the rope RefPtr.
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   112
                 ASSERT(buffer == position);
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   113
                 for (unsigned i = 0; i < m_fiberCount; ++i) {
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   114
-                    m_other.m_fibers[i]->deref();
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   115
-                    m_other.m_fibers[i] = 0;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   116
+                    m_other.m_union.m_fibers[i]->deref();
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   117
+                    m_other.m_union.m_fibers[i] = 0;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   118
                 }
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   119
                 m_fiberCount = 0;
901d2088a9b2 Bump webkit to 1.1.90
simonjin
parents:
diff changeset
   120
 
2664
7c14eb67b3de polish patches
simonjin
parents: 2650
diff changeset
   121
diff -r d2a07bdc6744 JavaScriptCore/runtime/JSString.h
7c14eb67b3de polish patches
simonjin
parents: 2650
diff changeset
   122
--- a/JavaScriptCore/runtime/JSString.h	Tue May 18 19:09:56 2010 +0800
7c14eb67b3de polish patches
simonjin
parents: 2650
diff changeset
   123
+++ b/JavaScriptCore/runtime/JSString.h	Tue May 18 20:11:12 2010 +0800
7c14eb67b3de polish patches
simonjin
parents: 2650
diff changeset
   124
@@ -92,7 +92,7 @@
7c14eb67b3de polish patches
simonjin
parents: 2650
diff changeset
   125
             {
7c14eb67b3de polish patches
simonjin
parents: 2650
diff changeset
   126
                 if (jsString->isRope()) {
7c14eb67b3de polish patches
simonjin
parents: 2650
diff changeset
   127
                     for (unsigned i = 0; i < jsString->m_fiberCount; ++i)
7c14eb67b3de polish patches
simonjin
parents: 2650
diff changeset
   128
-                        append(jsString->m_other.m_fibers[i]);
7c14eb67b3de polish patches
simonjin
parents: 2650
diff changeset
   129
+                        append(jsString->m_other.m_union.m_fibers[i]);
7c14eb67b3de polish patches
simonjin
parents: 2650
diff changeset
   130
                 } else
7c14eb67b3de polish patches
simonjin
parents: 2650
diff changeset
   131
                     append(jsString->string());
7c14eb67b3de polish patches
simonjin
parents: 2650
diff changeset
   132
             }