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

Side by Side Diff: src/string.js

Issue 11759008: Introduce ENABLE_LATIN_1 compile flag (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix FilterASCII Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/scanner.h ('k') | src/string-search.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 if (!%_IsSmi(code)) code = ToNumber(code); 818 if (!%_IsSmi(code)) code = ToNumber(code);
819 return %_StringCharFromCode(code & 0xffff); 819 return %_StringCharFromCode(code & 0xffff);
820 } 820 }
821 821
822 var one_byte = %NewString(n, NEW_ONE_BYTE_STRING); 822 var one_byte = %NewString(n, NEW_ONE_BYTE_STRING);
823 var i; 823 var i;
824 for (i = 0; i < n; i++) { 824 for (i = 0; i < n; i++) {
825 var code = %_Arguments(i); 825 var code = %_Arguments(i);
826 if (!%_IsSmi(code)) code = ToNumber(code) & 0xffff; 826 if (!%_IsSmi(code)) code = ToNumber(code) & 0xffff;
827 if (code < 0) code = code & 0xffff; 827 if (code < 0) code = code & 0xffff;
828 // TODO(dcarney): Fix for Latin-1.
828 if (code > 0x7f) break; 829 if (code > 0x7f) break;
829 %_OneByteSeqStringSetChar(one_byte, i, code); 830 %_OneByteSeqStringSetChar(one_byte, i, code);
830 } 831 }
831 if (i == n) return one_byte; 832 if (i == n) return one_byte;
832 one_byte = %TruncateString(one_byte, i); 833 one_byte = %TruncateString(one_byte, i);
833 834
834 var two_byte = %NewString(n - i, NEW_TWO_BYTE_STRING); 835 var two_byte = %NewString(n - i, NEW_TWO_BYTE_STRING);
835 for (var j = 0; i < n; i++, j++) { 836 for (var j = 0; i < n; i++, j++) {
836 var code = %_Arguments(i); 837 var code = %_Arguments(i);
837 if (!%_IsSmi(code)) code = ToNumber(code) & 0xffff; 838 if (!%_IsSmi(code)) code = ToNumber(code) & 0xffff;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 "fixed", StringFixed, 1002 "fixed", StringFixed,
1002 "italics", StringItalics, 1003 "italics", StringItalics,
1003 "small", StringSmall, 1004 "small", StringSmall,
1004 "strike", StringStrike, 1005 "strike", StringStrike,
1005 "sub", StringSub, 1006 "sub", StringSub,
1006 "sup", StringSup 1007 "sup", StringSup
1007 )); 1008 ));
1008 } 1009 }
1009 1010
1010 SetUpString(); 1011 SetUpString();
OLDNEW
« no previous file with comments | « src/scanner.h ('k') | src/string-search.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698