Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(942)

Unified Diff: test/mjsunit/thin-strings.js

Issue 2625073002: Revert of Internalize strings in-place (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-strings.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/thin-strings.js
diff --git a/test/mjsunit/thin-strings.js b/test/mjsunit/thin-strings.js
deleted file mode 100644
index 23c30e628a2b0b46ad7322753cc42fd542248e01..0000000000000000000000000000000000000000
--- a/test/mjsunit/thin-strings.js
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2016 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --allow-natives-syntax
-
-function get_thin_string(a, b) {
- var str = a + b; // Make a ConsString.
- var o = {};
- o[str]; // Turn it into a ThinString.
- return str;
-}
-
-var str = get_thin_string("foo", "bar");
-
-var re = /.o+ba./;
-assertEquals(["foobar"], re.exec(str));
-assertEquals(["foobar"], re.exec(str));
-assertEquals(["foobar"], re.exec(str));
-
-function CheckCS() {
- assertEquals("o", str.substring(1, 2));
- assertEquals("f".charCodeAt(0), str.charCodeAt(0));
- assertEquals("f", str.split(/oo/)[0]);
-}
-CheckCS();
-%OptimizeFunctionOnNextCall(CheckCS);
-CheckCS();
-
-function CheckTF() {
- try {} catch(e) {} // Turbofan.
- assertEquals("o", str.substring(1, 2));
- assertEquals("f".charCodeAt(0), str.charCodeAt(0));
- assertEquals("f", str.split(/oo/)[0]);
-}
-CheckTF();
-%OptimizeFunctionOnNextCall(CheckTF);
-CheckTF();
-
-// Flat cons strings can point to a thin string.
-
-function get_cons_thin_string(a, b) {
- // Make a ConsString.
- var s = a + b;
- // Flatten it.
- s.endsWith("a");
- // Internalize the first part.
- var o = {};
- o[s];
- return s;
-}
-
-var s = get_cons_thin_string("__________", "@@@@@@@@@@a");
-s.match(/.*a/);
-assertEquals("________", s.substring(0, 8));
-
-// Sliced strings can have a thin string as their parent.
-
-function get_sliced_thin_string(a, b) {
- // Make a long thin string.
- var s = a + b;
- // Slice a substring out of it.
- var slice = s.substring(0, 20);
- // Make the original string thin.
- var o = {};
- o[s];
- return slice;
-}
-
-var t = get_sliced_thin_string("abcdefghijklmnopqrstuvwxyz",
- "abcdefghijklmnopqrstuvwxyz");
-assertEquals("abcdefghijklmnopqrst", decodeURI(t));
« no previous file with comments | « test/cctest/test-strings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698