Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/isolate.cc

Issue 1034163002: Use atomic operation to read the length of a fixed array. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compile error Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/layout-descriptor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/layout-descriptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698