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

Side by Side Diff: src/string.js

Issue 7282026: Introduce code flushing of RegExp code. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 5 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
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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 builder.addSpecialSlice(end, subject.length); 269 builder.addSpecialSlice(end, subject.length);
270 270
271 return builder.generate(); 271 return builder.generate();
272 } 272 }
273 273
274 274
275 // Expand the $-expressions in the string and return a new string with 275 // Expand the $-expressions in the string and return a new string with
276 // the result. 276 // the result.
277 function ExpandReplacement(string, subject, matchInfo, builder) { 277 function ExpandReplacement(string, subject, matchInfo, builder) {
278 var length = string.length; 278 var length = string.length;
279 var builder_elements = builder.elements; 279 var builder_elements = builder.elements;
280 var next = %StringIndexOf(string, '$', 0); 280 var next = %StringIndexOf(string, '$', 0);
281 if (next < 0) { 281 if (next < 0) {
282 if (length > 0) builder_elements.push(string); 282 if (length > 0) builder_elements.push(string);
283 return; 283 return;
284 } 284 }
285 285
286 // Compute the number of captures; see ECMA-262, 15.5.4.11, p. 102. 286 // Compute the number of captures; see ECMA-262, 15.5.4.11, p. 102.
287 var m = NUMBER_OF_CAPTURES(matchInfo) >> 1; // Includes the match. 287 var m = NUMBER_OF_CAPTURES(matchInfo) >> 1; // Includes the match.
288 288
289 if (next > 0) builder_elements.push(SubString(string, 0, next)); 289 if (next > 0) builder_elements.push(SubString(string, 0, next));
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 "italics", StringItalics, 990 "italics", StringItalics,
991 "small", StringSmall, 991 "small", StringSmall,
992 "strike", StringStrike, 992 "strike", StringStrike,
993 "sub", StringSub, 993 "sub", StringSub,
994 "sup", StringSup 994 "sup", StringSup
995 )); 995 ));
996 } 996 }
997 997
998 998
999 SetupString(); 999 SetupString();
OLDNEW
« src/objects-debug.cc ('K') | « src/regexp.js ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698