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

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

Issue 2060213002: Revert of Replace all remaining Oddball checks with new function (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | src/runtime/runtime-typedarray.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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/regexp/jsregexp-inl.h" 8 #include "src/regexp/jsregexp-inl.h"
9 #include "src/string-builder.h" 9 #include "src/string-builder.h"
10 #include "src/string-search.h" 10 #include "src/string-search.h"
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 } 1049 }
1050 1050
1051 Handle<SeqString> result; // Same length as input. 1051 Handle<SeqString> result; // Same length as input.
1052 if (s->IsOneByteRepresentation()) { 1052 if (s->IsOneByteRepresentation()) {
1053 result = isolate->factory()->NewRawOneByteString(length).ToHandleChecked(); 1053 result = isolate->factory()->NewRawOneByteString(length).ToHandleChecked();
1054 } else { 1054 } else {
1055 result = isolate->factory()->NewRawTwoByteString(length).ToHandleChecked(); 1055 result = isolate->factory()->NewRawTwoByteString(length).ToHandleChecked();
1056 } 1056 }
1057 1057
1058 Object* answer = ConvertCaseHelper(isolate, *s, *result, length, mapping); 1058 Object* answer = ConvertCaseHelper(isolate, *s, *result, length, mapping);
1059 if (answer->IsException(isolate) || answer->IsString()) return answer; 1059 if (answer->IsException() || answer->IsString()) return answer;
1060 1060
1061 DCHECK(answer->IsSmi()); 1061 DCHECK(answer->IsSmi());
1062 length = Smi::cast(answer)->value(); 1062 length = Smi::cast(answer)->value();
1063 if (s->IsOneByteRepresentation() && length > 0) { 1063 if (s->IsOneByteRepresentation() && length > 0) {
1064 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 1064 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1065 isolate, result, isolate->factory()->NewRawOneByteString(length)); 1065 isolate, result, isolate->factory()->NewRawOneByteString(length));
1066 } else { 1066 } else {
1067 if (length < 0) length = -length; 1067 if (length < 0) length = -length;
1068 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 1068 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1069 isolate, result, isolate->factory()->NewRawTwoByteString(length)); 1069 isolate, result, isolate->factory()->NewRawTwoByteString(length));
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 SealHandleScope shs(isolate); 1206 SealHandleScope shs(isolate);
1207 DCHECK(args.length() == 2); 1207 DCHECK(args.length() == 2);
1208 if (!args[0]->IsString()) return isolate->heap()->undefined_value(); 1208 if (!args[0]->IsString()) return isolate->heap()->undefined_value();
1209 if (!args[1]->IsNumber()) return isolate->heap()->undefined_value(); 1209 if (!args[1]->IsNumber()) return isolate->heap()->undefined_value();
1210 if (std::isinf(args.number_at(1))) return isolate->heap()->nan_value(); 1210 if (std::isinf(args.number_at(1))) return isolate->heap()->nan_value();
1211 return __RT_impl_Runtime_StringCharCodeAtRT(args, isolate); 1211 return __RT_impl_Runtime_StringCharCodeAtRT(args, isolate);
1212 } 1212 }
1213 1213
1214 } // namespace internal 1214 } // namespace internal
1215 } // namespace v8 1215 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | src/runtime/runtime-typedarray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698