Revision: 15200
Author:   [email protected]
Date:     Wed Jun 19 01:59:56 2013
Log:      Removed ReplaceResultBuilder.

Most of its code was dead, and the remaining part was a simple
one-liner, which is now inlined at its single call-site.

[email protected]

Review URL: https://codereview.chromium.org/17101021
http://code.google.com/p/v8/source/detail?r=15200

Modified:
 /branches/bleeding_edge/src/string.js

=======================================
--- /branches/bleeding_edge/src/string.js       Fri May 10 06:50:10 2013
+++ /branches/bleeding_edge/src/string.js       Wed Jun 19 01:59:56 2013
@@ -495,8 +495,7 @@
       }
     }
   }
-  var resultBuilder = new ReplaceResultBuilder(subject, res);
-  var result = resultBuilder.generate();
+  var result = %StringBuilderConcat(res, res.length, subject);
   resultArray.length = 0;
   reusableReplaceArray = resultArray;
   return result;
@@ -949,43 +948,6 @@
 function StringSup() {
   return "<sup>" + this + "</sup>";
 }
-
-
-// ReplaceResultBuilder support.
-function ReplaceResultBuilder(str) {
-  if (%_ArgumentsLength() > 1) {
-    this.elements = %_Arguments(1);
-  } else {
-    this.elements = new InternalArray();
-  }
-  this.special_string = str;
-}
-
-SetUpLockedPrototype(ReplaceResultBuilder,
-  $Array("elements", "special_string"), $Array(
-  "add", function(str) {
-    str = TO_STRING_INLINE(str);
-    if (str.length > 0) this.elements.push(str);
-  },
-  "addSpecialSlice", function(start, end) {
-    var len = end - start;
-    if (start < 0 || len <= 0) return;
-    if (start < 0x80000 && len < 0x800) {
-      this.elements.push((start << 11) | len);
-    } else {
- // 0 < len <= String::kMaxLength and Smi::kMaxValue >= String::kMaxLength,
-      // so -len is a smi.
-      var elements = this.elements;
-      elements.push(-len);
-      elements.push(start);
-    }
-  },
-  "generate", function() {
-    var elements = this.elements;
- return %StringBuilderConcat(elements, elements.length, this.special_string);
-  }
-));
-

 // -------------------------------------------------------------------

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to