Revision: 20999
Author:   yang...@chromium.org
Date:     Mon Apr 28 07:18:53 2014 UTC
Log:      Version 3.25.28.15 (merged r20882)

Do not avoid flattening cons string when creating a string slice.

BUG=364656
LOG=N
R=u...@chromium.org

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

Modified:
 /branches/3.25/src/factory.cc
 /branches/3.25/src/version.cc

=======================================
--- /branches/3.25/src/factory.cc       Wed Mar 26 01:04:35 2014 UTC
+++ /branches/3.25/src/factory.cc       Mon Apr 28 07:18:53 2014 UTC
@@ -480,6 +480,8 @@
 #endif
   ASSERT(begin > 0 || end < str->length());

+  str = FlattenGetString(str);
+
   int length = end - begin;
   if (length <= 0) return empty_string();
   if (length == 1) {
@@ -514,28 +516,10 @@

   int offset = begin;

-  while (str->IsConsString()) {
-    Handle<ConsString> cons = Handle<ConsString>::cast(str);
-    int split = cons->first()->length();
-    if (split <= offset) {
-      // Slice is fully contained in the second part.
-      str = Handle<String>(cons->second(), isolate());
-      offset -= split;  // Adjust for offset.
-      continue;
-    } else if (offset + length <= split) {
-      // Slice is fully contained in the first part.
-      str = Handle<String>(cons->first(), isolate());
-      continue;
-    }
-    break;
-  }
-
   if (str->IsSlicedString()) {
     Handle<SlicedString> slice = Handle<SlicedString>::cast(str);
     str = Handle<String>(slice->parent(), isolate());
     offset += slice->offset();
-  } else {
-    str = FlattenGetString(str);
   }

   ASSERT(str->IsSeqString() || str->IsExternalString());
=======================================
--- /branches/3.25/src/version.cc       Wed Apr 23 12:19:54 2014 UTC
+++ /branches/3.25/src/version.cc       Mon Apr 28 07:18:53 2014 UTC
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     25
 #define BUILD_NUMBER      28
-#define PATCH_LEVEL       14
+#define PATCH_LEVEL       15
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0

--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to