| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <limits> | 6 #include <limits> |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
| (...skipping 1741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1752 | 1752 |
| 1753 RUNTIME_FUNCTION(Runtime_ThrowUnsupportedSuperError) { | 1753 RUNTIME_FUNCTION(Runtime_ThrowUnsupportedSuperError) { |
| 1754 HandleScope scope(isolate); | 1754 HandleScope scope(isolate); |
| 1755 DCHECK(args.length() == 0); | 1755 DCHECK(args.length() == 0); |
| 1756 THROW_NEW_ERROR_RETURN_FAILURE( | 1756 THROW_NEW_ERROR_RETURN_FAILURE( |
| 1757 isolate, | 1757 isolate, |
| 1758 NewReferenceError("unsupported_super", HandleVector<Object>(NULL, 0))); | 1758 NewReferenceError("unsupported_super", HandleVector<Object>(NULL, 0))); |
| 1759 } | 1759 } |
| 1760 | 1760 |
| 1761 | 1761 |
| 1762 RUNTIME_FUNCTION(Runtime_PromiseRejectEvent) { | 1762 RUNTIME_FUNCTION(Runtime_DebugPromiseRejectEvent) { |
| 1763 DCHECK(args.length() == 3); | 1763 DCHECK(args.length() == 2); |
| 1764 HandleScope scope(isolate); | 1764 HandleScope scope(isolate); |
| 1765 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); | 1765 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); |
| 1766 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 1766 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
| 1767 CONVERT_BOOLEAN_ARG_CHECKED(debug_event, 2); | 1767 isolate->debug()->OnPromiseReject(promise, value); |
| 1768 if (debug_event) isolate->debug()->OnPromiseReject(promise, value); | |
| 1769 Handle<Symbol> key = isolate->factory()->promise_has_handler_symbol(); | |
| 1770 // Do not report if we actually have a handler. | |
| 1771 if (JSObject::GetDataProperty(promise, key)->IsUndefined()) { | |
| 1772 isolate->ReportPromiseReject(promise, value, | |
| 1773 v8::kPromiseRejectWithNoHandler); | |
| 1774 } | |
| 1775 return isolate->heap()->undefined_value(); | 1768 return isolate->heap()->undefined_value(); |
| 1776 } | 1769 } |
| 1777 | 1770 |
| 1778 | 1771 |
| 1779 RUNTIME_FUNCTION(Runtime_PromiseRevokeReject) { | 1772 RUNTIME_FUNCTION(Runtime_PromiseRejectMessage) { |
| 1773 DCHECK(args.length() == 2); |
| 1774 HandleScope scope(isolate); |
| 1775 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); |
| 1776 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
| 1777 isolate->ReportPromiseReject(promise, value, v8::kPromiseRejectWithNoHandler); |
| 1778 return isolate->heap()->undefined_value(); |
| 1779 } |
| 1780 |
| 1781 |
| 1782 RUNTIME_FUNCTION(Runtime_PromiseRevokeRejectMessage) { |
| 1780 DCHECK(args.length() == 1); | 1783 DCHECK(args.length() == 1); |
| 1781 HandleScope scope(isolate); | 1784 HandleScope scope(isolate); |
| 1782 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); | 1785 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); |
| 1783 Handle<Symbol> key = isolate->factory()->promise_has_handler_symbol(); | |
| 1784 // At this point, no revocation has been issued before | |
| 1785 RUNTIME_ASSERT(JSObject::GetDataProperty(promise, key)->IsUndefined()); | |
| 1786 isolate->ReportPromiseReject(promise, Handle<Object>(), | 1786 isolate->ReportPromiseReject(promise, Handle<Object>(), |
| 1787 v8::kPromiseHandlerAddedAfterReject); | 1787 v8::kPromiseHandlerAddedAfterReject); |
| 1788 return isolate->heap()->undefined_value(); | 1788 return isolate->heap()->undefined_value(); |
| 1789 } | 1789 } |
| 1790 | 1790 |
| 1791 | 1791 |
| 1792 RUNTIME_FUNCTION(Runtime_PromiseHasHandlerSymbol) { | |
| 1793 DCHECK(args.length() == 0); | |
| 1794 return isolate->heap()->promise_has_handler_symbol(); | |
| 1795 } | |
| 1796 | |
| 1797 | |
| 1798 RUNTIME_FUNCTION(Runtime_StackGuard) { | 1792 RUNTIME_FUNCTION(Runtime_StackGuard) { |
| 1799 SealHandleScope shs(isolate); | 1793 SealHandleScope shs(isolate); |
| 1800 DCHECK(args.length() == 0); | 1794 DCHECK(args.length() == 0); |
| 1801 | 1795 |
| 1802 // First check if this is a real stack overflow. | 1796 // First check if this is a real stack overflow. |
| 1803 StackLimitCheck check(isolate); | 1797 StackLimitCheck check(isolate); |
| 1804 if (check.JsHasOverflowed()) { | 1798 if (check.JsHasOverflowed()) { |
| 1805 return isolate->StackOverflow(); | 1799 return isolate->StackOverflow(); |
| 1806 } | 1800 } |
| 1807 | 1801 |
| (...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3331 } | 3325 } |
| 3332 return NULL; | 3326 return NULL; |
| 3333 } | 3327 } |
| 3334 | 3328 |
| 3335 | 3329 |
| 3336 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 3330 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
| 3337 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 3331 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
| 3338 } | 3332 } |
| 3339 } | 3333 } |
| 3340 } // namespace v8::internal | 3334 } // namespace v8::internal |
| OLD | NEW |