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 2608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2619 WeakCell* cell = WeakCell::cast(detached_contexts->get(i + 1)); | 2619 WeakCell* cell = WeakCell::cast(detached_contexts->get(i + 1)); |
2620 if (mark_sweeps > 3) { | 2620 if (mark_sweeps > 3) { |
2621 PrintF("detached context 0x%p\n survived %d GCs (leak?)\n", | 2621 PrintF("detached context 0x%p\n survived %d GCs (leak?)\n", |
2622 static_cast<void*>(cell->value()), mark_sweeps); | 2622 static_cast<void*>(cell->value()), mark_sweeps); |
2623 } | 2623 } |
2624 } | 2624 } |
2625 } | 2625 } |
2626 if (new_length == 0) { | 2626 if (new_length == 0) { |
2627 heap()->set_detached_contexts(heap()->empty_fixed_array()); | 2627 heap()->set_detached_contexts(heap()->empty_fixed_array()); |
2628 } else if (new_length < length) { | 2628 } else if (new_length < length) { |
2629 heap()->RightTrimFixedArray<Heap::FROM_MUTATOR>(*detached_contexts, | 2629 heap()->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>( |
2630 length - new_length); | 2630 *detached_contexts, length - new_length); |
2631 } | 2631 } |
2632 } | 2632 } |
2633 | 2633 |
2634 | 2634 |
2635 bool StackLimitCheck::JsHasOverflowed() const { | 2635 bool StackLimitCheck::JsHasOverflowed() const { |
2636 StackGuard* stack_guard = isolate_->stack_guard(); | 2636 StackGuard* stack_guard = isolate_->stack_guard(); |
2637 #ifdef USE_SIMULATOR | 2637 #ifdef USE_SIMULATOR |
2638 // The simulator uses a separate JS stack. | 2638 // The simulator uses a separate JS stack. |
2639 Address jssp_address = Simulator::current(isolate_)->get_sp(); | 2639 Address jssp_address = Simulator::current(isolate_)->get_sp(); |
2640 uintptr_t jssp = reinterpret_cast<uintptr_t>(jssp_address); | 2640 uintptr_t jssp = reinterpret_cast<uintptr_t>(jssp_address); |
2641 if (jssp < stack_guard->real_jslimit()) return true; | 2641 if (jssp < stack_guard->real_jslimit()) return true; |
2642 #endif // USE_SIMULATOR | 2642 #endif // USE_SIMULATOR |
2643 return GetCurrentStackPosition() < stack_guard->real_climit(); | 2643 return GetCurrentStackPosition() < stack_guard->real_climit(); |
2644 } | 2644 } |
2645 | 2645 |
2646 | 2646 |
2647 bool PostponeInterruptsScope::Intercept(StackGuard::InterruptFlag flag) { | 2647 bool PostponeInterruptsScope::Intercept(StackGuard::InterruptFlag flag) { |
2648 // First check whether the previous scope intercepts. | 2648 // First check whether the previous scope intercepts. |
2649 if (prev_ && prev_->Intercept(flag)) return true; | 2649 if (prev_ && prev_->Intercept(flag)) return true; |
2650 // Then check whether this scope intercepts. | 2650 // Then check whether this scope intercepts. |
2651 if ((flag & intercept_mask_)) { | 2651 if ((flag & intercept_mask_)) { |
2652 intercepted_flags_ |= flag; | 2652 intercepted_flags_ |= flag; |
2653 return true; | 2653 return true; |
2654 } | 2654 } |
2655 return false; | 2655 return false; |
2656 } | 2656 } |
2657 | 2657 |
2658 } } // namespace v8::internal | 2658 } } // namespace v8::internal |
OLD | NEW |