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

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

Issue 1868963002: [builtins] Migrate String.prototype.charCodeAt and String.prototype.charAt to TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix typo Created 4 years, 8 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
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/conversions-inl.h" 8 #include "src/conversions-inl.h"
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 #include "src/regexp/jsregexp-inl.h" 10 #include "src/regexp/jsregexp-inl.h"
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 SealHandleScope shs(isolate); 1266 SealHandleScope shs(isolate);
1267 DCHECK(args.length() == 2); 1267 DCHECK(args.length() == 2);
1268 if (!args[0]->IsString()) return Smi::FromInt(0); 1268 if (!args[0]->IsString()) return Smi::FromInt(0);
1269 if (!args[1]->IsNumber()) return Smi::FromInt(0); 1269 if (!args[1]->IsNumber()) return Smi::FromInt(0);
1270 if (std::isinf(args.number_at(1))) return isolate->heap()->empty_string(); 1270 if (std::isinf(args.number_at(1))) return isolate->heap()->empty_string();
1271 Object* code = __RT_impl_Runtime_StringCharCodeAtRT(args, isolate); 1271 Object* code = __RT_impl_Runtime_StringCharCodeAtRT(args, isolate);
1272 if (code->IsNaN()) return isolate->heap()->empty_string(); 1272 if (code->IsNaN()) return isolate->heap()->empty_string();
1273 return __RT_impl_Runtime_StringCharFromCode(Arguments(1, &code), isolate); 1273 return __RT_impl_Runtime_StringCharFromCode(Arguments(1, &code), isolate);
1274 } 1274 }
1275 1275
1276 RUNTIME_FUNCTION(Runtime_ExternalStringGetChar) {
1277 SealHandleScope shs(isolate);
1278 DCHECK_EQ(2, args.length());
1279 CONVERT_ARG_CHECKED(ExternalString, string, 0);
1280 CONVERT_INT32_ARG_CHECKED(index, 1);
1281 return Smi::FromInt(string->Get(index));
1282 }
1276 1283
1277 RUNTIME_FUNCTION(Runtime_OneByteSeqStringGetChar) { 1284 RUNTIME_FUNCTION(Runtime_OneByteSeqStringGetChar) {
1278 SealHandleScope shs(isolate); 1285 SealHandleScope shs(isolate);
1279 DCHECK(args.length() == 2); 1286 DCHECK(args.length() == 2);
1280 CONVERT_ARG_CHECKED(SeqOneByteString, string, 0); 1287 CONVERT_ARG_CHECKED(SeqOneByteString, string, 0);
1281 CONVERT_INT32_ARG_CHECKED(index, 1); 1288 CONVERT_INT32_ARG_CHECKED(index, 1);
1282 return Smi::FromInt(string->SeqOneByteStringGet(index)); 1289 return Smi::FromInt(string->SeqOneByteStringGet(index));
1283 } 1290 }
1284 1291
1285 1292
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 SealHandleScope shs(isolate); 1325 SealHandleScope shs(isolate);
1319 DCHECK(args.length() == 2); 1326 DCHECK(args.length() == 2);
1320 if (!args[0]->IsString()) return isolate->heap()->undefined_value(); 1327 if (!args[0]->IsString()) return isolate->heap()->undefined_value();
1321 if (!args[1]->IsNumber()) return isolate->heap()->undefined_value(); 1328 if (!args[1]->IsNumber()) return isolate->heap()->undefined_value();
1322 if (std::isinf(args.number_at(1))) return isolate->heap()->nan_value(); 1329 if (std::isinf(args.number_at(1))) return isolate->heap()->nan_value();
1323 return __RT_impl_Runtime_StringCharCodeAtRT(args, isolate); 1330 return __RT_impl_Runtime_StringCharCodeAtRT(args, isolate);
1324 } 1331 }
1325 1332
1326 } // namespace internal 1333 } // namespace internal
1327 } // namespace v8 1334 } // namespace v8
OLDNEW
« src/compiler/code-stub-assembler.cc ('K') | « src/runtime/runtime-internal.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698