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

Side by Side Diff: src/string.js

Issue 341031: Reverting 3153 (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') | no next file » | 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-2008 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
11 // with the distribution. 11 // with the distribution.
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 var elements = this.elements; 803 var elements = this.elements;
804 elements[elements.length] = str; 804 elements[elements.length] = str;
805 } 805 }
806 } 806 }
807 807
808 808
809 ReplaceResultBuilder.prototype.addSpecialSlice = function(start, end) { 809 ReplaceResultBuilder.prototype.addSpecialSlice = function(start, end) {
810 var len = end - start; 810 var len = end - start;
811 if (len == 0) return; 811 if (len == 0) return;
812 var elements = this.elements; 812 var elements = this.elements;
813 if (start < 0x80000 && len < 0x800) { 813 if (start >= 0 && len >= 0 && start < 0x80000 && len < 0x800) {
814 elements[elements.length] = (start << 11) + len; 814 elements[elements.length] = (start << 11) + len;
815 } else { 815 } else {
816 // 0 < len <= String::kMaxLength and Smi::kMaxValue >= String::kMaxLength, 816 elements[elements.length] = SubString(this.special_string, start, end);
817 // so -len is a smi.
818 elements[elements.length] = -len;
819 elements[elements.length] = start;
820 } 817 }
821 } 818 }
822 819
823 820
824 StringBuilder.prototype.generate = function() { 821 StringBuilder.prototype.generate = function() {
825 return %StringBuilderConcat(this.elements, ""); 822 return %StringBuilderConcat(this.elements, "");
826 } 823 }
827 824
828 825
829 ReplaceResultBuilder.prototype.generate = function() { 826 ReplaceResultBuilder.prototype.generate = function() {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 "small", StringSmall, 882 "small", StringSmall,
886 "strike", StringStrike, 883 "strike", StringStrike,
887 "sub", StringSub, 884 "sub", StringSub,
888 "sup", StringSup, 885 "sup", StringSup,
889 "toJSON", StringToJSON 886 "toJSON", StringToJSON
890 )); 887 ));
891 } 888 }
892 889
893 890
894 SetupString(); 891 SetupString();
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698