| 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/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  Loading... | 
| 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 } |  | 
| 1283 | 1276 | 
| 1284 RUNTIME_FUNCTION(Runtime_OneByteSeqStringGetChar) { | 1277 RUNTIME_FUNCTION(Runtime_OneByteSeqStringGetChar) { | 
| 1285   SealHandleScope shs(isolate); | 1278   SealHandleScope shs(isolate); | 
| 1286   DCHECK(args.length() == 2); | 1279   DCHECK(args.length() == 2); | 
| 1287   CONVERT_ARG_CHECKED(SeqOneByteString, string, 0); | 1280   CONVERT_ARG_CHECKED(SeqOneByteString, string, 0); | 
| 1288   CONVERT_INT32_ARG_CHECKED(index, 1); | 1281   CONVERT_INT32_ARG_CHECKED(index, 1); | 
| 1289   return Smi::FromInt(string->SeqOneByteStringGet(index)); | 1282   return Smi::FromInt(string->SeqOneByteStringGet(index)); | 
| 1290 } | 1283 } | 
| 1291 | 1284 | 
| 1292 | 1285 | 
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1325   SealHandleScope shs(isolate); | 1318   SealHandleScope shs(isolate); | 
| 1326   DCHECK(args.length() == 2); | 1319   DCHECK(args.length() == 2); | 
| 1327   if (!args[0]->IsString()) return isolate->heap()->undefined_value(); | 1320   if (!args[0]->IsString()) return isolate->heap()->undefined_value(); | 
| 1328   if (!args[1]->IsNumber()) return isolate->heap()->undefined_value(); | 1321   if (!args[1]->IsNumber()) return isolate->heap()->undefined_value(); | 
| 1329   if (std::isinf(args.number_at(1))) return isolate->heap()->nan_value(); | 1322   if (std::isinf(args.number_at(1))) return isolate->heap()->nan_value(); | 
| 1330   return __RT_impl_Runtime_StringCharCodeAtRT(args, isolate); | 1323   return __RT_impl_Runtime_StringCharCodeAtRT(args, isolate); | 
| 1331 } | 1324 } | 
| 1332 | 1325 | 
| 1333 }  // namespace internal | 1326 }  // namespace internal | 
| 1334 }  // namespace v8 | 1327 }  // namespace v8 | 
| OLD | NEW | 
|---|