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 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1648 if (next_source_position < length) { | 1648 if (next_source_position < length) { |
1649 builder.AppendString( | 1649 builder.AppendString( |
1650 factory->NewSubString(string, next_source_position, length)); | 1650 factory->NewSubString(string, next_source_position, length)); |
1651 } | 1651 } |
1652 | 1652 |
1653 RETURN_RESULT_OR_FAILURE(isolate, builder.Finish()); | 1653 RETURN_RESULT_OR_FAILURE(isolate, builder.Finish()); |
1654 } | 1654 } |
1655 | 1655 |
1656 RUNTIME_FUNCTION(Runtime_RegExpExecReThrow) { | 1656 RUNTIME_FUNCTION(Runtime_RegExpExecReThrow) { |
1657 SealHandleScope shs(isolate); | 1657 SealHandleScope shs(isolate); |
1658 DCHECK_EQ(4, args.length()); | 1658 DCHECK_EQ(0, args.length()); |
1659 Object* exception = isolate->pending_exception(); | 1659 Object* exception = isolate->pending_exception(); |
1660 isolate->clear_pending_exception(); | 1660 isolate->clear_pending_exception(); |
1661 return isolate->ReThrow(exception); | 1661 return isolate->ReThrow(exception); |
1662 } | 1662 } |
1663 | 1663 |
1664 RUNTIME_FUNCTION(Runtime_RegExpInitializeAndCompile) { | 1664 RUNTIME_FUNCTION(Runtime_RegExpInitializeAndCompile) { |
1665 HandleScope scope(isolate); | 1665 HandleScope scope(isolate); |
1666 DCHECK_EQ(3, args.length()); | 1666 DCHECK_EQ(3, args.length()); |
1667 CONVERT_ARG_HANDLE_CHECKED(JSRegExp, regexp, 0); | 1667 CONVERT_ARG_HANDLE_CHECKED(JSRegExp, regexp, 0); |
1668 CONVERT_ARG_HANDLE_CHECKED(String, source, 1); | 1668 CONVERT_ARG_HANDLE_CHECKED(String, source, 1); |
1669 CONVERT_ARG_HANDLE_CHECKED(String, flags, 2); | 1669 CONVERT_ARG_HANDLE_CHECKED(String, flags, 2); |
1670 | 1670 |
1671 RETURN_FAILURE_ON_EXCEPTION(isolate, | 1671 RETURN_FAILURE_ON_EXCEPTION(isolate, |
1672 JSRegExp::Initialize(regexp, source, flags)); | 1672 JSRegExp::Initialize(regexp, source, flags)); |
1673 | 1673 |
1674 return *regexp; | 1674 return *regexp; |
1675 } | 1675 } |
1676 | 1676 |
1677 RUNTIME_FUNCTION(Runtime_IsRegExp) { | 1677 RUNTIME_FUNCTION(Runtime_IsRegExp) { |
1678 SealHandleScope shs(isolate); | 1678 SealHandleScope shs(isolate); |
1679 DCHECK_EQ(1, args.length()); | 1679 DCHECK_EQ(1, args.length()); |
1680 CONVERT_ARG_CHECKED(Object, obj, 0); | 1680 CONVERT_ARG_CHECKED(Object, obj, 0); |
1681 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); | 1681 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); |
1682 } | 1682 } |
1683 | 1683 |
1684 } // namespace internal | 1684 } // namespace internal |
1685 } // namespace v8 | 1685 } // namespace v8 |
OLD | NEW |