| OLD | NEW |
| 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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 BasePage* next() const { return m_next; } | 379 BasePage* next() const { return m_next; } |
| 380 | 380 |
| 381 // virtual methods are slow. So performance-sensitive methods | 381 // virtual methods are slow. So performance-sensitive methods |
| 382 // should be defined as non-virtual methods on NormalPage and LargeObjectPag
e. | 382 // should be defined as non-virtual methods on NormalPage and LargeObjectPag
e. |
| 383 // The following methods are not performance-sensitive. | 383 // The following methods are not performance-sensitive. |
| 384 virtual size_t objectPayloadSizeForTesting() = 0; | 384 virtual size_t objectPayloadSizeForTesting() = 0; |
| 385 virtual bool isEmpty() = 0; | 385 virtual bool isEmpty() = 0; |
| 386 virtual void removeFromHeap() = 0; | 386 virtual void removeFromHeap() = 0; |
| 387 virtual void sweep() = 0; | 387 virtual void sweep() = 0; |
| 388 virtual void makeConsistentForGC() = 0; | 388 virtual void makeConsistentForGC() = 0; |
| 389 virtual void makeConsistentForMutator() = 0; |
| 389 | 390 |
| 390 #if defined(ADDRESS_SANITIZER) | 391 #if defined(ADDRESS_SANITIZER) |
| 391 virtual void poisonObjects(ObjectsToPoison, Poisoning) = 0; | 392 virtual void poisonObjects(ObjectsToPoison, Poisoning) = 0; |
| 392 #endif | 393 #endif |
| 393 // Check if the given address points to an object in this | 394 // Check if the given address points to an object in this |
| 394 // heap page. If so, find the start of that object and mark it | 395 // heap page. If so, find the start of that object and mark it |
| 395 // using the given Visitor. Otherwise do nothing. The pointer must | 396 // using the given Visitor. Otherwise do nothing. The pointer must |
| 396 // be within the same aligned blinkPageSize as the this-pointer. | 397 // be within the same aligned blinkPageSize as the this-pointer. |
| 397 // | 398 // |
| 398 // This is used during conservative stack scanning to | 399 // This is used during conservative stack scanning to |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 bool containedInObjectPayload(Address address) | 468 bool containedInObjectPayload(Address address) |
| 468 { | 469 { |
| 469 return payload() <= address && address < payloadEnd(); | 470 return payload() <= address && address < payloadEnd(); |
| 470 } | 471 } |
| 471 | 472 |
| 472 virtual size_t objectPayloadSizeForTesting() override; | 473 virtual size_t objectPayloadSizeForTesting() override; |
| 473 virtual bool isEmpty() override; | 474 virtual bool isEmpty() override; |
| 474 virtual void removeFromHeap() override; | 475 virtual void removeFromHeap() override; |
| 475 virtual void sweep() override; | 476 virtual void sweep() override; |
| 476 virtual void makeConsistentForGC() override; | 477 virtual void makeConsistentForGC() override; |
| 478 virtual void makeConsistentForMutator() override; |
| 477 #if defined(ADDRESS_SANITIZER) | 479 #if defined(ADDRESS_SANITIZER) |
| 478 virtual void poisonObjects(ObjectsToPoison, Poisoning) override; | 480 virtual void poisonObjects(ObjectsToPoison, Poisoning) override; |
| 479 #endif | 481 #endif |
| 480 virtual void checkAndMarkPointer(Visitor*, Address) override; | 482 virtual void checkAndMarkPointer(Visitor*, Address) override; |
| 481 virtual void markOrphaned() override; | 483 virtual void markOrphaned() override; |
| 482 #if ENABLE(GC_PROFILING) | 484 #if ENABLE(GC_PROFILING) |
| 483 const GCInfo* findGCInfo(Address) override; | 485 const GCInfo* findGCInfo(Address) override; |
| 484 void snapshot(TracedValue*, ThreadState::SnapshotInfo*) override; | 486 void snapshot(TracedValue*, ThreadState::SnapshotInfo*) override; |
| 485 void incrementMarkedObjectsAge() override; | 487 void incrementMarkedObjectsAge() override; |
| 486 void countMarkedObjects(ClassAgeCountsMap&) override; | 488 void countMarkedObjects(ClassAgeCountsMap&) override; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 bool containedInObjectPayload(Address address) | 531 bool containedInObjectPayload(Address address) |
| 530 { | 532 { |
| 531 return payload() <= address && address < payloadEnd(); | 533 return payload() <= address && address < payloadEnd(); |
| 532 } | 534 } |
| 533 | 535 |
| 534 virtual size_t objectPayloadSizeForTesting() override; | 536 virtual size_t objectPayloadSizeForTesting() override; |
| 535 virtual bool isEmpty() override; | 537 virtual bool isEmpty() override; |
| 536 virtual void removeFromHeap() override; | 538 virtual void removeFromHeap() override; |
| 537 virtual void sweep() override; | 539 virtual void sweep() override; |
| 538 virtual void makeConsistentForGC() override; | 540 virtual void makeConsistentForGC() override; |
| 541 virtual void makeConsistentForMutator() override; |
| 539 #if defined(ADDRESS_SANITIZER) | 542 #if defined(ADDRESS_SANITIZER) |
| 540 virtual void poisonObjects(ObjectsToPoison, Poisoning) override; | 543 virtual void poisonObjects(ObjectsToPoison, Poisoning) override; |
| 541 #endif | 544 #endif |
| 542 virtual void checkAndMarkPointer(Visitor*, Address) override; | 545 virtual void checkAndMarkPointer(Visitor*, Address) override; |
| 543 virtual void markOrphaned() override; | 546 virtual void markOrphaned() override; |
| 544 | 547 |
| 545 #if ENABLE(GC_PROFILING) | 548 #if ENABLE(GC_PROFILING) |
| 546 const GCInfo* findGCInfo(Address) override; | 549 const GCInfo* findGCInfo(Address) override; |
| 547 void snapshot(TracedValue*, ThreadState::SnapshotInfo*) override; | 550 void snapshot(TracedValue*, ThreadState::SnapshotInfo*) override; |
| 548 void incrementMarkedObjectsAge() override; | 551 void incrementMarkedObjectsAge() override; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 void snapshot(TracedValue*, ThreadState::SnapshotInfo*); | 690 void snapshot(TracedValue*, ThreadState::SnapshotInfo*); |
| 688 virtual void snapshotFreeList(TracedValue&) { }; | 691 virtual void snapshotFreeList(TracedValue&) { }; |
| 689 | 692 |
| 690 void countMarkedObjects(ClassAgeCountsMap&) const; | 693 void countMarkedObjects(ClassAgeCountsMap&) const; |
| 691 void countObjectsToSweep(ClassAgeCountsMap&) const; | 694 void countObjectsToSweep(ClassAgeCountsMap&) const; |
| 692 void incrementMarkedObjectsAge(); | 695 void incrementMarkedObjectsAge(); |
| 693 #endif | 696 #endif |
| 694 | 697 |
| 695 virtual void clearFreeLists() { } | 698 virtual void clearFreeLists() { } |
| 696 void makeConsistentForGC(); | 699 void makeConsistentForGC(); |
| 700 void makeConsistentForMutator(); |
| 697 #if ENABLE(ASSERT) | 701 #if ENABLE(ASSERT) |
| 698 virtual bool isConsistentForGC() = 0; | 702 virtual bool isConsistentForGC() = 0; |
| 699 #endif | 703 #endif |
| 700 size_t objectPayloadSizeForTesting(); | 704 size_t objectPayloadSizeForTesting(); |
| 701 void prepareHeapForTermination(); | 705 void prepareHeapForTermination(); |
| 702 void prepareForSweep(); | 706 void prepareForSweep(); |
| 703 #if defined(ADDRESS_SANITIZER) | 707 #if defined(ADDRESS_SANITIZER) |
| 704 void poisonHeap(ObjectsToPoison, Poisoning); | 708 void poisonHeap(ObjectsToPoison, Poisoning); |
| 705 #endif | 709 #endif |
| 706 Address lazySweep(size_t, size_t gcInfoIndex); | 710 Address lazySweep(size_t, size_t gcInfoIndex); |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1386 size_t copySize = previousHeader->payloadSize(); | 1390 size_t copySize = previousHeader->payloadSize(); |
| 1387 if (copySize > size) | 1391 if (copySize > size) |
| 1388 copySize = size; | 1392 copySize = size; |
| 1389 memcpy(address, previous, copySize); | 1393 memcpy(address, previous, copySize); |
| 1390 return address; | 1394 return address; |
| 1391 } | 1395 } |
| 1392 | 1396 |
| 1393 } // namespace blink | 1397 } // namespace blink |
| 1394 | 1398 |
| 1395 #endif // Heap_h | 1399 #endif // Heap_h |
| OLD | NEW |