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

Side by Side Diff: src/heap.cc

Issue 14075012: Expose the GC under a name that is less collision prone than window.gc. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: --expose-gc-as Created 7 years, 8 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 5702 matching lines...) Expand 10 before | Expand all | Expand 10 after
5713 size_factor * IncrementalMarking::kAllocatedThreshold; 5713 size_factor * IncrementalMarking::kAllocatedThreshold;
5714 5714
5715 if (contexts_disposed_ > 0) { 5715 if (contexts_disposed_ > 0) {
5716 if (hint >= kMaxHint) { 5716 if (hint >= kMaxHint) {
5717 // The embedder is requesting a lot of GC work after context disposal, 5717 // The embedder is requesting a lot of GC work after context disposal,
5718 // we age inline caches so that they don't keep objects from 5718 // we age inline caches so that they don't keep objects from
5719 // the old context alive. 5719 // the old context alive.
5720 AgeInlineCaches(); 5720 AgeInlineCaches();
5721 } 5721 }
5722 int mark_sweep_time = Min(TimeMarkSweepWouldTakeInMs(), 1000); 5722 int mark_sweep_time = Min(TimeMarkSweepWouldTakeInMs(), 1000);
5723 if (hint >= mark_sweep_time && !FLAG_expose_gc && 5723 if (hint >= mark_sweep_time && !FLAG_expose_gc && !FLAG_expose_gc_as &&
5724 incremental_marking()->IsStopped()) { 5724 incremental_marking()->IsStopped()) {
5725 HistogramTimerScope scope(isolate_->counters()->gc_context()); 5725 HistogramTimerScope scope(isolate_->counters()->gc_context());
5726 CollectAllGarbage(kReduceMemoryFootprintMask, 5726 CollectAllGarbage(kReduceMemoryFootprintMask,
5727 "idle notification: contexts disposed"); 5727 "idle notification: contexts disposed");
5728 } else { 5728 } else {
5729 AdvanceIdleIncrementalMarking(step_size); 5729 AdvanceIdleIncrementalMarking(step_size);
5730 contexts_disposed_ = 0; 5730 contexts_disposed_ = 0;
5731 } 5731 }
5732 // After context disposal there is likely a lot of garbage remaining, reset 5732 // After context disposal there is likely a lot of garbage remaining, reset
5733 // the idle notification counters in order to trigger more incremental GCs 5733 // the idle notification counters in order to trigger more incremental GCs
(...skipping 2119 matching lines...) Expand 10 before | Expand all | Expand 10 after
7853 static_cast<int>(object_sizes_last_time_[index])); 7853 static_cast<int>(object_sizes_last_time_[index]));
7854 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 7854 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
7855 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7855 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7856 7856
7857 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7857 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7858 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7858 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7859 ClearObjectStats(); 7859 ClearObjectStats();
7860 } 7860 }
7861 7861
7862 } } // namespace v8::internal 7862 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698