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 "src/isolate.h" | 5 #include "src/isolate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 1757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1768 PromiseOnStack* prev = tltop->promise_on_stack_->prev(); | 1768 PromiseOnStack* prev = tltop->promise_on_stack_->prev(); |
1769 Handle<Object> global_promise = tltop->promise_on_stack_->promise(); | 1769 Handle<Object> global_promise = tltop->promise_on_stack_->promise(); |
1770 delete tltop->promise_on_stack_; | 1770 delete tltop->promise_on_stack_; |
1771 tltop->promise_on_stack_ = prev; | 1771 tltop->promise_on_stack_ = prev; |
1772 global_handles()->Destroy(global_promise.location()); | 1772 global_handles()->Destroy(global_promise.location()); |
1773 } | 1773 } |
1774 | 1774 |
1775 bool Isolate::PromiseHasUserDefinedRejectHandler(Handle<Object> promise) { | 1775 bool Isolate::PromiseHasUserDefinedRejectHandler(Handle<Object> promise) { |
1776 Handle<JSFunction> fun = promise_has_user_defined_reject_handler(); | 1776 Handle<JSFunction> fun = promise_has_user_defined_reject_handler(); |
1777 Handle<Object> has_reject_handler; | 1777 Handle<Object> has_reject_handler; |
| 1778 // If we are, e.g., overflowing the stack, don't try to call out to JS |
| 1779 if (!AllowJavascriptExecution::IsAllowed(this)) return false; |
| 1780 // Call the registered function to check for a handler |
1778 if (Execution::TryCall(this, fun, promise, 0, NULL) | 1781 if (Execution::TryCall(this, fun, promise, 0, NULL) |
1779 .ToHandle(&has_reject_handler)) { | 1782 .ToHandle(&has_reject_handler)) { |
1780 return has_reject_handler->IsTrue(this); | 1783 return has_reject_handler->IsTrue(this); |
1781 } | 1784 } |
1782 // If an exception is thrown in the course of execution of this built-in | 1785 // If an exception is thrown in the course of execution of this built-in |
1783 // function, it indicates either a bug, or a synthetic uncatchable | 1786 // function, it indicates either a bug, or a synthetic uncatchable |
1784 // exception in the shutdown path. In either case, it's OK to predict either | 1787 // exception in the shutdown path. In either case, it's OK to predict either |
1785 // way in DevTools. | 1788 // way in DevTools. |
1786 return false; | 1789 return false; |
1787 } | 1790 } |
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3487 // Then check whether this scope intercepts. | 3490 // Then check whether this scope intercepts. |
3488 if ((flag & intercept_mask_)) { | 3491 if ((flag & intercept_mask_)) { |
3489 intercepted_flags_ |= flag; | 3492 intercepted_flags_ |= flag; |
3490 return true; | 3493 return true; |
3491 } | 3494 } |
3492 return false; | 3495 return false; |
3493 } | 3496 } |
3494 | 3497 |
3495 } // namespace internal | 3498 } // namespace internal |
3496 } // namespace v8 | 3499 } // namespace v8 |
OLD | NEW |