OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |