Title: [100208] trunk/Source/_javascript_Core
Revision
100208
Author
msab...@apple.com
Date
2011-11-14 16:16:59 -0800 (Mon, 14 Nov 2011)

Log Message

Further changes and cleanup to JSString.h and cpp.

Reviewed by Darin Adler.

* runtime/JSString.cpp:
(JSC::JSString::resolveRope): Change PassRefPtr to RefPtr.  Eliminated exec in slow case calls.
(JSC::JSString::resolveRopeSlowCase8): Darin and I agreed that this should have 8 in name.
(JSC::JSString::resolveRopeSlowCase): Removed exec parameter.
* runtime/JSString.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (100207 => 100208)


--- trunk/Source/_javascript_Core/ChangeLog	2011-11-15 00:12:56 UTC (rev 100207)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-11-15 00:16:59 UTC (rev 100208)
@@ -1,3 +1,15 @@
+2011-11-14  Michael Saboff  <msab...@apple.com>
+
+        Further changes and cleanup to JSString.h and cpp.
+
+        Reviewed by Darin Adler.
+
+        * runtime/JSString.cpp:
+        (JSC::JSString::resolveRope): Change PassRefPtr to RefPtr.  Eliminated exec in slow case calls.
+        (JSC::JSString::resolveRopeSlowCase8): Darin and I agreed that this should have 8 in name.
+        (JSC::JSString::resolveRopeSlowCase): Removed exec parameter.
+        * runtime/JSString.h:
+
 2011-11-14  Adam Barth  <aba...@webkit.org>
 
         DateMath.cpp should not depend on _javascript_Core

Modified: trunk/Source/_javascript_Core/runtime/JSString.cpp (100207 => 100208)


--- trunk/Source/_javascript_Core/runtime/JSString.cpp	2011-11-15 00:12:56 UTC (rev 100207)
+++ trunk/Source/_javascript_Core/runtime/JSString.cpp	2011-11-15 00:16:59 UTC (rev 100208)
@@ -64,8 +64,8 @@
 
     if (is8Bit()) {
         LChar* buffer;
-        if (PassRefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer))
-            m_value = newImpl;
+        if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer))
+            m_value = newImpl.release();
         else {
             outOfMemory(exec);
             return;
@@ -73,7 +73,7 @@
 
         for (size_t i = 0; i < s_maxInternalRopeLength && m_fibers[i]; ++i) {
             if (m_fibers[i]->isRope())
-                return resolveRopeSlowCase(exec, buffer);
+                return resolveRopeSlowCase8(buffer);
         }
 
         LChar* position = buffer;
@@ -91,8 +91,8 @@
     }
 
     UChar* buffer;
-    if (PassRefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer))
-        m_value = newImpl;
+    if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer))
+        m_value = newImpl.release();
     else {
         outOfMemory(exec);
         return;
@@ -100,7 +100,7 @@
 
     for (size_t i = 0; i < s_maxInternalRopeLength && m_fibers[i]; ++i) {
         if (m_fibers[i]->isRope())
-            return resolveRopeSlowCase(exec, buffer);
+            return resolveRopeSlowCase(buffer);
     }
 
     UChar* position = buffer;
@@ -125,10 +125,8 @@
 // Vector before performing any concatenation, but by working backwards we likely
 // only fill the queue with the number of substrings at any given level in a
 // rope-of-ropes.)    
-void JSString::resolveRopeSlowCase(ExecState* exec, LChar* buffer) const
+void JSString::resolveRopeSlowCase8(LChar* buffer) const
 {
-    UNUSED_PARAM(exec);
-
     LChar* position = buffer + m_length; // We will be working backwards over the rope.
     Vector<JSString*, 32> workQueue; // Putting strings into a Vector is only OK because there are no GC points in this method.
     
@@ -158,10 +156,8 @@
     ASSERT(!isRope());
 }
 
-void JSString::resolveRopeSlowCase(ExecState* exec, UChar* buffer) const
+void JSString::resolveRopeSlowCase(UChar* buffer) const
 {
-    UNUSED_PARAM(exec);
-
     UChar* position = buffer + m_length; // We will be working backwards over the rope.
     Vector<JSString*, 32> workQueue; // These strings are kept alive by the parent rope, so using a Vector is OK.
 

Modified: trunk/Source/_javascript_Core/runtime/JSString.h (100207 => 100208)


--- trunk/Source/_javascript_Core/runtime/JSString.h	2011-11-15 00:12:56 UTC (rev 100207)
+++ trunk/Source/_javascript_Core/runtime/JSString.h	2011-11-15 00:16:59 UTC (rev 100208)
@@ -248,8 +248,8 @@
         }
 
         void resolveRope(ExecState*) const;
-        void resolveRopeSlowCase(ExecState*, LChar*) const;
-        void resolveRopeSlowCase(ExecState*, UChar*) const;
+        void resolveRopeSlowCase8(LChar*) const;
+        void resolveRopeSlowCase(UChar*) const;
         void outOfMemory(ExecState*) const;
 
         static JSObject* toThisObject(JSCell*, ExecState*);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to