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 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 } | 1658 } |
1659 | 1659 |
1660 RUNTIME_FUNCTION(Runtime_RegExpExecReThrow) { | 1660 RUNTIME_FUNCTION(Runtime_RegExpExecReThrow) { |
1661 SealHandleScope shs(isolate); | 1661 SealHandleScope shs(isolate); |
1662 DCHECK(args.length() == 4); | 1662 DCHECK(args.length() == 4); |
1663 Object* exception = isolate->pending_exception(); | 1663 Object* exception = isolate->pending_exception(); |
1664 isolate->clear_pending_exception(); | 1664 isolate->clear_pending_exception(); |
1665 return isolate->ReThrow(exception); | 1665 return isolate->ReThrow(exception); |
1666 } | 1666 } |
1667 | 1667 |
| 1668 RUNTIME_FUNCTION(Runtime_RegExpInitializeAndCompile) { |
| 1669 HandleScope scope(isolate); |
| 1670 DCHECK(args.length() == 3); |
| 1671 CONVERT_ARG_HANDLE_CHECKED(JSRegExp, regexp, 0); |
| 1672 CONVERT_ARG_HANDLE_CHECKED(String, source, 1); |
| 1673 CONVERT_ARG_HANDLE_CHECKED(String, flags, 2); |
| 1674 |
| 1675 RETURN_FAILURE_ON_EXCEPTION(isolate, |
| 1676 JSRegExp::Initialize(regexp, source, flags)); |
| 1677 |
| 1678 return *regexp; |
| 1679 } |
1668 | 1680 |
1669 RUNTIME_FUNCTION(Runtime_IsRegExp) { | 1681 RUNTIME_FUNCTION(Runtime_IsRegExp) { |
1670 SealHandleScope shs(isolate); | 1682 SealHandleScope shs(isolate); |
1671 DCHECK(args.length() == 1); | 1683 DCHECK(args.length() == 1); |
1672 CONVERT_ARG_CHECKED(Object, obj, 0); | 1684 CONVERT_ARG_CHECKED(Object, obj, 0); |
1673 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); | 1685 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); |
1674 } | 1686 } |
1675 | 1687 |
1676 } // namespace internal | 1688 } // namespace internal |
1677 } // namespace v8 | 1689 } // namespace v8 |
OLD | NEW |