| 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 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1222 | 1222 |
| 1223 | 1223 |
| 1224 RUNTIME_FUNCTION(Runtime_FlattenString) { | 1224 RUNTIME_FUNCTION(Runtime_FlattenString) { |
| 1225 HandleScope scope(isolate); | 1225 HandleScope scope(isolate); |
| 1226 DCHECK(args.length() == 1); | 1226 DCHECK(args.length() == 1); |
| 1227 CONVERT_ARG_HANDLE_CHECKED(String, str, 0); | 1227 CONVERT_ARG_HANDLE_CHECKED(String, str, 0); |
| 1228 return *String::Flatten(str); | 1228 return *String::Flatten(str); |
| 1229 } | 1229 } |
| 1230 | 1230 |
| 1231 | 1231 |
| 1232 RUNTIME_FUNCTION(RuntimeReference_StringCharFromCode) { | 1232 RUNTIME_FUNCTION(Runtime_StringCharFromCode) { |
| 1233 SealHandleScope shs(isolate); | 1233 SealHandleScope shs(isolate); |
| 1234 return __RT_impl_Runtime_CharFromCode(args, isolate); | 1234 return __RT_impl_Runtime_CharFromCode(args, isolate); |
| 1235 } | 1235 } |
| 1236 | 1236 |
| 1237 | 1237 |
| 1238 RUNTIME_FUNCTION(RuntimeReference_StringCharAt) { | 1238 RUNTIME_FUNCTION(Runtime_StringCharAt) { |
| 1239 SealHandleScope shs(isolate); | 1239 SealHandleScope shs(isolate); |
| 1240 DCHECK(args.length() == 2); | 1240 DCHECK(args.length() == 2); |
| 1241 if (!args[0]->IsString()) return Smi::FromInt(0); | 1241 if (!args[0]->IsString()) return Smi::FromInt(0); |
| 1242 if (!args[1]->IsNumber()) return Smi::FromInt(0); | 1242 if (!args[1]->IsNumber()) return Smi::FromInt(0); |
| 1243 if (std::isinf(args.number_at(1))) return isolate->heap()->empty_string(); | 1243 if (std::isinf(args.number_at(1))) return isolate->heap()->empty_string(); |
| 1244 Object* code = __RT_impl_Runtime_StringCharCodeAtRT(args, isolate); | 1244 Object* code = __RT_impl_Runtime_StringCharCodeAtRT(args, isolate); |
| 1245 if (code->IsNaN()) return isolate->heap()->empty_string(); | 1245 if (code->IsNaN()) return isolate->heap()->empty_string(); |
| 1246 return __RT_impl_Runtime_CharFromCode(Arguments(1, &code), isolate); | 1246 return __RT_impl_Runtime_CharFromCode(Arguments(1, &code), isolate); |
| 1247 } | 1247 } |
| 1248 | 1248 |
| 1249 | 1249 |
| 1250 RUNTIME_FUNCTION(RuntimeReference_OneByteSeqStringSetChar) { | 1250 RUNTIME_FUNCTION(Runtime_OneByteSeqStringSetChar) { |
| 1251 SealHandleScope shs(isolate); | 1251 SealHandleScope shs(isolate); |
| 1252 DCHECK(args.length() == 3); | 1252 DCHECK(args.length() == 3); |
| 1253 CONVERT_INT32_ARG_CHECKED(index, 0); | 1253 CONVERT_INT32_ARG_CHECKED(index, 0); |
| 1254 CONVERT_INT32_ARG_CHECKED(value, 1); | 1254 CONVERT_INT32_ARG_CHECKED(value, 1); |
| 1255 CONVERT_ARG_CHECKED(SeqOneByteString, string, 2); | 1255 CONVERT_ARG_CHECKED(SeqOneByteString, string, 2); |
| 1256 string->SeqOneByteStringSet(index, value); | 1256 string->SeqOneByteStringSet(index, value); |
| 1257 return string; | 1257 return string; |
| 1258 } | 1258 } |
| 1259 | 1259 |
| 1260 | 1260 |
| 1261 RUNTIME_FUNCTION(RuntimeReference_TwoByteSeqStringSetChar) { | 1261 RUNTIME_FUNCTION(Runtime_TwoByteSeqStringSetChar) { |
| 1262 SealHandleScope shs(isolate); | 1262 SealHandleScope shs(isolate); |
| 1263 DCHECK(args.length() == 3); | 1263 DCHECK(args.length() == 3); |
| 1264 CONVERT_INT32_ARG_CHECKED(index, 0); | 1264 CONVERT_INT32_ARG_CHECKED(index, 0); |
| 1265 CONVERT_INT32_ARG_CHECKED(value, 1); | 1265 CONVERT_INT32_ARG_CHECKED(value, 1); |
| 1266 CONVERT_ARG_CHECKED(SeqTwoByteString, string, 2); | 1266 CONVERT_ARG_CHECKED(SeqTwoByteString, string, 2); |
| 1267 string->SeqTwoByteStringSet(index, value); | 1267 string->SeqTwoByteStringSet(index, value); |
| 1268 return string; | 1268 return string; |
| 1269 } | 1269 } |
| 1270 | 1270 |
| 1271 | 1271 |
| 1272 RUNTIME_FUNCTION(RuntimeReference_StringCompare) { | 1272 RUNTIME_FUNCTION(Runtime_StringCharCodeAt) { |
| 1273 SealHandleScope shs(isolate); | |
| 1274 return __RT_impl_Runtime_StringCompare(args, isolate); | |
| 1275 } | |
| 1276 | |
| 1277 | |
| 1278 RUNTIME_FUNCTION(RuntimeReference_StringCharCodeAt) { | |
| 1279 SealHandleScope shs(isolate); | 1273 SealHandleScope shs(isolate); |
| 1280 DCHECK(args.length() == 2); | 1274 DCHECK(args.length() == 2); |
| 1281 if (!args[0]->IsString()) return isolate->heap()->undefined_value(); | 1275 if (!args[0]->IsString()) return isolate->heap()->undefined_value(); |
| 1282 if (!args[1]->IsNumber()) return isolate->heap()->undefined_value(); | 1276 if (!args[1]->IsNumber()) return isolate->heap()->undefined_value(); |
| 1283 if (std::isinf(args.number_at(1))) return isolate->heap()->nan_value(); | 1277 if (std::isinf(args.number_at(1))) return isolate->heap()->nan_value(); |
| 1284 return __RT_impl_Runtime_StringCharCodeAtRT(args, isolate); | 1278 return __RT_impl_Runtime_StringCharCodeAtRT(args, isolate); |
| 1285 } | 1279 } |
| 1286 | 1280 |
| 1287 | 1281 |
| 1288 RUNTIME_FUNCTION(RuntimeReference_SubString) { | 1282 RUNTIME_FUNCTION(Runtime_IsStringWrapperSafeForDefaultValueOf) { |
| 1289 SealHandleScope shs(isolate); | |
| 1290 return __RT_impl_Runtime_SubString(args, isolate); | |
| 1291 } | |
| 1292 | |
| 1293 | |
| 1294 RUNTIME_FUNCTION(RuntimeReference_StringAdd) { | |
| 1295 SealHandleScope shs(isolate); | |
| 1296 return __RT_impl_Runtime_StringAdd(args, isolate); | |
| 1297 } | |
| 1298 | |
| 1299 | |
| 1300 RUNTIME_FUNCTION(RuntimeReference_IsStringWrapperSafeForDefaultValueOf) { | |
| 1301 UNIMPLEMENTED(); | 1283 UNIMPLEMENTED(); |
| 1302 return NULL; | 1284 return NULL; |
| 1303 } | 1285 } |
| 1304 } | 1286 } |
| 1305 } // namespace v8::internal | 1287 } // namespace v8::internal |
| OLD | NEW |