| 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 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 | 1238 |
| 1239 RUNTIME_FUNCTION(Runtime_StringCharCodeAt) { | 1239 RUNTIME_FUNCTION(Runtime_StringCharCodeAt) { |
| 1240 SealHandleScope shs(isolate); | 1240 SealHandleScope shs(isolate); |
| 1241 DCHECK(args.length() == 2); | 1241 DCHECK(args.length() == 2); |
| 1242 if (!args[0]->IsString()) return isolate->heap()->undefined_value(); | 1242 if (!args[0]->IsString()) return isolate->heap()->undefined_value(); |
| 1243 if (!args[1]->IsNumber()) return isolate->heap()->undefined_value(); | 1243 if (!args[1]->IsNumber()) return isolate->heap()->undefined_value(); |
| 1244 if (std::isinf(args.number_at(1))) return isolate->heap()->nan_value(); | 1244 if (std::isinf(args.number_at(1))) return isolate->heap()->nan_value(); |
| 1245 return __RT_impl_Runtime_StringCharCodeAtRT(args, isolate); | 1245 return __RT_impl_Runtime_StringCharCodeAtRT(args, isolate); |
| 1246 } | 1246 } |
| 1247 | 1247 |
| 1248 | |
| 1249 RUNTIME_FUNCTION(Runtime_StringGetLength) { | |
| 1250 HandleScope scope(isolate); | |
| 1251 DCHECK(args.length() == 1); | |
| 1252 CONVERT_ARG_HANDLE_CHECKED(String, s, 0); | |
| 1253 return Smi::FromInt(s->length()); | |
| 1254 } | |
| 1255 } // namespace internal | 1248 } // namespace internal |
| 1256 } // namespace v8 | 1249 } // namespace v8 |
| OLD | NEW |