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

Side by Side Diff: src/string.js

Issue 385004: Remove sliced string string type... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-strings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // otherwise we call the runtime system. 173 // otherwise we call the runtime system.
174 function SubString(string, start, end) { 174 function SubString(string, start, end) {
175 // Use the one character string cache. 175 // Use the one character string cache.
176 if (start + 1 == end) { 176 if (start + 1 == end) {
177 var char_code = %_FastCharCodeAt(string, start); 177 var char_code = %_FastCharCodeAt(string, start);
178 if (!%_IsSmi(char_code)) { 178 if (!%_IsSmi(char_code)) {
179 char_code = %StringCharCodeAt(string, start); 179 char_code = %StringCharCodeAt(string, start);
180 } 180 }
181 return %CharFromCode(char_code); 181 return %CharFromCode(char_code);
182 } 182 }
183 return %StringSlice(string, start, end); 183 return %SubString(string, start, end);
184 } 184 }
185 185
186 186
187 // This has the same size as the lastMatchInfo array, and can be used for 187 // This has the same size as the lastMatchInfo array, and can be used for
188 // functions that expect that structure to be returned. It is used when the 188 // functions that expect that structure to be returned. It is used when the
189 // needle is a string rather than a regexp. In this case we can't update 189 // needle is a string rather than a regexp. In this case we can't update
190 // lastMatchArray without erroneously affecting the properties on the global 190 // lastMatchArray without erroneously affecting the properties on the global
191 // RegExp object. 191 // RegExp object.
192 var reusableMatchInfo = [2, "", "", -1, -1]; 192 var reusableMatchInfo = [2, "", "", -1, -1];
193 193
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 "small", StringSmall, 892 "small", StringSmall,
893 "strike", StringStrike, 893 "strike", StringStrike,
894 "sub", StringSub, 894 "sub", StringSub,
895 "sup", StringSup, 895 "sup", StringSup,
896 "toJSON", StringToJSON 896 "toJSON", StringToJSON
897 )); 897 ));
898 } 898 }
899 899
900 900
901 SetupString(); 901 SetupString();
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-strings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698