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

Side by Side Diff: src/incremental-marking.cc

Issue 8065003: Shrink the new space and uncommit marking deque on low memory notification. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/incremental-marking.h ('k') | test/cctest/test-heap.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 23 matching lines...) Expand all
34 #include "v8conversions.h" 34 #include "v8conversions.h"
35 35
36 namespace v8 { 36 namespace v8 {
37 namespace internal { 37 namespace internal {
38 38
39 39
40 IncrementalMarking::IncrementalMarking(Heap* heap) 40 IncrementalMarking::IncrementalMarking(Heap* heap)
41 : heap_(heap), 41 : heap_(heap),
42 state_(STOPPED), 42 state_(STOPPED),
43 marking_deque_memory_(NULL), 43 marking_deque_memory_(NULL),
44 marking_deque_memory_committed_(false),
44 steps_count_(0), 45 steps_count_(0),
45 steps_took_(0), 46 steps_took_(0),
46 longest_step_(0.0), 47 longest_step_(0.0),
47 old_generation_space_available_at_start_of_incremental_(0), 48 old_generation_space_available_at_start_of_incremental_(0),
48 old_generation_space_used_at_start_of_incremental_(0), 49 old_generation_space_used_at_start_of_incremental_(0),
49 steps_count_since_last_gc_(0), 50 steps_count_since_last_gc_(0),
50 steps_took_since_last_gc_(0), 51 steps_took_since_last_gc_(0),
51 should_hurry_(false), 52 should_hurry_(false),
52 allocation_marking_factor_(0), 53 allocation_marking_factor_(0),
53 allocated_(0), 54 allocated_(0),
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 } 434 }
434 } 435 }
435 } 436 }
436 } 437 }
437 } 438 }
438 439
439 440
440 void IncrementalMarking::EnsureMarkingDequeIsCommitted() { 441 void IncrementalMarking::EnsureMarkingDequeIsCommitted() {
441 if (marking_deque_memory_ == NULL) { 442 if (marking_deque_memory_ == NULL) {
442 marking_deque_memory_ = new VirtualMemory(4 * MB); 443 marking_deque_memory_ = new VirtualMemory(4 * MB);
443 marking_deque_memory_->Commit( 444 }
445 if (!marking_deque_memory_committed_) {
446 bool success = marking_deque_memory_->Commit(
444 reinterpret_cast<Address>(marking_deque_memory_->address()), 447 reinterpret_cast<Address>(marking_deque_memory_->address()),
445 marking_deque_memory_->size(), 448 marking_deque_memory_->size(),
446 false); // Not executable. 449 false); // Not executable.
450 CHECK(success);
451 marking_deque_memory_committed_ = true;
447 } 452 }
448 } 453 }
449 454
455 void IncrementalMarking::UncommitMarkingDeque() {
456 ASSERT(state_ == STOPPED);
457 if (marking_deque_memory_committed_) {
458 bool success = marking_deque_memory_->Uncommit(
459 reinterpret_cast<Address>(marking_deque_memory_->address()),
460 marking_deque_memory_->size());
461 CHECK(success);
462 marking_deque_memory_committed_ = false;
463 }
464 }
465
450 466
451 void IncrementalMarking::Start() { 467 void IncrementalMarking::Start() {
452 if (FLAG_trace_incremental_marking) { 468 if (FLAG_trace_incremental_marking) {
453 PrintF("[IncrementalMarking] Start\n"); 469 PrintF("[IncrementalMarking] Start\n");
454 } 470 }
455 ASSERT(FLAG_incremental_marking); 471 ASSERT(FLAG_incremental_marking);
456 ASSERT(state_ == STOPPED); 472 ASSERT(state_ == STOPPED);
457 473
458 ResetStepCounters(); 474 ResetStepCounters();
459 475
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 allocation_marking_factor_ = kInitialAllocationMarkingFactor; 911 allocation_marking_factor_ = kInitialAllocationMarkingFactor;
896 bytes_scanned_ = 0; 912 bytes_scanned_ = 0;
897 } 913 }
898 914
899 915
900 int64_t IncrementalMarking::SpaceLeftInOldSpace() { 916 int64_t IncrementalMarking::SpaceLeftInOldSpace() {
901 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize(); 917 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize();
902 } 918 }
903 919
904 } } // namespace v8::internal 920 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/incremental-marking.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698