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

Side by Side Diff: third_party/WebKit/Source/platform/heap/ThreadState.h

Issue 2531973002: Simple BlinkGC heap compaction. (Closed)
Patch Set: synchronize on compaction finish Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 void preGC(); 278 void preGC();
279 void postGC(BlinkGC::GCType); 279 void postGC(BlinkGC::GCType);
280 void preSweep(); 280 void preSweep();
281 void completeSweep(); 281 void completeSweep();
282 void postSweep(); 282 void postSweep();
283 // makeConsistentForMutator() drops marks from marked objects and rebuild 283 // makeConsistentForMutator() drops marks from marked objects and rebuild
284 // free lists. This is called after taking a snapshot and before resuming 284 // free lists. This is called after taking a snapshot and before resuming
285 // the executions of mutators. 285 // the executions of mutators.
286 void makeConsistentForMutator(); 286 void makeConsistentForMutator();
287 287
288 void compact();
289
288 // Support for disallowing allocation. Mainly used for sanity 290 // Support for disallowing allocation. Mainly used for sanity
289 // checks asserts. 291 // checks asserts.
290 bool isAllocationAllowed() const { 292 bool isAllocationAllowed() const {
291 return !isAtSafePoint() && !m_noAllocationCount; 293 return !isAtSafePoint() && !m_noAllocationCount;
292 } 294 }
293 void enterNoAllocationScope() { m_noAllocationCount++; } 295 void enterNoAllocationScope() { m_noAllocationCount++; }
294 void leaveNoAllocationScope() { m_noAllocationCount--; } 296 void leaveNoAllocationScope() { m_noAllocationCount--; }
295 bool isGCForbidden() const { 297 bool isGCForbidden() const {
296 return m_gcForbiddenCount || isMixinInConstruction(); 298 return m_gcForbiddenCount || isMixinInConstruction();
297 } 299 }
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 556
555 void resetHeapCounters(); 557 void resetHeapCounters();
556 void increaseAllocatedObjectSize(size_t); 558 void increaseAllocatedObjectSize(size_t);
557 void decreaseAllocatedObjectSize(size_t); 559 void decreaseAllocatedObjectSize(size_t);
558 void increaseMarkedObjectSize(size_t); 560 void increaseMarkedObjectSize(size_t);
559 561
560 void callThreadShutdownHooks(); 562 void callThreadShutdownHooks();
561 563
562 v8::Isolate* isolate() const { return m_isolate; } 564 v8::Isolate* isolate() const { return m_isolate; }
563 565
566 BlinkGC::StackState stackState() const { return m_stackState; }
567
564 void collectGarbage(BlinkGC::StackState, BlinkGC::GCType, BlinkGC::GCReason); 568 void collectGarbage(BlinkGC::StackState, BlinkGC::GCType, BlinkGC::GCReason);
565 void collectGarbageForTerminatingThread(); 569 void collectGarbageForTerminatingThread();
566 void collectAllGarbage(); 570 void collectAllGarbage();
567 571
568 private: 572 private:
569 enum SnapshotType { HeapSnapshot, FreelistSnapshot }; 573 enum SnapshotType { HeapSnapshot, FreelistSnapshot };
570 574
571 explicit ThreadState(BlinkGC::ThreadHeapMode); 575 explicit ThreadState(BlinkGC::ThreadHeapMode);
572 ~ThreadState(); 576 ~ThreadState();
573 577
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 class ThreadStateFor<AnyThread> { 756 class ThreadStateFor<AnyThread> {
753 STATIC_ONLY(ThreadStateFor); 757 STATIC_ONLY(ThreadStateFor);
754 758
755 public: 759 public:
756 static ThreadState* state() { return ThreadState::current(); } 760 static ThreadState* state() { return ThreadState::current(); }
757 }; 761 };
758 762
759 } // namespace blink 763 } // namespace blink
760 764
761 #endif // ThreadState_h 765 #endif // ThreadState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698