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

Side by Side Diff: src/heap.cc

Issue 669266: Let the callers of V8::ContextDisposedNoticication() know... (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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 void Heap::CollectAllGarbage(bool force_compaction) { 365 void Heap::CollectAllGarbage(bool force_compaction) {
366 // Since we are ignoring the return value, the exact choice of space does 366 // Since we are ignoring the return value, the exact choice of space does
367 // not matter, so long as we do not specify NEW_SPACE, which would not 367 // not matter, so long as we do not specify NEW_SPACE, which would not
368 // cause a full GC. 368 // cause a full GC.
369 MarkCompactCollector::SetForceCompaction(force_compaction); 369 MarkCompactCollector::SetForceCompaction(force_compaction);
370 CollectGarbage(0, OLD_POINTER_SPACE); 370 CollectGarbage(0, OLD_POINTER_SPACE);
371 MarkCompactCollector::SetForceCompaction(false); 371 MarkCompactCollector::SetForceCompaction(false);
372 } 372 }
373 373
374 374
375 void Heap::NotifyContextDisposed() {
376 contexts_disposed_++;
377 }
378
379
380 bool Heap::CollectGarbage(int requested_size, AllocationSpace space) { 375 bool Heap::CollectGarbage(int requested_size, AllocationSpace space) {
381 // The VM is in the GC state until exiting this function. 376 // The VM is in the GC state until exiting this function.
382 VMState state(GC); 377 VMState state(GC);
383 378
384 #ifdef DEBUG 379 #ifdef DEBUG
385 // Reset the allocation timeout to the GC interval, but make sure to 380 // Reset the allocation timeout to the GC interval, but make sure to
386 // allow at least a few allocations after a collection. The reason 381 // allow at least a few allocations after a collection. The reason
387 // for this is that we have a lot of allocation sequences and we 382 // for this is that we have a lot of allocation sequences and we
388 // assume that a garbage collection will allow the subsequent 383 // assume that a garbage collection will allow the subsequent
389 // allocation attempts to go through. 384 // allocation attempts to go through.
(...skipping 3849 matching lines...) Expand 10 before | Expand all | Expand 10 after
4239 void ExternalStringTable::TearDown() { 4234 void ExternalStringTable::TearDown() {
4240 new_space_strings_.Free(); 4235 new_space_strings_.Free();
4241 old_space_strings_.Free(); 4236 old_space_strings_.Free();
4242 } 4237 }
4243 4238
4244 4239
4245 List<Object*> ExternalStringTable::new_space_strings_; 4240 List<Object*> ExternalStringTable::new_space_strings_;
4246 List<Object*> ExternalStringTable::old_space_strings_; 4241 List<Object*> ExternalStringTable::old_space_strings_;
4247 4242
4248 } } // namespace v8::internal 4243 } } // 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