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

Side by Side Diff: src/runtime/runtime-strings.cc

Issue 663313003: Cleanup ConsStringIteratorOp. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/runtime/runtime.h ('k') | src/runtime/runtime-test.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/jsregexp-inl.h" 8 #include "src/jsregexp-inl.h"
9 #include "src/jsregexp.h" 9 #include "src/jsregexp.h"
10 #include "src/runtime/runtime-utils.h" 10 #include "src/runtime/runtime-utils.h"
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 // and I hereby claim my vaffel-is. 869 // and I hereby claim my vaffel-is.
870 // 870 //
871 // NOTE: This assumes that the upper/lower case of an ASCII 871 // NOTE: This assumes that the upper/lower case of an ASCII
872 // character is also ASCII. This is currently the case, but it 872 // character is also ASCII. This is currently the case, but it
873 // might break in the future if we implement more context and locale 873 // might break in the future if we implement more context and locale
874 // dependent upper/lower conversions. 874 // dependent upper/lower conversions.
875 bool has_changed_character = false; 875 bool has_changed_character = false;
876 876
877 // Convert all characters to upper case, assuming that they will fit 877 // Convert all characters to upper case, assuming that they will fit
878 // in the buffer 878 // in the buffer
879 Access<ConsStringIteratorOp> op(isolate->runtime_state()->string_iterator()); 879 StringCharacterStream stream(string);
880 StringCharacterStream stream(string, op.value());
881 unibrow::uchar chars[Converter::kMaxWidth]; 880 unibrow::uchar chars[Converter::kMaxWidth];
882 // We can assume that the string is not empty 881 // We can assume that the string is not empty
883 uc32 current = stream.GetNext(); 882 uc32 current = stream.GetNext();
884 bool ignore_overflow = Converter::kIsToLower || result->IsSeqTwoByteString(); 883 bool ignore_overflow = Converter::kIsToLower || result->IsSeqTwoByteString();
885 for (int i = 0; i < result_length;) { 884 for (int i = 0; i < result_length;) {
886 bool has_next = stream.HasMore(); 885 bool has_next = stream.HasMore();
887 uc32 next = has_next ? stream.GetNext() : 0; 886 uc32 next = has_next ? stream.GetNext() : 0;
888 int char_length = mapping->get(current, next, chars); 887 int char_length = mapping->get(current, next, chars);
889 if (char_length == 0) { 888 if (char_length == 0) {
890 // The case conversion of this character is the character itself. 889 // The case conversion of this character is the character itself.
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 return __RT_impl_Runtime_StringAdd(args, isolate); 1296 return __RT_impl_Runtime_StringAdd(args, isolate);
1298 } 1297 }
1299 1298
1300 1299
1301 RUNTIME_FUNCTION(RuntimeReference_IsStringWrapperSafeForDefaultValueOf) { 1300 RUNTIME_FUNCTION(RuntimeReference_IsStringWrapperSafeForDefaultValueOf) {
1302 UNIMPLEMENTED(); 1301 UNIMPLEMENTED();
1303 return NULL; 1302 return NULL;
1304 } 1303 }
1305 } 1304 }
1306 } // namespace v8::internal 1305 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698