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

Side by Side Diff: src/heap.cc

Issue 661173: Add an explicit API entry to notify V8 that one or more... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/heap.h ('k') | 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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 void Heap::CollectAllGarbage(bool force_compaction) { 364 void Heap::CollectAllGarbage(bool force_compaction) {
365 // Since we are ignoring the return value, the exact choice of space does 365 // Since we are ignoring the return value, the exact choice of space does
366 // not matter, so long as we do not specify NEW_SPACE, which would not 366 // not matter, so long as we do not specify NEW_SPACE, which would not
367 // cause a full GC. 367 // cause a full GC.
368 MarkCompactCollector::SetForceCompaction(force_compaction); 368 MarkCompactCollector::SetForceCompaction(force_compaction);
369 CollectGarbage(0, OLD_POINTER_SPACE); 369 CollectGarbage(0, OLD_POINTER_SPACE);
370 MarkCompactCollector::SetForceCompaction(false); 370 MarkCompactCollector::SetForceCompaction(false);
371 } 371 }
372 372
373 373
374 void Heap::CollectAllGarbageIfContextDisposed() { 374 void Heap::CollectAllGarbageIfContextDisposed(bool notified) {
375 // If the request has ever been the result of an explicit
376 // notification, we ignore non-notified requests. This is a
377 // temporary solution to let the two ways of achieving GC at
378 // context disposal time co-exist.
379 static bool ever_notified = false;
380 if (notified) ever_notified = true;
381 if (ever_notified && !notified) return;
382
bakster 2010/02/26 11:46:42 Please change is so context_disposed_pending_ is N
375 // If the garbage collector interface is exposed through the global 383 // If the garbage collector interface is exposed through the global
376 // gc() function, we avoid being clever about forcing GCs when 384 // gc() function, we avoid being clever about forcing GCs when
377 // contexts are disposed and leave it to the embedder to make 385 // contexts are disposed and leave it to the embedder to make
378 // informed decisions about when to force a collection. 386 // informed decisions about when to force a collection.
379 if (!FLAG_expose_gc && context_disposed_pending_) { 387 if (!FLAG_expose_gc && context_disposed_pending_) {
380 HistogramTimerScope scope(&Counters::gc_context); 388 HistogramTimerScope scope(&Counters::gc_context);
381 CollectAllGarbage(false); 389 CollectAllGarbage(false);
382 } 390 }
383 context_disposed_pending_ = false; 391 context_disposed_pending_ = false;
384 } 392 }
(...skipping 3839 matching lines...) Expand 10 before | Expand all | Expand 10 after
4224 void ExternalStringTable::TearDown() { 4232 void ExternalStringTable::TearDown() {
4225 new_space_strings_.Free(); 4233 new_space_strings_.Free();
4226 old_space_strings_.Free(); 4234 old_space_strings_.Free();
4227 } 4235 }
4228 4236
4229 4237
4230 List<Object*> ExternalStringTable::new_space_strings_; 4238 List<Object*> ExternalStringTable::new_space_strings_;
4231 List<Object*> ExternalStringTable::old_space_strings_; 4239 List<Object*> ExternalStringTable::old_space_strings_;
4232 4240
4233 } } // namespace v8::internal 4241 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698