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

Side by Side Diff: src/heap.cc

Issue 8770003: Use the old idle notification handler when context is disposed. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years 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 | no next file » | 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 4523 matching lines...) Expand 10 before | Expand all | Expand 10 after
4534 void Heap::EnsureHeapIsIterable() { 4534 void Heap::EnsureHeapIsIterable() {
4535 ASSERT(IsAllocationAllowed()); 4535 ASSERT(IsAllocationAllowed());
4536 if (!IsHeapIterable()) { 4536 if (!IsHeapIterable()) {
4537 CollectAllGarbage(kMakeHeapIterableMask); 4537 CollectAllGarbage(kMakeHeapIterableMask);
4538 } 4538 }
4539 ASSERT(IsHeapIterable()); 4539 ASSERT(IsHeapIterable());
4540 } 4540 }
4541 4541
4542 4542
4543 bool Heap::IdleNotification(int hint) { 4543 bool Heap::IdleNotification(int hint) {
4544 if (!FLAG_incremental_marking || FLAG_expose_gc || Serializer::enabled()) { 4544 if (contexts_disposed_ > 0 || !FLAG_incremental_marking ||
4545 FLAG_expose_gc || Serializer::enabled()) {
4545 return hint < 1000 ? true : IdleGlobalGC(); 4546 return hint < 1000 ? true : IdleGlobalGC();
4546 } 4547 }
4547 4548
4548 // By doing small chunks of GC work in each IdleNotification, 4549 // By doing small chunks of GC work in each IdleNotification,
4549 // perform a round of incremental GCs and after that wait until 4550 // perform a round of incremental GCs and after that wait until
4550 // the mutator creates enough garbage to justify a new round. 4551 // the mutator creates enough garbage to justify a new round.
4551 // An incremental GC progresses as follows: 4552 // An incremental GC progresses as follows:
4552 // 1. many incremental marking steps, 4553 // 1. many incremental marking steps,
4553 // 2. one old space mark-sweep-compact, 4554 // 2. one old space mark-sweep-compact,
4554 // 3. many lazy sweep steps. 4555 // 3. many lazy sweep steps.
(...skipping 2027 matching lines...) Expand 10 before | Expand all | Expand 10 after
6582 isolate_->heap()->store_buffer()->Compact(); 6583 isolate_->heap()->store_buffer()->Compact();
6583 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); 6584 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED);
6584 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { 6585 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) {
6585 next = chunk->next_chunk(); 6586 next = chunk->next_chunk();
6586 isolate_->memory_allocator()->Free(chunk); 6587 isolate_->memory_allocator()->Free(chunk);
6587 } 6588 }
6588 chunks_queued_for_free_ = NULL; 6589 chunks_queued_for_free_ = NULL;
6589 } 6590 }
6590 6591
6591 } } // namespace v8::internal 6592 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698