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 #ifndef V8_ISOLATE_H_ | 5 #ifndef V8_ISOLATE_H_ |
6 #define V8_ISOLATE_H_ | 6 #define V8_ISOLATE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <queue> | 9 #include <queue> |
10 | 10 |
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1569 return GetCurrentStackPosition() < stack_guard->climit(); | 1569 return GetCurrentStackPosition() < stack_guard->climit(); |
1570 } | 1570 } |
1571 | 1571 |
1572 // Use this to check for stack-overflow when entering runtime from JS code. | 1572 // Use this to check for stack-overflow when entering runtime from JS code. |
1573 bool JsHasOverflowed(uintptr_t gap = 0) const; | 1573 bool JsHasOverflowed(uintptr_t gap = 0) const; |
1574 | 1574 |
1575 private: | 1575 private: |
1576 Isolate* isolate_; | 1576 Isolate* isolate_; |
1577 }; | 1577 }; |
1578 | 1578 |
1579 #define STACK_CHECK(isolate, result_value) \ | 1579 #define STACK_CHECK(isolate, result_value) \ |
1580 do { \ | 1580 do { \ |
1581 StackLimitCheck stack_check(isolate); \ | 1581 StackLimitCheck stack_check(isolate); \ |
1582 if (stack_check.HasOverflowed()) { \ | 1582 if (stack_check.HasOverflowed()) { \ |
1583 isolate->Throw(*isolate->factory()->NewRangeError( \ | 1583 isolate->StackOverflow(); \ |
1584 MessageTemplate::kStackOverflow)); \ | 1584 return result_value; \ |
1585 return result_value; \ | 1585 } \ |
1586 } \ | |
1587 } while (false) | 1586 } while (false) |
1588 | 1587 |
1589 // Support for temporarily postponing interrupts. When the outermost | 1588 // Support for temporarily postponing interrupts. When the outermost |
1590 // postpone scope is left the interrupts will be re-enabled and any | 1589 // postpone scope is left the interrupts will be re-enabled and any |
1591 // interrupts that occurred while in the scope will be taken into | 1590 // interrupts that occurred while in the scope will be taken into |
1592 // account. | 1591 // account. |
1593 class PostponeInterruptsScope BASE_EMBEDDED { | 1592 class PostponeInterruptsScope BASE_EMBEDDED { |
1594 public: | 1593 public: |
1595 PostponeInterruptsScope(Isolate* isolate, | 1594 PostponeInterruptsScope(Isolate* isolate, |
1596 int intercept_mask = StackGuard::ALL_INTERRUPTS) | 1595 int intercept_mask = StackGuard::ALL_INTERRUPTS) |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1683 | 1682 |
1684 EmbeddedVector<char, 128> filename_; | 1683 EmbeddedVector<char, 128> filename_; |
1685 FILE* file_; | 1684 FILE* file_; |
1686 int scope_depth_; | 1685 int scope_depth_; |
1687 }; | 1686 }; |
1688 | 1687 |
1689 } // namespace internal | 1688 } // namespace internal |
1690 } // namespace v8 | 1689 } // namespace v8 |
1691 | 1690 |
1692 #endif // V8_ISOLATE_H_ | 1691 #endif // V8_ISOLATE_H_ |
OLD | NEW |