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

Side by Side Diff: src/heap.cc

Issue 8506017: Fix IdleNotification to correctly free objects. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « no previous file | test/cctest/test-api.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 4528 matching lines...) Expand 10 before | Expand all | Expand 10 after
4539 // Before doing the mark-sweep collections we clear the 4539 // Before doing the mark-sweep collections we clear the
4540 // compilation cache to avoid hanging on to source code and 4540 // compilation cache to avoid hanging on to source code and
4541 // generated code for cached functions. 4541 // generated code for cached functions.
4542 isolate_->compilation_cache()->Clear(); 4542 isolate_->compilation_cache()->Clear();
4543 4543
4544 CollectAllGarbage(kNoGCFlags); 4544 CollectAllGarbage(kNoGCFlags);
4545 new_space_.Shrink(); 4545 new_space_.Shrink();
4546 last_idle_notification_gc_count_ = gc_count_; 4546 last_idle_notification_gc_count_ = gc_count_;
4547 4547
4548 } else if (number_idle_notifications_ == kIdlesBeforeMarkCompact) { 4548 } else if (number_idle_notifications_ == kIdlesBeforeMarkCompact) {
4549 CollectAllGarbage(kNoGCFlags); 4549 CollectAllGarbage(kMakeHeapIterableMask);
4550 new_space_.Shrink(); 4550 new_space_.Shrink();
4551 last_idle_notification_gc_count_ = gc_count_; 4551 last_idle_notification_gc_count_ = gc_count_;
4552 number_idle_notifications_ = 0; 4552 number_idle_notifications_ = 0;
4553 finished = true; 4553 finished = true;
4554 } else if (contexts_disposed_ > 0) { 4554 } else if (contexts_disposed_ > 0) {
4555 if (FLAG_expose_gc) { 4555 if (FLAG_expose_gc) {
4556 contexts_disposed_ = 0; 4556 contexts_disposed_ = 0;
4557 } else { 4557 } else {
4558 HistogramTimerScope scope(isolate_->counters()->gc_context()); 4558 HistogramTimerScope scope(isolate_->counters()->gc_context());
4559 CollectAllGarbage(kNoGCFlags); 4559 CollectAllGarbage(kNoGCFlags);
(...skipping 1892 matching lines...) Expand 10 before | Expand all | Expand 10 after
6452 isolate_->heap()->store_buffer()->Compact(); 6452 isolate_->heap()->store_buffer()->Compact();
6453 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); 6453 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED);
6454 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { 6454 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) {
6455 next = chunk->next_chunk(); 6455 next = chunk->next_chunk();
6456 isolate_->memory_allocator()->Free(chunk); 6456 isolate_->memory_allocator()->Free(chunk);
6457 } 6457 }
6458 chunks_queued_for_free_ = NULL; 6458 chunks_queued_for_free_ = NULL;
6459 } 6459 }
6460 6460
6461 } } // namespace v8::internal 6461 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698