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

Side by Side Diff: src/string.js

Issue 7540025: Merge regexp codeflushing (r8532+r8560) to the 3.3 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.3/
Patch Set: '' Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/regexp.js ('k') | src/version.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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 builder.addSpecialSlice(end, subject.length); 267 builder.addSpecialSlice(end, subject.length);
268 268
269 return builder.generate(); 269 return builder.generate();
270 } 270 }
271 271
272 272
273 // Expand the $-expressions in the string and return a new string with 273 // Expand the $-expressions in the string and return a new string with
274 // the result. 274 // the result.
275 function ExpandReplacement(string, subject, matchInfo, builder) { 275 function ExpandReplacement(string, subject, matchInfo, builder) {
276 var length = string.length; 276 var length = string.length;
277 var builder_elements = builder.elements; 277 var builder_elements = builder.elements;
278 var next = %StringIndexOf(string, '$', 0); 278 var next = %StringIndexOf(string, '$', 0);
279 if (next < 0) { 279 if (next < 0) {
280 if (length > 0) builder_elements.push(string); 280 if (length > 0) builder_elements.push(string);
281 return; 281 return;
282 } 282 }
283 283
284 // Compute the number of captures; see ECMA-262, 15.5.4.11, p. 102. 284 // Compute the number of captures; see ECMA-262, 15.5.4.11, p. 102.
285 var m = NUMBER_OF_CAPTURES(matchInfo) >> 1; // Includes the match. 285 var m = NUMBER_OF_CAPTURES(matchInfo) >> 1; // Includes the match.
286 286
287 if (next > 0) builder_elements.push(SubString(string, 0, next)); 287 if (next > 0) builder_elements.push(SubString(string, 0, next));
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 "italics", StringItalics, 985 "italics", StringItalics,
986 "small", StringSmall, 986 "small", StringSmall,
987 "strike", StringStrike, 987 "strike", StringStrike,
988 "sub", StringSub, 988 "sub", StringSub,
989 "sup", StringSup 989 "sup", StringSup
990 )); 990 ));
991 } 991 }
992 992
993 993
994 SetupString(); 994 SetupString();
OLDNEW
« no previous file with comments | « src/regexp.js ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698