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/messages.h" | 10 #include "src/messages.h" |
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1331 bool ok; | 1331 bool ok; |
1332 Handle<String> capture = | 1332 Handle<String> capture = |
1333 RegExpUtils::GenericCaptureGetter(isolate, match_indices, j, &ok); | 1333 RegExpUtils::GenericCaptureGetter(isolate, match_indices, j, &ok); |
1334 if (ok) { | 1334 if (ok) { |
1335 argv[j] = capture; | 1335 argv[j] = capture; |
1336 } else { | 1336 } else { |
1337 argv[j] = factory->undefined_value(); | 1337 argv[j] = factory->undefined_value(); |
1338 } | 1338 } |
1339 } | 1339 } |
1340 | 1340 |
1341 argv[m] = handle(Smi::FromInt(index), isolate); | 1341 argv[argc - 2] = handle(Smi::FromInt(index), isolate); |
1342 argv[m + 1] = subject; | 1342 argv[argc - 1] = subject; |
1343 | 1343 |
1344 Handle<Object> replacement_obj; | 1344 Handle<Object> replacement_obj; |
1345 ASSIGN_RETURN_ON_EXCEPTION( | 1345 ASSIGN_RETURN_ON_EXCEPTION( |
1346 isolate, replacement_obj, | 1346 isolate, replacement_obj, |
1347 Execution::Call(isolate, replace_obj, factory->undefined_value(), argc, | 1347 Execution::Call(isolate, replace_obj, factory->undefined_value(), argc, |
1348 argv.start()), | 1348 argv.start()), |
1349 String); | 1349 String); |
1350 | 1350 |
1351 Handle<String> replacement; | 1351 Handle<String> replacement; |
1352 ASSIGN_RETURN_ON_EXCEPTION( | 1352 ASSIGN_RETURN_ON_EXCEPTION( |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1652 | 1652 |
1653 RUNTIME_FUNCTION(Runtime_IsRegExp) { | 1653 RUNTIME_FUNCTION(Runtime_IsRegExp) { |
1654 SealHandleScope shs(isolate); | 1654 SealHandleScope shs(isolate); |
1655 DCHECK(args.length() == 1); | 1655 DCHECK(args.length() == 1); |
1656 CONVERT_ARG_CHECKED(Object, obj, 0); | 1656 CONVERT_ARG_CHECKED(Object, obj, 0); |
1657 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); | 1657 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); |
1658 } | 1658 } |
1659 | 1659 |
1660 } // namespace internal | 1660 } // namespace internal |
1661 } // namespace v8 | 1661 } // namespace v8 |
OLD | NEW |