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 2574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2585 WeakCell* cell = WeakCell::cast(detached_contexts->get(i + 1)); | 2585 WeakCell* cell = WeakCell::cast(detached_contexts->get(i + 1)); |
2586 if (mark_sweeps > 3) { | 2586 if (mark_sweeps > 3) { |
2587 PrintF("detached context 0x%p\n survived %d GCs (leak?)\n", | 2587 PrintF("detached context 0x%p\n survived %d GCs (leak?)\n", |
2588 static_cast<void*>(cell->value()), mark_sweeps); | 2588 static_cast<void*>(cell->value()), mark_sweeps); |
2589 } | 2589 } |
2590 } | 2590 } |
2591 } | 2591 } |
2592 if (new_length == 0) { | 2592 if (new_length == 0) { |
2593 heap()->set_detached_contexts(heap()->empty_fixed_array()); | 2593 heap()->set_detached_contexts(heap()->empty_fixed_array()); |
2594 } else if (new_length < length) { | 2594 } else if (new_length < length) { |
2595 heap()->RightTrimFixedArray<Heap::FROM_GC>(*detached_contexts, | 2595 heap()->RightTrimFixedArray<Heap::FROM_MUTATOR>(*detached_contexts, |
2596 length - new_length); | 2596 length - new_length); |
2597 } | 2597 } |
2598 } | 2598 } |
2599 | 2599 |
2600 | 2600 |
2601 bool StackLimitCheck::JsHasOverflowed() const { | 2601 bool StackLimitCheck::JsHasOverflowed() const { |
2602 StackGuard* stack_guard = isolate_->stack_guard(); | 2602 StackGuard* stack_guard = isolate_->stack_guard(); |
2603 #ifdef USE_SIMULATOR | 2603 #ifdef USE_SIMULATOR |
2604 // The simulator uses a separate JS stack. | 2604 // The simulator uses a separate JS stack. |
2605 Address jssp_address = Simulator::current(isolate_)->get_sp(); | 2605 Address jssp_address = Simulator::current(isolate_)->get_sp(); |
2606 uintptr_t jssp = reinterpret_cast<uintptr_t>(jssp_address); | 2606 uintptr_t jssp = reinterpret_cast<uintptr_t>(jssp_address); |
2607 if (jssp < stack_guard->real_jslimit()) return true; | 2607 if (jssp < stack_guard->real_jslimit()) return true; |
2608 #endif // USE_SIMULATOR | 2608 #endif // USE_SIMULATOR |
2609 return GetCurrentStackPosition() < stack_guard->real_climit(); | 2609 return GetCurrentStackPosition() < stack_guard->real_climit(); |
2610 } | 2610 } |
2611 | 2611 |
2612 | 2612 |
2613 bool PostponeInterruptsScope::Intercept(StackGuard::InterruptFlag flag) { | 2613 bool PostponeInterruptsScope::Intercept(StackGuard::InterruptFlag flag) { |
2614 // First check whether the previous scope intercepts. | 2614 // First check whether the previous scope intercepts. |
2615 if (prev_ && prev_->Intercept(flag)) return true; | 2615 if (prev_ && prev_->Intercept(flag)) return true; |
2616 // Then check whether this scope intercepts. | 2616 // Then check whether this scope intercepts. |
2617 if ((flag & intercept_mask_)) { | 2617 if ((flag & intercept_mask_)) { |
2618 intercepted_flags_ |= flag; | 2618 intercepted_flags_ |= flag; |
2619 return true; | 2619 return true; |
2620 } | 2620 } |
2621 return false; | 2621 return false; |
2622 } | 2622 } |
2623 | 2623 |
2624 } } // namespace v8::internal | 2624 } } // namespace v8::internal |
OLD | NEW |