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 | 6 |
7 #include <fstream> // NOLINT(readability/streams) | 7 #include <fstream> // NOLINT(readability/streams) |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/v8.h" | 10 #include "src/v8.h" |
(...skipping 1886 matching lines...) Loading... |
1897 bootstrapper_->TearDown(); | 1897 bootstrapper_->TearDown(); |
1898 | 1898 |
1899 if (runtime_profiler_ != NULL) { | 1899 if (runtime_profiler_ != NULL) { |
1900 delete runtime_profiler_; | 1900 delete runtime_profiler_; |
1901 runtime_profiler_ = NULL; | 1901 runtime_profiler_ = NULL; |
1902 } | 1902 } |
1903 | 1903 |
1904 delete basic_block_profiler_; | 1904 delete basic_block_profiler_; |
1905 basic_block_profiler_ = NULL; | 1905 basic_block_profiler_ = NULL; |
1906 | 1906 |
| 1907 for (CancelableTask* task : cancelable_tasks_) { |
| 1908 task->Cancel(); |
| 1909 } |
| 1910 cancelable_tasks_.clear(); |
| 1911 |
1907 heap_.TearDown(); | 1912 heap_.TearDown(); |
1908 logger_->TearDown(); | 1913 logger_->TearDown(); |
1909 | 1914 |
1910 delete heap_profiler_; | 1915 delete heap_profiler_; |
1911 heap_profiler_ = NULL; | 1916 heap_profiler_ = NULL; |
1912 delete cpu_profiler_; | 1917 delete cpu_profiler_; |
1913 cpu_profiler_ = NULL; | 1918 cpu_profiler_ = NULL; |
1914 | 1919 |
1915 ClearSerializerData(); | 1920 ClearSerializerData(); |
1916 } | 1921 } |
(...skipping 859 matching lines...) Loading... |
2776 } | 2781 } |
2777 if (new_length == 0) { | 2782 if (new_length == 0) { |
2778 heap()->set_detached_contexts(heap()->empty_fixed_array()); | 2783 heap()->set_detached_contexts(heap()->empty_fixed_array()); |
2779 } else if (new_length < length) { | 2784 } else if (new_length < length) { |
2780 heap()->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>( | 2785 heap()->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>( |
2781 *detached_contexts, length - new_length); | 2786 *detached_contexts, length - new_length); |
2782 } | 2787 } |
2783 } | 2788 } |
2784 | 2789 |
2785 | 2790 |
| 2791 void Isolate::RegisterCancelableTask(CancelableTask* task) { |
| 2792 cancelable_tasks_.insert(task); |
| 2793 } |
| 2794 |
| 2795 |
| 2796 void Isolate::RemoveCancelableTask(CancelableTask* task) { |
| 2797 auto removed = cancelable_tasks_.erase(task); |
| 2798 USE(removed); |
| 2799 DCHECK(removed == 1); |
| 2800 } |
| 2801 |
| 2802 |
2786 bool StackLimitCheck::JsHasOverflowed(uintptr_t gap) const { | 2803 bool StackLimitCheck::JsHasOverflowed(uintptr_t gap) const { |
2787 StackGuard* stack_guard = isolate_->stack_guard(); | 2804 StackGuard* stack_guard = isolate_->stack_guard(); |
2788 #ifdef USE_SIMULATOR | 2805 #ifdef USE_SIMULATOR |
2789 // The simulator uses a separate JS stack. | 2806 // The simulator uses a separate JS stack. |
2790 Address jssp_address = Simulator::current(isolate_)->get_sp(); | 2807 Address jssp_address = Simulator::current(isolate_)->get_sp(); |
2791 uintptr_t jssp = reinterpret_cast<uintptr_t>(jssp_address); | 2808 uintptr_t jssp = reinterpret_cast<uintptr_t>(jssp_address); |
2792 if (jssp - gap < stack_guard->real_jslimit()) return true; | 2809 if (jssp - gap < stack_guard->real_jslimit()) return true; |
2793 #endif // USE_SIMULATOR | 2810 #endif // USE_SIMULATOR |
2794 return GetCurrentStackPosition() - gap < stack_guard->real_climit(); | 2811 return GetCurrentStackPosition() - gap < stack_guard->real_climit(); |
2795 } | 2812 } |
(...skipping 16 matching lines...) Loading... |
2812 // Then check whether this scope intercepts. | 2829 // Then check whether this scope intercepts. |
2813 if ((flag & intercept_mask_)) { | 2830 if ((flag & intercept_mask_)) { |
2814 intercepted_flags_ |= flag; | 2831 intercepted_flags_ |= flag; |
2815 return true; | 2832 return true; |
2816 } | 2833 } |
2817 return false; | 2834 return false; |
2818 } | 2835 } |
2819 | 2836 |
2820 } // namespace internal | 2837 } // namespace internal |
2821 } // namespace v8 | 2838 } // namespace v8 |
OLD | NEW |